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