Doxygen
Loading...
Searching...
No Matches
rtfstyle.h
Go to the documentation of this file.
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#include <cstdint>
22
23#include "qcstring.h"
24
25// used for table column width calculation
26const int rtf_pageWidth = 8748;
27
28extern QCString rtf_title;
33extern QCString rtf_author;
38
40{
41 const char *name;
42 const char *reference;
43 const char *definition;
44};
45
47{
48 int id;
49 int lvl;
50 const char *definition;
51 const char *place;
52};
53
54extern char rtf_Style_Reset[];
57
59{
60 // elements of this type are stored in dictionary Rtf_Style
61 //
62 // to define a tag in the header reference + definition is required
63 // to use a tag in the body of the document only reference is required
64
65 public:
66 StyleData() = default;
67 StyleData(const std::string &reference, const std::string &definition);
68 bool setStyle(const std::string &command, const std::string &styleName);
69 const char *reference() const { return m_reference.c_str(); }
70 const char *definition() const { return m_definition.c_str(); }
71 uint32_t index() const { return m_index; }
72
73 private:
74 uint32_t m_index = 0; // index in style-sheet, i.e. number in s-clause
75 std::string m_reference; // everything required to apply the style
76 std::string m_definition; // additional tags like \snext and style name
77};
78
79using StyleDataMap = std::map<std::string,StyleData>;
80
82
83void loadExtensions(const QCString &name);
84void loadStylesheet(const QCString &name, StyleDataMap& map);
85
86#endif
This is an alternative implementation of QCString.
Definition qcstring.h:101
QCString rtf_company
Definition rtfstyle.cpp:26
StyleDataMap rtf_Style
Definition rtfstyle.cpp:362
QCString rtf_documentType
Definition rtfstyle.cpp:30
Rtf_Style_Default rtf_Style_Default[]
Definition rtfstyle.cpp:88
char rtf_Style_Reset[]
Definition rtfstyle.cpp:49
QCString rtf_logoFilename
Definition rtfstyle.cpp:27
QCString rtf_title
Definition rtfstyle.cpp:23
Rtf_Table_Default rtf_Table_Default[]
Definition rtfstyle.cpp:245
QCString rtf_keywords
Definition rtfstyle.cpp:32
QCString rtf_author
Definition rtfstyle.cpp:28
QCString rtf_manager
Definition rtfstyle.cpp:29
QCString rtf_comments
Definition rtfstyle.cpp:25
QCString rtf_subject
Definition rtfstyle.cpp:24
QCString rtf_documentId
Definition rtfstyle.cpp:31
void loadStylesheet(const QCString &name, StyleDataMap &map)
Definition rtfstyle.cpp:322
std::map< std::string, StyleData > StyleDataMap
Definition rtfstyle.h:79
void loadExtensions(const QCString &name)
Definition rtfstyle.cpp:364
const int rtf_pageWidth
Definition rtfstyle.h:26
const char * name
Definition rtfstyle.h:41
const char * reference
Definition rtfstyle.h:42
const char * definition
Definition rtfstyle.h:43
const char * definition
Definition rtfstyle.h:50
const char * place
Definition rtfstyle.h:51
StyleData()=default
uint32_t m_index
Definition rtfstyle.h:74
uint32_t index() const
Definition rtfstyle.h:71
bool setStyle(const std::string &command, const std::string &styleName)
Definition rtfstyle.cpp:301
const char * definition() const
Definition rtfstyle.h:70
const char * reference() const
Definition rtfstyle.h:69
std::string m_reference
Definition rtfstyle.h:75
std::string m_definition
Definition rtfstyle.h:76