]> git.lyx.org Git - lyx.git/blob - src/frontends/qt4/QCitation.h
This new citation dialog follows a new design similar to lyx-1.3:
[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 "QDialogView.h"
17
18 #include <QStringListModel>
19
20 namespace lyx {
21 namespace frontend {
22
23 class ControlCitation;
24 class QCitationDialog;
25
26
27 class QCitation : public QController<ControlCitation, QView<QCitationDialog> >
28 {
29 public:
30         friend class QCitationDialog;
31         ///
32         QCitation(Dialog &);
33
34         QStringListModel * available() 
35         { return &available_keys_; }
36
37         QStringListModel * selected() 
38         { return &selected_keys_; }
39
40         QStringListModel * found() 
41         { return &found_keys_; }
42         
43         QModelIndex findKey(QString const & str, QModelIndex const & index) const;
44         QModelIndex findKey(QString const & str) const;
45
46         void addKeys(QModelIndexList const & indexes);
47         void deleteKeys(QModelIndexList const & indexes);
48         void upKey(QModelIndexList const & indexes);
49         void downKey(QModelIndexList const & indexes);
50
51 protected:
52         virtual bool isValid();
53
54 private:
55
56         /// Set the Params variable for the Controller.
57         virtual void apply();
58         /// Build the dialog.
59         virtual void build_dialog();
60         /// Hide the dialog.
61         virtual void hide();
62         /// Update dialog before/whilst showing it.
63         virtual void update_contents();
64
65         /// available keys
66         QStringListModel available_keys_;
67
68         /// selected keys
69         QStringListModel selected_keys_;
70
71         /// found keys
72         QStringListModel found_keys_;
73 };
74
75 } // namespace frontend
76 } // namespace lyx
77
78 #endif // QCITATION_H