]> git.lyx.org Git - lyx.git/blob - src/frontends/qt4/QCitation.h
rename LFUN enum values according to their command (as used in th minibuffer/bind...
[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  *
10  * Full author contact details are available in file CREDITS.
11  */
12
13 #ifndef QCITATION_H
14 #define QCITATION_H
15
16 #include "ControlCitation.h"
17
18 #include <QStringListModel>
19
20 namespace lyx {
21 namespace frontend {
22
23 class QCitation : public ControlCitation
24 {
25 public:
26         ///
27         QCitation(Dialog &);
28
29         QStringListModel * available()
30         { return &available_keys_; }
31
32         QStringListModel * selected()
33         { return &selected_keys_; }
34
35         QStringListModel * found()
36         { return &found_keys_; }
37
38         QString textBefore();
39         QString textAfter();
40
41         QModelIndex findKey(QString const & str, QModelIndex const & index) const;
42         QModelIndex findKey(QString const & str) const;
43
44         void addKeys(QModelIndexList const & indexes);
45         void deleteKeys(QModelIndexList const & indexes);
46         void upKey(QModelIndexList const & indexes);
47         void downKey(QModelIndexList const & indexes);
48
49         QStringList citationStyles(int sel);
50
51
52         virtual bool isValid();
53
54         /// Set the Params variable for the Controller.
55         virtual void apply(int const choice, bool const full, bool const force,
56                                           QString before, QString After);
57
58         /// Update dialog before/whilst showing it.
59         virtual void updateModel();
60
61 private:        
62         /// available keys
63         QStringListModel available_keys_;
64
65         /// selected keys
66         QStringListModel selected_keys_;
67
68         /// found keys
69         QStringListModel found_keys_;
70 };
71
72
73 /** A controller for Citation dialogs.
74  */
75 /*
76 class Citation {
77 public:
78         ///
79         Citation();
80
81         ///
82         virtual bool initialiseParams(std::string const & data);
83
84         /// clean-up on hide.
85         virtual void clearParams();
86
87         /** Disconnect from the inset when the Apply button is pressed.
88          *  Allows easy insertion of multiple citations.
89          */
90 /*      virtual bool disconnectOnApply() const { return true; }
91
92         /// Returns a reference to the map of stored keys
93         biblio::InfoMap const & bibkeysInfo() const;
94
95         ///
96         biblio::CiteEngine_enum getEngine() const;
97
98         /// Possible citations based on this key
99         std::vector<std::string> const getCiteStrings(std::string const & key) const;
100
101         /// available CiteStyle-s (depends on availability of Natbib/Jurabib)
102         static std::vector<biblio::CiteStyle> const & getCiteStyles() {
103                 return citeStyles_;
104         }
105 private:
106         /// The info associated with each key
107         biblio::InfoMap bibkeysInfo_;
108
109         ///
110         static std::vector<biblio::CiteStyle> citeStyles_;
111 };
112 */
113 } // namespace frontend
114 } // namespace lyx
115
116 #endif // QCITATION_H