]> git.lyx.org Git - lyx.git/blob - src/frontends/xforms/FormParagraph.h
small patch from Dekel, begin introducing the real boost framework, get rid of the...
[lyx.git] / src / frontends / xforms / FormParagraph.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_PARAGRAPH_H
14 #define FORM_PARAGRAPH_H
15
16 #include "DialogBase.h"
17 #include <boost/utility.hpp>
18 #include <vector>
19
20 #ifdef __GNUG_
21 #pragma interface
22 #endif
23
24 class LyXView;
25 class Dialogs;
26 class NoRepeatedApplyReadOnlyPolicy;
27 //template <class x> class ButtonController;
28 class ButtonController;
29
30 struct FD_form_tabbed_paragraph;
31 struct FD_form_paragraph_general;
32 struct FD_form_paragraph_extra;
33
34 #ifdef SIGC_CXX_NAMESPACES
35 using SigC::Connection;
36 #endif
37
38 /** This class provides an XForms implementation of the FormParagraph Popup.
39     The table-layout-form here changes values for latex-tabulars
40  */
41 class FormParagraph : public DialogBase, public noncopyable {
42 public:
43     FormParagraph(LyXView *, Dialogs *);
44     ~FormParagraph();
45     ///
46     static  int WMHideCB(FL_FORM *, void *);
47     static void OKCB(FL_OBJECT *, long);
48     static void ApplyCB(FL_OBJECT *, long);
49     static void CancelCB(FL_OBJECT *, long);
50     static void RestoreCB(FL_OBJECT *, long);
51     static void InputCB(FL_OBJECT *, long);
52     static void VSpaceCB(FL_OBJECT *, long);
53     ///
54     enum EnumPopupStatus {
55         ///
56         POPUP_UNMODIFIED,
57         ///
58         POPUP_MODIFIED,
59         ///
60         POPUP_READONLY
61     };
62
63 private:
64     /// Create the popup if necessary, update it and display it.
65     void show();
66     /// Hide the popup.
67     void hide();
68     /// Update the popup.
69     void update();
70     ///
71     void general_update();
72     ///
73     void extra_update();
74     /// Apply from popup
75     void apply();
76     ///
77     void general_apply();
78     ///
79     void extra_apply();
80     /// Cancel from popup
81     void cancel();
82     /// Build the popup
83     void build();
84     /// Explicitly free the popup.
85     void free();
86     ///
87     bool CheckParagraphInput(FL_OBJECT * ob, long);
88
89
90     /// Typedefinitions from the fdesign produced Header file
91     FD_form_tabbed_paragraph * build_tabbed_paragraph();
92     ///
93     FD_form_paragraph_general * build_paragraph_general();
94     ///
95     FD_form_paragraph_extra * build_paragraph_extra();
96
97     /// Real GUI implementation.
98     FD_form_tabbed_paragraph  * dialog_;
99     ///
100     FD_form_paragraph_general * general_;
101     ///
102     FD_form_paragraph_extra   * extra_;
103     /// Which LyXView do we belong to?
104     LyXView * lv_;
105     ///
106     Dialogs * d_;
107     /// Update connection.
108     Connection u_;
109     /// Hide connection.
110     Connection h_;
111     /// has form contents changed? Used to control OK/Apply
112     EnumPopupStatus status;
113     ///
114         ButtonController/*<NoRepeatedApplyReadOnlyPolicy>*/ * bc_;
115 };
116
117 #endif