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
|
2007-03-25 01:32:12 +00:00
|
|
|
* \author Abdelrazak Younes
|
2006-03-05 17:24:44 +00:00
|
|
|
*
|
|
|
|
* Full author contact details are available in file CREDITS.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef QCITATION_H
|
|
|
|
#define QCITATION_H
|
|
|
|
|
2007-03-25 01:32:12 +00:00
|
|
|
#include "frontends/controllers/ControlCitation.h"
|
2006-03-05 17:24:44 +00:00
|
|
|
|
2007-03-25 01:32:12 +00:00
|
|
|
#include <QStringList>
|
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 &);
|
2007-03-25 01:32:12 +00:00
|
|
|
virtual ~QCitation() {}
|
|
|
|
virtual bool initialiseParams(std::string const & data);
|
|
|
|
|
|
|
|
///
|
|
|
|
void init();
|
|
|
|
|
2006-06-28 08:28:16 +00:00
|
|
|
/// Available keys
|
2007-03-25 01:32:12 +00:00
|
|
|
QStringListModel * available() { return &available_model_; }
|
2006-03-25 21:26:09 +00:00
|
|
|
|
2006-06-28 08:28:16 +00:00
|
|
|
/// Selected keys
|
2007-03-25 01:32:12 +00:00
|
|
|
QStringListModel * selected() { return &selected_model_; }
|
2006-04-05 23:56:29 +00:00
|
|
|
|
2006-06-28 08:28:16 +00:00
|
|
|
/// Text before cite
|
2006-04-11 08:26:43 +00:00
|
|
|
QString textBefore();
|
2006-06-28 08:28:16 +00:00
|
|
|
|
|
|
|
/// Text after cite
|
2006-04-11 08:26:43 +00:00
|
|
|
QString textAfter();
|
|
|
|
|
2006-06-28 08:28:16 +00:00
|
|
|
/// Get key description
|
|
|
|
QString getKeyInfo(QString const &);
|
|
|
|
|
2006-12-15 09:58:44 +00:00
|
|
|
/// Clear selected keys
|
|
|
|
void clearSelection();
|
|
|
|
|
2007-03-25 01:32:12 +00:00
|
|
|
/// Find keys containing a string.
|
|
|
|
void findKey(
|
|
|
|
QString const & str, //< string expression
|
|
|
|
bool only_keys, //< set to true if only keys shall be searched.
|
|
|
|
bool case_sensitive, //< set to true for case sensitive search.
|
|
|
|
bool reg_exp //< set to true if \c str is a regular expression.
|
|
|
|
);
|
2006-06-28 08:28:16 +00:00
|
|
|
|
|
|
|
/// Add key to selected keys
|
|
|
|
void addKey(QModelIndex const &);
|
|
|
|
|
|
|
|
/// Delete key from selected keys
|
|
|
|
void deleteKey(QModelIndex const &);
|
2006-03-25 21:26:09 +00:00
|
|
|
|
2006-06-28 08:28:16 +00:00
|
|
|
/// Move selected key one place up
|
|
|
|
void upKey(QModelIndex const &);
|
2006-03-25 21:26:09 +00:00
|
|
|
|
2006-06-28 08:28:16 +00:00
|
|
|
/// Move selected key one place down
|
|
|
|
void downKey(QModelIndex const &);
|
2006-03-25 21:26:09 +00:00
|
|
|
|
2006-06-28 08:28:16 +00:00
|
|
|
/// List of example cite strings
|
|
|
|
QStringList citationStyles(int);
|
2006-04-11 08:26:43 +00:00
|
|
|
|
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,
|
2006-06-28 08:28:16 +00:00
|
|
|
QString before, QString after);
|
2006-04-11 08:26:43 +00:00
|
|
|
|
2007-05-28 22:27:45 +00:00
|
|
|
private:
|
2007-03-25 01:32:12 +00:00
|
|
|
/// available keys.
|
|
|
|
QStringListModel available_model_;
|
|
|
|
|
|
|
|
/// selected keys.
|
|
|
|
QStringListModel selected_model_;
|
2006-03-05 17:24:44 +00:00
|
|
|
|
2007-03-25 01:32:12 +00:00
|
|
|
/// All keys.
|
|
|
|
QStringList all_keys_;
|
2006-03-25 21:26:09 +00:00
|
|
|
|
2007-03-25 01:32:12 +00:00
|
|
|
/// Cited keys.
|
|
|
|
QStringList cited_keys_;
|
2006-03-05 17:24:44 +00:00
|
|
|
};
|
|
|
|
|
2006-04-11 08:26:43 +00:00
|
|
|
|
2006-03-05 17:24:44 +00:00
|
|
|
} // namespace frontend
|
|
|
|
} // namespace lyx
|
|
|
|
|
|
|
|
#endif // QCITATION_H
|