]> git.lyx.org Git - lyx.git/blob - src/frontends/qt/GuiBibtex.h
Remove obsolete (and false) comment.
[lyx.git] / src / frontends / qt / 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 on_editPB_clicked();
43         void databaseChanged();
44         void rescanClicked();
45         void selUpdated();
46         void filterPressed();
47         void filterChanged(const QString & text);
48         void resetFilter();
49
50 private:
51         /// Apply changes
52         void applyView();
53         /// update
54         void updateContents();
55
56         /// Browse for a .bib file
57         QString browseBib(QString const & in_name) const;
58         /// Browse for a .bst file
59         QString browseBst(QString const & in_name) const;
60         /// get the list of bst files
61         QStringList bibStyles() const;
62         /// get the list of bib files
63         QStringList bibFiles(bool const extension = true) const;
64         /// build filelists of all availabe bib/bst/cls/sty-files. done through
65         /// kpsewhich and an external script, saved in *Files.lst
66         void rescanBibStyles() const;
67         /// do we use bibtopic (for sectioned bibliography)?
68         bool usingBibtopic() const;
69         /// should we put the bibliography to the TOC?
70         bool bibtotoc() const;
71         /// do we use biblatex?
72         bool usingBiblatex() const;
73         /// which stylefile do we use?
74         QString styleFile() const;
75         /// Clear selected keys
76         void clearSelection();
77         /// Set selected keys
78         void setSelectedBibs(QStringList const);
79         /// prepares a call to GuiCitation::searchKeys when we
80         /// are ready to search the Bib entries
81         void findText(QString const & text);
82         ///
83         void init();
84         /// Get selected keys
85         QStringList selectedBibs();
86         ///
87         void setButtons();
88         ///
89         std::vector<docstring> getFileEncodings();
90         ///
91         void setFileEncodings(std::vector<docstring> const & m);
92
93         ///
94         bool initialiseParams(std::string const & data);
95         /// clean-up on hide.
96         void clearParams() { params_.clear(); }
97         /// clean-up on hide.
98         void dispatchParams();
99         ///
100         bool isBufferDependent() const { return true; }
101
102 private:
103         ///
104         InsetCommandParams params_;
105         ///
106         GuiSelectionManager * selectionManager;
107         /// available keys.
108         QStringListModel available_model_;
109         /// selected keys.
110         QStandardItemModel selected_model_;
111         /// All keys.
112         QStringList all_bibs_;
113         /// Cited keys.
114         QStringList selected_bibs_;
115         /// contains the search box
116         FancyLineEdit * filter_;
117         ///
118         QMap<QString, QString> encodings_;
119 };
120
121 } // namespace frontend
122 } // namespace lyx
123
124 #endif // GUIBIBTEX_H