X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Ffrontends%2Fqt4%2FGuiBibtex.h;h=3ce3ada32d5031665519c8972927f94e9c25eade;hb=425d092204118ea6c24c28e85fdf03fcf2bb51a4;hp=027d5396347f31aab14562821e748db35fdf8a62;hpb=a1cec91afaca91968b46e695533c10ad2a3f73d3;p=lyx.git diff --git a/src/frontends/qt4/GuiBibtex.h b/src/frontends/qt4/GuiBibtex.h index 027d539634..3ce3ada32d 100644 --- a/src/frontends/qt4/GuiBibtex.h +++ b/src/frontends/qt4/GuiBibtex.h @@ -5,90 +5,102 @@ * Licence details can be found in the file COPYING. * * \author John Levon + * \author Angus Leeming * * Full author contact details are available in file CREDITS. */ -#ifndef QBIBTEX_H -#define QBIBTEX_H - -#include "GuiDialogView.h" +#ifndef GUIBIBTEX_H +#define GUIBIBTEX_H +#include "GuiDialog.h" +#include "ButtonController.h" #include "ui_BibtexUi.h" #include "ui_BibtexAddUi.h" -#include "ButtonController.h" +#include "insets/InsetCommandParams.h" -#include -#include namespace lyx { namespace frontend { -class GuiBibtex; - -template -class UiDialog : public QDialog, public UI +class GuiBibtexAddDialog : public QDialog, public Ui::BibtexAddUi { public: - UiDialog(QWidget * parent=0, bool modal=false, Qt::WFlags f=0) - : QDialog(parent, f) + GuiBibtexAddDialog(QWidget * parent) : QDialog(parent) { - UI::setupUi(this); - QDialog::setModal(modal); + Ui::BibtexAddUi::setupUi(this); + QDialog::setModal(true); } }; -class GuiBibtexDialog : public QDialog, public Ui::BibtexUi { +class GuiBibtex : public GuiDialog, public Ui::BibtexUi +{ Q_OBJECT public: - GuiBibtexDialog(GuiBibtex * form); - - UiDialog * add_; - -protected Q_SLOTS: - virtual void change_adaptor(); - virtual void browsePressed(); - virtual void browseBibPressed(); - virtual void addPressed(); - virtual void addDatabase(); - virtual void deletePressed(); - virtual void databaseChanged(); - virtual void availableChanged(); + explicit GuiBibtex(GuiView & lv); + +private Q_SLOTS: + void change_adaptor(); + void browsePressed(); + void browseBibPressed(); + void addPressed(); + void addDatabase(); + void deletePressed(); + void upPressed(); + void downPressed(); + void databaseChanged(); + void availableChanged(); void bibEDChanged(); + void rescanClicked(); -protected: - virtual void closeEvent(QCloseEvent * e); - -private: - GuiBibtex * form_; - ButtonController add_bc_; -}; - - -class ControlBibtex; - -class GuiBibtex - : public QController > -{ -public: - friend class GuiBibtexDialog; - - GuiBibtex(Dialog &); -protected: - virtual bool isValid(); private: + /// + bool isValid(); /// Apply changes - virtual void apply(); + void applyView(); /// update - virtual void update_contents(); - /// build the dialog - virtual void build_dialog(); + void updateContents(); + + /// Browse for a .bib file + QString browseBib(QString const & in_name) const; + /// Browse for a .bst file + QString browseBst(QString const & in_name) const; + /// get the list of bst files + QStringList bibStyles() const; + /// get the list of bib files + QStringList bibFiles() const; + /// build filelists of all availabe bib/bst/cls/sty-files. done through + /// kpsewhich and an external script, saved in *Files.lst + void rescanBibStyles() const; + /// do we use bibtopic (for sectioned bibliography)? + bool usingBibtopic() const; + /// should we put the bibliography to the TOC? + bool bibtotoc() const; + /// which stylefile do we use? + QString styleFile() const; + + /// + bool initialiseParams(std::string const & data); + /// clean-up on hide. + void clearParams() { params_.clear(); } + /// clean-up on hide. + void dispatchParams(); + /// + bool isBufferDependent() const { return true; } + +private: + /// + InsetCommandParams params_; + /// + GuiBibtexAddDialog * add_; + /// + ButtonController add_bc_; }; } // namespace frontend } // namespace lyx -#endif // QBIBTEX_H +#endif // GUIBIBTEX_H