]> git.lyx.org Git - lyx.git/blob - src/frontends/gnome/FormCitation.h
John's KDE FormRef 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--/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
32 /** This class provides an Gnome implementation of the FormCitation Dialog.
33  */
34 class FormCitation : public DialogBase, public noncopyable {
35 public:
36   ///
37   FormCitation(LyXView *, Dialogs *);
38   ///
39   ~FormCitation();
40 private:
41   /// Slot launching dialog to (possibly) create a new inset
42   void createInset( string const & );
43   /// Slot launching dialog to an existing inset
44   void showInset( InsetCommand * const );
45   
46   /// Update dialog before showing it
47   virtual void update();
48   /// Apply from dialog (modify or create inset)
49   virtual void apply();
50   /// Explicitly free the dialog.
51   void free();
52   /// Create the dialog if necessary, update it and display it.
53   void show();
54   /// Hide the dialog.
55   void hide();
56
57   /// sort biblist
58   void sortBibList(gint);
59   /// update state of the buttons
60   void updateButtons();
61   /// clist selection/unselection callback
62   void selection_toggled(gint            row,
63                          gint            column,
64                          GdkEvent       *event,
65                          bool selected,
66                          bool citeselected);
67   /// adds new citation key
68   void newCitation();
69   /// removes selected citation key
70   void removeCitation();
71   /// moves citation up
72   void moveCitationUp();
73   /// moves citation up
74   void moveCitationDown();
75   /// searches for entries
76   void search();
77
78   /// add item to the list 
79   void addItemToBibList(int i);
80
81   /** Which LyXFunc do we use?
82       We could modify Dialogs to have a visible LyXFunc* instead and
83       save a couple of bytes per dialog.
84   */
85   LyXView * lv_;
86   /** Which Dialogs do we belong to?
87       Used so we can get at the signals we have to connect to.
88   */
89   Dialogs * d_;
90   /// pointer to the inset passed through showInset (if any)
91   InsetCommand * inset_;
92   /// the nitty-griity. What is modified and passed back
93   InsetCommandParams params;
94   /// Update connection.
95   Connection u_;
96   /// Hide connection.
97   Connection h_;
98   /// inset::hide connection.
99   Connection ih_;
100
101   /// Real GUI implementation.
102   Gtk::Widget * dialog_;
103   Gtk::Button * b_ok;
104   Gtk::Button * b_cancel;
105
106   Gnome::Less * info_;
107   Gnome::Entry * text_after_;
108
109   Gnome::Entry * search_text_;
110
111   Gtk::Button * button_select_;
112   Gtk::Button * button_unselect_;
113   Gtk::Button * button_up_;
114   Gtk::Button * button_down_;
115   Gtk::Button * button_search_;
116
117   Gtk::CList * clist_selected_;
118   Gtk::CList * clist_bib_;
119   
120   Gtk::Paned * paned_info_;
121   Gtk::Paned * paned_key_;
122   Gtk::Box * box_keys_;
123   
124   std::vector<string> bibkeys;
125   ///
126   std::vector<string> bibkeysInfo;
127 };
128
129 #endif