File indexing completed on 2024-05-12 16:37:15

0001 /* This file is part of the KDE project
0002  * Copyright (C) 2006 Thomas Zander <zander@kde.org>
0003  *
0004  * This library is free software; you can redistribute it and/or
0005  * modify it under the terms of the GNU Library General Public
0006  * License as published by the Free Software Foundation; either
0007  * version 2 of the License, or (at your option) any later version.
0008  *
0009  * This library is distributed in the hope that it will be useful,
0010  * but WITHOUT ANY WARRANTY; without even the implied warranty of
0011  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
0012  * Library General Public License for more details.
0013  *
0014  * You should have received a copy of the GNU Library General Public License
0015  * along with this library; see the file COPYING.LIB.  If not, write to
0016  * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
0017  * Boston, MA 02110-1301, USA.
0018  */
0019 
0020 #ifndef WORDS_H
0021 #define WORDS_H
0022 
0023 #define TextShape_SHAPEID "TextShapeID"
0024 
0025 #include <KoCanvasResourceManager.h>
0026 
0027 class KWFrameSet;
0028 class KWTextFrameSet;
0029 
0030 /// The words-global namespace for all Words related things.
0031 namespace Words
0032 {
0033     enum FrameSetType {
0034         BackgroundFrameSet,
0035         TextFrameSet,
0036         OtherFrameSet
0037     };
0038 
0039     /// Each text frame set can be categorized in one of these items
0040     enum TextFrameSetType {
0041         OddPagesHeaderTextFrameSet,  ///< The frameSet that holds the headers for the odd pages
0042         EvenPagesHeaderTextFrameSet, ///< The frameSet that holds the headers for the even pages
0043         OddPagesFooterTextFrameSet,  ///< The frameSet that holds the footers for the odd pages
0044         EvenPagesFooterTextFrameSet, ///< The frameSet that holds the footers for the even pages
0045         MainTextFrameSet,   ///< The frameset that holds all the frames for the main text area
0046         OtherTextFrameSet   ///< Any other text frameset not managed by the auto-frame layout
0047     };
0048 
0049     /// used in KWPageSettings to determine if, and what kind of header/footer to use
0050     enum HeaderFooterType {
0051         HFTypeNone,       ///< Don't show the frames
0052         HFTypeEvenOdd,    ///< Show different content for even and odd pages
0053         HFTypeUniform    ///< Show the same content for each page
0054     };
0055 
0056     /// Specifies the horizontal position of the line that separates main text and foot note
0057     enum FootNoteSeparatorLinePos {
0058         FootNoteSeparatorLeft, ///< Left of page
0059         FootNoteSeparatorCenter, ///< Centered on page
0060         FootNoteSeparatorRight  ///< Right of page
0061     };
0062 
0063     /// Specifies the Words specific resources that you can put and get from the KoCanvasResourceManager
0064     enum WordsCanvasResources {
0065         // lets try to put Current in front of everything for ease of reading.
0066         CurrentPictureCount = KoCanvasResourceManager::WordsStart,
0067         CurrentTableCount,
0068         CurrentPageCount,
0069         FrameOutlineColor
0070     };
0071 
0072     /**
0073      * Returns true if the passed frameset is a known type that the frameLayout auto-creates.
0074      * @param fs the frameset to check. 0 is allowed.
0075      */
0076     bool isAutoGenerated(KWFrameSet *fs);
0077     /**
0078      * Returns true if the passed frameset is a header or a footer frameset.
0079      * @param fs the frameset to check. 0 is allowed.
0080      */
0081     bool isHeaderFooter(KWTextFrameSet *fs);
0082     /**
0083      * Returns a localized name for the TextFrameSetType.
0084      * @param type the frameset-type for which a localized name should be returned.
0085      */
0086     QString frameSetTypeName(TextFrameSetType type);
0087     QString frameSetTypeName(KWFrameSet* frameset);
0088 }
0089 
0090 #endif