]> git.lyx.org Git - lyx.git/blob - src/frontends/qt4/GuiBibtex.h
do what the FIXME suggested
[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 upPressed();
57         void downPressed();
58         void databaseChanged();
59         void availableChanged();
60         void bibEDChanged();
61
62 private:
63         ///
64         bool isValid();
65         /// Apply changes
66         void applyView();
67         /// update
68         void updateContents();
69
70         /// Browse for a .bib file
71         docstring const browseBib(docstring const & in_name) const;
72
73         /// Browse for a .bst file
74         docstring const browseBst(docstring const & in_name) const;
75
76         /// get the list of bst files
77         void getBibStyles(std::vector<std::string> & data) const;
78         /// get the list of bib files
79         void getBibFiles(std::vector<std::string> & data) const;
80         /// build filelists of all availabe bib/bst/cls/sty-files. done through
81         /// kpsewhich and an external script, saved in *Files.lst
82         void rescanBibStyles() const;
83         /// do we use bibtopic (for sectioned bibliography)?
84         bool usingBibtopic() const;
85         /// should we put the bibliography to the TOC?
86         bool bibtotoc() const;
87         /// which stylefile do we use?
88         std::string const getStylefile() const;
89
90         ///
91         GuiBibtexAddDialog * add_;
92         ///
93         ButtonController add_bc_;
94 };
95
96 } // namespace frontend
97 } // namespace lyx
98
99 #endif // GUIBIBTEX_H