16 #ifndef PARAGRAPHSTYLE_H
17 #define PARAGRAPHSTYLE_H
20 #include "charstyle.h"
21 #include "styles/stylecontextproxy.h"
30 enum LineSpacingMode {
32 AutomaticLineSpacing = 1,
33 BaselineGridLineSpacing = 2
42 enum OpticalMarginType {
44 OM_LeftProtruding = 1,
45 OM_RightProtruding = 2,
46 OM_LeftHangingPunct = 4,
47 OM_RightHangingPunct = 8,
48 OM_Default = OM_RightProtruding + OM_LeftHangingPunct + OM_RightHangingPunct
50 enum HyphenationMode {
52 ManualHyphenation = 1,
53 AutomaticHyphenation = 2
60 bool operator==(
const TabRecord& other)
const;
61 bool operator<(
const TabRecord& other)
const {
return tabPosition < other.tabPosition; }
63 bool operator>(
const TabRecord& other)
const {
return tabPosition > other.tabPosition; }
64 bool operator>=(
const TabRecord& other)
const {
return tabPosition >= other.tabPosition; }
73 static void desaxeRules(
const Xml_string& prefixPattern,
desaxe::Digester& ruleset, Xml_string elemtag = saxxDefaultElem);
75 virtual void saxx(
SaxHandler& handler,
const Xml_string& elemtag)
const;
82 QString displayName()
const;
94 StyleContext* charStyleContext() {
return & cstyleContext; }
95 const StyleContext* charStyleContext()
const {
return & cstyleContext; }
96 CharStyle & charStyle() {
return cstyle; }
97 const CharStyle& charStyle()
const {
return cstyle; }
101 void breakImplicitCharStyleInheritance(
bool val =
true);
106 void repairImplicitCharStyleInheritance();
110 #define ATTRDEF(attr_TYPE, attr_GETTER, attr_NAME, attr_DEFAULT) \
111 const attr_TYPE &attr_GETTER() const { validate(); return m_##attr_NAME; }
112 #include "paragraphstyle.attrdefs.cxx"
117 #define ATTRDEF(attr_TYPE, attr_GETTER, attr_NAME, attr_DEFAULT) \
118 void set##attr_NAME(attr_TYPE v) { m_##attr_NAME = v; inh_##attr_NAME = false; }
119 #include "paragraphstyle.attrdefs.cxx"
121 void appendTabValue(
const TabRecord& tab) {
validate(); m_TabValues.append(tab); inh_TabValues =
false; }
126 #define ATTRDEF(attr_TYPE, attr_GETTER, attr_NAME, attr_DEFAULT) \
127 void reset##attr_NAME() { m_##attr_NAME = attr_DEFAULT; inh_##attr_NAME = true; }
128 #include "paragraphstyle.attrdefs.cxx"
132 #define ATTRDEF(attr_TYPE, attr_GETTER, attr_NAME, attr_DEFAULT) \
133 bool isInh##attr_NAME() const { return inh_##attr_NAME; }
134 #include "paragraphstyle.attrdefs.cxx"
139 #define ATTRDEF(attr_TYPE, attr_GETTER, attr_NAME, attr_DEFAULT) \
140 bool isDef##attr_NAME() const { \
141 if ( !inh_##attr_NAME ) return true; \
142 const ParagraphStyle * par = dynamic_cast<const ParagraphStyle*>(parentStyle()); \
143 return par && par->isDef##attr_NAME(); \
145 #include "paragraphstyle.attrdefs.cxx"
153 bool cstyleContextIsInh;
156 #define ATTRDEF(attr_TYPE, attr_GETTER, attr_NAME, attr_DEFAULT) \
157 attr_TYPE m_##attr_NAME; \
158 bool inh_##attr_NAME;
159 #include "paragraphstyle.attrdefs.cxx"
Definition: charstyle.h:78
virtual bool equiv(const Style &other) const =0
Definition: stylecontext.h:35
Definition: saxhandler.h:21
Definition: stylecontextproxy.h:33
virtual void saxx(SaxHandler &handler) const
Definition: paragraphstyle.h:76
virtual void update(const StyleContext *b=NULL)
Definition: style.cpp:54
Definition: paragraphstyle.h:55
Definition: paragraphstyle.h:27
bool operator<=(Point const &a, Point const &b)
Definition: point.h:156
void applyStyle(const Style &other)
Definition: style.h:145
void eraseStyle(const Style &other)
Definition: style.h:153
static const Xml_string saxxDefaultElem
Definition: saxio.h:40
void erase()
Definition: paragraphstyle.h:92
Definition: digester.h:100
virtual void saxx(SaxHandler &, const Xml_string &) const =0
void validate() const
Definition: style.h:113
Definition: resourcecollection.h:41