]> git.lyx.org Git - lyx.git/blob - src/frontends/controllers/ControlCitation.h
5 new lfuns, move all apply code out of ControlDocument and into the core.
[lyx.git] / src / frontends / controllers / ControlCitation.h
1 // -*- C++ -*-
2 /**
3  * \file ControlCitation.h
4  * This file is part of LyX, the document processor.
5  * Licence details can be found in the file COPYING.
6  *
7  * \author Angus Leeming
8  *
9  * Full author contact details are available in file CREDITS.
10  */
11
12 #ifndef CONTROLCITATION_H
13 #define CONTROLCITATION_H
14
15
16 #include "ControlCommand.h"
17 #include "biblio.h" // biblio::InfoMap
18
19 /** A controller for Citation dialogs.
20  */
21 class ControlCitation : public ControlCommand {
22 public:
23         ///
24         ControlCitation(Dialog &);
25
26         ///
27         virtual bool initialiseParams(std::string const & data);
28         /// clean-up on hide.
29         virtual void clearParams();
30
31         /** Disconnect from the inset when the Apply button is pressed.
32          *  Allows easy insertion of multiple citations.
33          */
34         virtual bool disconnectOnApply() const { return true; }
35
36         /// Returns a reference to the map of stored keys
37         biblio::InfoMap const & bibkeysInfo() const;
38
39         ///
40         bool usingNatbib() const;
41         ///
42         bool usingJurabib() const;
43         /// Possible citations based on this key
44         std::vector<std::string> const getCiteStrings(std::string const & key) const;
45
46         /// available CiteStyle-s (depends on availability of Natbib/Jurabib)
47         static std::vector<biblio::CiteStyle> const & getCiteStyles() {
48                 return citeStyles_;
49         }
50 private:
51         /// The info associated with each key
52         biblio::InfoMap bibkeysInfo_;
53
54         ///
55         static std::vector<biblio::CiteStyle> citeStyles_;
56 };
57
58
59 #endif // CONTROLCITATION_H