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"
|
2018-08-11 12:17:42 +02:00
|
|
|
#include "GuiSelectionManager.h"
|
2007-09-05 20:33:29 +00:00
|
|
|
#include "ButtonController.h"
|
2018-08-11 12:17:42 +02:00
|
|
|
#include "FancyLineEdit.h"
|
2007-08-11 15:48:15 +00:00
|
|
|
#include "ui_BibtexUi.h"
|
2007-04-25 08:42:22 +00:00
|
|
|
|
2008-04-20 09:24:14 +00:00
|
|
|
#include "insets/InsetCommandParams.h"
|
|
|
|
|
2018-08-11 12:17:42 +02:00
|
|
|
#include <QStandardItemModel>
|
|
|
|
#include <QStringListModel>
|
2007-10-06 09:55:21 +00:00
|
|
|
|
2006-03-05 17:24:44 +00:00
|
|
|
namespace lyx {
|
|
|
|
namespace frontend {
|
|
|
|
|
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();
|
2018-08-11 12:17:42 +02:00
|
|
|
void on_buttonBox_accepted();
|
|
|
|
void browseBstPressed();
|
2007-09-05 20:33:29 +00:00
|
|
|
void browseBibPressed();
|
2019-03-30 11:37:28 +01:00
|
|
|
void on_editPB_clicked();
|
2007-09-05 20:33:29 +00:00
|
|
|
void databaseChanged();
|
2008-12-02 08:46:59 +00:00
|
|
|
void rescanClicked();
|
2018-08-11 12:17:42 +02:00
|
|
|
void selUpdated();
|
|
|
|
void filterPressed();
|
|
|
|
void filterChanged(const QString & text);
|
|
|
|
void resetFilter();
|
2007-04-25 08:42:22 +00:00
|
|
|
|
2007-09-05 20:33:29 +00:00
|
|
|
private:
|
2006-03-05 17:24:44 +00:00
|
|
|
/// Apply changes
|
2020-10-01 10:42:11 +03:00
|
|
|
void applyView() override;
|
2006-03-05 17:24:44 +00:00
|
|
|
/// update
|
2020-10-01 10:42:11 +03:00
|
|
|
void updateContents() override;
|
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
|
2018-08-11 12:17:42 +02:00
|
|
|
QStringList bibFiles(bool const extension = true) const;
|
Run codespell on src/frontends
Command was:
codespell -w -i 3 -S Makefile.in -L mathed,afe,tthe,ue,fro,uint,larg,alph,te,thes,alle,Claus,pres,pass-thru src/frontends/
2020-06-26 00:04:31 +02:00
|
|
|
/// build filelists of all available bib/bst/cls/sty-files. done through
|
2007-10-06 09:55:21 +00:00
|
|
|
/// 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 09:39:46 +01: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;
|
2018-08-11 12:17:42 +02:00
|
|
|
/// Clear selected keys
|
|
|
|
void clearSelection();
|
|
|
|
/// Set selected keys
|
|
|
|
void setSelectedBibs(QStringList const);
|
|
|
|
/// prepares a call to GuiCitation::searchKeys when we
|
|
|
|
/// are ready to search the Bib entries
|
|
|
|
void findText(QString const & text);
|
|
|
|
///
|
|
|
|
void init();
|
|
|
|
/// Get selected keys
|
|
|
|
QStringList selectedBibs();
|
|
|
|
///
|
|
|
|
void setButtons();
|
2019-03-29 15:45:55 +01:00
|
|
|
///
|
|
|
|
std::vector<docstring> getFileEncodings();
|
|
|
|
///
|
2019-09-17 23:22:35 +02:00
|
|
|
void setFileEncodings(std::vector<docstring> const & m);
|
2007-10-06 09:55:21 +00:00
|
|
|
|
2008-04-20 09:24:14 +00:00
|
|
|
///
|
2020-10-01 10:42:11 +03:00
|
|
|
bool initialiseParams(std::string const & data) override;
|
2008-04-20 09:24:14 +00:00
|
|
|
/// clean-up on hide.
|
2020-10-01 10:42:11 +03:00
|
|
|
void clearParams() override { params_.clear(); }
|
2008-04-20 09:24:14 +00:00
|
|
|
/// clean-up on hide.
|
2020-10-01 10:42:11 +03:00
|
|
|
void dispatchParams() override;
|
2008-04-20 09:24:14 +00:00
|
|
|
///
|
2020-10-01 10:42:11 +03:00
|
|
|
bool isBufferDependent() const override { return true; }
|
2008-04-20 09:24:14 +00:00
|
|
|
|
|
|
|
private:
|
|
|
|
///
|
|
|
|
InsetCommandParams params_;
|
2007-09-05 20:33:29 +00:00
|
|
|
///
|
2018-08-11 12:17:42 +02:00
|
|
|
GuiSelectionManager * selectionManager;
|
|
|
|
/// available keys.
|
|
|
|
QStringListModel available_model_;
|
|
|
|
/// selected keys.
|
|
|
|
QStandardItemModel selected_model_;
|
|
|
|
/// All keys.
|
|
|
|
QStringList all_bibs_;
|
|
|
|
/// Cited keys.
|
|
|
|
QStringList selected_bibs_;
|
|
|
|
/// contains the search box
|
|
|
|
FancyLineEdit * filter_;
|
2019-03-29 15:45:55 +01:00
|
|
|
///
|
|
|
|
QMap<QString, QString> encodings_;
|
2006-03-05 17:24:44 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace frontend
|
|
|
|
} // namespace lyx
|
|
|
|
|
2007-08-31 22:16:11 +00:00
|
|
|
#endif // GUIBIBTEX_H
|