4 * This file is part of LyX, the document processor.
5 * Licence details can be found in the file COPYING.
8 * \author Angus Leeming
10 * Full author contact details are available in file CREDITS.
16 #include "GuiDialog.h"
17 #include "GuiSelectionManager.h"
18 #include "ButtonController.h"
19 #include "ui_BibtexUi.h"
21 #include "insets/InsetCommandParams.h"
23 #include <QStandardItemModel>
24 #include <QStringListModel>
31 class GuiBibtex : public GuiDialog, public Ui::BibtexUi
36 explicit GuiBibtex(GuiView & lv);
39 void change_adaptor();
40 void on_buttonBox_accepted();
41 void browseBstPressed();
42 void browseBibPressed();
43 void on_editPB_clicked();
44 void databaseChanged();
48 void filterChanged(const QString & text);
53 void applyView() override;
55 void updateContents() override;
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();
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);
86 QStringList selectedBibs();
90 std::vector<docstring> getFileEncodings();
92 void setFileEncodings(std::vector<docstring> const & m);
95 bool initialiseParams(std::string const & data) override;
97 void clearParams() override { params_.clear(); }
99 void dispatchParams() override;
101 bool isBufferDependent() const override { return true; }
105 InsetCommandParams params_;
107 GuiSelectionManager * selectionManager;
109 QStringListModel available_model_;
111 QStandardItemModel selected_model_;
113 QStringList all_bibs_;
115 QStringList selected_bibs_;
116 /// contains the search box
117 FancyLineEdit * filter_;
119 QMap<QString, QString> encodings_;
122 } // namespace frontend
125 #endif // GUIBIBTEX_H