~ubuntu-branches/ubuntu/precise/koffice/precise

« back to all changes in this revision

Viewing changes to filters/kspread/latex/export/fileheader.h

  • Committer: Bazaar Package Importer
  • Author(s): Jonathan Riddell
  • Date: 2010-09-21 15:36:35 UTC
  • mfrom: (1.4.1 upstream) (60.2.11 maverick)
  • Revision ID: james.westby@ubuntu.com-20100921153635-6tejqkiro2u21ydi
Tags: 1:2.2.2-0ubuntu3
Add kubuntu_03_fix-crash-on-closing-sqlite-connection-2.2.2.diff and
kubuntu_04_support-large-memo-values-for-msaccess-2.2.2.diff as
recommended by upstream http://kexi-
project.org/wiki/wikiview/index.php@Kexi2.2_Patches.html#sqlite_stab
ility

Show diffs side-by-side

added added

removed removed

Lines of Context:
38
38
 */
39
39
class FileHeader: public XmlParser
40
40
{
41
 
        public:
42
 
                enum TFormat { TF_A3, TF_A4, TF_A5, TF_USLETTER, TF_USLEGAL, TF_SCREEN,
43
 
                        TF_CUSTOM, TF_B3, TF_USEXECUTIVE };
44
 
                enum TUnit { TMillimeter, TCentimeter, TPoint, TInch };
45
 
                enum TOrient { TO_PORTRAIT, TO_LANDSCAPE };
46
 
                enum TColonne { TC_NONE, TC_1, TC_2, TC_MORE };
47
 
                enum THeadfoot { TH_ALL = 0, TH_XXX = 1, TH_FIRST = 2, TH_EVODD = 3 };
48
 
                enum TProcType { TP_NORMAL, TP_DTP };
49
 
 
50
 
                static FileHeader* instance(void);
51
 
 
52
 
        private:
53
 
                /* PAPER */
54
 
                TFormat   _format;
55
 
                double    _width,
56
 
                                _height;
57
 
                TOrient   _orientation;
58
 
                TColonne  _colonne;
59
 
                double    _columnSpacing;
60
 
                THeadfoot _headType;
61
 
                THeadfoot _footType;
62
 
                TProcType _processing;
63
 
                int       _standardPage;
64
 
                double    _footBody;
65
 
                double    _headBody;
66
 
 
67
 
                /* PAPERBORDERS */
68
 
                double    _leftBorder,
69
 
                                _rightBorder,
70
 
                                _bottomBorder,
71
 
                                _topBorder;
72
 
 
73
 
                /* ATTRIBUTES */
74
 
                TUnit    _unite;
75
 
                bool     _hasHeader;
76
 
                bool     _hasFooter;
77
 
                bool     _hasTOC;
78
 
 
79
 
                /* FOOTNOTEMGR */
80
 
 
81
 
                /* DIVERSE */
82
 
                /* for special packages to include */
83
 
                bool     _hasColor;
84
 
                bool     _hasUnderline;
85
 
                bool     _hasEnumerate;
86
 
                bool     _hasGraphics;
87
 
                bool     _hasTable;
88
 
 
89
 
        public:
90
 
                
91
 
                /**
92
 
                 * Destructor
93
 
                 */
94
 
                virtual ~FileHeader();
95
 
 
96
 
                /**
97
 
                 * Accessors
98
 
                 */
99
 
                TFormat   getFormat        () const { return _format;         }
100
 
                TOrient   getOrientation   () const { return _orientation;    }
101
 
                TColonne  getColumns       () const { return _colonne;        }
102
 
                THeadfoot getHeadType      () const { return _headType;       }
103
 
                THeadfoot getFootType      () const { return _footType;       }
104
 
                TUnit     getUnit          () const { return _unite;          }
105
 
                TProcType getProcessing    () const { return _processing;     }
106
 
                int       getStandardPge   () const { return _standardPage;   }
107
 
                bool      hasHeader        () const { return _hasHeader;      }
108
 
                bool      hasFooter        () const { return _hasFooter;      }
109
 
                bool      hasTOC           () const { return _hasTOC;         }
110
 
                bool      hasColor         () const { return _hasColor;       }
111
 
                bool      hasUnderline     () const { return _hasUnderline;   }
112
 
                bool      hasEnumerate     () const { return _hasEnumerate;   }
113
 
                bool      hasGraphics      () const { return _hasGraphics;    }
114
 
                bool      hasTable         () const { return _hasTable;       }
115
 
 
116
 
                /**
117
 
                 * Modifiors
118
 
                 */
119
 
                void setFormat     (TFormat f)  { _format       = f;              }
120
 
                void setFormat     (int f)      { _format       = (TFormat) f;    }
121
 
                void setOrientation(TOrient o)  { _orientation  = o;              }
122
 
                void setOrientation(int o)      { _orientation  = (TOrient) o;    }
123
 
                void setColumns    (TColonne c) { _colonne      = c;              }
124
 
                void setColumns    (int c)      { _colonne      = (TColonne) c;   }
125
 
                void setUnit       (int u)      { _unite        = (TUnit) u;      }
126
 
                void setProcessing (int p)      { _processing   = (TProcType) p;  }
127
 
                void setStandardPge(int s)      { _standardPage = s;              }
128
 
                void setTOC        (int t)      { _hasTOC       = t;              }
129
 
                void setHeadType   (int ht)     { _headType     = (THeadfoot) ht; }
130
 
                void setFootType   (int ft)     { _footType     = (THeadfoot) ft; }
131
 
                void useColor      ()           { _hasColor     = true;           }
132
 
                void useUnderline  ()           { _hasUnderline = true;           }
133
 
                void useEnumerate  ()           { _hasEnumerate = true;           }
134
 
                void useGraphics   ()           { _hasGraphics  = true;           }
135
 
                void useTable      ()           { _hasTable     = true;           }
136
 
 
137
 
                void analyzePaper     (const QDomNode);
138
 
                void analyzeAttributes (const QDomNode);
139
 
 
140
 
                void generate         (QTextStream &);
141
 
 
142
 
        protected:
143
 
                /**
144
 
                 * Constructor
145
 
                 */
146
 
                FileHeader();           /* Ensure singleton */
147
 
 
148
 
                static FileHeader* _instance; /* singleton */
149
 
 
150
 
        private:
151
 
 
152
 
                void analyzePaperParam(const QDomNode);
153
 
 
154
 
                void generatePaper    (QTextStream&);
155
 
                void generateLatinPreamble(QTextStream&);
156
 
                void generateUnicodePreamble(QTextStream&);
157
 
                void generatePackage  (QTextStream&);
 
41
public:
 
42
    enum TFormat { TF_A3, TF_A4, TF_A5, TF_USLETTER, TF_USLEGAL, TF_SCREEN,
 
43
                   TF_CUSTOM, TF_B3, TF_USEXECUTIVE
 
44
                 };
 
45
    enum TUnit { TMillimeter, TCentimeter, TPoint, TInch };
 
46
    enum TOrient { TO_PORTRAIT, TO_LANDSCAPE };
 
47
    enum TColonne { TC_NONE, TC_1, TC_2, TC_MORE };
 
48
    enum THeadfoot { TH_ALL = 0, TH_XXX = 1, TH_FIRST = 2, TH_EVODD = 3 };
 
49
    enum TProcType { TP_NORMAL, TP_DTP };
 
50
 
 
51
    static FileHeader* instance(void);
 
52
 
 
53
private:
 
54
    /* PAPER */
 
55
    TFormat   _format;
 
56
    double    _width,
 
57
    _height;
 
58
    TOrient   _orientation;
 
59
    TColonne  _colonne;
 
60
    double    _columnSpacing;
 
61
    THeadfoot _headType;
 
62
    THeadfoot _footType;
 
63
    TProcType _processing;
 
64
    int       _standardPage;
 
65
    double    _footBody;
 
66
    double    _headBody;
 
67
 
 
68
    /* PAPERBORDERS */
 
69
    double    _leftBorder,
 
70
    _rightBorder,
 
71
    _bottomBorder,
 
72
    _topBorder;
 
73
 
 
74
    /* ATTRIBUTES */
 
75
    TUnit    _unite;
 
76
    bool     _hasHeader;
 
77
    bool     _hasFooter;
 
78
    bool     _hasTOC;
 
79
 
 
80
    /* FOOTNOTEMGR */
 
81
 
 
82
    /* DIVERSE */
 
83
    /* for special packages to include */
 
84
    bool     _hasColor;
 
85
    bool     _hasUnderline;
 
86
    bool     _hasEnumerate;
 
87
    bool     _hasGraphics;
 
88
    bool     _hasTable;
 
89
 
 
90
public:
 
91
 
 
92
    /**
 
93
     * Destructor
 
94
     */
 
95
    virtual ~FileHeader();
 
96
 
 
97
    /**
 
98
     * Accessors
 
99
     */
 
100
    TFormat   getFormat() const {
 
101
        return _format;
 
102
    }
 
103
    TOrient   getOrientation() const {
 
104
        return _orientation;
 
105
    }
 
106
    TColonne  getColumns() const {
 
107
        return _colonne;
 
108
    }
 
109
    THeadfoot getHeadType() const {
 
110
        return _headType;
 
111
    }
 
112
    THeadfoot getFootType() const {
 
113
        return _footType;
 
114
    }
 
115
    TUnit     getUnit() const {
 
116
        return _unite;
 
117
    }
 
118
    TProcType getProcessing() const {
 
119
        return _processing;
 
120
    }
 
121
    int       getStandardPge() const {
 
122
        return _standardPage;
 
123
    }
 
124
    bool      hasHeader() const {
 
125
        return _hasHeader;
 
126
    }
 
127
    bool      hasFooter() const {
 
128
        return _hasFooter;
 
129
    }
 
130
    bool      hasTOC() const {
 
131
        return _hasTOC;
 
132
    }
 
133
    bool      hasColor() const {
 
134
        return _hasColor;
 
135
    }
 
136
    bool      hasUnderline() const {
 
137
        return _hasUnderline;
 
138
    }
 
139
    bool      hasEnumerate() const {
 
140
        return _hasEnumerate;
 
141
    }
 
142
    bool      hasGraphics() const {
 
143
        return _hasGraphics;
 
144
    }
 
145
    bool      hasTable() const {
 
146
        return _hasTable;
 
147
    }
 
148
 
 
149
    /**
 
150
     * Modifiors
 
151
     */
 
152
    void setFormat(TFormat f)  {
 
153
        _format       = f;
 
154
    }
 
155
    void setFormat(int f)      {
 
156
        _format       = (TFormat) f;
 
157
    }
 
158
    void setOrientation(TOrient o)  {
 
159
        _orientation  = o;
 
160
    }
 
161
    void setOrientation(int o)      {
 
162
        _orientation  = (TOrient) o;
 
163
    }
 
164
    void setColumns(TColonne c) {
 
165
        _colonne      = c;
 
166
    }
 
167
    void setColumns(int c)      {
 
168
        _colonne      = (TColonne) c;
 
169
    }
 
170
    void setUnit(int u)      {
 
171
        _unite        = (TUnit) u;
 
172
    }
 
173
    void setProcessing(int p)      {
 
174
        _processing   = (TProcType) p;
 
175
    }
 
176
    void setStandardPge(int s)      {
 
177
        _standardPage = s;
 
178
    }
 
179
    void setTOC(int t)      {
 
180
        _hasTOC       = t;
 
181
    }
 
182
    void setHeadType(int ht)     {
 
183
        _headType     = (THeadfoot) ht;
 
184
    }
 
185
    void setFootType(int ft)     {
 
186
        _footType     = (THeadfoot) ft;
 
187
    }
 
188
    void useColor()           {
 
189
        _hasColor     = true;
 
190
    }
 
191
    void useUnderline()           {
 
192
        _hasUnderline = true;
 
193
    }
 
194
    void useEnumerate()           {
 
195
        _hasEnumerate = true;
 
196
    }
 
197
    void useGraphics()           {
 
198
        _hasGraphics  = true;
 
199
    }
 
200
    void useTable()           {
 
201
        _hasTable     = true;
 
202
    }
 
203
 
 
204
    void analyzePaper(const QDomNode);
 
205
    void analyzeAttributes(const QDomNode);
 
206
 
 
207
    void generate(QTextStream &);
 
208
 
 
209
protected:
 
210
    /**
 
211
     * Constructor
 
212
     */
 
213
    FileHeader();  /* Ensure singleton */
 
214
 
 
215
    static FileHeader* _instance; /* singleton */
 
216
 
 
217
private:
 
218
 
 
219
    void analyzePaperParam(const QDomNode);
 
220
 
 
221
    void generatePaper(QTextStream&);
 
222
    void generateLatinPreamble(QTextStream&);
 
223
    void generateUnicodePreamble(QTextStream&);
 
224
    void generatePackage(QTextStream&);
158
225
 
159
226
};
160
227