]> git.lyx.org Git - lyx.git/blob - src/frontends/qt4/QCitationDialog.h
This new citation dialog follows a new design similar to lyx-1.3:
[lyx.git] / src / frontends / qt4 / QCitationDialog.h
1 // -*- C++ -*-
2 /**
3  * \file QCitationDialog.h
4  * This file is part of LyX, the document processor.
5  * Licence details can be found in the file COPYING.
6  *
7  * \author Kalle Dalheimer
8  *
9  * Full author contact details are available in file CREDITS.
10  */
11
12 #ifndef QCITATIONDIALOG_H
13 #define QCITATIONDIALOG_H
14
15 #include "ui/QCitationUi.h"
16 #include "ui/QCitationFindUi.h"
17 #include "controllers/biblio.h"
18
19 #include <QDialog>
20 #include <vector>
21
22 class Q3ListBox;
23 class Q3ListBoxItem;
24
25 class InsetCommandParams;
26
27 namespace lyx {
28 namespace frontend {
29
30 class QCitation;
31 class QCitationFind;
32
33 class QCitationDialog : public QDialog, public Ui::QCitationUi {
34         Q_OBJECT
35
36 public:
37         QCitationDialog(QCitation * form);
38
39         ~QCitationDialog();
40
41         void update(InsetCommandParams const & params);
42         void apply(InsetCommandParams & params);
43
44 //      virtual bool isValid();
45
46 protected slots:
47
48 //      void on_selectedLB_currentChanged(Q3ListBoxItem*);
49         
50         void on_okPB_clicked();
51         void on_cancelPB_clicked();
52         void on_restorePB_clicked();
53         void on_applyPB_clicked();
54         void on_addPB_clicked();
55
56         void on_deletePB_clicked();
57         void on_upPB_clicked();
58         void on_downPB_clicked();
59         void on_findLE_textChanged(const QString & text);
60         void on_advancedSearchPB_clicked();
61
62         virtual void changed();
63
64 private:
65         void setButtons();
66         /// open the find dialog if nothing selected
67         void openFind();
68
69         /// fill the styles combo
70         void fillStyles();
71
72         /// set the styles combo
73         void updateStyle();
74
75         /// check if apply has been pressed
76         bool open_find_;
77
78         /// selected keys
79         std::vector<std::string> citekeys;
80
81         /// selected natbib style
82         int style_;
83
84         QCitation * form_;
85         QCitationFind * find_;
86 };
87
88
89 class QCitationFind: public QDialog, public Ui::QCitationFindUi {
90         Q_OBJECT
91
92 public:
93         QCitationFind(QCitation * form, QWidget * parent = 0, Qt::WFlags f = 0);
94
95         void update();
96
97         std::vector<std::string> const & foundCitations()
98         { return foundkeys;     }
99
100 signals:
101         void newCitations();
102
103 protected slots:
104
105         void on_availableLB_currentChanged(Q3ListBoxItem *);
106         void on_availableLB_selected(Q3ListBoxItem *);
107         void on_addPB_clicked();
108         virtual void previous();
109         virtual void next();
110
111 private:
112         void find(biblio::Direction dir);
113
114         /// selected keys
115         std::vector<std::string> foundkeys;
116
117         QCitation * form_;
118 };
119
120 } // namespace frontend
121 } // namespace lyx
122
123 #endif // QCITATIOINDIALOG_H