]> git.lyx.org Git - lyx.git/blob - src/frontends/gnome/FormCitation.h
Fixes to insettabular/text + GNOME patch + KDE patch
[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 "support/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
33 /** This class provides an Gnome implementation of the FormCitation Dialog.
34  */
35 class FormCitation : public DialogBase, public noncopyable {
36 public:
37   ///
38   FormCitation(LyXView *, Dialogs *);
39   ///
40   ~FormCitation();
41 private:
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 );
46   
47   /// Update dialog before showing it
48   virtual void update();
49   /// Apply from dialog (modify or create inset)
50   virtual void apply();
51   /// Apply from dialog (modify or create inset)
52   virtual void applySelect();
53   /// Explicitly free the dialog.
54   void free();
55   /// Hide the dialog.
56   void hide();
57   /// Create the dialog if necessary, update it and display it. Not used in this dialog
58   void show() { }
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();
65   
66   /// sort biblist
67   void sortBibList(gint);
68   /// update state of the buttons
69   void updateButtons();
70   /// clist selection/unselection callback
71   void selection_toggled(gint            row,
72                          gint            column,
73                          GdkEvent       *event,
74                          bool selected,
75                          bool citeselected);
76   /// adds new citation key
77   void newCitation();
78   /// removes selected citation key
79   void removeCitation();
80   /// moves citation up
81   void moveCitationUp();
82   /// moves citation up
83   void moveCitationDown();
84   /// searches for entries
85   void search();
86   void searchReg();
87   void searchSimple();
88
89   /// add item to the list 
90   void addItemToBibList(int i);
91
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.
95   */
96   LyXView * lv_;
97   /** Which Dialogs do we belong to?
98       Used so we can get at the signals we have to connect to.
99   */
100   Dialogs * d_;
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.
106   Connection u_;
107   /// Hide connection.
108   Connection h_;
109   /// inset::hide connection.
110   Connection ih_;
111
112   /// Real GUI implementation.
113   Gtk::Container * dialog_;
114   Gtk::Button * b_ok;
115   Gtk::Button * b_cancel;
116
117   Gnome::Entry * search_text_;
118   string search_string_;
119   bool use_regexp_;
120
121   Gnome::Less * info_;
122   Gnome::Entry * text_after_;
123
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_;
129   
130   Gtk::CList * clist_selected_;
131   Gtk::CList * clist_bib_;
132   
133   Gtk::Paned * paned_info_;
134   Gtk::Paned * paned_key_;
135   Gtk::Box * box_keys_;
136   
137   std::vector<string> bibkeys;
138   ///
139   std::vector<string> bibkeysInfo;
140 };
141
142 #endif