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>
32 #include "pixbutton.h"
34 /** This class provides an Gnome implementation of the FormCitation Dialog.
36 class FormCitation : public DialogBase, public noncopyable {
39 FormCitation(LyXView *, Dialogs *);
43 /// Slot launching dialog to (possibly) create a new inset
44 void createInset( string const & );
45 /// Slot launching dialog to an existing inset
46 void showInset( InsetCommand * const );
48 /// The following three methods do nothing in this implementation
49 virtual void update() { }
50 virtual void apply() { }
53 /// Explicitly free the dialog.
58 /// Apply from dialog (modify or create inset)
60 /// Apply from dialog (modify or create inset)
63 /// Ask user for requested action: add new citation or edit the existing ones
64 void showStageAction();
65 /// Ask user for regexp or keyword(s)
66 void showStageSearch();
67 /// Ask user to select the citation in the list
68 void showStageSelect();
69 /// Ask user to edit the citation in the list
72 /// moves from Search to Select "stage"
73 void moveFromSearchToSelect();
74 /// moves from Action to Search "stage"
75 void moveFromActionToSearch();
76 /// moves from Action to Edit "stage"
77 void moveFromActionToEdit();
80 void sortBibList(gint);
81 /// update state of the buttons
83 /// clist selection/unselection callback
84 void selectionToggled(gint row,
90 /// removes selected citation key
91 void removeCitation();
93 void moveCitationUp();
95 void moveCitationDown();
97 /// searches for entries (calls searchReg or searchSimple)
99 /// searches for entries using regexp
101 /// searches for entries containing keyword(s)
104 /// adds item to clist_bib_
105 void addItemToBibList(int i);
107 /// sets all widget pointers to NULL
108 void cleanupWidgets();
109 /// initializes all non-NULL member widgets
111 /// stores configuration of all non-NULL member widgets
114 /** Which LyXFunc do we use?
115 We could modify Dialogs to have a visible LyXFunc* instead and
116 save a couple of bytes per dialog.
119 /** Which Dialogs do we belong to?
120 Used so we can get at the signals we have to connect to.
123 /// pointer to the inset passed through showInset (if any)
124 InsetCommand * inset_;
125 /// the nitty-griity. What is modified and passed back
126 InsetCommandParams params;
127 /// Update connection.
131 /// inset::hide connection.
134 /// Real GUI implementation.
135 Gtk::Container * dialog_;
137 Gtk::Button * b_cancel;
139 Gnome::Entry * search_text_;
140 string search_string_;
144 Gnome::Entry * text_after_;
146 Gnome::PixButton * button_unselect_;
147 Gnome::PixButton * button_up_;
148 Gnome::PixButton * button_down_;
149 Gtk::CheckButton * button_regexp_;
151 Gtk::CList * clist_selected_;
152 Gtk::CList * clist_bib_;
154 Gtk::Paned * paned_info_;
156 std::vector<string> bibkeys;
158 std::vector<string> bibkeysInfo;