]> git.lyx.org Git - lyx.git/blob - src/LyXView.h
e8c99e22cb669163b12463bb5d4f1528714a6a9f
[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 class Dialogs;
31
32 ///
33 struct  FD_form_main {
34         ///
35         FL_FORM * form_main;
36 };
37
38
39 /**
40   This class is the form containing the view of the buffer. The actual buffer
41   view is supposed (at least IMHO) to be another class, that shows its output
42   in one or more LyXView's.
43  */
44 class LyXView {
45 public:
46         /// constructor
47         LyXView(int w, int h);
48
49         /// destructor
50         ~LyXView();
51
52         /// Where to place the form.
53         void setPosition(int, int);
54
55         /// Show the main form.
56         void show(int, int, char const * t = "LyX");
57
58         /// init (should probably be removed later) (Lgb)
59         void init();
60
61         /// Redraw the main form.
62         void redraw();
63
64         /// returns the buffer currently shown in the main form.
65         Buffer * buffer() const;
66
67         ///
68         BufferView * view() const;
69
70         /// returns a pointer to the main form.
71         FD_form_main * getMainForm() const;
72
73         /// returns a pointer to the form.
74         FL_FORM * getForm() const;
75
76         /// return a pointer to the toolbar
77         Toolbar * getToolbar() const;
78
79         /// return a pointer to the lyxfunc
80         LyXFunc * getLyXFunc() const;
81
82         /// return a pointer to the minibuffer
83         MiniBuffer * getMiniBuffer() const;
84
85         ///
86         Menus * getMenus() const;
87
88         ///
89         Intl * getIntl() const;
90
91         ///
92         Dialogs * getDialogs() { return dialogs_; }
93
94         ///
95         void updateLayoutChoice();
96
97         /// Updates the title of the window
98         void updateWindowTitle();
99
100         /// Reset autosave timer
101         void resetAutosaveTimer();
102 private:
103         /// 
104         LyXFunc * lyxfunc;
105         /// 
106         Toolbar * toolbar;
107         /// 
108         MiniBuffer * minibuffer;
109         ///
110         Menus * menus;
111         ///
112         Intl * intl;
113         ///
114         Dialogs * dialogs_;
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(void *);
134 private:
135         ///
136         Timeout autosave_timeout;
137         /// makes the main form.
138         void create_form_form_main(int width, int height);
139         /// A pointer to the form.      
140         FD_form_main * form_main_;
141         /// A pointer to the form.      
142         FL_FORM * form_;
143         /** The last textclass layout list in the layout choice selector
144           This should probably be moved to the toolbar, but for now it's
145         here. (Asger) */
146         int last_textclass;
147 };
148 #endif