]> git.lyx.org Git - lyx.git/blob - src/frontends/controllers/ControlCitation.h
This file is part of LyX, the document processor.
[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 #ifdef __GNUG__
16 #pragma interface
17 #endif
18
19 #include "ControlCommand.h"
20 #include "biblio.h" // biblio::InfoMap
21
22 /** A controller for Citation dialogs.
23  */
24 class ControlCitation : public ControlCommand
25 {
26 public:
27         ///
28         ControlCitation(LyXView &, Dialogs &);
29
30         /// Returns a reference to the map of stored keys
31         biblio::InfoMap const & bibkeysInfo() const;
32
33         ///
34         bool usingNatbib() const;
35         /// Possible citations based on this key
36         std::vector<string> const getCiteStrings(string const & key) const;
37
38         /// available CiteStyle-s (depends on availability of Natbib
39         static std::vector<biblio::CiteStyle> const & getCiteStyles()
40                 { return citeStyles_; }
41
42 private:
43         /// create the InfoMap of keys and data
44         virtual void setDaughterParams();
45         ///
46         virtual void clearDaughterParams();
47
48         /** disconnect from the inset when the Apply button is pressed.
49          Allows easy insertion of multiple citations. */
50         virtual bool disconnectOnApply() { return true; }
51
52         /// The info associated with each key
53         biblio::InfoMap bibkeysInfo_;
54
55         ///
56         static std::vector<biblio::CiteStyle> citeStyles_;
57 };
58
59
60 #endif // CONTROLCITATION_H