]> git.lyx.org Git - lyx.git/blob - src/frontends/qt4/QCitationDialog.h
Fix unreported bug related to 3246 by Richard Heck:
[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/QCitationUi.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 protected:
53         void closeEvent (QCloseEvent * e);
54         void keyPressEvent (QKeyEvent * event);
55         void findText(QString const & text);
56
57 protected Q_SLOTS:
58
59         void on_okPB_clicked();
60         void on_cancelPB_clicked();
61         void on_restorePB_clicked();
62         void on_applyPB_clicked();
63         void on_addPB_clicked();
64         void on_deletePB_clicked();
65         void on_upPB_clicked();
66         void on_downPB_clicked();
67         void on_findLE_textChanged(const QString & text);
68         void on_caseCB_stateChanged(int);
69         void on_regexCB_stateChanged(int);
70         void on_selectedLV_clicked(const QModelIndex &);
71         void selectedChanged(const QModelIndex &, const QModelIndex &);
72         void on_availableLV_clicked(const QModelIndex &);
73         void on_availableLV_activated(const QModelIndex &);
74         void on_availableLV_entered(const QModelIndex &);
75         void availableChanged(const QModelIndex &, const QModelIndex &);
76         virtual void changed();
77         /// check whether key is already selected
78         bool isSelected(const QModelIndex &);
79         /// update infobox
80         void updateInfo(const QModelIndex &);
81
82 private:
83         /// enable/disable buttons
84         void setButtons();
85
86         /// fill the styles combo
87         void fillStyles();
88
89         /// set the styles combo
90         void updateStyle();
91
92         /// last used citation style
93         int style_;
94
95         QCitation * form_;
96 };
97
98
99 } // namespace frontend
100 } // namespace lyx
101
102 #endif // QCITATIOINDIALOG_H