2 /* This file is part of
3 * ======================================================
5 * LyX, The Document Processor
7 * Copyright 2000 The LyX Team.
9 * ======================================================
12 #ifndef FORMCITATION_H
13 #define FORMCITATION_H
19 #include "DialogBase.h"
21 #include "support/utility.hpp"
22 #include "insets/insetcommand.h"
24 #include <gtk--/container.h>
25 #include <gtk--/clist.h>
26 #include <gnome--/entry.h>
27 #include <gnome--/less.h>
28 #include <gtk--/button.h>
29 #include <gtk--/paned.h>
30 #include <gtk--/box.h>
31 #include <gtk--/checkbutton.h>
33 /** This class provides an Gnome implementation of the FormCitation Dialog.
35 class FormCitation : public DialogBase, public noncopyable {
38 FormCitation(LyXView *, Dialogs *);
42 /// Slot launching dialog to (possibly) create a new inset
43 void createInset( string const & );
44 /// Slot launching dialog to an existing inset
45 void showInset( InsetCommand * const );
47 /// Update dialog before showing it
48 virtual void update();
49 /// Apply from dialog (modify or create inset)
51 /// Apply from dialog (modify or create inset)
52 virtual void applySelect();
53 /// Explicitly free the dialog.
57 /// Create the dialog if necessary, update it and display it. Not used in this dialog
59 /// Ask user for regexp or keyword(s)
60 void showStageSearch();
61 /// Ask user to select the citation in the list
62 void showStageSelect();
63 /// moves from Search to Select "stage"
64 void moveFromSearchToSelect();
67 void sortBibList(gint);
68 /// update state of the buttons
70 /// clist selection/unselection callback
71 void selection_toggled(gint row,
76 /// adds new citation key
78 /// removes selected citation key
79 void removeCitation();
81 void moveCitationUp();
83 void moveCitationDown();
84 /// searches for entries
89 /// add item to the list
90 void addItemToBibList(int i);
92 /** Which LyXFunc do we use?
93 We could modify Dialogs to have a visible LyXFunc* instead and
94 save a couple of bytes per dialog.
97 /** Which Dialogs do we belong to?
98 Used so we can get at the signals we have to connect to.
101 /// pointer to the inset passed through showInset (if any)
102 InsetCommand * inset_;
103 /// the nitty-griity. What is modified and passed back
104 InsetCommandParams params;
105 /// Update connection.
109 /// inset::hide connection.
112 /// Real GUI implementation.
113 Gtk::Container * dialog_;
115 Gtk::Button * b_cancel;
117 Gnome::Entry * search_text_;
118 string search_string_;
122 Gnome::Entry * text_after_;
124 Gtk::Button * button_select_;
125 Gtk::Button * button_unselect_;
126 Gtk::Button * button_up_;
127 Gtk::Button * button_down_;
128 Gtk::CheckButton * button_regexp_;
130 Gtk::CList * clist_selected_;
131 Gtk::CList * clist_bib_;
133 Gtk::Paned * paned_info_;
134 Gtk::Paned * paned_key_;
135 Gtk::Box * box_keys_;
137 std::vector<string> bibkeys;
139 std::vector<string> bibkeysInfo;