]> git.lyx.org Git - lyx.git/blob - src/LyXView.h
Added using directive.
[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         /// Resize all BufferViews in this LyXView (because the width changed)
63         void resize();
64
65         /// returns the buffer currently shown in the main form.
66         Buffer * buffer() const;
67
68         ///
69         BufferView * view() const;
70
71         /// returns a pointer to the form.
72         FL_FORM * getForm() const;
73
74         /// return a pointer to the toolbar
75         Toolbar * getToolbar() const;
76
77         /// sets the layout in the toolbar layout combox
78         void setLayout(LyXTextClass::size_type layout);
79
80         /// update the toolbar
81         void updateToolbar();
82
83         /// return a pointer to the lyxfunc
84         LyXFunc * getLyXFunc() const;
85
86         /// return a pointer to the minibuffer
87         MiniBuffer * getMiniBuffer() const;
88
89         ///
90         void message(string const &);
91         ///
92         void messagePush(string const & str);
93         ///
94         void messagePop();
95         
96         ///
97         Menubar * getMenubar() const;
98
99         ///
100         void updateMenubar();
101
102         ///
103         Intl * getIntl() const;
104
105         ///
106         Dialogs * getDialogs() { return dialogs_; }
107
108         ///
109         void updateLayoutChoice();
110
111         /// Updates the title of the window
112         void updateWindowTitle();
113
114         /// Show state (toolbar and font in minibuffer)
115         void showState();
116
117         /// Reset autosave timer
118         void resetAutosaveTimer();
119 private:
120         /// 
121         LyXFunc * lyxfunc;
122         /// 
123         Toolbar * toolbar;
124         /// 
125         MiniBuffer * minibuffer;
126         ///
127         Menubar * menubar;
128         ///
129         Intl * intl;
130         ///
131         Dialogs * dialogs_;
132
133         /** This is supposed to be a pointer or a list of pointers to the
134            BufferViews currently being shown in the LyXView. So far
135            this is not used, but that should change pretty soon. (Lgb) */
136         BufferView * bufferview;
137         ///
138         void invalidateLayoutChoice();
139 public:
140         /** This callback is run when a close event is sent from the
141           window manager. */
142         static int atCloseMainFormCB(FL_FORM *, void *);
143         /// A callback
144         void AutoSave();
145 private:
146         ///
147         Timeout autosave_timeout;
148         /// makes the main form.
149         void create_form_form_main(int width, int height);
150         /// A pointer to the form.      
151         FL_FORM * form_;
152         /** The last textclass layout list in the layout choice selector
153           This should probably be moved to the toolbar, but for now it's
154         here. (Asger) */
155         int last_textclass;
156 };
157 #endif