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
|
|
|
|
2007-09-05 20:33:29 +00:00
|
|
|
#include "GuiDialog.h"
|
|
|
|
#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
|
|
|
|
2007-10-06 09:55:21 +00:00
|
|
|
#include "ControlCommand.h"
|
|
|
|
|
|
|
|
#include "support/docstring.h"
|
|
|
|
|
|
|
|
#include <vector>
|
|
|
|
|
2006-03-05 17:24:44 +00:00
|
|
|
namespace lyx {
|
2007-10-06 09:55:21 +00:00
|
|
|
|
|
|
|
namespace support { class FileFilterList; }
|
|
|
|
|
2006-03-05 17:24:44 +00:00
|
|
|
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);
|
2007-04-25 08:42:22 +00:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2007-10-06 09:55:21 +00:00
|
|
|
class GuiBibtex : public GuiDialog, public Ui::BibtexUi, public ControlCommand
|
2007-09-05 20:33:29 +00:00
|
|
|
{
|
2007-04-25 08:42:22 +00:00
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
2007-10-06 09:55:21 +00:00
|
|
|
GuiBibtex(LyXView & 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();
|
|
|
|
void databaseChanged();
|
|
|
|
void availableChanged();
|
2007-04-25 08:42:22 +00:00
|
|
|
void bibEDChanged();
|
|
|
|
|
|
|
|
private:
|
2007-09-05 20:33:29 +00:00
|
|
|
void closeEvent(QCloseEvent * e);
|
2007-04-25 08:42:22 +00:00
|
|
|
|
2007-09-05 20:33:29 +00:00
|
|
|
private:
|
2007-08-31 22:16:11 +00:00
|
|
|
/// parent controller
|
2007-10-06 09:55:21 +00:00
|
|
|
Controller & controller() { return *this; }
|
2007-09-05 20:33:29 +00:00
|
|
|
///
|
2006-03-05 17:24:44 +00:00
|
|
|
virtual bool isValid();
|
|
|
|
/// Apply changes
|
2007-09-03 20:28:26 +00:00
|
|
|
virtual void applyView();
|
2006-03-05 17:24:44 +00:00
|
|
|
/// update
|
2007-09-11 18:33:42 +00:00
|
|
|
virtual void updateContents();
|
2007-09-05 20:33:29 +00:00
|
|
|
|
2007-10-06 09:55:21 +00:00
|
|
|
/// Browse for a .bib file
|
|
|
|
docstring const browseBib(docstring const & in_name) const;
|
|
|
|
|
|
|
|
/// Browse for a .bst file
|
|
|
|
docstring const browseBst(docstring const & in_name) const;
|
|
|
|
|
|
|
|
/// get the list of bst files
|
|
|
|
void getBibStyles(std::vector<std::string> & data) const;
|
|
|
|
/// get the list of bib files
|
|
|
|
void getBibFiles(std::vector<std::string> & data) 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?
|
|
|
|
std::string const getStylefile() const;
|
|
|
|
|
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
|