2006-03-05 17:24:44 +00:00
|
|
|
// -*- C++ -*-
|
|
|
|
/**
|
2007-08-31 05:53:55 +00:00
|
|
|
* \file GuiBibtex.h
|
2006-03-05 17:24:44 +00:00
|
|
|
* This file is part of LyX, the document processor.
|
|
|
|
* Licence details can be found in the file COPYING.
|
|
|
|
*
|
|
|
|
* \author John Levon
|
|
|
|
*
|
|
|
|
* Full author contact details are available in file CREDITS.
|
|
|
|
*/
|
|
|
|
|
2007-08-31 22:16:11 +00:00
|
|
|
#ifndef GUIBIBTEX_H
|
|
|
|
#define GUIBIBTEX_H
|
2006-03-05 17:24:44 +00:00
|
|
|
|
2007-08-31 05:53:55 +00:00
|
|
|
#include "GuiDialogView.h"
|
2007-08-31 22:16:11 +00:00
|
|
|
#include "ButtonController.h"
|
|
|
|
#include "ControlBibtex.h"
|
2007-08-11 15:48:15 +00:00
|
|
|
#include "ui_BibtexUi.h"
|
|
|
|
#include "ui_BibtexAddUi.h"
|
2007-04-25 08:42:22 +00:00
|
|
|
|
|
|
|
#include <QDialog>
|
2006-03-05 17:24:44 +00:00
|
|
|
|
|
|
|
namespace lyx {
|
|
|
|
namespace frontend {
|
|
|
|
|
2007-08-31 05:53:55 +00:00
|
|
|
class GuiBibtex;
|
2007-04-25 08:42:22 +00:00
|
|
|
|
|
|
|
template<class UI>
|
|
|
|
class UiDialog : public QDialog, public UI
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
UiDialog(QWidget * parent=0, bool modal=false, Qt::WFlags f=0)
|
|
|
|
: QDialog(parent, f)
|
|
|
|
{
|
|
|
|
UI::setupUi(this);
|
|
|
|
QDialog::setModal(modal);
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2007-08-31 05:53:55 +00:00
|
|
|
class GuiBibtexDialog : public QDialog, public Ui::BibtexUi {
|
2007-04-25 08:42:22 +00:00
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
2007-08-31 05:53:55 +00:00
|
|
|
GuiBibtexDialog(GuiBibtex * form);
|
2007-04-25 08:42:22 +00:00
|
|
|
|
2007-08-31 05:53:55 +00:00
|
|
|
UiDialog<Ui::BibtexAddUi> * add_;
|
2007-04-25 08:42:22 +00:00
|
|
|
|
|
|
|
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();
|
|
|
|
void bibEDChanged();
|
|
|
|
|
|
|
|
protected:
|
|
|
|
virtual void closeEvent(QCloseEvent * e);
|
|
|
|
|
|
|
|
private:
|
2007-08-31 05:53:55 +00:00
|
|
|
GuiBibtex * form_;
|
2007-04-25 08:42:22 +00:00
|
|
|
ButtonController add_bc_;
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2007-08-31 22:16:11 +00:00
|
|
|
class GuiBibtex : public GuiView<GuiBibtexDialog>
|
2006-03-05 17:24:44 +00:00
|
|
|
{
|
|
|
|
public:
|
2007-08-31 05:53:55 +00:00
|
|
|
friend class GuiBibtexDialog;
|
2006-03-05 17:24:44 +00:00
|
|
|
|
2007-09-03 05:59:32 +00:00
|
|
|
GuiBibtex(GuiDialog &);
|
2007-08-31 22:16:11 +00:00
|
|
|
/// parent controller
|
|
|
|
ControlBibtex & controller()
|
|
|
|
{ return static_cast<ControlBibtex &>(this->getController()); }
|
|
|
|
/// parent controller
|
|
|
|
ControlBibtex const & controller() const
|
|
|
|
{ return static_cast<ControlBibtex const &>(this->getController()); }
|
2006-03-05 17:24:44 +00:00
|
|
|
protected:
|
|
|
|
virtual bool isValid();
|
|
|
|
private:
|
|
|
|
/// Apply changes
|
2007-09-03 20:28:26 +00:00
|
|
|
virtual void applyView();
|
2006-03-05 17:24:44 +00:00
|
|
|
/// update
|
|
|
|
virtual void update_contents();
|
|
|
|
/// build the dialog
|
|
|
|
virtual void build_dialog();
|
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace frontend
|
|
|
|
} // namespace lyx
|
|
|
|
|
2007-08-31 22:16:11 +00:00
|
|
|
#endif // GUIBIBTEX_H
|