2001-06-13 14:33:31 +00:00
|
|
|
// -*- C++ -*-
|
2002-09-05 14:10:50 +00:00
|
|
|
/**
|
|
|
|
* \file ControlCitation.h
|
2002-09-05 15:14:23 +00:00
|
|
|
* This file is part of LyX, the document processor.
|
|
|
|
* Licence details can be found in the file COPYING.
|
2001-03-15 13:37:04 +00:00
|
|
|
*
|
2002-09-05 14:10:50 +00:00
|
|
|
* \author Angus Leeming
|
2007-03-25 01:32:12 +00:00
|
|
|
* \author Abdelrazak Younes
|
2001-03-15 13:37:04 +00:00
|
|
|
*
|
2003-08-23 00:17:00 +00:00
|
|
|
* Full author contact details are available in file CREDITS.
|
2001-03-15 13:37:04 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef CONTROLCITATION_H
|
|
|
|
#define CONTROLCITATION_H
|
|
|
|
|
|
|
|
|
|
|
|
#include "ControlCommand.h"
|
2004-05-14 13:13:20 +00:00
|
|
|
#include "biblio.h"
|
2001-03-15 13:37:04 +00:00
|
|
|
|
2004-05-19 15:11:37 +00:00
|
|
|
namespace lyx {
|
|
|
|
namespace frontend {
|
|
|
|
|
2001-04-03 14:30:58 +00:00
|
|
|
/** A controller for Citation dialogs.
|
2001-03-15 13:37:04 +00:00
|
|
|
*/
|
2002-10-21 17:38:09 +00:00
|
|
|
class ControlCitation : public ControlCommand {
|
2001-03-15 13:37:04 +00:00
|
|
|
public:
|
|
|
|
///
|
2003-02-25 14:51:38 +00:00
|
|
|
ControlCitation(Dialog &);
|
2007-03-25 01:32:12 +00:00
|
|
|
virtual ~ControlCitation() {}
|
2003-10-06 15:43:21 +00:00
|
|
|
virtual bool initialiseParams(std::string const & data);
|
2007-03-25 01:32:12 +00:00
|
|
|
|
2003-02-25 14:51:38 +00:00
|
|
|
/// clean-up on hide.
|
|
|
|
virtual void clearParams();
|
|
|
|
|
|
|
|
/** Disconnect from the inset when the Apply button is pressed.
|
|
|
|
* Allows easy insertion of multiple citations.
|
|
|
|
*/
|
|
|
|
virtual bool disconnectOnApply() const { return true; }
|
2001-03-28 12:59:29 +00:00
|
|
|
|
2007-03-25 01:32:12 +00:00
|
|
|
/// \return the list of all available bibliography keys.
|
|
|
|
std::vector<std::string> const availableKeys() const;
|
2001-07-19 14:12:37 +00:00
|
|
|
///
|
2007-03-25 01:32:12 +00:00
|
|
|
biblio::CiteEngine const getEngine() const;
|
|
|
|
|
|
|
|
/// \return information for this key.
|
|
|
|
docstring const getInfo(std::string const & key) const;
|
|
|
|
|
|
|
|
/// Search a given string within the passed keys.
|
|
|
|
/// \return the vector of matched keys.
|
|
|
|
std::vector<std::string> searchKeys(
|
|
|
|
std::vector<std::string> const & keys_to_search, //< Keys to search.
|
|
|
|
docstring const & search_expression, //< Search expression (regex possible)
|
|
|
|
bool case_sensitive = false, // set to true is the search should be case sensitive
|
|
|
|
bool regex = false /// \set to true if \c search_expression is a regex
|
|
|
|
); //
|
2004-05-10 20:55:00 +00:00
|
|
|
|
2007-03-25 01:32:12 +00:00
|
|
|
/// \return possible citations based on this key.
|
2006-12-17 10:52:04 +00:00
|
|
|
std::vector<docstring> const getCiteStrings(std::string const & key) const;
|
2001-07-19 14:12:37 +00:00
|
|
|
|
2004-03-07 14:33:17 +00:00
|
|
|
/// available CiteStyle-s (depends on availability of Natbib/Jurabib)
|
2002-10-21 17:38:09 +00:00
|
|
|
static std::vector<biblio::CiteStyle> const & getCiteStyles() {
|
|
|
|
return citeStyles_;
|
|
|
|
}
|
2001-03-15 13:37:04 +00:00
|
|
|
private:
|
|
|
|
/// The info associated with each key
|
2001-03-28 12:59:29 +00:00
|
|
|
biblio::InfoMap bibkeysInfo_;
|
2001-07-19 14:12:37 +00:00
|
|
|
|
|
|
|
///
|
|
|
|
static std::vector<biblio::CiteStyle> citeStyles_;
|
2001-03-15 13:37:04 +00:00
|
|
|
};
|
|
|
|
|
2004-05-19 15:11:37 +00:00
|
|
|
} // namespace frontend
|
|
|
|
} // namespace lyx
|
2001-07-19 14:12:37 +00:00
|
|
|
|
2001-03-15 13:37:04 +00:00
|
|
|
#endif // CONTROLCITATION_H
|