]> git.lyx.org Git - lyx.git/blob - src/Citation.h
Fix make check.
[lyx.git] / src / Citation.h
1 // -*- C++ -*-
2 /**
3  * \file Citation.h
4  * This file is part of LyX, the document processor.
5  * Licence details can be found in the file COPYING.
6  *
7  * \author Herbert Voß
8  *
9  * Full author contact details are available in file CREDITS.
10  */
11
12 #ifndef CITATION_H
13 #define CITATION_H
14
15 #include "support/docstring.h"
16 #include <string>
17
18 namespace lyx {
19
20 class Buffer;
21
22
23 enum CiteEngineType {
24         ENGINE_TYPE_AUTHORYEAR = 1,
25         ENGINE_TYPE_NUMERICAL = 2,
26         ENGINE_TYPE_DEFAULT = 3,
27 };
28
29
30 class CitationStyle
31 {
32 public:
33         ///
34         CitationStyle() : name("cite"), cmd("cite"), forceUpperCase(false),
35                 hasStarredVersion(false), textAfter(false), textBefore(false) {}
36
37         /// the LyX name
38         std::string name;
39         /// the LaTeX command (might differ from the LyX name)
40         std::string cmd;
41         /// Optional alternative description what the starred version does (for the GUI)
42         std::string stardesc;
43         /// Optional tooltip for the starred version
44         std::string startooltip;
45         /// upper casing author prefixes (van -> Van)
46         bool forceUpperCase;
47         /// starred version (full author list by default)
48         bool hasStarredVersion;
49         /// supports text after the citation
50         bool textAfter;
51         /// supports text before the citation
52         bool textBefore;
53 };
54
55
56 /**
57  * Class for storing information about a given citation item in a given context.
58  * This is used in the label and menu string generation process.
59  */
60 class CiteItem
61 {
62 public:
63         /// The context this citation is displayed
64         enum CiteContext{
65                 Everywhere,
66                 Dialog,
67                 Export
68         };
69         ///
70         CiteItem() : forceUpperCase(false), Starred(false),
71                 context(CiteItem::Everywhere), textAfter(docstring()),
72                 textBefore(docstring()), max_size(128), max_key_size(128),
73                 richtext(false) {}
74         /// requests upper casing author prefixes (van -> Van)
75         bool forceUpperCase;
76         /// is starred version (full author list by default)
77         bool Starred;
78         /// where this to be displayed?
79         CiteItem::CiteContext context;
80         /// text after the citation
81         docstring textAfter;
82         /// text before the citation
83         docstring textBefore;
84         /// the maximum display size as a label
85         size_t max_size;
86         /// the maximum size of the processed keys
87         /// (limited for performance reasons)
88         size_t max_key_size;
89         /// output richtext information?
90         bool richtext;
91 };
92
93 } // namespace lyx
94
95 #endif