]> git.lyx.org Git - lyx.git/blob - src/frontends/xforms/FormDocument.h
ebf57246ef4a3d2474e0e598128f1112036ed8da
[lyx.git] / src / frontends / xforms / FormDocument.h
1 // -*- C++ -*-
2 /* This file is part of
3  * ======================================================
4  * 
5  *           LyX, The Document Processor
6  *       
7  *           Copyright (C) 2000 The LyX Team.
8  *
9  *           @author Jürgen Vigna
10  *
11  *======================================================*/
12
13 #ifndef FORM_DOCUMENT_H
14 #define FORM_DOCUMENT_H
15
16 #include "FormBase.h"
17 #include <vector>
18
19 #ifdef __GNUG_
20 #pragma interface
21 #endif
22
23 class LyXView;
24 class Dialogs;
25 class Combox;
26 class BufferParams;
27
28 struct FD_form_tabbed_document;
29 struct FD_form_doc_paper;
30 struct FD_form_doc_class;
31 struct FD_form_doc_language;
32 struct FD_form_doc_options;
33 struct FD_form_doc_bullet;
34
35 /** This class provides an XForms implementation of the FormDocument Popup.
36     The table-layout-form here changes values for latex-tabulars
37  */
38 class FormDocument : public FormBase {
39 public:
40     /// #FormDocument x(Communicator ..., Popups ...);#
41     FormDocument(LyXView *, Dialogs *);
42     ///
43     ~FormDocument();
44     /// this operates very differently to FormBase::InputCB
45     static void InputCB(FL_OBJECT *, long);
46     ///
47     static void ComboInputCB(int, void *, Combox *);
48     ///
49     static void ChoiceClassCB(FL_OBJECT *, long);
50     ///
51     static void ChoiceBulletSizeCB(FL_OBJECT * ob, long);
52     ///
53     static void InputBulletLaTeXCB(FL_OBJECT * ob, long);
54     ///
55     static void BulletDepthCB(FL_OBJECT * ob, long);
56     ///
57     static void BulletPanelCB(FL_OBJECT * ob, long);
58     ///
59     static void BulletBMTableCB(FL_OBJECT * ob, long);
60
61 private:
62     ///
63     bool CheckDocumentInput(FL_OBJECT * ob, long);
64     ///
65     void ChoiceBulletSize(FL_OBJECT * ob, long);
66     ///
67     void InputBulletLaTeX(FL_OBJECT * ob, long);
68     ///
69     void BulletDepth(FL_OBJECT * ob, long);
70     ///
71     void BulletPanel(FL_OBJECT * ob, long);
72     ///
73     void BulletBMTable(FL_OBJECT * ob, long);
74     ///
75     void checkMarginValues();
76     ///
77     void checkReadOnly();
78     ///
79     void CheckChoiceClass(FL_OBJECT * ob, long);
80     ///
81     void UpdateLayoutDocument(BufferParams const & params);
82
83     /// Update the popup.
84     virtual void update();
85     ///
86     void paper_update(BufferParams const &);
87     ///
88     void class_update(BufferParams const &);
89     ///
90     void language_update(BufferParams const &);
91     ///
92     void options_update(BufferParams const &);
93     ///
94     void bullets_update(BufferParams const &);
95     /// Apply from popup
96     virtual void apply();
97     ///
98     void paper_apply();
99     ///
100     bool class_apply();
101     ///
102     bool language_apply();
103     ///
104     bool options_apply();
105     ///
106     void bullets_apply();
107     /// Cancel from popup
108     virtual void cancel();
109     ///
110     virtual void restore() {
111         update();
112     }
113     /// Build the popup
114     virtual void build();
115     ///
116     virtual FL_FORM * form() const;
117
118     /// Typedefinitions from the fdesign produced Header file
119     FD_form_tabbed_document * build_tabbed_document();
120     ///
121     FD_form_doc_paper * build_doc_paper();
122     ///
123     FD_form_doc_class * build_doc_class();
124     ///
125     FD_form_doc_language * build_doc_language();
126     ///
127     FD_form_doc_options * build_doc_options();
128     ///
129     FD_form_doc_bullet * build_doc_bullet();
130
131     /// Real GUI implementation.
132     FD_form_tabbed_document * dialog_;
133     ///
134     FD_form_doc_paper       * paper_;
135     ///
136     FD_form_doc_class       * class_;
137     ///
138     FD_form_doc_language    * language_;
139     ///
140     FD_form_doc_options     * options_;
141     ///
142     FD_form_doc_bullet      * bullets_;
143     ///
144     int ActCell;
145     ///
146     int Confirmed;
147     ///
148     int current_bullet_panel;
149     ///
150     int current_bullet_depth;
151     ///
152     FL_OBJECT * fbullet;
153     ///
154     Combox * combo_language;
155     ///
156     Combox * combo_doc_class;
157 };
158
159 #endif