1999-09-27 18:44:28 +00:00
|
|
|
// -*- C++ -*-
|
2002-09-25 14:26:13 +00:00
|
|
|
/**
|
2007-04-25 01:24:38 +00:00
|
|
|
* \file InsetBibtex.h
|
2002-09-25 14:26:13 +00:00
|
|
|
* This file is part of LyX, the document processor.
|
|
|
|
* Licence details can be found in the file COPYING.
|
1999-09-27 18:44:28 +00:00
|
|
|
*
|
2002-09-25 14:26:13 +00:00
|
|
|
* \author Alejandro Aguilar Sierra
|
2002-03-21 17:09:55 +00:00
|
|
|
*
|
2003-08-23 00:17:00 +00:00
|
|
|
* Full author contact details are available in file CREDITS.
|
2002-09-25 14:26:13 +00:00
|
|
|
*/
|
1999-09-27 18:44:28 +00:00
|
|
|
|
2003-02-21 09:20:18 +00:00
|
|
|
#ifndef INSET_BIBTEX_H
|
|
|
|
#define INSET_BIBTEX_H
|
1999-09-27 18:44:28 +00:00
|
|
|
|
2008-03-29 14:38:38 +00:00
|
|
|
#include "InsetCommand.h"
|
|
|
|
|
2010-10-31 00:31:57 +00:00
|
|
|
namespace lyx {
|
2008-04-19 15:52:35 +00:00
|
|
|
|
2010-10-31 00:31:57 +00:00
|
|
|
class BiblioInfo;
|
2018-09-02 04:10:01 +00:00
|
|
|
class docstring_list;
|
1999-09-27 18:44:28 +00:00
|
|
|
|
2010-10-31 00:31:57 +00:00
|
|
|
namespace support {
|
|
|
|
class FileName;
|
2017-07-23 11:11:54 +00:00
|
|
|
} // namespace support
|
2006-12-01 20:09:08 +00:00
|
|
|
|
2003-09-03 17:40:58 +00:00
|
|
|
/** Used to insert BibTeX's information
|
|
|
|
*/
|
|
|
|
class InsetBibtex : public InsetCommand {
|
1999-09-27 18:44:28 +00:00
|
|
|
public:
|
|
|
|
///
|
2009-11-08 15:53:21 +00:00
|
|
|
InsetBibtex(Buffer *, InsetCommandParams const &);
|
2010-10-27 21:35:13 +00:00
|
|
|
|
2003-05-26 09:13:55 +00:00
|
|
|
///
|
2018-09-02 04:10:01 +00:00
|
|
|
docstring_list getBibFiles() const;
|
2010-10-27 21:35:13 +00:00
|
|
|
///
|
|
|
|
bool addDatabase(docstring const &);
|
|
|
|
///
|
|
|
|
bool delDatabase(docstring const &);
|
2015-05-03 21:55:19 +00:00
|
|
|
///
|
|
|
|
void write(std::ostream &) const;
|
2010-10-27 21:35:13 +00:00
|
|
|
|
|
|
|
/// \name Public functions inherited from Inset class
|
|
|
|
//@{
|
1999-09-27 18:44:28 +00:00
|
|
|
///
|
2008-04-28 12:48:04 +00:00
|
|
|
docstring toolTip(BufferView const & bv, int x, int y) const;
|
|
|
|
///
|
2009-04-22 20:55:13 +00:00
|
|
|
bool hasSettings() const { return true; }
|
2000-08-04 13:12:30 +00:00
|
|
|
///
|
2007-10-13 09:04:52 +00:00
|
|
|
InsetCode lyxCode() const { return BIBTEX_CODE; }
|
2000-08-04 13:12:30 +00:00
|
|
|
///
|
2007-05-18 14:32:29 +00:00
|
|
|
DisplayType display() const { return AlignCenter; }
|
2003-10-22 10:22:09 +00:00
|
|
|
///
|
2011-02-10 20:02:48 +00:00
|
|
|
void latex(otexstream &, OutputParams const &) const;
|
1999-09-27 18:44:28 +00:00
|
|
|
///
|
2013-03-08 19:52:18 +00:00
|
|
|
int plaintext(odocstringstream & ods, OutputParams const & op,
|
|
|
|
size_t max_length = INT_MAX) const;
|
2013-01-14 16:26:55 +00:00
|
|
|
///
|
2017-11-05 01:23:25 +00:00
|
|
|
void updateBuffer(ParIterator const &, UpdateType);
|
|
|
|
///
|
2017-10-18 07:20:31 +00:00
|
|
|
void collectBibKeys(InsetIterator const &, support::FileNameList &) const;
|
2001-07-20 14:18:48 +00:00
|
|
|
///
|
2004-03-29 13:17:25 +00:00
|
|
|
void validate(LaTeXFeatures &) const;
|
2007-10-25 04:13:56 +00:00
|
|
|
///
|
2009-11-30 22:48:10 +00:00
|
|
|
docstring xhtml(XHTMLStream &, OutputParams const &) const;
|
2009-06-11 21:23:18 +00:00
|
|
|
///
|
2011-10-29 14:48:55 +00:00
|
|
|
std::string contextMenuName() const;
|
2010-10-27 21:35:13 +00:00
|
|
|
//@}
|
|
|
|
|
|
|
|
/// \name Static public methods obligated for InsetCommand derived classes
|
|
|
|
//@{
|
|
|
|
///
|
2008-02-23 22:01:02 +00:00
|
|
|
static ParamInfo const & findInfo(std::string const &);
|
2007-10-25 04:13:56 +00:00
|
|
|
///
|
2009-11-30 22:48:10 +00:00
|
|
|
static std::string defaultCommand() { return "bibtex"; }
|
2007-10-25 04:13:56 +00:00
|
|
|
///
|
2011-12-03 22:15:11 +00:00
|
|
|
static bool isCompatibleCommand(std::string const & s)
|
2007-10-25 04:13:56 +00:00
|
|
|
{ return s == "bibtex"; }
|
2010-10-27 21:35:13 +00:00
|
|
|
//@}
|
|
|
|
|
|
|
|
private:
|
2008-04-28 15:14:18 +00:00
|
|
|
///
|
2010-10-27 21:35:13 +00:00
|
|
|
void editDatabases() const;
|
2010-12-03 19:29:46 +00:00
|
|
|
///
|
2017-10-18 07:20:31 +00:00
|
|
|
void parseBibTeXFiles(support::FileNameList &) const;
|
2017-01-08 08:39:46 +00:00
|
|
|
///
|
|
|
|
bool usingBiblatex() const;
|
2010-10-27 21:35:13 +00:00
|
|
|
|
|
|
|
/// \name Private functions inherited from Inset class
|
|
|
|
//@{
|
2008-02-23 22:01:02 +00:00
|
|
|
///
|
2008-04-28 15:14:18 +00:00
|
|
|
bool getStatus(Cursor & cur, FuncRequest const & cmd,
|
|
|
|
FuncStatus & flag) const;
|
|
|
|
///
|
2010-10-27 21:35:13 +00:00
|
|
|
void doDispatch(Cursor & cur, FuncRequest & cmd);
|
2008-04-28 15:14:18 +00:00
|
|
|
///
|
2008-03-05 00:21:05 +00:00
|
|
|
Inset * clone() const { return new InsetBibtex(*this); }
|
2010-10-27 21:35:13 +00:00
|
|
|
//@}
|
|
|
|
|
|
|
|
/// \name Private functions inherited from InsetCommand class
|
|
|
|
//@{
|
|
|
|
///
|
|
|
|
docstring screenLabel() const;
|
|
|
|
//@}
|
1999-09-27 18:44:28 +00:00
|
|
|
};
|
|
|
|
|
2006-10-21 00:16:43 +00:00
|
|
|
|
|
|
|
} // namespace lyx
|
|
|
|
|
2003-02-21 09:20:18 +00:00
|
|
|
#endif // INSET_BIBTEX_H
|