]> git.lyx.org Git - lyx.git/blob - src/frontends/qt4/GuiBibtex.h
next ones
[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 "ControlCommand.h"
22
23 #include "support/docstring.h"
24
25 #include <vector>
26
27 namespace lyx {
28
29 namespace support { class FileFilterList; }
30
31 namespace frontend {
32
33 class GuiBibtexAddDialog : public QDialog, public Ui::BibtexAddUi
34 {
35 public:
36         GuiBibtexAddDialog(QWidget * parent) : QDialog(parent)
37         {
38                 Ui::BibtexAddUi::setupUi(this);
39                 QDialog::setModal(true);
40         }
41 };
42
43
44 class GuiBibtex : public GuiDialog, public Ui::BibtexUi, public ControlCommand
45 {
46         Q_OBJECT
47
48 public:
49         GuiBibtex(LyXView & lv);
50
51 private Q_SLOTS:
52         void change_adaptor();
53         void browsePressed();
54         void browseBibPressed();
55         void addPressed();
56         void addDatabase();
57         void deletePressed();
58         void databaseChanged();
59         void availableChanged();
60         void bibEDChanged();
61
62 private:
63         void closeEvent(QCloseEvent * e);
64
65 private:
66         /// parent controller
67         Controller & controller() { return *this; }
68         ///
69         virtual bool isValid();
70         /// Apply changes
71         virtual void applyView();
72         /// update
73         virtual void updateContents();
74
75         /// Browse for a .bib file
76         docstring const browseBib(docstring const & in_name) const;
77
78         /// Browse for a .bst file
79         docstring const browseBst(docstring const & in_name) const;
80
81         /// get the list of bst files
82         void getBibStyles(std::vector<std::string> & data) const;
83         /// get the list of bib files
84         void getBibFiles(std::vector<std::string> & data) const;
85         /// build filelists of all availabe bib/bst/cls/sty-files. done through
86         /// kpsewhich and an external script, saved in *Files.lst
87         void rescanBibStyles() const;
88         /// do we use bibtopic (for sectioned bibliography)?
89         bool usingBibtopic() const;
90         /// should we put the bibliography to the TOC?
91         bool bibtotoc() const;
92         /// which stylefile do we use?
93         std::string const getStylefile() const;
94
95         ///
96         GuiBibtexAddDialog * add_;
97         ///
98         ButtonController add_bc_;
99 };
100
101 } // namespace frontend
102 } // namespace lyx
103
104 #endif // GUIBIBTEX_H