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 inheritPressed();
44 void on_editPB_clicked();
45 void databaseChanged();
49 void filterChanged(const QString & text);
54 void applyView() override;
56 void updateContents() override;
58 /// Browse for a .bib file
59 QString browseBib(QString const & in_name) const;
60 /// Browse for a .bst file
61 QString browseBst(QString const & in_name) const;
62 /// get the list of bst files
63 QStringList bibStyles() const;
64 /// get the list of bib files
65 QStringList bibFiles(bool const extension = true) const;
66 /// build filelists of all available bib/bst/cls/sty-files. done through
67 /// kpsewhich and an external script, saved in *Files.lst
68 void rescanBibStyles() const;
69 /// do we use bibtopic (for sectioned bibliography)?
70 bool usingBibtopic() const;
71 /// should we put the bibliography to the TOC?
72 bool bibtotoc() const;
73 /// do we use biblatex?
74 bool usingBiblatex() const;
75 /// which stylefile do we use?
76 QString styleFile() const;
77 /// Clear selected keys
78 void clearSelection();
80 void setSelectedBibs(QStringList const &);
81 /// prepares a call to GuiCitation::searchKeys when we
82 /// are ready to search the Bib entries
83 void findText(QString const & text);
87 QStringList selectedBibs();
91 std::vector<docstring> getFileEncodings();
93 void setFileEncodings(std::vector<docstring> const & m);
96 bool initialiseParams(std::string const & data) override;
98 void clearParams() override { params_.clear(); }
100 void dispatchParams() override;
102 bool isBufferDependent() const override { return true; }
103 /// Is his a child which can inherit bibs from its master?
108 InsetCommandParams params_;
110 GuiSelectionManager * selectionManager;
112 QStringListModel available_model_;
114 QStandardItemModel selected_model_;
116 QStringList all_bibs_;
118 QStringList selected_bibs_;
119 /// contains the search box
120 FancyLineEdit * filter_;
122 QMap<QString, QString> encodings_;
125 } // namespace frontend
128 #endif // GUIBIBTEX_H