|
1 /****************************************************************************** |
|
2 * |
|
3 * |
|
4 * |
|
5 * |
|
6 * Copyright (C) 1997-2008 by Dimitri van Heesch. |
|
7 * |
|
8 * Permission to use, copy, modify, and distribute this software and its |
|
9 * documentation under the terms of the GNU General Public License is hereby |
|
10 * granted. No representations are made about the suitability of this software |
|
11 * for any purpose. It is provided "as is" without express or implied warranty. |
|
12 * See the GNU General Public License for more details. |
|
13 * |
|
14 * Documents produced by Doxygen are derivative works derived from the |
|
15 * input used in their production; they are not affected by this license. |
|
16 * |
|
17 */ |
|
18 |
|
19 #ifndef RTFSTYLE_H |
|
20 #define RTFSTYLE_H |
|
21 |
|
22 #include "qtbc.h" |
|
23 #include <qregexp.h> |
|
24 #include <qdict.h> |
|
25 |
|
26 // used for table column width calculation |
|
27 const int rtf_pageWidth = 8748; |
|
28 |
|
29 extern QCString rtf_title; |
|
30 extern QCString rtf_subject; |
|
31 extern QCString rtf_comments; |
|
32 extern QCString rtf_company; |
|
33 extern QCString rtf_logoFilename; |
|
34 extern QCString rtf_author; |
|
35 extern QCString rtf_manager; |
|
36 extern QCString rtf_documentType; |
|
37 extern QCString rtf_documentId; |
|
38 extern QCString rtf_keywords; |
|
39 |
|
40 struct RTFListItemInfo |
|
41 { |
|
42 bool isEnum; |
|
43 int number; |
|
44 }; |
|
45 |
|
46 const int rtf_maxIndentLevels = 10; |
|
47 |
|
48 extern RTFListItemInfo rtf_listItemInfo[rtf_maxIndentLevels]; |
|
49 |
|
50 struct Rtf_Style_Default |
|
51 { |
|
52 const char *name; |
|
53 const char *reference; |
|
54 const char *definition; |
|
55 }; |
|
56 |
|
57 extern char rtf_Style_Reset[]; |
|
58 extern Rtf_Style_Default rtf_Style_Default[]; |
|
59 |
|
60 struct StyleData |
|
61 { |
|
62 // elements of this type are stored in dictionary Rtf_Style |
|
63 // |
|
64 // to define a tag in the header reference + definition is required |
|
65 // to use a tag in the body of the document only reference is required |
|
66 |
|
67 unsigned index; // index in style-sheet, i.e. number in s-clause |
|
68 char* reference; // everything required to apply the style |
|
69 char* definition; // aditional tags like \snext and style name |
|
70 |
|
71 StyleData(const char* reference, const char* definition); |
|
72 ~StyleData(); |
|
73 bool setStyle(const char* s, const char* styleName); |
|
74 |
|
75 static const QRegExp s_clause; |
|
76 }; |
|
77 |
|
78 extern QDict<StyleData> rtf_Style; |
|
79 |
|
80 void loadExtensions(const char *name); |
|
81 void loadStylesheet(const char *name, QDict<StyleData>& dict); |
|
82 |
|
83 #endif |