]> git.lyx.org Git - lyx.git/blob - src/frontends/qt4/GuiBibtex.h
Use the command-alternatives sequence as defined in menus.bind
[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 change_adaptor();
48         void browsePressed();
49         void browseBibPressed();
50         void addPressed();
51         void addDatabase();
52         void deletePressed();
53         void upPressed();
54         void downPressed();
55         void databaseChanged();
56         void availableChanged();
57         void bibEDChanged();
58         void rescanClicked();
59
60 private:
61         ///
62         bool isValid();
63         /// Apply changes
64         void applyView();
65         /// update
66         void updateContents();
67
68         /// Browse for a .bib file
69         QString browseBib(QString const & in_name) const;
70         /// Browse for a .bst file
71         QString browseBst(QString const & in_name) const;
72         /// get the list of bst files
73         QStringList bibStyles() const;
74         /// get the list of bib files
75         QStringList bibFiles() const;
76         /// build filelists of all availabe bib/bst/cls/sty-files. done through
77         /// kpsewhich and an external script, saved in *Files.lst
78         void rescanBibStyles() const;
79         /// do we use bibtopic (for sectioned bibliography)?
80         bool usingBibtopic() const;
81         /// should we put the bibliography to the TOC?
82         bool bibtotoc() const;
83         /// do we use biblatex?
84         bool usingBiblatex() const;
85         /// which stylefile do we use?
86         QString styleFile() const;
87
88         ///
89         bool initialiseParams(std::string const & data);
90         /// clean-up on hide.
91         void clearParams() { params_.clear(); }
92         /// clean-up on hide.
93         void dispatchParams();
94         ///
95         bool isBufferDependent() const { return true; }
96
97 private:
98         ///
99         InsetCommandParams params_;
100         ///
101         GuiBibtexAddDialog * add_;
102         ///
103         ButtonController add_bc_;
104 };
105
106 } // namespace frontend
107 } // namespace lyx
108
109 #endif // GUIBIBTEX_H