4 * This file is part of LyX, the document processor.
5 * Licence details can be found in the file COPYING.
7 * \author Bernhard Reiter
9 * Full author contact details are available in file CREDITS.
15 #include "GViewBase.h"
17 #include "ControlCitation.h"
19 #include "bufferparams.h"
25 class ControlCitation;
27 /** This class provides a GTK+ implementation of the Citation Dialog.
29 class GCitation : public GViewCB<ControlCitation, GViewGladeB> {
31 GCitation(Dialog & parent);
34 virtual void doBuild();
35 virtual void update();
37 /// Update dialog before/whilst showing it.
38 virtual void update_contents();
40 /// fill the styles combo
43 /// set the styles combo
46 /// enable the apply button if applylock_ is false
49 /// Move selected inset key up one line in list
51 /// Move selected inset key down one line in list
54 /// Add bibliography key to inset key list, remove it from bibliography view
56 /// Remove inset key from list, move it back to bibliography key view
59 /// Find previous occurence of search string in selected key view
61 /// Find next occurence of search string in selected key view
63 /// Find function, called by previous() and next()
64 void find(biblio::Direction);
66 /// Called when inset key is (un)selected
68 /// Called when bibliography key is (un)selected
71 /** Set previous and next buttons according to state of the search
72 string entry, the radio buttons and the selected keys in the inset
73 and bibliography views.
75 inline void set_search_buttons();
77 /** Helper function for bibFilter_; true if argument's
78 [bibColumns.cite] is false.
80 static inline bool bib_visible(const Gtk::TreeModel::const_iterator&);
82 /// Handle adding a bib key by double clicking
83 void bibkeysview_activated(const Gtk::TreeModel::Path&, Gtk::TreeViewColumn*);
85 /** apply() won't act when this is true.
86 true if no text is selected when the citation dialog is opened
90 /// Last selected stylecombo_ item
93 Gtk::Button * restorebutton_;
94 Gtk::Button * cancelbutton_;
95 Gtk::Button * okbutton_;
96 Gtk::Button * applybutton_;
98 Gtk::Button * addbutton_;
99 Gtk::Button * removebutton_;
100 Gtk::Button * backbutton_;
101 Gtk::Button * forwardbutton_;
102 Gtk::Button * upbutton_;
103 Gtk::Button * downbutton_;
105 Gtk::TreeView * citekeysview_;
106 Gtk::TreeView * bibkeysview_;
108 Gtk::TextView * infoview_;
110 Gtk::Entry * findentry_;
111 Gtk::CheckButton * citeradio_;
112 Gtk::CheckButton * bibradio_;
113 Gtk::CheckButton * casecheck_;
114 Gtk::CheckButton * regexpcheck_;
116 Gtk::Label * stylelabel_;
117 Gtk::ComboBox * stylecombo_;
119 Gtk::Label * beforelabel_;
120 Gtk::Entry * beforeentry_;
121 Gtk::Entry * afterentry_;
122 Gtk::CheckButton * authorcheck_;
123 Gtk::CheckButton * uppercasecheck_;
125 Glib::RefPtr<Gtk::TextBuffer> info_;
127 Glib::RefPtr<Gtk::ListStore> allListStore_;
128 Glib::RefPtr<Gtk::ListStore> styleStore_;
130 Glib::RefPtr<Gtk::TreeSelection> citeselection_;
131 Glib::RefPtr<Gtk::TreeSelection> bibselection_;
133 Glib::RefPtr<Gtk::TreeModelFilter> citeFilter_;
134 Glib::RefPtr<Gtk::TreeModelFilter> bibFilter_;
135 Glib::RefPtr<Gtk::TreeModelSort> bibSort_;
139 } // namespace frontend
142 #endif // GCITATION_H