]> git.lyx.org Git - lyx.git/blob - src/frontends/xforms/FormInclude.h
Merging BRANCH_MVC back into HEAD.
[lyx.git] / src / frontends / xforms / FormInclude.h
1 // -*- C++ -*-
2 /**
3  * \file FormInclude.h
4  * Copyright 2001 the LyX Team
5  * See the file COPYING
6  *
7  * \author Alejandro Aguilar Sierra
8  * \author John Levon
9  */
10 #ifndef FORMINCLUDE_H
11 #define FORMINCLUDE_H
12
13 #include <boost/smart_ptr.hpp>
14
15 #ifdef __GNUG__
16 #pragma interface
17 #endif
18
19 #include "FormBaseDeprecated.h"
20 #include "xformsBC.h"
21 #include "insets/insetinclude.h"
22
23 struct FD_form_include;
24
25 /** This class provides an XForms implementation of the FormInclude Dialog.
26  */
27 class FormInclude : public FormBaseBD {
28 public:
29         ///
30         FormInclude(LyXView *, Dialogs *);
31 private:
32         ///
33         enum State {
34                 /// the browse button
35                 BROWSE = 0,
36                 /// the load file button
37                 LOAD = 5,
38                 /// the verbatim radio choice
39                 VERBATIM = 10,
40                 /// the input and include radio choices
41                 INPUTINCLUDE = 11
42         };
43  
44         /// Pointer to the actual instantiation of the ButtonController.
45         virtual xformsBC & bc();
46         /// Slot launching dialog to an existing inset
47         void showInclude(InsetInclude *);
48
49         /// Connect signals. Also perform any necessary initialisation.
50         virtual void connect();
51         /// Disconnect signals. Also perform any necessary housekeeping.
52         virtual void disconnect();
53
54         /// Build the dialog
55         virtual void build();
56         /// Filter the inputs
57         virtual bool input( FL_OBJECT *, long );
58         /// Update dialog before showing it
59         virtual void update();
60         /// Apply from dialog (modify or create inset)
61         virtual void apply();
62         /// Pointer to the actual instantiation of the xforms form
63         virtual FL_FORM * form() const;
64         /// bool indicates if a buffer switch took place
65         virtual void updateSlot(bool);
66
67
68         /// Type definition from the fdesign produced header file.
69         FD_form_include * build_include();
70
71         /// Real GUI implementation.
72         boost::scoped_ptr<FD_form_include> dialog_;
73         /// The ButtonController
74         ButtonController<OkCancelReadOnlyPolicy, xformsBC> bc_;
75
76         /// inset::hide connection.
77         Connection ih_;
78  
79         /// pointer to the inset passed through showInset
80         InsetInclude * inset_;
81         /// the nitty-gritty. What is modified and passed back
82         InsetInclude::InsetIncludeParams params;
83 };
84
85
86 inline
87 xformsBC & FormInclude::bc()
88 {
89   return bc_;
90 }
91 #endif