X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2FCitation.h;h=8aeb56c3e5a207b39fa67135692b836ef934716a;hb=bb277747d2fc128d65edb55662d075ce44100bc7;hp=a9094bd4f532c656eddf44f64b1646bacba0c339;hpb=d2576eb003247e68d18a5d416fd04ea54ea0d67b;p=lyx.git diff --git a/src/Citation.h b/src/Citation.h index a9094bd4f5..8aeb56c3e5 100644 --- a/src/Citation.h +++ b/src/Citation.h @@ -4,7 +4,7 @@ * This file is part of LyX, the document processor. * Licence details can be found in the file COPYING. * - * \author Herbert Voß + * \author Herbert Voß * * Full author contact details are available in file CREDITS. */ @@ -12,27 +12,19 @@ #ifndef CITATION_H #define CITATION_H +#include "support/docstring.h" +#include +#include + namespace lyx { - + class Buffer; -enum CiteEngine { - ENGINE_BASIC, - ENGINE_NATBIB_AUTHORYEAR, - ENGINE_NATBIB_NUMERICAL, - ENGINE_JURABIB -}; -enum CiteStyle { - CITE, - NOCITE, - CITET, - CITEP, - CITEALT, - CITEALP, - CITEAUTHOR, - CITEYEAR, - CITEYEARPAR +enum CiteEngineType { + ENGINE_TYPE_AUTHORYEAR = 1, + ENGINE_TYPE_NUMERICAL = 2, + ENGINE_TYPE_DEFAULT = 3, }; @@ -40,14 +32,78 @@ class CitationStyle { public: /// - CitationStyle() : style(CITE), full(false), forceUpperCase(false) {} + CitationStyle() : name("cite"), cmd("cite"), forceUpperCase(false), + hasStarredVersion(false), hasQualifiedList(false), + textAfter(false), textBefore(false) {} + + /// the LyX name + std::string name; + /// the LaTeX command (might differ from the LyX name) + std::string cmd; + /// Optional alternative description what the starred version does (for the GUI) + std::string stardesc; + /// Optional tooltip for the starred version + std::string startooltip; + /// upper casing author prefixes (van -> Van) + bool forceUpperCase; + /// starred version (full author list by default) + bool hasStarredVersion; + /// allows for qualified citation lists (a Biblatex feature) + bool hasQualifiedList; + /// supports text after the citation + bool textAfter; + /// supports text before the citation + bool textBefore; +}; + +/** + * Class for storing information about a given citation item in a given context. + * This is used in the label and menu string generation process. + */ +class CiteItem +{ +public: + /// The context this citation is displayed + enum CiteContext{ + Everywhere, + Dialog, + Export + }; /// - CiteStyle style; + CiteItem() : forceUpperCase(false), Starred(false), isQualified(false), + context(CiteItem::Everywhere), textAfter(docstring()), + textBefore(docstring()), max_size(128), max_key_size(128), + richtext(false) {} + /// requests upper casing author prefixes (van -> Van) + bool forceUpperCase; + /// is starred version (full author list by default) + bool Starred; + /// is a real qualified list + bool isQualified; + /// where this to be displayed? + CiteItem::CiteContext context; + /// text after the citation + docstring textAfter; + /// text before the citation + docstring textBefore; /// - bool full; + typedef std::vector> QualifiedList; + /// Qualified lists's pre texts + QualifiedList pretexts; /// - bool forceUpperCase; + QualifiedList getPretexts() const { return pretexts; } + /// Qualified lists's post texts + QualifiedList posttexts; + /// + QualifiedList getPosttexts() const { return posttexts; } + /// the maximum display size as a label + size_t max_size; + /// the maximum size of the processed keys + /// (limited for performance reasons) + size_t max_key_size; + /// output richtext information? + bool richtext; }; } // namespace lyx