]> git.lyx.org Git - lyx.git/blob - src/frontends/controllers/ControlCitation.h
prefs/tabular MVC work
[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 public:
26         ///
27         ControlCitation(LyXView &, Dialogs &);
28
29         /// Returns a reference to the map of stored keys
30         biblio::InfoMap const & bibkeysInfo() const;
31
32         ///
33         bool usingNatbib() const;
34         /// Possible citations based on this key
35         std::vector<string> const getCiteStrings(string const & key) const;
36
37         /// available CiteStyle-s (depends on availability of Natbib
38         static std::vector<biblio::CiteStyle> const & getCiteStyles() {
39                 return citeStyles_;
40         }
41 private:
42         /// create the InfoMap of keys and data
43         virtual void setDaughterParams();
44         ///
45         virtual void clearDaughterParams();
46
47         /** disconnect from the inset when the Apply button is pressed.
48          Allows easy insertion of multiple citations. */
49         virtual bool disconnectOnApply() { return true; }
50
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