]> git.lyx.org Git - lyx.git/blob - src/frontends/qt4/GuiBibtex.h
Amend cab46ff9d1ea3
[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 "GuiSelectionManager.h"
18 #include "ButtonController.h"
19 #include "FancyLineEdit.h"
20 #include "ui_BibtexUi.h"
21
22 #include "insets/InsetCommandParams.h"
23
24 #include <QStandardItemModel>
25 #include <QStringListModel>
26
27 namespace lyx {
28 namespace frontend {
29
30 class GuiBibtex : public GuiDialog, public Ui::BibtexUi
31 {
32         Q_OBJECT
33
34 public:
35         explicit GuiBibtex(GuiView & lv);
36
37 private Q_SLOTS:
38         void change_adaptor();
39         void on_buttonBox_accepted();
40         void browseBstPressed();
41         void browseBibPressed();
42         void databaseChanged();
43         void rescanClicked();
44         void selUpdated();
45         void filterPressed();
46         void filterChanged(const QString & text);
47         void resetFilter();
48
49 private:
50         /// Apply changes
51         void applyView();
52         /// update
53         void updateContents();
54
55         /// Browse for a .bib file
56         QString browseBib(QString const & in_name) const;
57         /// Browse for a .bst file
58         QString browseBst(QString const & in_name) const;
59         /// get the list of bst files
60         QStringList bibStyles() const;
61         /// get the list of bib files
62         QStringList bibFiles(bool const extension = true) const;
63         /// build filelists of all availabe bib/bst/cls/sty-files. done through
64         /// kpsewhich and an external script, saved in *Files.lst
65         void rescanBibStyles() const;
66         /// do we use bibtopic (for sectioned bibliography)?
67         bool usingBibtopic() const;
68         /// should we put the bibliography to the TOC?
69         bool bibtotoc() const;
70         /// do we use biblatex?
71         bool usingBiblatex() const;
72         /// which stylefile do we use?
73         QString styleFile() const;
74         /// Clear selected keys
75         void clearSelection();
76         /// Set selected keys
77         void setSelectedBibs(QStringList const);
78         /// prepares a call to GuiCitation::searchKeys when we
79         /// are ready to search the Bib entries
80         void findText(QString const & text);
81         ///
82         void init();
83         /// Get selected keys
84         QStringList selectedBibs();
85         ///
86         void setButtons();
87
88         ///
89         bool initialiseParams(std::string const & data);
90         /// clean-up on hide.
91         void clearParams() { params_.clear(); }
92         /// clean-up on hide.
93         void dispatchParams();
94         ///
95         bool isBufferDependent() const { return true; }
96
97 private:
98         ///
99         InsetCommandParams params_;
100         ///
101         GuiSelectionManager * selectionManager;
102         /// available keys.
103         QStringListModel available_model_;
104         /// selected keys.
105         QStandardItemModel selected_model_;
106         /// All keys.
107         QStringList all_bibs_;
108         /// Cited keys.
109         QStringList selected_bibs_;
110         /// contains the search box
111         FancyLineEdit * filter_;
112 };
113
114 } // namespace frontend
115 } // namespace lyx
116
117 #endif // GUIBIBTEX_H