]> git.lyx.org Git - features.git/blob - src/frontends/controllers/ControlCitation.h
Remove warnings reported with gcc 4.3:
[features.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  * \author Abdelrazak Younes
9  *
10  * Full author contact details are available in file CREDITS.
11  */
12
13 #ifndef CONTROLCITATION_H
14 #define CONTROLCITATION_H
15
16 #include "BiblioInfo.h"
17 #include "ControlCommand.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         virtual ~ControlCitation() {}
29         virtual bool initialiseParams(std::string const & data);
30
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         /// \return the list of all available bibliography keys.
40         std::vector<docstring> const availableKeys() const;
41         /// \return the list of all used BibTeX fields
42         std::vector<docstring> const availableFields() const;
43         /// \return the list of all used BibTeX entry types
44         std::vector<docstring> const availableEntries() const;
45         ///
46         void filterByEntryType(
47                 std::vector<docstring> & keyVector, docstring entryType);
48         ///
49         biblio::CiteEngine getEngine() const;
50
51         /// \return information for this key.
52         docstring const getInfo(docstring const & key) const;
53
54         /// Search a given string within the passed keys.
55         /// \return the vector of matched keys.
56         std::vector<docstring> searchKeys(
57                 std::vector<docstring> const & keys_to_search, //< Keys to search.
58                 bool only_keys, //< whether to search only the keys
59                 docstring const & search_expression, //< Search expression (regex possible)
60                 docstring field, //< field to search, empty for all fields
61                 bool case_sensitive = false, //< set to true is the search should be case sensitive
62                 bool regex = false //< \set to true if \c search_expression is a regex
63                 ); //
64
65         /// \return possible citations based on this key.
66         std::vector<docstring> const getCiteStrings(docstring const & key) const;
67
68         /// available CiteStyle-s (depends on availability of Natbib/Jurabib)
69         static std::vector<biblio::CiteStyle> const & getCiteStyles() {
70                 return citeStyles_;
71         }
72 private:
73         /// The BibTeX information available to the dialog
74         BiblioInfo bibkeysInfo_;
75
76         ///
77         static std::vector<biblio::CiteStyle> citeStyles_;
78 };
79
80 } // namespace frontend
81 } // namespace lyx
82
83 #endif // CONTROLCITATION_H