Doxygen
rtfstyle.h
浏览该文件的文档.
1 /******************************************************************************
2  *
3  * Copyright (C) 1997-2020 by Dimitri van Heesch.
4  *
5  * Permission to use, copy, modify, and distribute this software and its
6  * documentation under the terms of the GNU General Public License is hereby
7  * granted. No representations are made about the suitability of this software
8  * for any purpose. It is provided "as is" without express or implied warranty.
9  * See the GNU General Public License for more details.
10  *
11  * Documents produced by Doxygen are derivative works derived from the
12  * input used in their production; they are not affected by this license.
13  *
14  */
15 
16 #ifndef RTFSTYLE_H
17 #define RTFSTYLE_H
18 
19 #include <map>
20 #include <string>
21 
22 #include "qcstring.h"
23 
24 // used for table column width calculation
25 const int rtf_pageWidth = 8748;
26 
27 extern QCString rtf_title;
28 extern QCString rtf_subject;
29 extern QCString rtf_comments;
30 extern QCString rtf_company;
32 extern QCString rtf_author;
33 extern QCString rtf_manager;
36 extern QCString rtf_keywords;
37 
39 {
40  const char *name;
41  const char *reference;
42  const char *definition;
43 };
44 
45 extern char rtf_Style_Reset[];
47 
48 struct StyleData
49 {
50  // elements of this type are stored in dictionary Rtf_Style
51  //
52  // to define a tag in the header reference + definition is required
53  // to use a tag in the body of the document only reference is required
54 
55  public:
56  StyleData() = default;
57  StyleData(const std::string &reference, const std::string &definition);
58  bool setStyle(const std::string &command, const std::string &styleName);
59  const char *reference() const { return m_reference.c_str(); }
60  const char *definition() const { return m_definition.c_str(); }
61  uint index() const { return m_index; }
62 
63  private:
64  uint m_index = 0; // index in style-sheet, i.e. number in s-clause
65  std::string m_reference; // everything required to apply the style
66  std::string m_definition; // additional tags like \snext and style name
67 };
68 
69 using StyleDataMap = std::map<std::string,StyleData>;
70 
71 extern StyleDataMap rtf_Style;
72 
73 void loadExtensions(const QCString &name);
74 void loadStylesheet(const QCString &name, StyleDataMap& map);
75 
76 #endif
rtf_comments
QCString rtf_comments
Definition: rtfstyle.cpp:25
Rtf_Style_Default::name
const char * name
Definition: rtfstyle.h:40
rtf_logoFilename
QCString rtf_logoFilename
Definition: rtfstyle.cpp:27
Rtf_Style_Default::reference
const char * reference
Definition: rtfstyle.h:41
rtf_Style
StyleDataMap rtf_Style
Definition: rtfstyle.cpp:313
rtf_company
QCString rtf_company
Definition: rtfstyle.cpp:26
rtf_Style_Default
Rtf_Style_Default rtf_Style_Default[]
Definition: rtfstyle.cpp:88
rtf_subject
QCString rtf_subject
Definition: rtfstyle.cpp:24
rtf_documentType
QCString rtf_documentType
Definition: rtfstyle.cpp:30
Rtf_Style_Default::definition
const char * definition
Definition: rtfstyle.h:42
loadExtensions
void loadExtensions(const QCString &name)
Definition: rtfstyle.cpp:315
Rtf_Style_Default
Definition: rtfstyle.h:38
qcstring.h
StyleData::m_index
uint m_index
Definition: rtfstyle.h:64
StyleData::definition
const char * definition() const
Definition: rtfstyle.h:60
StyleData
Definition: rtfstyle.h:48
uint
unsigned uint
Definition: qcstring.h:40
StyleDataMap
std::map< std::string, StyleData > StyleDataMap
Definition: rtfstyle.h:69
rtf_author
QCString rtf_author
Definition: rtfstyle.cpp:28
StyleData::index
uint index() const
Definition: rtfstyle.h:61
StyleData::setStyle
bool setStyle(const std::string &command, const std::string &styleName)
Definition: rtfstyle.cpp:252
rtf_title
QCString rtf_title
Definition: rtfstyle.cpp:23
rtf_documentId
QCString rtf_documentId
Definition: rtfstyle.cpp:31
rtf_keywords
QCString rtf_keywords
Definition: rtfstyle.cpp:32
rtf_manager
QCString rtf_manager
Definition: rtfstyle.cpp:29
loadStylesheet
void loadStylesheet(const QCString &name, StyleDataMap &map)
Definition: rtfstyle.cpp:273
StyleData::m_reference
std::string m_reference
Definition: rtfstyle.h:65
StyleData::StyleData
StyleData()=default
rtf_Style_Reset
char rtf_Style_Reset[]
Definition: rtfstyle.cpp:49
rtf_pageWidth
const int rtf_pageWidth
Definition: rtfstyle.h:25
StyleData::reference
const char * reference() const
Definition: rtfstyle.h:59
StyleData::m_definition
std::string m_definition
Definition: rtfstyle.h:66
QCString
This is an alternative implementation of QCString.
Definition: qcstring.h:108