]> git.lyx.org Git - lyx.git/blob - src/LyXView.h
5fab87d125d46d90059c00ccdb8a44c3ae381f95
[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 /**
34   This class is the form containing the view of the buffer. The actual buffer
35   view is supposed (at least IMHO) to be another class, that shows its output
36   in one or more LyXView's.
37  */
38 class LyXView : public SigC::Object {
39 public:
40         /// constructor
41         LyXView(int w, int h);
42
43         /// destructor
44         ~LyXView();
45
46         /// Where to place the form.
47         void setPosition(int, int);
48
49         /// Show the main form.
50         void show(int, int, char const * t = "LyX");
51
52         /// init (should probably be removed later) (Lgb)
53         void init();
54
55         /// Redraw the main form.
56         void redraw();
57
58         /// returns the buffer currently shown in the main form.
59         Buffer * buffer() const;
60
61         ///
62         BufferView * view() const;
63
64         /// returns a pointer to the form.
65         FL_FORM * getForm() const;
66
67         /// return a pointer to the toolbar
68         Toolbar * getToolbar() const;
69
70         /// return a pointer to the lyxfunc
71         LyXFunc * getLyXFunc() const;
72
73         /// return a pointer to the minibuffer
74         MiniBuffer * getMiniBuffer() const;
75
76         ///
77         Menus * getMenus() const;
78
79         ///
80         Intl * getIntl() const;
81
82         ///
83         Dialogs * getDialogs() { return dialogs_; }
84
85         ///
86         void updateLayoutChoice();
87
88         /// Updates the title of the window
89         void updateWindowTitle();
90
91         /// Reset autosave timer
92         void resetAutosaveTimer();
93 private:
94         /// 
95         LyXFunc * lyxfunc;
96         /// 
97         Toolbar * toolbar;
98         /// 
99         MiniBuffer * minibuffer;
100         ///
101         Menus * menus;
102         ///
103         Intl * intl;
104         ///
105         Dialogs * dialogs_;
106
107         /** This is supposed to be a pointer or a list of pointers to the
108            BufferViews currently being shown in the LyXView. So far
109            this is not used, but that should change pretty soon. (Lgb) */
110         BufferView * bufferview;
111         ///
112         void invalidateLayoutChoice();
113         ///
114         void UpdateDocumentClassChoice();
115 public:
116         ///
117         static int KeyPressMask_raw_callback(FL_FORM *, void * xev);
118         /** This callback is run when a close event is sent from the
119           window manager. */
120         static int atCloseMainFormCB(FL_FORM *, void *);
121         /// A callback
122         void AutoSave();
123 private:
124         ///
125         Timeout autosave_timeout;
126         /// makes the main form.
127         void create_form_form_main(int width, int height);
128         /// A pointer to the form.      
129         FL_FORM * form_;
130         /** The last textclass layout list in the layout choice selector
131           This should probably be moved to the toolbar, but for now it's
132         here. (Asger) */
133         int last_textclass;
134 };
135 #endif