4 * This file is part of LyX, the document processor.
5 * Licence details can be found in the file COPYING.
7 * \author Angus Leeming
8 * \author Kalle Dalheimer
10 * Full author contact details are available in file CREDITS.
16 #include "ControlCitation.h"
18 #include <QStringListModel>
23 class QCitation : public ControlCitation
29 QStringListModel * available()
30 { return &available_keys_; }
32 QStringListModel * selected()
33 { return &selected_keys_; }
35 QStringListModel * found()
36 { return &found_keys_; }
41 QModelIndex findKey(QString const & str, QModelIndex const & index) const;
42 QModelIndex findKey(QString const & str) const;
44 void addKeys(QModelIndexList const & indexes);
45 void deleteKeys(QModelIndexList const & indexes);
46 void upKey(QModelIndexList const & indexes);
47 void downKey(QModelIndexList const & indexes);
49 QStringList citationStyles(int sel);
52 virtual bool isValid();
54 /// Set the Params variable for the Controller.
55 virtual void apply(int const choice, bool const full, bool const force,
56 QString before, QString After);
58 /// Update dialog before/whilst showing it.
59 virtual void updateModel();
63 QStringListModel available_keys_;
66 QStringListModel selected_keys_;
69 QStringListModel found_keys_;
74 /** A controller for Citation dialogs.
82 virtual bool initialiseParams(std::string const & data);
85 virtual void clearParams();
87 /** Disconnect from the inset when the Apply button is pressed.
88 * Allows easy insertion of multiple citations.
90 virtual bool disconnectOnApply() const { return true; }
92 /// Returns a reference to the map of stored keys
93 biblio::InfoMap const & bibkeysInfo() const;
96 biblio::CiteEngine_enum getEngine() const;
98 /// Possible citations based on this key
99 std::vector<std::string> const getCiteStrings(std::string const & key) const;
101 /// available CiteStyle-s (depends on availability of Natbib/Jurabib)
102 static std::vector<biblio::CiteStyle> const & getCiteStyles() {
106 /// The info associated with each key
107 biblio::InfoMap bibkeysInfo_;
110 static std::vector<biblio::CiteStyle> citeStyles_;
113 } // namespace frontend
116 #endif // QCITATION_H