]> git.lyx.org Git - lyx.git/blob - src/frontends/qt4/GuiCitation.h
7059106ef87427e32b391f8aab4a366b08ffa420
[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
11  *
12  * Full author contact details are available in file CREDITS.
13  */
14
15 #ifndef GUICITATION_H
16 #define GUICITATION_H
17
18 #include "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         /// selected keys.
86         QStringListModel selected_model_;
87         /// All keys.
88         QStringList all_keys_;
89         /// Cited keys.
90         QStringList cited_keys_;
91 };
92
93
94 } // namespace frontend
95 } // namespace lyx
96
97 #endif // GUICITATION_H