2006-03-05 17:24:44 +00:00
|
|
|
// -*- C++ -*-
|
|
|
|
/**
|
|
|
|
* \file QCitation.h
|
|
|
|
* This file is part of LyX, the document processor.
|
|
|
|
* Licence details can be found in the file COPYING.
|
|
|
|
*
|
|
|
|
* \author Angus Leeming
|
|
|
|
* \author Kalle Dalheimer
|
|
|
|
*
|
|
|
|
* Full author contact details are available in file CREDITS.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef QCITATION_H
|
|
|
|
#define QCITATION_H
|
|
|
|
|
2006-04-11 08:26:43 +00:00
|
|
|
#include "ControlCitation.h"
|
2006-03-05 17:24:44 +00:00
|
|
|
|
2006-03-25 21:26:09 +00:00
|
|
|
#include <QStringListModel>
|
2006-03-05 17:24:44 +00:00
|
|
|
|
|
|
|
namespace lyx {
|
|
|
|
namespace frontend {
|
|
|
|
|
2006-04-11 08:26:43 +00:00
|
|
|
class QCitation : public ControlCitation
|
2006-03-05 17:24:44 +00:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
///
|
|
|
|
QCitation(Dialog &);
|
2006-03-25 21:26:09 +00:00
|
|
|
|
2006-04-05 23:56:29 +00:00
|
|
|
QStringListModel * available()
|
2006-03-25 21:26:09 +00:00
|
|
|
{ return &available_keys_; }
|
|
|
|
|
2006-04-05 23:56:29 +00:00
|
|
|
QStringListModel * selected()
|
2006-03-25 21:26:09 +00:00
|
|
|
{ return &selected_keys_; }
|
|
|
|
|
2006-04-05 23:56:29 +00:00
|
|
|
QStringListModel * found()
|
2006-03-25 21:26:09 +00:00
|
|
|
{ return &found_keys_; }
|
2006-04-05 23:56:29 +00:00
|
|
|
|
2006-04-11 08:26:43 +00:00
|
|
|
QString textBefore();
|
|
|
|
QString textAfter();
|
|
|
|
|
2006-03-25 21:26:09 +00:00
|
|
|
QModelIndex findKey(QString const & str, QModelIndex const & index) const;
|
|
|
|
QModelIndex findKey(QString const & str) const;
|
|
|
|
|
|
|
|
void addKeys(QModelIndexList const & indexes);
|
|
|
|
void deleteKeys(QModelIndexList const & indexes);
|
|
|
|
void upKey(QModelIndexList const & indexes);
|
|
|
|
void downKey(QModelIndexList const & indexes);
|
|
|
|
|
2006-04-11 08:26:43 +00:00
|
|
|
QStringList citationStyles(int sel);
|
2006-03-25 21:26:09 +00:00
|
|
|
|
2006-04-11 08:26:43 +00:00
|
|
|
|
|
|
|
virtual bool isValid();
|
2006-03-05 17:24:44 +00:00
|
|
|
|
|
|
|
/// Set the Params variable for the Controller.
|
2006-04-11 08:26:43 +00:00
|
|
|
virtual void apply(int const choice, bool const full, bool const force,
|
|
|
|
QString before, QString After);
|
|
|
|
|
2006-03-05 17:24:44 +00:00
|
|
|
/// Update dialog before/whilst showing it.
|
2006-04-11 08:26:43 +00:00
|
|
|
virtual void updateModel();
|
2006-03-05 17:24:44 +00:00
|
|
|
|
2006-04-11 08:26:43 +00:00
|
|
|
private:
|
2006-03-25 21:26:09 +00:00
|
|
|
/// available keys
|
|
|
|
QStringListModel available_keys_;
|
2006-03-05 17:24:44 +00:00
|
|
|
|
|
|
|
/// selected keys
|
2006-03-25 21:26:09 +00:00
|
|
|
QStringListModel selected_keys_;
|
|
|
|
|
|
|
|
/// found keys
|
|
|
|
QStringListModel found_keys_;
|
2006-03-05 17:24:44 +00:00
|
|
|
};
|
|
|
|
|
2006-04-11 08:26:43 +00:00
|
|
|
|
|
|
|
/** A controller for Citation dialogs.
|
|
|
|
*/
|
|
|
|
/*
|
|
|
|
class Citation {
|
|
|
|
public:
|
|
|
|
///
|
|
|
|
Citation();
|
|
|
|
|
|
|
|
///
|
|
|
|
virtual bool initialiseParams(std::string const & data);
|
|
|
|
|
|
|
|
/// 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; }
|
|
|
|
|
|
|
|
/// Returns a reference to the map of stored keys
|
|
|
|
biblio::InfoMap const & bibkeysInfo() const;
|
|
|
|
|
|
|
|
///
|
|
|
|
biblio::CiteEngine_enum getEngine() const;
|
|
|
|
|
|
|
|
/// Possible citations based on this key
|
|
|
|
std::vector<std::string> const getCiteStrings(std::string const & key) const;
|
|
|
|
|
|
|
|
/// available CiteStyle-s (depends on availability of Natbib/Jurabib)
|
|
|
|
static std::vector<biblio::CiteStyle> const & getCiteStyles() {
|
|
|
|
return citeStyles_;
|
|
|
|
}
|
|
|
|
private:
|
|
|
|
/// The info associated with each key
|
|
|
|
biblio::InfoMap bibkeysInfo_;
|
|
|
|
|
|
|
|
///
|
|
|
|
static std::vector<biblio::CiteStyle> citeStyles_;
|
|
|
|
};
|
|
|
|
*/
|
2006-03-05 17:24:44 +00:00
|
|
|
} // namespace frontend
|
|
|
|
} // namespace lyx
|
|
|
|
|
|
|
|
#endif // QCITATION_H
|