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