filters
layout.h00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #ifndef __KWORD_LAYOUT_H__
00024 #define __KWORD_LAYOUT_H__
00025
00026 #include <qtextstream.h>
00027 #include <qstring.h>
00028 #include <kdebug.h>
00029 #include "textformat.h"
00030
00031 enum _EType
00032 {
00033 TL_NONE,
00034 TL_ARABIC,
00035 TL_LLETTER,
00036 TL_CLETTER,
00037 TL_LLNUMBER,
00038 TL_CLNUMBER,
00039 TL_CUSTOM_SIMPLE,
00040 TL_CUSTOM_COMPLEX,
00041 TL_CIRCLE_BULLET,
00042 TL_SQUARE_BULLET,
00043 TL_DISC_BULLET
00044 };
00045
00046 enum _EEnv
00047 {
00048 ENV_NONE,
00049 ENV_LEFT,
00050 ENV_RIGHT,
00051 ENV_CENTER,
00052 ENV_JUSTIFY
00053 };
00054
00055 typedef enum _EType EType;
00056 typedef enum _EEnv EEnv;
00057
00058
00059
00060
00061
00066 class Layout: public TextFormat
00067 {
00068 QString _name;
00069 QString _following;
00070 EType _counterType;
00071 int _counterDepth;
00072 int _counterBullet;
00073 int _counterStart;
00074 int _numberingType;
00075 EEnv _env;
00076 static QString _last_name;
00077 static EType _last_counter;
00078 bool _useHardBreakAfter;
00079 bool _useHardBreak;
00080 bool _keepLinesTogether;
00081
00082 public:
00088 Layout();
00089
00090
00091
00092
00093
00094
00095 virtual ~Layout() {
00096 kdDebug(30522) << "Destruction of a layout." << endl;
00097 }
00098
00102 bool isChapter () const { return (_numberingType == 1); }
00103 bool isList () const { return (_numberingType == 0); }
00104 bool isEnum () const { return (_counterType != TL_NONE); }
00105 bool isLastSame () const { return (_name == _last_name); }
00106 bool isNextSame () const { return (_following == _name); }
00107 QString getLastName () const { return _last_name; }
00108 EType getLastCounter () const { return _last_counter; }
00109 EType getCounterType () const { return _counterType; }
00110 int getCounterDepth () const { return _counterDepth; }
00111 int getCounterBullet () const { return _counterBullet; }
00112 int getCounterStart () const { return _counterStart; }
00113 int getNumberingType () const { return _numberingType; }
00114 EEnv getEnv () const { return _env; }
00115 bool isHardBreakAfter () const { return _useHardBreakAfter; }
00116 bool isHardBreak () const { return _useHardBreak; }
00117 bool isKeppLinesTogether() const { return _keepLinesTogether; }
00118
00122 void setName (QString name) { _name = name; }
00123 void setLastName () { _last_name = _name; }
00124 void setLastCounter () { _last_counter= _counterType; }
00125 void setFollowing (QString name) { _following = name; }
00126 void setCounterType (int ct) { _counterType = (EType) ct; }
00127 void setCounterDepth (int cd) { _counterDepth = cd; }
00128 void setCounterBullet(int cb) { _counterBullet = cb; }
00129 void setCounterStart (int cs) { _counterStart = cs; }
00130 void setNumberingType(int nt) { _numberingType = nt; }
00131 void setEnv (int env) { _env = (EEnv) env; }
00132 void useHardBreakAfter() { _useHardBreakAfter = true; }
00133 void useHardBreak () { _useHardBreak = true; }
00134 void keepLinesTogether() { _keepLinesTogether = true; }
00135
00140 void analyseLayout (const QDomNode);
00141
00142 private:
00143 void analyseCounter (const QDomNode);
00144 void analyseFollowing(const QDomNode);
00145 void analyseName (const QDomNode);
00146 void analyseEnv (const QDomNode);
00147 void analyseBreakLine(const QDomNode);
00148 };
00149
00150 #endif
|