Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #ifndef _ODE_STYLE_STYLE_H_
00024 #define _ODE_STYLE_STYLE_H_
00025
00026 #include <vector>
00027 #include <map>
00028 #include <string>
00029
00030
00031 #include <ut_string_class.h>
00032
00033
00034 #include <gsf/gsf.h>
00035
00036
00037 class PP_AttrProp;
00038 class ODe_Style_List;
00039
00043 class ODe_Style_Style {
00044 public:
00045
00046 ODe_Style_Style();
00047 virtual ~ODe_Style_Style();
00048
00049
00050 bool write(GsfOutput* pODT, const UT_UTF8String& rSpacesOffset) const;
00051
00052 static bool hasTextStyleProps(const PP_AttrProp* pAP);
00053 static bool hasParagraphStyleProps(const PP_AttrProp* pAP);
00054 static bool hasSectionInfo(const PP_AttrProp* pAP);
00055 static bool hasTableStyleProps(const PP_AttrProp* pAP);
00056
00057
00058
00059
00060 bool isEquivalentTo(const ODe_Style_Style& rStyle);
00061
00062 bool isEmpty() const;
00063
00064 ODe_Style_Style& operator=(const ODe_Style_Style& rStyle);
00065
00066
00067 bool fetchAttributesFromAbiStyle(const PP_AttrProp* pAP);
00068
00069
00070 void fetchAttributesFromAbiSpan(const PP_AttrProp* pAP);
00071
00072
00073 void fetchAttributesFromAbiBlock(const PP_AttrProp* pAP, const ODe_Style_List* pCurrentListStyle);
00074
00075
00076 void fetchAttributesFromAbiSection(const PP_AttrProp* pAP);
00077
00078
00079 void fetchAttributesFromAbiTable(const PP_AttrProp* pAP);
00080
00081
00082 void fetchAttributesFromAbiCell(const PP_AttrProp* pAP);
00083
00084
00085 void fetchAttributesFromAbiFrame(const PP_AttrProp& rAP);
00086
00087 void makeDefaultStyle() {
00088 m_defaultStyle = true;
00089 if (m_pParagraphProps)
00090 m_pParagraphProps->m_defaultStyle = m_defaultStyle;
00091 }
00092
00093 void setStyleName(const UT_UTF8String& rStyleName) {
00094 m_name = rStyleName;
00095 }
00096
00097 const UT_UTF8String& getName() const {
00098 return m_name;
00099 }
00100
00101 void setFamily(const gchar* pFamily) {
00102 m_family = pFamily;
00103 }
00104
00105 void setParentStyleName(const gchar* pParentStyleName) {
00106 m_parentStyleName = pParentStyleName;
00107 }
00108
00109 void setMasterPageName(const UT_UTF8String& rMasterPageName) {
00110 m_masterPageName = rMasterPageName;
00111 }
00112
00113 void setListStyleName(const UT_UTF8String& rListStyleName) {
00114 m_listStyleName = rListStyleName;
00115 }
00116
00117 const UT_UTF8String& getFontName();
00118
00119 void setBreakBefore(const gchar* pBreakBefore);
00120 void setColumnWidth(const gchar* pColumnWidth);
00121 void setRelColumnWidth(const gchar* pRelColumnWidth);
00122 void setRelTableWidth(const gchar* pRelTableWidth);
00123 void setTableWidth(const gchar* pTableWidth);
00124 void setRowHeight(const gchar* pRowHeight);
00125 void setMinRowHeight(const gchar* pMinRowHeight);
00126 void inheritTableCellProperties(const ODe_Style_Style& tableStyle);
00127 void setWrap(const UT_UTF8String& rWrap);
00128 void setRunThrough(const UT_UTF8String& rRunThrough);
00129 void setPadding(const UT_UTF8String& rPadding);
00130 void setHorizontalPos(const UT_UTF8String& rHorizontalPos);
00131 void setVerticalPos(const UT_UTF8String& rVerticalPos);
00132 void setVerticalRel(const UT_UTF8String& rVerticalRel);
00133
00134 const UT_UTF8String& getDefaultTabInterval();
00135 void setDefaultTabInterval(const UT_UTF8String& rDefaultTabInterval);
00136
00137 static UT_UTF8String convertStyleToNCName(const UT_UTF8String& name);
00138
00139 private:
00140
00141
00142
00143
00144
00145
00146 static std::map<std::string, std::string> m_NCStyleMappings;
00147
00148
00150
00151 bool m_defaultStyle;
00152 UT_UTF8String m_name;
00153 UT_UTF8String m_family;
00154 UT_UTF8String m_parentStyleName;
00155 UT_UTF8String m_nextStyleName;
00156 UT_UTF8String m_masterPageName;
00157 UT_UTF8String m_listStyleName;
00158
00159
00161
00162 class SectionProps {
00163 public:
00164
00165 bool isEmpty() const;
00166 void fetchAttributesFromAbiProps(const PP_AttrProp& rAP);
00167 void write(UT_UTF8String& rOutput, const UT_UTF8String& rSpacesOffset) const ;
00168 SectionProps& operator=(const SectionProps& rSectionProps);
00169 bool operator==(const SectionProps& rSectionProps) const;
00170
00172
00173 UT_UTF8String m_columnCount;
00174 UT_UTF8String m_columnGap;
00175 } *m_pSectionProps;
00176
00177
00179
00180 class TabStop {
00181 public:
00182 bool operator==(const TabStop& rTabStop) const;
00183
00184 UT_UTF8String m_type;
00185 UT_UTF8String m_char;
00186 UT_UTF8String m_position;
00187 UT_UTF8String m_leaderStyle;
00188 UT_UTF8String m_leaderText;
00189 };
00190
00192
00193 class ParagraphProps {
00194 public:
00195 ParagraphProps() {
00196
00197
00198 }
00199 ParagraphProps(bool defaultStyle)
00200 : m_defaultStyle(defaultStyle)
00201 { }
00202
00203 bool isEmpty() const;
00204 void fetchAttributesFromAbiProps(const PP_AttrProp& rAP);
00205 void write(UT_UTF8String& rOutput, const UT_UTF8String& rSpacesOffset) const ;
00206 ParagraphProps& operator=(const ParagraphProps& rParagraphProps);
00207 bool operator==(const ParagraphProps& rParagraphProps) const;
00208
00209 bool m_defaultStyle;
00210
00211 UT_UTF8String m_textAlign;
00212 UT_UTF8String m_textIndent;
00213 UT_UTF8String m_lineHeight;
00214 UT_UTF8String m_lineHeightAtLeast;
00215 UT_UTF8String m_backgroundColor;
00216 UT_UTF8String m_widows;
00217 UT_UTF8String m_orphans;
00218 UT_UTF8String m_marginLeft;
00219 UT_UTF8String m_marginRight;
00220 UT_UTF8String m_marginTop;
00221 UT_UTF8String m_marginBottom;
00222 UT_UTF8String m_keepWithNext;
00223 UT_UTF8String m_breakBefore;
00224 UT_UTF8String m_writingMode;
00225 UT_UTF8String m_borderMerge;
00226 UT_UTF8String m_borderLeft;
00227 UT_UTF8String m_borderRight;
00228 UT_UTF8String m_borderTop;
00229 UT_UTF8String m_borderBottom;
00230 UT_UTF8String m_botSpace;
00231 UT_UTF8String m_leftSpace;
00232 UT_UTF8String m_rightSpace;
00233 UT_UTF8String m_topSpace;
00234
00235 UT_UTF8String m_defaultTabInterval;
00236 std::vector<TabStop> m_tabStops;
00237 } *m_pParagraphProps;
00238
00239
00241
00242 class TextProps {
00243 public:
00244
00245 bool isEmpty() const;
00246 void fetchAttributesFromAbiProps(const PP_AttrProp& rAP);
00247 void write(UT_UTF8String& rOutput, const UT_UTF8String& rSpacesOffset) const ;
00248 TextProps& operator=(const TextProps& rTextProps);
00249 bool operator==(const TextProps& rTextProps) const;
00250
00251 UT_UTF8String m_color;
00252 UT_UTF8String m_underlineType;
00253 UT_UTF8String m_lineThroughType;
00254 UT_UTF8String m_textPosition;
00255 UT_UTF8String m_fontName;
00256 UT_UTF8String m_fontSize;
00257 UT_UTF8String m_language;
00258 UT_UTF8String m_country;
00259 UT_UTF8String m_fontStyle;
00260 UT_UTF8String m_fontWeight;
00261 UT_UTF8String m_backgroundColor;
00262 UT_UTF8String m_display;
00263 std::string m_transform;
00264 } *m_pTextProps;
00265
00266
00268
00269 class TableProps {
00270 public:
00271
00272 bool isEmpty() const;
00273 void fetchAttributesFromAbiProps(const PP_AttrProp& rAP);
00274 void write(UT_UTF8String& rOutput, const UT_UTF8String& rSpacesOffset) const ;
00275 TableProps& operator=(const TableProps& rTableProps);
00276 bool operator==(const TableProps& rTableProps) const;
00277
00278 UT_UTF8String m_width;
00279 UT_UTF8String m_RelTableWidth;
00280 UT_UTF8String m_backgroundColor;
00281 UT_UTF8String m_align;
00282 UT_UTF8String m_marginLeft;
00283 UT_UTF8String m_marginRight;
00284 } *m_pTableProps;
00285
00286
00288
00289 class ColumnProps {
00290 public:
00291
00292 bool isEmpty() const;
00293 void write(UT_UTF8String& rOutput, const UT_UTF8String& rSpacesOffset) const ;
00294 ColumnProps& operator=(const ColumnProps& rColumnProps);
00295 bool operator==(const ColumnProps& rColumnProps) const;
00296
00297 UT_UTF8String m_columnWidth;
00298 UT_UTF8String m_RelColumnWidth;
00299 } *m_pColumnProps;
00300
00301
00303
00304 class RowProps {
00305 public:
00306
00307 bool isEmpty() const;
00308 void write(UT_UTF8String& rOutput, const UT_UTF8String& rSpacesOffset) const ;
00309 RowProps& operator=(const RowProps& rRowProps);
00310 bool operator==(const RowProps& rRowProps) const;
00311
00312 UT_UTF8String m_rowHeight;
00313 UT_UTF8String m_minRowHeight;
00314 } *m_pRowProps;
00315
00316
00318
00319 class CellProps {
00320 public:
00321
00322 bool isEmpty() const;
00323 void fetchAttributesFromAbiProps(const PP_AttrProp& rAP);
00324 void write(UT_UTF8String& rOutput, const UT_UTF8String& rSpacesOffset) const ;
00325 CellProps& operator=(const CellProps& rCellProps);
00326 bool operator==(const CellProps& rCellProps) const;
00327
00328 UT_UTF8String m_leftThickness;
00329 UT_UTF8String m_leftColor;
00330 UT_UTF8String m_rightThickness;
00331 UT_UTF8String m_rightColor;
00332 UT_UTF8String m_topThickness;
00333 UT_UTF8String m_topColor;
00334 UT_UTF8String m_bottomThickness;
00335 UT_UTF8String m_bottomColor;
00336 UT_UTF8String m_backgroundColor;
00337 UT_UTF8String m_backgroundImage;
00338 UT_UTF8String m_verticalAlign;
00339
00340
00341 } *m_pCellProps;
00342
00343
00345
00346 class GraphicProps {
00347 public:
00348
00349 bool isEmpty() const;
00350 void fetchAttributesFromAbiProps(const PP_AttrProp& rAP);
00351 void write(UT_UTF8String& rOutput, const UT_UTF8String& rSpacesOffset) const ;
00352 GraphicProps& operator=(const GraphicProps& rGraphicProps);
00353 bool operator==(const GraphicProps& rGraphicProps) const;
00354
00355 UT_UTF8String m_backgroundColor;
00356 UT_UTF8String m_borderLeft;
00357 UT_UTF8String m_borderRight;
00358 UT_UTF8String m_borderTop;
00359 UT_UTF8String m_borderBottom;
00360 UT_UTF8String m_wrap;
00361 UT_UTF8String m_runThrough;
00362 UT_UTF8String m_verticalPos;
00363 UT_UTF8String m_verticalRel;
00364 UT_UTF8String m_horizontalPos;
00365 UT_UTF8String m_horizontalRel;
00366 UT_UTF8String m_padding;
00367 } *m_pGraphicProps;
00368 };
00369
00370
00371 #endif //_ODE_STYLE_STYLE_H_