2008-04-20 15:00:11 +00:00
|
|
|
// -*- C++ -*-
|
|
|
|
/**
|
2008-04-20 16:34:30 +00:00
|
|
|
* \file Citation.h
|
2008-04-20 15:00:11 +00:00
|
|
|
* This file is part of LyX, the document processor.
|
|
|
|
* Licence details can be found in the file COPYING.
|
|
|
|
*
|
2008-11-14 15:58:50 +00:00
|
|
|
* \author Herbert Voß
|
2008-04-20 15:00:11 +00:00
|
|
|
*
|
|
|
|
* Full author contact details are available in file CREDITS.
|
|
|
|
*/
|
|
|
|
|
2008-04-20 16:34:30 +00:00
|
|
|
#ifndef CITATION_H
|
|
|
|
#define CITATION_H
|
2008-04-20 15:00:11 +00:00
|
|
|
|
2017-01-07 15:46:00 +00:00
|
|
|
#include "support/docstring.h"
|
2012-03-01 00:41:30 +00:00
|
|
|
#include <string>
|
2019-08-07 11:00:29 +00:00
|
|
|
#include <vector>
|
2012-03-01 00:41:30 +00:00
|
|
|
|
2008-04-20 15:00:11 +00:00
|
|
|
namespace lyx {
|
2011-12-03 22:15:11 +00:00
|
|
|
|
2008-04-20 15:00:11 +00:00
|
|
|
|
2012-01-09 13:16:38 +00:00
|
|
|
enum CiteEngineType {
|
|
|
|
ENGINE_TYPE_AUTHORYEAR = 1,
|
|
|
|
ENGINE_TYPE_NUMERICAL = 2,
|
2013-05-16 14:00:54 +00:00
|
|
|
ENGINE_TYPE_DEFAULT = 3,
|
2012-01-09 13:16:38 +00:00
|
|
|
};
|
|
|
|
|
2008-04-20 15:00:11 +00:00
|
|
|
|
|
|
|
class CitationStyle
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
///
|
2017-01-03 12:11:11 +00:00
|
|
|
CitationStyle() : name("cite"), cmd("cite"), forceUpperCase(false),
|
Support for "qualified citation lists"
These are biblatex-specific multicite commands that allow for multiple
pre- and postnotes, as in:
\cites(pre)(post)[pre1][post1]{key1}[pre2][post2]{key2}...
with an optional general pre- and postnote, which applies to the whole
list (like [][] in normal cite commands) and an optional pre- and
postnotes for each item, so that pagination can actually be specified in
multi-cite references, as in:
(cf. Miller 2015, 2; furthermore Smith 2013, 23-23; Jenkins 2012, 103,
also refer to chapter 6 in this book)
See the biblatex manual, sec. 3.8.3., for details.
File format change.
2017-01-21 13:25:17 +00:00
|
|
|
hasStarredVersion(false), hasQualifiedList(false),
|
|
|
|
textAfter(false), textBefore(false) {}
|
2008-04-20 15:00:11 +00:00
|
|
|
|
2017-01-03 12:11:11 +00:00
|
|
|
/// the LyX name
|
|
|
|
std::string name;
|
|
|
|
/// the LaTeX command (might differ from the LyX name)
|
2012-03-01 00:41:30 +00:00
|
|
|
std::string cmd;
|
2017-01-03 16:25:41 +00:00
|
|
|
/// Optional alternative description what the starred version does (for the GUI)
|
|
|
|
std::string stardesc;
|
|
|
|
/// Optional tooltip for the starred version
|
|
|
|
std::string startooltip;
|
2012-03-01 00:41:30 +00:00
|
|
|
/// upper casing author prefixes (van -> Van)
|
2008-04-20 15:00:11 +00:00
|
|
|
bool forceUpperCase;
|
2017-01-03 16:25:41 +00:00
|
|
|
/// starred version (full author list by default)
|
|
|
|
bool hasStarredVersion;
|
Support for "qualified citation lists"
These are biblatex-specific multicite commands that allow for multiple
pre- and postnotes, as in:
\cites(pre)(post)[pre1][post1]{key1}[pre2][post2]{key2}...
with an optional general pre- and postnote, which applies to the whole
list (like [][] in normal cite commands) and an optional pre- and
postnotes for each item, so that pagination can actually be specified in
multi-cite references, as in:
(cf. Miller 2015, 2; furthermore Smith 2013, 23-23; Jenkins 2012, 103,
also refer to chapter 6 in this book)
See the biblatex manual, sec. 3.8.3., for details.
File format change.
2017-01-21 13:25:17 +00:00
|
|
|
/// allows for qualified citation lists (a Biblatex feature)
|
|
|
|
bool hasQualifiedList;
|
2012-03-01 00:41:30 +00:00
|
|
|
/// supports text after the citation
|
|
|
|
bool textAfter;
|
|
|
|
/// supports text before the citation
|
|
|
|
bool textBefore;
|
2008-04-20 15:00:11 +00:00
|
|
|
};
|
|
|
|
|
2017-01-07 15:46:00 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* 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
|
|
|
|
};
|
|
|
|
///
|
Support for "qualified citation lists"
These are biblatex-specific multicite commands that allow for multiple
pre- and postnotes, as in:
\cites(pre)(post)[pre1][post1]{key1}[pre2][post2]{key2}...
with an optional general pre- and postnote, which applies to the whole
list (like [][] in normal cite commands) and an optional pre- and
postnotes for each item, so that pagination can actually be specified in
multi-cite references, as in:
(cf. Miller 2015, 2; furthermore Smith 2013, 23-23; Jenkins 2012, 103,
also refer to chapter 6 in this book)
See the biblatex manual, sec. 3.8.3., for details.
File format change.
2017-01-21 13:25:17 +00:00
|
|
|
CiteItem() : forceUpperCase(false), Starred(false), isQualified(false),
|
2017-01-07 15:46:00 +00:00
|
|
|
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;
|
Support for "qualified citation lists"
These are biblatex-specific multicite commands that allow for multiple
pre- and postnotes, as in:
\cites(pre)(post)[pre1][post1]{key1}[pre2][post2]{key2}...
with an optional general pre- and postnote, which applies to the whole
list (like [][] in normal cite commands) and an optional pre- and
postnotes for each item, so that pagination can actually be specified in
multi-cite references, as in:
(cf. Miller 2015, 2; furthermore Smith 2013, 23-23; Jenkins 2012, 103,
also refer to chapter 6 in this book)
See the biblatex manual, sec. 3.8.3., for details.
File format change.
2017-01-21 13:25:17 +00:00
|
|
|
/// is a real qualified list
|
|
|
|
bool isQualified;
|
2017-01-07 15:46:00 +00:00
|
|
|
/// where this to be displayed?
|
|
|
|
CiteItem::CiteContext context;
|
|
|
|
/// text after the citation
|
|
|
|
docstring textAfter;
|
|
|
|
/// text before the citation
|
|
|
|
docstring textBefore;
|
2019-08-07 11:00:29 +00:00
|
|
|
///
|
|
|
|
typedef std::vector<std::pair<docstring, docstring>> QualifiedList;
|
Support for "qualified citation lists"
These are biblatex-specific multicite commands that allow for multiple
pre- and postnotes, as in:
\cites(pre)(post)[pre1][post1]{key1}[pre2][post2]{key2}...
with an optional general pre- and postnote, which applies to the whole
list (like [][] in normal cite commands) and an optional pre- and
postnotes for each item, so that pagination can actually be specified in
multi-cite references, as in:
(cf. Miller 2015, 2; furthermore Smith 2013, 23-23; Jenkins 2012, 103,
also refer to chapter 6 in this book)
See the biblatex manual, sec. 3.8.3., for details.
File format change.
2017-01-21 13:25:17 +00:00
|
|
|
/// Qualified lists's pre texts
|
2019-08-07 11:00:29 +00:00
|
|
|
QualifiedList pretexts;
|
Support for "qualified citation lists"
These are biblatex-specific multicite commands that allow for multiple
pre- and postnotes, as in:
\cites(pre)(post)[pre1][post1]{key1}[pre2][post2]{key2}...
with an optional general pre- and postnote, which applies to the whole
list (like [][] in normal cite commands) and an optional pre- and
postnotes for each item, so that pagination can actually be specified in
multi-cite references, as in:
(cf. Miller 2015, 2; furthermore Smith 2013, 23-23; Jenkins 2012, 103,
also refer to chapter 6 in this book)
See the biblatex manual, sec. 3.8.3., for details.
File format change.
2017-01-21 13:25:17 +00:00
|
|
|
///
|
2019-08-07 11:00:29 +00:00
|
|
|
QualifiedList getPretexts() const { return pretexts; }
|
Support for "qualified citation lists"
These are biblatex-specific multicite commands that allow for multiple
pre- and postnotes, as in:
\cites(pre)(post)[pre1][post1]{key1}[pre2][post2]{key2}...
with an optional general pre- and postnote, which applies to the whole
list (like [][] in normal cite commands) and an optional pre- and
postnotes for each item, so that pagination can actually be specified in
multi-cite references, as in:
(cf. Miller 2015, 2; furthermore Smith 2013, 23-23; Jenkins 2012, 103,
also refer to chapter 6 in this book)
See the biblatex manual, sec. 3.8.3., for details.
File format change.
2017-01-21 13:25:17 +00:00
|
|
|
/// Qualified lists's post texts
|
2019-08-07 11:00:29 +00:00
|
|
|
QualifiedList posttexts;
|
Support for "qualified citation lists"
These are biblatex-specific multicite commands that allow for multiple
pre- and postnotes, as in:
\cites(pre)(post)[pre1][post1]{key1}[pre2][post2]{key2}...
with an optional general pre- and postnote, which applies to the whole
list (like [][] in normal cite commands) and an optional pre- and
postnotes for each item, so that pagination can actually be specified in
multi-cite references, as in:
(cf. Miller 2015, 2; furthermore Smith 2013, 23-23; Jenkins 2012, 103,
also refer to chapter 6 in this book)
See the biblatex manual, sec. 3.8.3., for details.
File format change.
2017-01-21 13:25:17 +00:00
|
|
|
///
|
2019-08-07 11:00:29 +00:00
|
|
|
QualifiedList getPosttexts() const { return posttexts; }
|
2017-01-07 15:46:00 +00:00
|
|
|
/// 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;
|
|
|
|
};
|
|
|
|
|
2008-04-20 15:00:11 +00:00
|
|
|
} // namespace lyx
|
|
|
|
|
|
|
|
#endif
|