]> git.lyx.org Git - lyx.git/blob - src/LyXView.h
update copyright year
[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-2001 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 <config.h>
20 #include FORMS_H_LOCATION
21
22 #include "LString.h"
23 #include "frontends/Timeout.h"
24 #include <boost/utility.hpp>
25 #include "layout.h"
26
27 class LyXFunc;
28 class Toolbar;
29 class MiniBuffer;
30 class Intl;
31 class Buffer;
32 class Menubar;
33
34 class BufferView;
35 class Dialogs;
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 SigC::Object, boost::noncopyable {
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, string const & t = string("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         /// sets the layout in the toolbar layout combox
75         void setLayout(LyXTextClass::size_type layout);
76
77         /// update the toolbar
78         void updateToolbar();
79
80         /// return a pointer to the lyxfunc
81         LyXFunc * getLyXFunc() const;
82
83         /// return a pointer to the minibuffer
84         MiniBuffer * getMiniBuffer() const;
85
86         ///
87         void message(string const &);
88         ///
89         void messagePush(string const & str);
90         ///
91         void messagePop();
92         
93         ///
94         Menubar * getMenubar() const;
95
96         ///
97         void updateMenubar();
98
99         ///
100         Intl * getIntl() const;
101
102         ///
103         Dialogs * getDialogs() { return dialogs_; }
104
105         ///
106         void updateLayoutChoice();
107
108         /// Updates the title of the window
109         void updateWindowTitle();
110
111         /// Show state (toolbar and font in minibuffer)
112         void showState();
113
114         /// Reset autosave timer
115         void resetAutosaveTimer();
116 private:
117         /// 
118         LyXFunc * lyxfunc;
119         /// 
120         Toolbar * toolbar;
121         /// 
122         MiniBuffer * minibuffer;
123         ///
124         Menubar * menubar;
125         ///
126         Intl * intl;
127         ///
128         Dialogs * dialogs_;
129
130         /** This is supposed to be a pointer or a list of pointers to the
131            BufferViews currently being shown in the LyXView. So far
132            this is not used, but that should change pretty soon. (Lgb) */
133         BufferView * bufferview;
134         ///
135         void invalidateLayoutChoice();
136 public:
137         /** This callback is run when a close event is sent from the
138           window manager. */
139         static int atCloseMainFormCB(FL_FORM *, void *);
140         /// A callback
141         void AutoSave();
142 private:
143         ///
144         Timeout autosave_timeout;
145         /// makes the main form.
146         void create_form_form_main(int width, int height);
147         /// A pointer to the form.      
148         FL_FORM * form_;
149         /** The last textclass layout list in the layout choice selector
150           This should probably be moved to the toolbar, but for now it's
151         here. (Asger) */
152         int last_textclass;
153 };
154 #endif