]> git.lyx.org Git - lyx.git/blob - src/frontends/qt4/QCitation.h
* src/frontends/qt4/ui/TextLayoutUi.ui:
[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
19 #include <QStringList>
20 #include <QStringListModel>
21
22 namespace lyx {
23 namespace frontend {
24
25 class QCitation : public ControlCitation
26 {
27 public:
28         ///
29         QCitation(Dialog &);
30         virtual ~QCitation() {}
31         virtual bool initialiseParams(std::string const & data);
32
33         ///
34         void init();
35
36         /// Available keys
37         QStringListModel * available() { return &available_model_; }
38
39         /// Selected keys
40         QStringListModel * selected() { return &selected_model_; }
41
42         /// Text before cite
43         QString textBefore();
44
45         /// Text after cite
46         QString textAfter();
47
48         /// Get key description
49         QString getKeyInfo(QString const &);
50
51         /// Clear selected keys
52         void clearSelection();
53
54         /// Find keys containing a string.
55         void findKey(
56                 QString const & str, //< string expression
57                 bool only_keys, //< set to true if only keys shall be searched.
58                 bool case_sensitive, //< set to true for case sensitive search.
59                 bool reg_exp //< set to true if \c str is a regular expression.
60                 );
61
62         /// Add key to selected keys
63         void addKey(QModelIndex const &);
64
65         /// Delete key from selected keys
66         void deleteKey(QModelIndex const &);
67
68         /// Move selected key one place up
69         void upKey(QModelIndex const &);
70
71         /// Move selected key one place down
72         void downKey(QModelIndex const &);
73
74         /// List of example cite strings
75         QStringList citationStyles(int);
76
77         /// Set the Params variable for the Controller.
78         virtual void apply(int const choice, bool const full, bool const force,
79                                           QString before, QString after);
80
81 private:
82         /// available keys.
83         QStringListModel available_model_;
84
85         /// selected keys.
86         QStringListModel selected_model_;
87
88         /// All keys.
89         QStringList all_keys_;
90
91         /// Cited keys.
92         QStringList cited_keys_;
93 };
94
95
96 } // namespace frontend
97 } // namespace lyx
98
99 #endif // QCITATION_H