]> git.lyx.org Git - lyx.git/blob - src/frontends/gnome/FormCitation.h
try this for distinguishing inner and outer tabs
[lyx.git] / src / frontends / gnome / FormCitation.h
1 // -*- C++ -*-
2 /* This file is part of
3  * ====================================================== 
4  *
5  *           LyX, The Document Processor
6  *
7  *           Copyright 2000 The LyX Team.
8  *
9  * ======================================================
10  */
11
12 #ifndef FORMCITATION_H
13 #define FORMCITATION_H
14
15 #ifdef __GNUG__
16 #pragma interface
17 #endif
18
19 #include "DialogBase.h"
20 #include "LString.h"
21 #include "boost/utility.hpp"
22 #include "insets/insetcommand.h"
23
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"
33
34 /** This class provides an Gnome implementation of the FormCitation Dialog.
35  */
36 class FormCitation : public DialogBase, public noncopyable {
37 public:
38   ///
39   FormCitation(LyXView *, Dialogs *);
40   ///
41   ~FormCitation();
42 private:
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 );
47
48   virtual void update() { }
49   virtual void updateSlot(bool = false);
50   /// The following two methods do nothing in this implementation
51   virtual void apply() { }
52   void show() { }
53
54   /// Explicitly free the dialog.
55   void free();
56   /// Hide the dialog.
57   void hide();
58
59   /// Apply from dialog (modify or create inset)
60   void applySelect();
61   /// Apply from dialog (modify or create inset)
62   void applyEdit();
63
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
71   void showStageEdit();
72
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();
79   
80   /// sort biblist
81   void sortBibList(gint);
82   /// update state of the buttons
83   void updateButtons();
84   /// clist selection/unselection callback
85   void selectionToggled(gint            row,
86                         gint            column,
87                         GdkEvent       *event,
88                         bool selected,
89                         bool citeselected);
90
91   /// removes selected citation key
92   void removeCitation();
93   /// moves citation up
94   void moveCitationUp();
95   /// moves citation up
96   void moveCitationDown();
97
98   /// searches for entries (calls searchReg or searchSimple)
99   void search();
100   /// searches for entries using regexp
101   void searchReg();
102   /// searches for entries containing keyword(s)
103   void searchSimple();
104
105   /// adds item to clist_bib_
106   void addItemToBibList(int i);
107
108   /// sets all widget pointers to 0
109   void cleanupWidgets();
110   /// initializes all non-0 member widgets
111   void initWidgets();
112   /// stores configuration of all non-0 member widgets
113   void storeWidgets();
114   
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.
118   */
119   LyXView * lv_;
120   /** Which Dialogs do we belong to?
121       Used so we can get at the signals we have to connect to.
122   */
123   Dialogs * d_;
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.
129   Connection u_;
130   /// Hide connection.
131   Connection h_;
132   /// inset::hide connection.
133   Connection ih_;
134
135   /// Real GUI implementation.
136   Gtk::Container * dialog_;
137   Gtk::Button * b_ok;
138   Gtk::Button * b_cancel;
139
140   Gnome::Entry * search_text_;
141   string search_string_;
142   bool use_regexp_;
143
144   Gnome::Less * info_;
145   Gnome::Entry * text_after_;
146
147   Gnome::PixButton * button_unselect_;
148   Gnome::PixButton * button_up_;
149   Gnome::PixButton * button_down_;
150   Gtk::CheckButton * button_regexp_;
151   
152   Gtk::CList * clist_selected_;
153   Gtk::CList * clist_bib_;
154   
155   Gtk::Paned * paned_info_;
156   
157   std::vector<string> bibkeys;
158   ///
159   std::vector<string> bibkeysInfo;
160 };
161
162 #endif