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