]> git.lyx.org Git - lyx.git/blob - src/frontends/xforms/FormCitation.h
noncopyable + read ChangeLog
[lyx.git] / src / frontends / xforms / 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 #include <vector>
16
17 #include "DialogBase.h"
18 #include "LString.h"
19 #include "support/utility.hpp"
20
21 #ifndef __GNUG__
22 #pragma interface
23 #endif
24
25 class Dialogs;
26 // same arguement as in Dialogs.h s/LyX/UI/
27 class LyXView;
28 class InsetCitation;
29 struct FD_form_citation;
30
31 /** This class provides an XForms implementation of the FormCitation Dialog.
32  */
33 class FormCitation : public DialogBase, public noncopyable {
34 public:
35         ///
36         enum State {
37                 DOWN,
38                 UP,
39                 DELETE,
40                 ADD,
41                 BIBBRSR,
42                 CITEBRSR,
43                 ON,
44                 OFF
45         };
46         /**@name Constructors and Destructors */
47         //@{
48         /// #FormCitation x(LyXFunc ..., Dialogs ...);#
49         FormCitation(LyXView *, Dialogs *);
50         ///
51         ~FormCitation();
52         //@}
53
54         /**@name Real per-instance Callback Methods */
55         //@{
56         static  int WMHideCB(FL_FORM *, void *);
57         static void OKCB(FL_OBJECT *, long);
58         static void CancelCB(FL_OBJECT *, long);
59         static void InputCB(FL_OBJECT *, long);
60         //@}
61
62 private:
63         /**@name Slot Methods */
64         //@{
65         /// Create the dialog if necessary, update it and display it.
66         void createInset( string const & );
67         /// 
68         void showInset( InsetCitation * );
69         /// 
70         void show();
71         /// Hide the dialog.
72         void hide();
73         ///
74         void update();
75         //@}
76
77         /**@name Dialog internal methods */
78         //@{
79         /// Apply from dialog
80         void apply();
81         /// Filter the inputs
82         void input( State );
83         /// Build the dialog
84         void build();
85         ///
86         void updateCitekeys( string const & );
87         ///
88         void updateBrowser( FL_OBJECT *, std::vector<string> const & ) const;
89         ///
90         void setBibButtons( State ) const;
91         ///
92         void setCiteButtons( State ) const;
93         ///
94         void setSize( int, bool ) const;
95         ///
96         FD_form_citation * build_citation();
97         /// Explicitly free the dialog.
98         void free();
99         //@}
100
101         /**@name Private Data */
102         //@{
103         /// Real GUI implementation.
104         FD_form_citation * dialog_;
105         /** Which LyXFunc do we use?
106             We could modify Dialogs to have a visible LyXFunc* instead and
107             save a couple of bytes per dialog.
108         */
109         LyXView * lv_;
110         /** Which Dialogs do we belong to?
111             Used so we can get at the signals we have to connect to.
112         */
113         Dialogs * d_;
114         /// Update connection.
115         Connection u_;
116         /// Hide connection.
117         Connection h_;
118         /// inset::hide connection.
119         Connection ih_;
120         ///
121         InsetCitation * inset_;
122         ///
123         bool dialogIsOpen;
124         ///
125         string textAfter;
126         ///
127         std::vector<string> citekeys;
128         ///
129         std::vector<string> bibkeys;
130         ///
131         std::vector<string> bibkeysInfo;
132         //@}
133 };
134
135 #endif