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