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