]> git.lyx.org Git - lyx.git/blob - src/frontends/qt4/QCitationDialog.h
rename LFUN enum values according to their command (as used in th minibuffer/bind...
[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 "Dialog.h"
16
17 #include "ui/QCitationUi.h"
18 #include "ui/QCitationFindUi.h"
19 #include "controllers/biblio.h"
20
21 #include <QDialog>
22 #include <vector>
23
24 class Q3ListBox;
25 class Q3ListBoxItem;
26
27 class InsetCommandParams;
28
29 namespace lyx {
30 namespace frontend {
31
32 class QCitation;
33 class QCitationFind;
34
35 class QCitationDialog: public QDialog, public Ui::QCitationUi, public Dialog::View {
36         Q_OBJECT
37
38 public:
39         QCitationDialog(Dialog &, QCitation * form );
40
41         //QCitationDialog(QCitation * form);
42
43         virtual ~QCitationDialog();
44
45         virtual void apply();
46
47         /// Hide the dialog from sight
48         void hide();
49
50         /// Redraw the dialog (e.g. if the colors have been remapped).
51         void redraw() {}
52
53         /// Create the dialog if necessary, update it and display it.
54         void show();
55
56         /// Update the display of the dialog whilst it is still visible.
57         void update();
58
59         /// \return true if the dialog is visible.
60         bool isVisible() const;
61
62 protected slots:
63
64 //      void on_selectedLB_currentChanged(Q3ListBoxItem*);
65         
66         void on_okPB_clicked();
67         void on_cancelPB_clicked();
68         void on_restorePB_clicked();
69         void on_applyPB_clicked();
70         void on_addPB_clicked();
71
72         void on_deletePB_clicked();
73         void on_upPB_clicked();
74         void on_downPB_clicked();
75         void on_findLE_textChanged(const QString & text);
76         void on_advancedSearchPB_clicked();
77
78         virtual void changed();
79
80 private:
81         void setButtons();
82         /// open the find dialog if nothing selected
83         void openFind();
84
85         /// fill the styles combo
86         void fillStyles();
87
88         /// set the styles combo
89         void updateStyle();
90
91         /// check if apply has been pressed
92         bool open_find_;
93
94         /// selected keys
95         std::vector<std::string> citekeys;
96
97         /// selected natbib style
98         int style_;
99
100         QCitation * form_;
101         QCitationFind * find_;
102 };
103
104
105 class QCitationFind: public QDialog, public Ui::QCitationFindUi {
106         Q_OBJECT
107
108 public:
109         QCitationFind(QCitation * form, QWidget * parent = 0, Qt::WFlags f = 0);
110
111         void update();
112
113         std::vector<std::string> const & foundCitations()
114         { return foundkeys;     }
115
116 signals:
117         void newCitations();
118
119 protected slots:
120
121         void on_availableLB_currentChanged(Q3ListBoxItem *);
122         void on_availableLB_selected(Q3ListBoxItem *);
123         void on_addPB_clicked();
124         virtual void previous();
125         virtual void next();
126
127 private:
128         void find(biblio::Direction dir);
129
130         /// selected keys
131         std::vector<std::string> foundkeys;
132
133         QCitation * form_;
134 };
135
136 } // namespace frontend
137 } // namespace lyx
138
139 #endif // QCITATIOINDIALOG_H