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 "FancyLineEdit.h"
20 #include "ui_BibtexUi.h"
22 #include "insets/InsetCommandParams.h"
24 #include <QStandardItemModel>
25 #include <QStringListModel>
30 class GuiBibtex : public GuiDialog, public Ui::BibtexUi
35 explicit GuiBibtex(GuiView & lv);
38 void change_adaptor();
39 void on_buttonBox_accepted();
40 void browseBstPressed();
41 void browseBibPressed();
42 void on_editPB_clicked();
43 void databaseChanged();
47 void filterChanged(const QString & text);
54 void updateContents();
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();
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);
85 QStringList selectedBibs();
89 std::vector<docstring> getFileEncodings();
91 void setFileEncodings(std::vector<docstring> const m);
94 bool initialiseParams(std::string const & data);
96 void clearParams() { params_.clear(); }
98 void dispatchParams();
100 bool isBufferDependent() const { return true; }
104 InsetCommandParams params_;
106 GuiSelectionManager * selectionManager;
108 QStringListModel available_model_;
110 QStandardItemModel selected_model_;
112 QStringList all_bibs_;
114 QStringList selected_bibs_;
115 /// contains the search box
116 FancyLineEdit * filter_;
118 QMap<QString, QString> encodings_;
121 } // namespace frontend
124 #endif // GUIBIBTEX_H