]> git.lyx.org Git - lyx.git/blob - src/frontends/qt4/GuiBibtex.h
QDialogButtonBox for the remaining dialogs.
[lyx.git] / src / frontends / qt4 / GuiBibtex.h
1 // -*- C++ -*-
2 /**
3  * \file GuiBibtex.h
4  * This file is part of LyX, the document processor.
5  * Licence details can be found in the file COPYING.
6  *
7  * \author John Levon
8  * \author Angus Leeming
9  *
10  * Full author contact details are available in file CREDITS.
11  */
12
13 #ifndef GUIBIBTEX_H
14 #define GUIBIBTEX_H
15
16 #include "GuiDialog.h"
17 #include "ButtonController.h"
18 #include "ui_BibtexUi.h"
19 #include "ui_BibtexAddUi.h"
20
21 #include "insets/InsetCommandParams.h"
22
23
24 namespace lyx {
25 namespace frontend {
26
27 class GuiBibtexAddDialog : public QDialog, public Ui::BibtexAddUi
28 {
29 public:
30         GuiBibtexAddDialog(QWidget * parent) : QDialog(parent)
31         {
32                 Ui::BibtexAddUi::setupUi(this);
33                 QDialog::setModal(true);
34                 setWindowModality(Qt::WindowModal);
35         }
36 };
37
38
39 class GuiBibtex : public GuiDialog, public Ui::BibtexUi
40 {
41         Q_OBJECT
42
43 public:
44         explicit GuiBibtex(GuiView & lv);
45
46 private Q_SLOTS:
47         void addBBClicked(QAbstractButton * button);
48         void change_adaptor();
49         void browsePressed();
50         void browseBibPressed();
51         void addPressed();
52         void addDatabase();
53         void deletePressed();
54         void upPressed();
55         void downPressed();
56         void databaseChanged();
57         void availableChanged();
58         void bibEDChanged();
59         void rescanClicked();
60
61 private:
62         ///
63         bool isValid();
64         /// Apply changes
65         void applyView();
66         /// update
67         void updateContents();
68
69         /// Browse for a .bib file
70         QString browseBib(QString const & in_name) const;
71         /// Browse for a .bst file
72         QString browseBst(QString const & in_name) const;
73         /// get the list of bst files
74         QStringList bibStyles() const;
75         /// get the list of bib files
76         QStringList bibFiles() const;
77         /// build filelists of all availabe bib/bst/cls/sty-files. done through
78         /// kpsewhich and an external script, saved in *Files.lst
79         void rescanBibStyles() const;
80         /// do we use bibtopic (for sectioned bibliography)?
81         bool usingBibtopic() const;
82         /// should we put the bibliography to the TOC?
83         bool bibtotoc() const;
84         /// do we use biblatex?
85         bool usingBiblatex() const;
86         /// which stylefile do we use?
87         QString styleFile() const;
88
89         ///
90         bool initialiseParams(std::string const & data);
91         /// clean-up on hide.
92         void clearParams() { params_.clear(); }
93         /// clean-up on hide.
94         void dispatchParams();
95         ///
96         bool isBufferDependent() const { return true; }
97
98 private:
99         ///
100         InsetCommandParams params_;
101         ///
102         GuiBibtexAddDialog * add_;
103         ///
104         ButtonController add_bc_;
105 };
106
107 } // namespace frontend
108 } // namespace lyx
109
110 #endif // GUIBIBTEX_H