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