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