*
* \author Angus Leeming
* \author Kalle Dalheimer
+ * \author Abdelrazak Younes
*
* Full author contact details are available in file CREDITS.
*/
#ifndef QCITATION_H
#define QCITATION_H
-#include "QDialogView.h"
+#include "frontends/controllers/ControlCitation.h"
+#include <QStringList>
#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 &);
+ virtual ~QCitation() {}
+ virtual bool initialiseParams(std::string const & data);
- QStringListModel * available()
- { return &available_keys_; }
+ ///
+ void init();
- QStringListModel * selected()
- { return &selected_keys_; }
+ /// Available keys
+ QStringListModel * available() { return &available_model_; }
- QStringListModel * found()
- { return &found_keys_; }
+ /// Selected keys
+ QStringListModel * selected() { return &selected_model_; }
- QModelIndex findKey(QString const & str, QModelIndex const & index) const;
- QModelIndex findKey(QString const & str) const;
+ /// Text before cite
+ QString textBefore();
- void addKeys(QModelIndexList const & indexes);
- void deleteKeys(QModelIndexList const & indexes);
- void upKey(QModelIndexList const & indexes);
- void downKey(QModelIndexList const & indexes);
+ /// Text after cite
+ QString textAfter();
-protected:
- virtual bool isValid();
+ /// Get key description
+ QString getKeyInfo(QString const &);
-private:
+ /// Clear selected keys
+ void clearSelection();
+
+ /// 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.
+ );
+
+ /// Add key to selected keys
+ void addKey(QModelIndex const &);
+
+ /// 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);
/// Set the Params variable for the Controller.
- virtual void apply();
- /// Build the dialog.
- virtual void build_dialog();
- /// Hide the dialog.
- virtual void hide();
- /// Update dialog before/whilst showing it.
- virtual void update_contents();
-
- /// available keys
- QStringListModel available_keys_;
-
- /// selected keys
- QStringListModel selected_keys_;
-
- /// found keys
- QStringListModel found_keys_;
+ virtual void apply(int const choice, bool const full, bool const force,
+ QString before, QString after);
+
+private:
+ /// available keys.
+ QStringListModel available_model_;
+
+ /// selected keys.
+ QStringListModel selected_model_;
+
+ /// All keys.
+ QStringList all_keys_;
+
+ /// Cited keys.
+ QStringList cited_keys_;
};
+
} // namespace frontend
} // namespace lyx