]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/qt4/GuiCitation.h
Compil fix.
[lyx.git] / src / frontends / qt4 / GuiCitation.h
index a3f6351024e2444bded1debf1f38bcf3bc9305c0..6d7273dbc6d5c05f068af38a7d0253e94baf8c04 100644 (file)
 #ifndef GUICITATION_H
 #define GUICITATION_H
 
-#include "GuiDialog.h"
-#include "GuiSelectionManager.h"
+#include "DialogView.h"
 #include "ui_CitationUi.h"
 
-#include "BiblioInfo.h"
-#include "Citation.h"
-
 #include "insets/InsetCommandParams.h"
 
+#include "Citation.h"
+
 #include <QStringList>
 #include <QStringListModel>
 
 namespace lyx {
+
+class BiblioInfo;
+
 namespace frontend {
 
-class GuiCitation : public GuiDialog, public Ui::CitationUi
+class GuiSelectionManager;
+
+class GuiCitation : public DialogView, public Ui::CitationUi
 {
        Q_OBJECT
 
 public:
        ///
        GuiCitation(GuiView & lv);
-
        ///
-       void applyView();
-
-public Q_SLOTS:
-       /// Update the display of the dialog whilst it is still visible.
-       void updateView();
-
-private:
-       ///
-       void showEvent(QShowEvent * e);
-       ///
-       void closeEvent(QCloseEvent * e);
-       /// prepares a call to GuiCitation::searchKeys when we
-       /// are ready to search the BibTeX entries
-       void findText(QString const & text, bool reset = false);
-       /// check whether key is already selected
-       bool isSelected(const QModelIndex &);
-       /// update the display of BibTeX information
-       void updateInfo(QModelIndex const &);
+       ~GuiCitation();
 
 private Q_SLOTS:
        void cleanUp();
@@ -76,9 +61,37 @@ private Q_SLOTS:
        ///
        void setCitedKeys();
        /// performs a limited update, suitable for internal call
-       void updateDialog();
+       void updateControls();
        
+
 private:
+       /// Dialog inherited methods
+       //@{
+       void applyView();
+       void updateView() {}
+       bool initialiseParams(std::string const & data);
+       void clearParams();
+       void dispatchParams();
+       bool isBufferDependent() const { return true; }
+       void saveSession() const;
+       void restoreSession();
+       /** Disconnect from the inset when the Apply button is pressed.
+        *  Allows easy insertion of multiple citations.
+        */
+       bool disconnectOnApply() const { return true; }
+       //@}
+
+       ///
+       void showEvent(QShowEvent * e);
+       ///
+       void closeEvent(QCloseEvent * e);
+       /// prepares a call to GuiCitation::searchKeys when we
+       /// are ready to search the BibTeX entries
+       void findText(QString const & text, bool reset = false);
+       /// check whether key is already selected
+       bool isSelected(const QModelIndex &);
+       /// update the display of BibTeX information
+       void updateInfo(QModelIndex const &);
        /// enable/disable buttons
        void setButtons();
        /// fill the styles combo
@@ -91,29 +104,10 @@ private:
        void updateStyle();
        /// set the formatting widgets
        void updateFormatting(CiteStyle currentStyle);
-       /// last used citation style
-       int style_;
-       
-       GuiSelectionManager * selectionManager;
-
        ///
        void init();
-       /// Available keys
-       QStringListModel * available() { return &available_model_; }
-       /// Selected keys
-       QStringListModel * selected() { return &selected_model_; }
-       /// Text before cite
-       QString textBefore();
-       /// Text after cite
-       QString textAfter();
-       /// Get key description
-       QString getKeyInfo(QString const &);
        /// Clear selected keys
        void clearSelection();
-       /// Return a list of available fields 
-       QStringList getFieldsAsQStringList();
-       /// Return a list of available fields 
-       QStringList getEntriesAsQStringList();
        
        /// Find keys containing a string.
        void findKey(
@@ -132,47 +126,13 @@ private:
        /// Set the Params variable for the Controller.
        void apply(int const choice, bool const full, bool const force,
                                          QString before, QString after);
-       ///
-       bool initialiseParams(std::string const & data);
-       /// clean-up on hide.
-       void clearParams();
-       /// clean-up on hide.
-       void dispatchParams();
-       ///
-       bool isBufferDependent() const { return true; }
 
-private:
-       /// available keys.
-       QStringListModel available_model_;
-       /// selected keys.
-       QStringListModel selected_model_;
-       /// All keys.
-       QStringList all_keys_;
-       /// Cited keys.
-       QStringList cited_keys_;
-       ///
-       InsetCommandParams params_;
-
-       /** Disconnect from the inset when the Apply button is pressed.
-        *  Allows easy insertion of multiple citations.
-        */
-       bool disconnectOnApply() const { return true; }
-
-       /// \return the list of all available bibliography keys.
-       std::vector<docstring> availableKeys() const;
-       /// \return the list of all used BibTeX fields
-       std::vector<docstring> availableFields() const;
-       /// \return the list of all used BibTeX entry types
-       std::vector<docstring> availableEntries() const;
        ///
        void filterByEntryType(
                std::vector<docstring> & keyVector, docstring entryType);
        ///
        CiteEngine citeEngine() const;
 
-       /// \return information for this key.
-       docstring getInfo(docstring const & key) const;
-
        /// Search a given string within the passed keys.
        /// \return the vector of matched keys.
        std::vector<docstring> searchKeys(
@@ -184,9 +144,23 @@ private:
                bool regex = false //< \set to true if \c search_expression is a regex
                ); //
 
-private:
        /// The BibTeX information available to the dialog
        BiblioInfo const & bibInfo() const;
+
+       /// last used citation style
+       int style_;
+       ///
+       GuiSelectionManager * selectionManager;
+       /// available keys.
+       QStringListModel available_model_;
+       /// selected keys.
+       QStringListModel selected_model_;
+       /// All keys.
+       QStringList all_keys_;
+       /// Cited keys.
+       QStringList cited_keys_;
+       ///
+       InsetCommandParams params_;
 };
 
 } // namespace frontend