]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/gnome/FormCitation.h
small patch from Dekel, begin introducing the real boost framework, get rid of the...
[lyx.git] / src / frontends / gnome / FormCitation.h
index c55838aada5e73e6f995dcb1c7b18ec94462d308..9c6c8c5072695114f8c69ceb0db54527fb96da18 100644 (file)
 #include "support/utility.hpp"
 #include "insets/insetcommand.h"
 
-#include <gtk--/widget.h>
+#include <gtk--/container.h>
 #include <gtk--/clist.h>
 #include <gnome--/entry.h>
 #include <gnome--/less.h>
 #include <gtk--/button.h>
 #include <gtk--/paned.h>
 #include <gtk--/box.h>
+#include <gtk--/checkbutton.h>
+#include "pixbutton.h"
 
 /** This class provides an Gnome implementation of the FormCitation Dialog.
  */
@@ -42,42 +44,73 @@ private:
   void createInset( string const & );
   /// Slot launching dialog to an existing inset
   void showInset( InsetCommand * const );
-  
-  /// Update dialog before showing it
-  virtual void update();
-  /// Apply from dialog (modify or create inset)
-  virtual void apply();
+
+  /// The following three methods do nothing in this implementation
+  virtual void update() { }
+  virtual void apply() { }
+  void show() { }
+
   /// Explicitly free the dialog.
   void free();
-  /// Create the dialog if necessary, update it and display it.
-  void show();
   /// Hide the dialog.
   void hide();
 
+  /// Apply from dialog (modify or create inset)
+  void applySelect();
+  /// Apply from dialog (modify or create inset)
+  void applyEdit();
+
+  /// Ask user for requested action: add new citation or edit the existing ones
+  void showStageAction();
+  /// Ask user for regexp or keyword(s)
+  void showStageSearch();
+  /// Ask user to select the citation in the list
+  void showStageSelect();
+  /// Ask user to edit the citation in the list
+  void showStageEdit();
+
+  /// moves from Search to Select "stage"
+  void moveFromSearchToSelect();
+  /// moves from Action to Search "stage"
+  void moveFromActionToSearch();
+  /// moves from Action to Edit "stage"
+  void moveFromActionToEdit();
+  
   /// sort biblist
   void sortBibList(gint);
   /// update state of the buttons
   void updateButtons();
   /// clist selection/unselection callback
-  void selection_toggled(gint            row,
-                        gint            column,
-                        GdkEvent       *event,
-                        bool selected,
-                        bool citeselected);
-  /// adds new citation key
-  void newCitation();
+  void selectionToggled(gint            row,
+                       gint            column,
+                       GdkEvent       *event,
+                       bool selected,
+                       bool citeselected);
+
   /// removes selected citation key
   void removeCitation();
   /// moves citation up
   void moveCitationUp();
   /// moves citation up
   void moveCitationDown();
-  /// searches for entries
+
+  /// searches for entries (calls searchReg or searchSimple)
   void search();
+  /// searches for entries using regexp
+  void searchReg();
+  /// searches for entries containing keyword(s)
+  void searchSimple();
 
-  /// add item to the list 
+  /// adds item to clist_bib_
   void addItemToBibList(int i);
 
+  /// sets all widget pointers to NULL
+  void cleanupWidgets();
+  /// initializes all non-NULL member widgets
+  void initWidgets();
+  /// stores configuration of all non-NULL member widgets
+  void storeWidgets();
+  
   /** Which LyXFunc do we use?
       We could modify Dialogs to have a visible LyXFunc* instead and
       save a couple of bytes per dialog.
@@ -99,27 +132,26 @@ private:
   Connection ih_;
 
   /// Real GUI implementation.
-  Gtk::Widget * dialog_;
+  Gtk::Container * dialog_;
   Gtk::Button * b_ok;
   Gtk::Button * b_cancel;
 
-  Gnome::Less * info_;
-  Gnome::Entry * text_after_;
-
   Gnome::Entry * search_text_;
+  string search_string_;
+  bool use_regexp_;
 
-  Gtk::Button * button_select_;
-  Gtk::Button * button_unselect_;
-  Gtk::Button * button_up_;
-  Gtk::Button * button_down_;
-  Gtk::Button * button_search_;
+  Gnome::Less * info_;
+  Gnome::Entry * text_after_;
 
+  Gnome::PixButton * button_unselect_;
+  Gnome::PixButton * button_up_;
+  Gnome::PixButton * button_down_;
+  Gtk::CheckButton * button_regexp_;
+  
   Gtk::CList * clist_selected_;
   Gtk::CList * clist_bib_;
   
   Gtk::Paned * paned_info_;
-  Gtk::Paned * paned_key_;
-  Gtk::Box * box_keys_;
   
   std::vector<string> bibkeys;
   ///