lib

KoParagStyle.h
1/* This file is part of the KDE project
2 Copyright (C) 2001-2005 David Faure <faure@kde.org>
3
4 This library is free software; you can redistribute it and/or
5 modify it under the terms of the GNU Library General Public
6 License version 2 as published by the Free Software Foundation.
7
8 This library is distributed in the hope that it will be useful,
9 but WITHOUT ANY WARRANTY; without even the implied warranty of
10 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 Library General Public License for more details.
12
13 You should have received a copy of the GNU Library General Public License
14 along with this library; see the file COPYING.LIB. If not, write to
15 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
16 Boston, MA 02110-1301, USA.
17*/
18
19#ifndef KOPARAGSTYLE_H
20#define KOPARAGSTYLE_H
21
22#include "KoTextFormat.h"
23#include "KoParagLayout.h"
24#include "KoUserStyle.h"
25class KoGenStyles;
26class TQDomElement;
27
32class KOTEXT_EXPORT KoCharStyle : public KoUserStyle
33{
34public:
36 KoCharStyle( const TQString & name );
37
39 KoCharStyle( const KoCharStyle & rhs ) : KoUserStyle( TQString() ) { *this = rhs; }
40
43 const KoTextFormat & format() const;
44 KoTextFormat & format();
45
46protected:
47 KoTextFormat m_format;
48};
49
54class KOTEXT_EXPORT KoParagStyle : public KoCharStyle
55{
56public:
58 KoParagStyle( const TQString & name );
59
61 KoParagStyle( const KoParagStyle & rhs );
62
64
65 void operator=( const KoParagStyle & );
66
67
68 const KoParagLayout & paragLayout() const;
69 KoParagLayout & paragLayout();
70
71 KoParagStyle *followingStyle() const { return m_followingStyle; }
72 void setFollowingStyle( KoParagStyle *fst );
73
76 void saveStyle( TQDomElement & parentElem );
79 void loadStyle( TQDomElement & parentElem, int docVersion = 2 );
80
82 void loadStyle( TQDomElement & styleElem, KoOasisContext& context );
85 TQString saveStyle( KoGenStyles& genStyles, int styleType, const TQString& parentStyleName, KoSavingContext& context ) const;
86
87 KoParagStyle * parentStyle() const {return m_parentStyle;}
88 void setParentStyle( KoParagStyle *_style){ m_parentStyle = _style;}
89
90 int inheritedParagLayoutFlag() const { return m_inheritedParagLayoutFlag; }
91 int inheritedFormatFlag() const { return m_inheritedFormatFlag; }
92
93 void propagateChanges( int paragLayoutFlag, int formatFlag );
94
95 // If true, paragraphs with this style will be included in the table of contents
96 bool isOutline() const { return m_bOutline; }
97 void setOutline( bool b );
98
99private:
100 KoParagLayout m_paragLayout;
101 KoParagStyle *m_followingStyle;
102 KoParagStyle *m_parentStyle;
103 int m_inheritedParagLayoutFlag;
104 int m_inheritedFormatFlag;
105 bool m_bOutline;
106};
107
108#endif /* KOPARAGSTYLE_H */
109
A KoCharStyle is a set of formatting attributes (font, color, etc.) to be applied to a run of text.
KoCharStyle(const KoCharStyle &rhs)
Copy another style.
Repository of styles used during saving of OASIS/OOo file.
Definition KoGenStyles.h:60
Used during loading of Oasis format (and discarded at the end of the loading).
This class holds the paragraph-specific formatting information It's separated from KoTextParag so tha...
A paragraph style is a combination of a character style and paragraph-layout attributes,...
Used during saving to Oasis format (and discarded at the end of the saving).
Each character (KoTextStringChar) points to a KoTextFormat that defines the formatting of that charac...
Base class for any kind of style that the user can create/modify/delete/display.
Definition KoUserStyle.h:34