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