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