]> git.lyx.org Git - lyx.git/blob - src/frontends/controllers/ControlCitation.h
bug 183
[lyx.git] / src / frontends / controllers / ControlCitation.h
1 // -*- C++ -*-
2 /* This file is part of
3  * ====================================================== 
4  *
5  *           LyX, The Document Processor
6  *
7  *           Copyright 2001 The LyX Team.
8  *
9  * ======================================================
10  *
11  * \file ControlCitation.h
12  * \author Angus Leeming <a.leeming@ic.ac.uk>
13  */
14
15 #ifndef CONTROLCITATION_H
16 #define CONTROLCITATION_H
17
18 #ifdef __GNUG__
19 #pragma interface
20 #endif
21
22 #include "ControlCommand.h"
23 #include "biblio.h" // biblio::InfoMap
24
25 /** A controller for Citation dialogs.
26  */
27 class ControlCitation : public ControlCommand
28 {
29 public:
30         ///
31         ControlCitation(LyXView &, Dialogs &);
32
33         /// Returns a reference to the map of stored keys
34         biblio::InfoMap const & bibkeysInfo() const;
35
36         ///
37         bool usingNatbib() const;
38         /// Possible citations based on this key
39         std::vector<string> const getCiteStrings(string const & key) const;
40
41         /// available CiteStyle-s (depends on availability of Natbib
42         static std::vector<biblio::CiteStyle> const & getCiteStyles()
43                 { return citeStyles_; }
44
45 private:
46         /// create the InfoMap of keys and data
47         virtual void setDaughterParams();
48         /// 
49         virtual void clearDaughterParams();
50
51         /** disconnect from the inset when the Apply button is pressed.
52          Allows easy insertion of multiple citations. */
53         virtual bool disconnectOnApply() { return true; }
54
55         /// The info associated with each key
56         biblio::InfoMap bibkeysInfo_;
57
58         ///
59         static std::vector<biblio::CiteStyle> citeStyles_;
60 };
61
62
63 #endif // CONTROLCITATION_H