Scribus
Open source desktop publishing at your fingertips
gtparagraphstyle.h
1 /*
2 For general Scribus (>=1.3.2) copyright and licensing information please refer
3 to the COPYING file provided with the program. Following this notice may exist
4 a copyright and/or license notice that predates the release of Scribus 1.3.2
5 for which a new license (GPL+exception) is in place.
6 */
7 /***************************************************************************
8  * Copyright (C) 2004 by Riku Leino *
9  * tsoots@gmail.com *
10  * *
11  * This program is free software; you can redistribute it and/or modify *
12  * it under the terms of the GNU General Public License as published by *
13  * the Free Software Foundation; either version 2 of the License, or *
14  * (at your option) any later version. *
15  * *
16  * This program is distributed in the hope that it will be useful, *
17  * but WITHOUT ANY WARRANTY; without even the implied warranty of *
18  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
19  * GNU General Public License for more details. *
20  * *
21  * You should have received a copy of the GNU General Public License *
22  * along with this program; if not, write to the *
23  * Free Software Foundation, Inc., *
24  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
25  ***************************************************************************/
26 
27 #ifndef GTPARAGRAPHSTYLE_H
28 #define GTPARAGRAPHSTYLE_H
29 
30 #include "scribusapi.h"
31 #include "gtstyle.h"
32 #include "sctextstruct.h"
33 
34 enum Alignment {
35  LEFT,
36  CENTER,
37  RIGHT,
38  BLOCK,
39  FORCED,
40  AlignmentMAX
41 };
42 
43 enum TabType {
44  LEFT_T,
45  RIGHT_T,
46  FULL_STOP_T,
47  COMMA_T,
48  CENTER_T
49 };
50 
51 class SCRIBUS_API gtParagraphStyle : public gtStyle
52 {
53 private:
54  void init();
55 protected:
56  int flags;
57  bool defaultStyle;
58  double lineSpacing;
59  int alignment;
60  double indent;
61  double firstLineIndent;
62  double spaceAbove;
63  double spaceBelow;
64  QList<ParagraphStyle::TabRecord> tabValues;
65  bool dropCap;
66  int dropCapHeight;
67  bool m_bullet;
68  QString m_bulletStr;
69  bool m_numeration;
70  int m_numLevel;
72  int m_numStart;
73  QString m_numPrefix;
74  QString m_numSuffix;
75  bool adjToBaseline;
76  bool autoLineSpacing;
77  bool isVisible;
78 public:
79 
80  typedef enum
81  {
82  lineSpacingWasSet = 1,
83  alignmentWasSet = 2,
84  indentWasSet = 4,
85  firstIndentWasSet = 8,
86  spaceAboveWasSet = 16,
87  spaceBelowWasSet = 32,
88  tabValueWasSet = 64,
89  fillShadeWasSet = 128,
90  dropCapWasSet = 256,
91  dropCapHeightWasSet = 512,
92  adjToBaselineWasSet = 1024,
93  autoLineSpacingWasSet = 2048,
94  bulletWasSet = 4096,
95  numWasSet = 8192
96  } wasSetFlags;
97 
98  int getFlags();
99  bool isDefaultStyle();
100  void setDefaultStyle(bool defStyle);
101  double getLineSpacing();
102  void setLineSpacing(double newLineSpacing);
103  bool getAutoLineSpacing();
104  void setAutoLineSpacing(bool newALS);
105  int getAlignment();
106  void setAlignment(Alignment newAlignment);
107  void setAlignment(int newAlignment);
108  double getIndent();
109  void setIndent(double newIndent);
110  double getFirstLineIndent();
111  void setFirstLineIndent(double newFirstLineIndent);
112  double getSpaceAbove();
113  void setSpaceAbove(double newSpaceAbove);
114  double getSpaceBelow();
115  void setSpaceBelow(double newSpaceBelow);
116  QList<ParagraphStyle::TabRecord>* getTabValues();
117  void setTabValue(double newTabValue, TabType ttype = LEFT_T);
118  bool hasDropCap();
119  void setDropCap(bool newDropCap);
120  void setDropCap(int newHeight);
121  int getDropCapHeight();
122  void setDropCapHeight(int newHeight);
123  bool isAdjToBaseline();
124  void setAdjToBaseline(bool newAdjToBaseline);
125  void getStyle(gtStyle* style);
126  gtParagraphStyle(QString name);
128  gtParagraphStyle(const gtStyle& s);
129  ~gtParagraphStyle();
130  QString target();
131  bool hasBullet();
132  void setBullet(bool newBullet, QString str);
133  QString getBullet();
134  bool hasNum();
135  void setNum(bool newNum, int format=0, int level=0, int start = 1, QString prefix = "", QString suffix = "");
136  int getNumLevel();
137  int getNumFormat();
138  int getNumStart();
139  QString getNumPrefix();
140  QString getNumSuffix();
141 };
142 
143 #endif // GTPARAGRAPHSTYLE_H
bool m_bullet
Is style using bullet?
Definition: gtparagraphstyle.h:67
QString m_numPrefix
Numeration prefix of style.
Definition: gtparagraphstyle.h:73
int m_numStart
Numeration starts at number.
Definition: gtparagraphstyle.h:72
Definition: gtstyle.h:34
Definition: gtparagraphstyle.h:51
int m_numFormat
1_2_3, i_ii_ii, a_b_c
Definition: gtparagraphstyle.h:71
bool m_numeration
Is style using numeration?
Definition: gtparagraphstyle.h:69
int m_numLevel
Level in hierarchical numbering.
Definition: gtparagraphstyle.h:70
QString m_numSuffix
Numeration sufffix of style.
Definition: gtparagraphstyle.h:74
QString m_bulletStr
String used as bullet.
Definition: gtparagraphstyle.h:68