]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/qt4/QCitation.h
rename LFUN enum values according to their command (as used in th minibuffer/bind...
[lyx.git] / src / frontends / qt4 / QCitation.h
index f41052dae6fb893789ec766fe8a7277ba96a8561..b018bc3a6d33a9a21a40acd9955d45c8dd123713 100644 (file)
 #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 &);
 
@@ -40,6 +35,9 @@ public:
        QStringListModel * found()
        { return &found_keys_; }
 
+       QString textBefore();
+       QString textAfter();
+
        QModelIndex findKey(QString const & str, QModelIndex const & index) const;
        QModelIndex findKey(QString const & str) const;
 
@@ -48,20 +46,19 @@ public:
        void upKey(QModelIndexList const & indexes);
        void downKey(QModelIndexList const & indexes);
 
-protected:
-       virtual bool isValid();
+       QStringList citationStyles(int sel);
 
-private:
+
+       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_;
 
@@ -72,6 +69,47 @@ private:
        QStringListModel found_keys_;
 };
 
+
+/** 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_;
+};
+*/
 } // namespace frontend
 } // namespace lyx