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
|
2007-10-06 09:55:21 +00:00
|
|
|
* \author Angus Leeming
|
2006-03-05 17:24:44 +00:00
|
|
|
*
|
|
|
|
* 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
|
|
|
|
2008-04-20 09:24:14 +00:00
|
|
|
#include "GuiDialog.h"
|
2007-09-05 20:33:29 +00:00
|
|
|
#include "ButtonController.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
|
|
|
|
2008-04-20 09:24:14 +00:00
|
|
|
#include "insets/InsetCommandParams.h"
|
|
|
|
|
2007-10-06 09:55:21 +00:00
|
|
|
|
2006-03-05 17:24:44 +00:00
|
|
|
namespace lyx {
|
|
|
|
namespace frontend {
|
|
|
|
|
2007-09-05 20:33:29 +00:00
|
|
|
class GuiBibtexAddDialog : public QDialog, public Ui::BibtexAddUi
|
2007-04-25 08:42:22 +00:00
|
|
|
{
|
|
|
|
public:
|
2007-09-05 20:33:29 +00:00
|
|
|
GuiBibtexAddDialog(QWidget * parent) : QDialog(parent)
|
2007-04-25 08:42:22 +00:00
|
|
|
{
|
2007-09-05 20:33:29 +00:00
|
|
|
Ui::BibtexAddUi::setupUi(this);
|
|
|
|
QDialog::setModal(true);
|
2017-09-12 09:05:42 +00:00
|
|
|
setWindowModality(Qt::WindowModal);
|
2007-04-25 08:42:22 +00:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2008-04-20 09:24:14 +00:00
|
|
|
class GuiBibtex : public GuiDialog, public Ui::BibtexUi
|
2007-09-05 20:33:29 +00:00
|
|
|
{
|
2007-04-25 08:42:22 +00:00
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
2008-03-08 07:59:47 +00:00
|
|
|
explicit GuiBibtex(GuiView & lv);
|
2007-09-05 20:33:29 +00:00
|
|
|
|
|
|
|
private Q_SLOTS:
|
|
|
|
void change_adaptor();
|
|
|
|
void browsePressed();
|
|
|
|
void browseBibPressed();
|
|
|
|
void addPressed();
|
|
|
|
void addDatabase();
|
|
|
|
void deletePressed();
|
2008-01-12 09:30:21 +00:00
|
|
|
void upPressed();
|
|
|
|
void downPressed();
|
2007-09-05 20:33:29 +00:00
|
|
|
void databaseChanged();
|
|
|
|
void availableChanged();
|
2007-04-25 08:42:22 +00:00
|
|
|
void bibEDChanged();
|
2008-12-02 08:46:59 +00:00
|
|
|
void rescanClicked();
|
2007-04-25 08:42:22 +00:00
|
|
|
|
2007-09-05 20:33:29 +00:00
|
|
|
private:
|
|
|
|
///
|
2007-10-07 18:40:01 +00:00
|
|
|
bool isValid();
|
2006-03-05 17:24:44 +00:00
|
|
|
/// Apply changes
|
2007-10-07 18:40:01 +00:00
|
|
|
void applyView();
|
2006-03-05 17:24:44 +00:00
|
|
|
/// update
|
2007-10-07 18:40:01 +00:00
|
|
|
void updateContents();
|
2007-09-05 20:33:29 +00:00
|
|
|
|
2007-10-06 09:55:21 +00:00
|
|
|
/// Browse for a .bib file
|
2008-03-06 00:07:19 +00:00
|
|
|
QString browseBib(QString const & in_name) const;
|
2007-10-06 09:55:21 +00:00
|
|
|
/// Browse for a .bst file
|
2008-03-06 00:07:19 +00:00
|
|
|
QString browseBst(QString const & in_name) const;
|
2007-10-06 09:55:21 +00:00
|
|
|
/// get the list of bst files
|
2008-03-08 07:59:47 +00:00
|
|
|
QStringList bibStyles() const;
|
2007-10-06 09:55:21 +00:00
|
|
|
/// get the list of bib files
|
2008-03-08 07:59:47 +00:00
|
|
|
QStringList bibFiles() const;
|
2007-10-06 09:55:21 +00:00
|
|
|
/// 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;
|
2017-01-08 08:39:46 +00:00
|
|
|
/// do we use biblatex?
|
|
|
|
bool usingBiblatex() const;
|
2007-10-06 09:55:21 +00:00
|
|
|
/// which stylefile do we use?
|
2008-03-08 07:59:47 +00:00
|
|
|
QString styleFile() const;
|
2007-10-06 09:55:21 +00:00
|
|
|
|
2008-04-20 09:24:14 +00:00
|
|
|
///
|
|
|
|
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_;
|
2007-09-05 20:33:29 +00:00
|
|
|
///
|
|
|
|
GuiBibtexAddDialog * add_;
|
|
|
|
///
|
|
|
|
ButtonController add_bc_;
|
2006-03-05 17:24:44 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace frontend
|
|
|
|
} // namespace lyx
|
|
|
|
|
2007-08-31 22:16:11 +00:00
|
|
|
#endif // GUIBIBTEX_H
|