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