]> git.lyx.org Git - lyx.git/blob - src/frontends/qt4/GuiCitation.h
f99b009b670f3c4c97d6c62bbfa8d4add44b7b80
[lyx.git] / src / frontends / qt4 / GuiCitation.h
1 // -*- C++ -*-
2 /**
3  * \file GuiCitation.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 Kalle Dalheimer
9  * \author Abdelrazak Younes
10  * \author Richard Heck (adapted to QSelectionManager)
11  *
12  * Full author contact details are available in file CREDITS.
13  */
14
15 #ifndef QCITATION_H
16 #define QCITATION_H
17
18 #include "frontends/controllers/ControlCitation.h"
19 #include "support/docstring.h"
20
21 #include <QStringList>
22 #include <QStringListModel>
23
24 namespace lyx {
25 namespace frontend {
26
27 class GuiCitation : public ControlCitation
28 {
29 public:
30         ///
31         GuiCitation(Dialog &);
32         virtual ~GuiCitation() {}
33         virtual bool initialiseParams(std::string const & data);
34
35         ///
36         void init();
37
38         /// Available keys
39         QStringListModel * available() { return &available_model_; }
40
41         /// Selected keys
42         QStringListModel * selected() { return &selected_model_; }
43
44         /// Text before cite
45         QString textBefore();
46
47         /// Text after cite
48         QString textAfter();
49
50         /// Get key description
51         QString getKeyInfo(QString const &);
52
53         /// Clear selected keys
54         void clearSelection();
55         
56         /// Return a list of available fields 
57         QStringList getFieldsAsQStringList();
58         
59         /// Return a list of available fields 
60         QStringList getEntriesAsQStringList();
61         
62         /// Find keys containing a string.
63         void findKey(
64                 QString const & str, //< string expression
65                 bool only_keys, //< set to true if only keys shall be searched.
66                 docstring field, //<field to search, empty for all fields
67                 docstring entryType, //<entry type to display, empty for all
68                 bool case_sensitive, //< set to true for case sensitive search.
69                 bool reg_exp, //< set to true if \c str is a regular expression.
70                 bool reset = false //< whether to reset and search all keys
71                 );
72
73         /// List of example cite strings
74         QStringList citationStyles(int);
75
76         /// Set the Params variable for the Controller.
77         virtual void apply(int const choice, bool const full, bool const force,
78                                           QString before, QString after);
79         
80         void setCitedKeys();
81
82 private:
83         /// available keys.
84         QStringListModel available_model_;
85
86         /// selected keys.
87         QStringListModel selected_model_;
88
89         /// All keys.
90         QStringList all_keys_;
91         
92         /// Cited keys.
93         QStringList cited_keys_;
94 };
95
96
97 } // namespace frontend
98 } // namespace lyx
99
100 #endif // QCITATION_H