3 * Copyright 2001 the LyX Team
4 * Read the file COPYING
10 #define FORMCITATION_H
13 #include <boost/smart_ptr.hpp>
20 #include "ButtonPolicies.h"
24 class ControlCitation;
27 class FormCitation : public ViewBC<kdeBC> {
29 FormCitation(ControlCitation &);
31 /// Functions accessible to the Controller.
33 /// Set the Params variable for the Controller.
35 /// Set the Params variable for the Controller.
39 /// Update dialog before/whilst showing it.
40 virtual void update();
41 /// Create the dialog if necessary, update it and display it.
45 ButtonPolicy::SMInput add();
47 ButtonPolicy::SMInput remove();
49 ButtonPolicy::SMInput up();
51 ButtonPolicy::SMInput down();
52 /// a key has been highlighted
53 void highlight_key(char const * key);
54 /// a chosen key has been highlighted
55 void highlight_chosen(char const * key);
56 /// a key has been double-clicked
57 ButtonPolicy::SMInput select_key(char const * key);
60 /// The parent controller
61 ControlCitation & controller() const;
62 /// update add,remove,up,down
64 /// update the available keys list
65 void updateAvailableList();
66 /// update the chosen keys list
67 void updateChosenList();
68 /// select the currently chosen key
70 /// does the dirty work for highlight_key(), highlight_chosen()
71 void highlight(char const *, QListBox *, string &, string &);
72 /// does the dirty work for updateAvailableList(), updateChosenList()
73 void updateList(QListBox *, std::vector<string> const &);
75 /// Real GUI implementation.
76 boost::scoped_ptr<CitationDialog> dialog_;
78 /// available citation keys
79 std::vector<string> keys;
80 /// chosen citation keys
81 std::vector<string> chosenkeys;
83 /// currently selected key
86 /// currently selected chosen key
87 string selectedChosenKey;
90 #endif // FORMCITATION_H