]> git.lyx.org Git - lyx.git/blob - src/frontends/controllers/ControlCitation.h
fix crash due to invalidated iterator
[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"
18
19 namespace lyx {
20 namespace frontend {
21
22 /** A controller for Citation dialogs.
23  */
24 class ControlCitation : public ControlCommand {
25 public:
26         ///
27         ControlCitation(Dialog &);
28
29         ///
30         virtual bool initialiseParams(std::string const & data);
31         /// clean-up on hide.
32         virtual void clearParams();
33
34         /** Disconnect from the inset when the Apply button is pressed.
35          *  Allows easy insertion of multiple citations.
36          */
37         virtual bool disconnectOnApply() const { return true; }
38
39         /// Returns a reference to the map of stored keys
40         biblio::InfoMap const & bibkeysInfo() const;
41
42         ///
43         biblio::CiteEngine_enum getEngine() const;
44
45         /// Possible citations based on this key
46         std::vector<std::string> const getCiteStrings(std::string const & key) const;
47
48         /// available CiteStyle-s (depends on availability of Natbib/Jurabib)
49         static std::vector<biblio::CiteStyle> const & getCiteStyles() {
50                 return citeStyles_;
51         }
52 private:
53         /// The info associated with each key
54         biblio::InfoMap bibkeysInfo_;
55
56         ///
57         static std::vector<biblio::CiteStyle> citeStyles_;
58 };
59
60 } // namespace frontend
61 } // namespace lyx
62
63 #endif // CONTROLCITATION_H