#ifndef QCITATION_H
#define QCITATION_H
-#include "QDialogView.h"
+#include "ControlCitation.h"
#include <QStringListModel>
namespace lyx {
namespace frontend {
-class ControlCitation;
-class QCitationDialog;
-
-
-class QCitation : public QController<ControlCitation, QView<QCitationDialog> >
+class QCitation : public ControlCitation
{
public:
- friend class QCitationDialog;
///
QCitation(Dialog &);
-
- QStringListModel * available()
+ /// Available keys
+ QStringListModel * available()
{ return &available_keys_; }
- QStringListModel * selected()
+ /// Selected keys
+ QStringListModel * selected()
{ return &selected_keys_; }
- QStringListModel * found()
+ /// Found keys
+ QStringListModel * found()
{ return &found_keys_; }
-
- 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);
+ /// Text before cite
+ QString textBefore();
-protected:
- virtual bool isValid();
+ /// Text after cite
+ QString textAfter();
+
+ /// Get key description
+ QString getKeyInfo(QString const &);
+
+ /// Find keys containing the string (not case-sens)
+ void findKey(QString const &);
+
+ /// Add key to selected keys
+ void addKey(QModelIndex const &);
-private:
+ /// Delete key from selected keys
+ void deleteKey(QModelIndex const &);
+
+ /// Move selected key one place up
+ void upKey(QModelIndex const &);
+
+ /// Move selected key one place down
+ void downKey(QModelIndex const &);
+
+ /// List of example cite strings
+ QStringList citationStyles(int);
+
+ /// Check whether there are keys to select
+ virtual bool isValid();
/// Set the Params variable for the Controller.
- virtual void apply();
- /// Build the dialog.
- virtual void build_dialog();
- /// Hide the dialog.
- virtual void hide();
+ virtual void apply(int const choice, bool const full, bool const force,
+ QString before, QString after);
+
/// Update dialog before/whilst showing it.
- virtual void update_contents();
+ virtual void updateModel();
+private:
/// available keys
QStringListModel available_keys_;
QStringListModel found_keys_;
};
+
} // namespace frontend
} // namespace lyx