]> git.lyx.org Git - lyx.git/blob - src/LyXView.h
paragraph-spacing, redoparagraph in deleteemptyparagraphmechanism, got rid of some...
[lyx.git] / src / LyXView.h
1 // -*- C++ -*-
2 /* This file is part of
3  * ====================================================== 
4  * 
5  *           LyX, The Document Processor
6  *        
7  *           Copyright 1995 Matthias Ettrich
8  *           Copyright 1995-2000 The LyX Team.
9  *
10  * ====================================================== */
11
12 #ifndef LyXView_H
13 #define LyXView_H
14
15 #ifdef __GNUG__
16 #pragma interface
17 #endif
18
19 #include FORMS_H_LOCATION
20
21 class LyXFunc;
22 class Toolbar;
23 class MiniBuffer;
24 class Intl;
25 class Buffer;
26 class Menus;
27 class BufferView;
28
29 ///
30 struct  FD_form_main {
31         ///
32         FL_FORM * form_main;
33         ///
34         FL_OBJECT * timer_autosave;
35         ///
36         FL_OBJECT * timer_update;
37         ///
38         void * vdata;
39         ///
40         long ldata;
41 };
42
43
44 /**
45   This class is the form containing the view of the buffer. The actual buffer
46   view is supposed (at least IMHO) to be another class, that shows its output
47   in one or more LyXView's.
48  */
49 class LyXView {
50 public:
51         /// constructor
52         LyXView(int w, int h);
53
54         /// destructor
55         ~LyXView();
56
57         /// Where to place the form.
58         void setPosition(int, int);
59
60         /// Show the main form.
61         void show(int, int, char const * t = "LyX");
62
63         /// init (should probably be removed later) (Lgb)
64         void init();
65
66         /// Redraw the main form.
67         void redraw();
68
69         /// returns the buffer currently shown in the main form.
70         Buffer * buffer() const;
71
72         ///
73         BufferView * view() const;
74
75         /// returns a pointer to the main form.
76         FD_form_main * getMainForm() const;
77
78         /// returns a pointer to the form.
79         FL_FORM * getForm() const;
80
81         /// return a pointer to the toolbar
82         Toolbar * getToolbar() const;
83
84         /// return a pointer to the lyxfunc
85         LyXFunc * getLyXFunc() const;
86
87         /// return a pointer to the minibuffer
88         MiniBuffer * getMiniBuffer() const;
89
90         ///
91         Menus * getMenus() const;
92
93         ///
94         Intl * getIntl() const;
95
96         ///
97         void updateLayoutChoice();
98
99         /// Updates the title of the window
100         void updateWindowTitle();
101
102         /// Reset autosave timer
103         void resetAutosaveTimer();
104 private:
105         /// 
106         LyXFunc * lyxfunc;
107         /// 
108         Toolbar * toolbar;
109         /// 
110         MiniBuffer * minibuffer;
111         ///
112         Menus * menus;
113         ///
114         Intl * intl;
115
116         /** This is supposed to be a pointer or a list of pointers to the
117            BufferViews currently being shown in the LyXView. So far
118            this is not used, but that should change pretty soon. (Lgb) */
119         BufferView * bufferview;
120         ///
121         void invalidateLayoutChoice();
122         ///
123         void UpdateDocumentClassChoice();
124 public:
125         ///
126         static int KeyPressMask_raw_callback(FL_FORM *, void * xev);
127         /** This callback is run when a close event is sent from the
128           window manager. */
129         static int atCloseMainFormCB(FL_FORM *, void *);
130         /// A callback
131         void AutoSave();
132         /// A callback
133         static void UpdateTimerCB(FL_OBJECT *, long);
134 private:
135         /// makes the main form.
136         void create_form_form_main(int width, int height);
137         /// A pointer to the form.      
138         FD_form_main * form_main_;
139         /// A pointer to the form.      
140         FL_FORM * form_;
141
142         /** The last textclass layout list in the layout choice selector
143           This should probably be moved to the toolbar, but for now it's
144         here. (Asger) */
145         int last_textclass;
146 };
147 #endif