]> git.lyx.org Git - lyx.git/blob - src/LyXView.h
encoding + etc patch from dekel
[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         /// Reset autosave timer
96         void resetAutosaveTimer();
97 private:
98         /// 
99         LyXFunc * lyxfunc;
100         /// 
101         Toolbar * toolbar;
102         /// 
103         MiniBuffer * minibuffer;
104         ///
105         Menus * menus;
106         ///
107         Intl * intl;
108         ///
109         Dialogs * dialogs_;
110
111         /** This is supposed to be a pointer or a list of pointers to the
112            BufferViews currently being shown in the LyXView. So far
113            this is not used, but that should change pretty soon. (Lgb) */
114         BufferView * bufferview;
115         ///
116         void invalidateLayoutChoice();
117         ///
118         void UpdateDocumentClassChoice();
119 public:
120         ///
121         static int KeyPressMask_raw_callback(FL_FORM *, void * xev);
122         /** This callback is run when a close event is sent from the
123           window manager. */
124         static int atCloseMainFormCB(FL_FORM *, void *);
125         /// A callback
126         void AutoSave();
127 private:
128         ///
129         Timeout autosave_timeout;
130         /// makes the main form.
131         void create_form_form_main(int width, int height);
132         /// A pointer to the form.      
133         FL_FORM * form_;
134         /** The last textclass layout list in the layout choice selector
135           This should probably be moved to the toolbar, but for now it's
136         here. (Asger) */
137         int last_textclass;
138 };
139 #endif