filters

kword/latex/export/config.h
1/*
2** Header file for inclusion with kword_xml2latex.c
3**
4** Copyright (C) 2002 - 2003 Robert JACOLIN
5**
6** This library is free software; you can redistribute it and/or
7** modify it under the terms of the GNU Library General Public
8** License as published by the Free Software Foundation; either
9** version 2 of the License, or (at your option) any later version.
10**
11** This library is distributed in the hope that it will be useful,
12** but WITHOUT ANY WARRANTY; without even the implied warranty of
13** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14** Library General Public License for more details.
15**
16** To receive a copy of the GNU Library General Public License, write to the
17** Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
18 * Boston, MA 02110-1301, USA.
19**
20*/
21
22#ifndef __LATEX_CONFIG_H__
23#define __LATEX_CONFIG_H__
24
25#include <tqtextstream.h>
26#include <tqstringlist.h>
27
28/***********************************************************************/
29/* Class: Config */
30/***********************************************************************/
31
37class Config
38{
39 /* Document tab */
40 bool _useLatexStyle;
41 bool _isEmbeded;
42 TQString _class;
43 TQString _quality;
44 unsigned int _defaultFontSize;
45
46 /* Pictures tab */
47 bool _convertPictures;
48 TQString _picturesDir;
49
50 /* Language tab */
51 //bool _useUnicode;
52 //bool _useLatin1;
53 TQString _encoding;
54 TQStringList _languagesList;
55 TQString _defaultLanguage;
56
57 int _tabSize; /* Size of the para indentation. */
58 int _tabulation; /* Total size of the indentation. */
59
60 public:
61
62 static const char SPACE_CHAR;
63
64 static Config* instance(void);
65
66 Config(const Config&);
67
68 /*
69 * Destructor
70 */
71 virtual ~Config();
72
73 /* ==== Getters ==== */
74
78 bool isKwordStyleUsed() const { return (_useLatexStyle == false); }
79 bool isEmbeded() const { return _isEmbeded; }
80 TQString getClass() const { return _class; }
81 TQString getQuality() const { return _quality; }
82 unsigned int getDefaultFontSize() const { return _defaultFontSize; }
83
84 bool convertPictures() const { return _convertPictures; }
85 TQString getPicturesDir() const { return _picturesDir; }
86
87 bool mustUseUnicode() const { return (_encoding == "unicode"); }
88 bool mustUseLatin1() const { return (_encoding != "unicode"); }
89 TQString getEncoding() const { return _encoding; }
90 TQStringList getLanguagesList() const { return _languagesList; }
91 TQString getDefaultLanguage() const { return _defaultLanguage; }
92
93 int getTabSize() const { return _tabSize; }
94 int getIndentation() const { return _tabulation; }
95
96 /* ==== Setters ==== */
97
102 void setTabSize(int size)
103 {
104 if(size >= 0)
105 _tabSize = size;
106 }
107
108 void useLatexStyle() { _useLatexStyle = true; }
109 void useKwordStyle() { _useLatexStyle = false; }
110 void setEmbeded(bool emb) { _isEmbeded = emb; }
113 void setClass(const TQString &lclass) { _class = lclass; }
114 void setQuality(const TQString &quality) { _quality = quality; }
115 void setDefaultFontSize(int size) { _defaultFontSize = size; }
116
117 void convertPictures(bool state) { _convertPictures = state; }
118 void setPicturesDir(const TQString &dir) { _picturesDir = dir; }
119
120 void setEncoding(const TQString &enc) { _encoding = enc; }
121 void addLanguage(const TQString &l) { _languagesList.append(l); }
122 void setDefaultLanguage(const TQString &l) { _defaultLanguage = l; }
123
124 void setIndentation(int indent) { _tabulation = indent; }
125
126 /* ==== Helpfull functions ==== */
127 void indent();
128 void desindent();
129
130 void writeIndent(TQTextStream& out);
131
132 protected:
139 Config(); /* Ensure singleton */
140
141 static Config* _instance; /* Singleton */
142
143 private:
144
145};
146
147#endif /* __LATEX_CONFIG_H__ */
This class hold all parameters and configuration from a file or from the filter configuration dialog ...
void setTabSize(int size)
Initialise the tab size.
bool isKwordStyleUsed() const
Return the value of a tabulation.
Config()
Constructors.
void setClass(const TQString &lclass)
The class can be article, book, letter, report or slides.