]> git.lyx.org Git - lyx.git/blob - src/frontends/gnome/FormCitation.h
regex patch for gnom from Marko
[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--/widget.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   /// Explicitly free the dialog.
52   void free();
53   /// Create the dialog if necessary, update it and display it.
54   void show();
55   /// Hide the dialog.
56   void hide();
57
58   /// sort biblist
59   void sortBibList(gint);
60   /// update state of the buttons
61   void updateButtons();
62   /// clist selection/unselection callback
63   void selection_toggled(gint            row,
64                          gint            column,
65                          GdkEvent       *event,
66                          bool selected,
67                          bool citeselected);
68   /// adds new citation key
69   void newCitation();
70   /// removes selected citation key
71   void removeCitation();
72   /// moves citation up
73   void moveCitationUp();
74   /// moves citation up
75   void moveCitationDown();
76   /// searches for entries
77   void search();
78   void searchReg();
79   void searchSimple();
80
81   /// add item to the list 
82   void addItemToBibList(int i);
83
84   /** Which LyXFunc do we use?
85       We could modify Dialogs to have a visible LyXFunc* instead and
86       save a couple of bytes per dialog.
87   */
88   LyXView * lv_;
89   /** Which Dialogs do we belong to?
90       Used so we can get at the signals we have to connect to.
91   */
92   Dialogs * d_;
93   /// pointer to the inset passed through showInset (if any)
94   InsetCommand * inset_;
95   /// the nitty-griity. What is modified and passed back
96   InsetCommandParams params;
97   /// Update connection.
98   Connection u_;
99   /// Hide connection.
100   Connection h_;
101   /// inset::hide connection.
102   Connection ih_;
103
104   /// Real GUI implementation.
105   Gtk::Widget * dialog_;
106   Gtk::Button * b_ok;
107   Gtk::Button * b_cancel;
108
109   Gnome::Less * info_;
110   Gnome::Entry * text_after_;
111
112   Gnome::Entry * search_text_;
113
114   Gtk::Button * button_select_;
115   Gtk::Button * button_unselect_;
116   Gtk::Button * button_up_;
117   Gtk::Button * button_down_;
118   Gtk::Button * button_search_;
119   Gtk::CheckButton * button_regexp_;
120   
121   Gtk::CList * clist_selected_;
122   Gtk::CList * clist_bib_;
123   
124   Gtk::Paned * paned_info_;
125   Gtk::Paned * paned_key_;
126   Gtk::Box * box_keys_;
127   
128   std::vector<string> bibkeys;
129   ///
130   std::vector<string> bibkeysInfo;
131 };
132
133 #endif