]> git.lyx.org Git - lyx.git/blob - src/frontends/qt4/QCitationDialog.h
delete unneeded Menubar virtual interface.
[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  * \author Abdelrazak Younes
9  *
10  * Full author contact details are available in file CREDITS.
11  */
12
13 #ifndef QCITATIONDIALOG_H
14 #define QCITATIONDIALOG_H
15
16 #include "Dialog.h"
17 #include "ui_CitationUi.h"
18
19 #include <QCloseEvent>
20 #include <QKeyEvent>
21
22 namespace lyx {
23 namespace frontend {
24
25 class QCitation;
26
27 class QCitationDialog: public QDialog, public Ui::QCitationUi, public Dialog::View {
28         Q_OBJECT
29
30 public:
31         QCitationDialog(Dialog &, QCitation * form );
32
33         virtual ~QCitationDialog();
34
35         virtual void apply();
36
37         /// Hide the dialog from sight
38         void hide();
39
40         /// Redraw the dialog (e.g. if the colors have been remapped).
41         void redraw() {}
42
43         /// Create the dialog if necessary, update it and display it.
44         void show();
45
46         /// Update the display of the dialog whilst it is still visible.
47         void update();
48
49         /// \return true if the dialog is visible.
50         bool isVisible() const;
51         
52         ///
53         bool eventFilter(QObject *, QEvent *);
54
55 protected:
56         void closeEvent (QCloseEvent * e);
57         /// prepares a call to QCitation::searchKeys when we
58         /// are ready to search the BibTeX entries
59         void findText(QString const & text, bool reset = false);
60         /// check whether key is already selected
61         bool isSelected(const QModelIndex &);
62         /// update the display of BibTeX information
63         void updateInfo(QListView const * const);
64
65 protected Q_SLOTS:
66         void cleanUp();
67         void on_okPB_clicked();
68         void on_cancelPB_clicked();
69         void on_restorePB_clicked();
70         void on_applyPB_clicked();
71         void on_addPB_clicked();
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_fieldsCO_currentIndexChanged(int index);
77         void on_entriesCO_currentIndexChanged(int index);
78         void on_caseCB_stateChanged(int);
79         void on_regexCB_stateChanged(int);
80         void on_selectedLV_clicked(const QModelIndex &);
81         void selectedChanged(const QModelIndex &, const QModelIndex &);
82         void on_availableLV_clicked(const QModelIndex &);
83         void on_availableLV_doubleClicked(const QModelIndex &);
84         void availableChanged(const QModelIndex &, const QModelIndex &);
85         virtual void changed();
86
87 private:
88         /// enable/disable buttons
89         void setButtons();
90         /// fill the styles combo
91         void fillStyles();
92         /// fill the fields combo
93         void fillFields();
94         /// fill the entries combo
95         void fillEntries();
96         /// set the styles combo
97         void updateStyle();
98         /// performs a limited update, suitable for internal call
99         void updateDialog();
100         /// last used citation style
101         int style_;
102         /// which of available and selected is "focused", in the sense
103         /// of which one should be used for updating the info via updateInfo().
104         /// true, obviously, if it is availableLV.
105         bool availableFocused_;
106         
107         QCitation * form_;
108 };
109
110 } // namespace frontend
111 } // namespace lyx
112
113 #endif // QCITATIOINDIALOG_H