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 "boost/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 virtual void update() { }
49 virtual void updateSlot(bool = false);
50 /// The following two methods do nothing in this implementation
51 virtual void apply() { }
54 /// Explicitly free the dialog.
59 /// Apply from dialog (modify or create inset)
61 /// Apply from dialog (modify or create inset)
64 /// Ask user for requested action: add new citation or edit the existing ones
65 void showStageAction();
66 /// Ask user for regexp or keyword(s)
67 void showStageSearch();
68 /// Ask user to select the citation in the list
69 void showStageSelect();
70 /// Ask user to edit the citation in the list
73 /// moves from Search to Select "stage"
74 void moveFromSearchToSelect();
75 /// moves from Action to Search "stage"
76 void moveFromActionToSearch();
77 /// moves from Action to Edit "stage"
78 void moveFromActionToEdit();
81 void sortBibList(gint);
82 /// update state of the buttons
84 /// clist selection/unselection callback
85 void selectionToggled(gint row,
91 /// removes selected citation key
92 void removeCitation();
94 void moveCitationUp();
96 void moveCitationDown();
98 /// searches for entries (calls searchReg or searchSimple)
100 /// searches for entries using regexp
102 /// searches for entries containing keyword(s)
105 /// adds item to clist_bib_
106 void addItemToBibList(int i);
108 /// sets all widget pointers to 0
109 void cleanupWidgets();
110 /// initializes all non-0 member widgets
112 /// stores configuration of all non-0 member widgets
115 /** Which LyXFunc do we use?
116 We could modify Dialogs to have a visible LyXFunc* instead and
117 save a couple of bytes per dialog.
120 /** Which Dialogs do we belong to?
121 Used so we can get at the signals we have to connect to.
124 /// pointer to the inset passed through showInset (if any)
125 InsetCommand * inset_;
126 /// the nitty-griity. What is modified and passed back
127 InsetCommandParams params;
128 /// Update connection.
132 /// inset::hide connection.
135 /// Real GUI implementation.
136 Gtk::Container * dialog_;
138 Gtk::Button * b_cancel;
140 Gnome::Entry * search_text_;
141 string search_string_;
145 Gnome::Entry * text_after_;
147 Gnome::PixButton * button_unselect_;
148 Gnome::PixButton * button_up_;
149 Gnome::PixButton * button_down_;
150 Gtk::CheckButton * button_regexp_;
152 Gtk::CList * clist_selected_;
153 Gtk::CList * clist_bib_;
155 Gtk::Paned * paned_info_;
157 std::vector<string> bibkeys;
159 std::vector<string> bibkeysInfo;