]> git.lyx.org Git - lyx.git/blob - src/LyXView.h
use anon namespace, somewhat better comp. handling of minipages, not quite there yet
[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 <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, public 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         Menubar * getMenubar() const;
88
89         ///
90         void updateMenubar();
91
92         ///
93         Intl * getIntl() const;
94
95         ///
96         Dialogs * getDialogs() { return dialogs_; }
97
98         ///
99         void updateLayoutChoice();
100
101         /// Updates the title of the window
102         void updateWindowTitle();
103
104
105         /// Show state (toolbar and font in minibuffer)
106         void showState();
107
108         /// Reset autosave timer
109         void resetAutosaveTimer();
110 private:
111         /// 
112         LyXFunc * lyxfunc;
113         /// 
114         Toolbar * toolbar;
115         /// 
116         MiniBuffer * minibuffer;
117         ///
118         Menubar * menubar;
119         ///
120         Intl * intl;
121         ///
122         Dialogs * dialogs_;
123
124         /** This is supposed to be a pointer or a list of pointers to the
125            BufferViews currently being shown in the LyXView. So far
126            this is not used, but that should change pretty soon. (Lgb) */
127         BufferView * bufferview;
128         ///
129         void invalidateLayoutChoice();
130 public:
131         /** This callback is run when a close event is sent from the
132           window manager. */
133         static int atCloseMainFormCB(FL_FORM *, void *);
134         /// A callback
135         void AutoSave();
136 private:
137         ///
138         Timeout autosave_timeout;
139         /// makes the main form.
140         void create_form_form_main(int width, int height);
141         /// A pointer to the form.      
142         FL_FORM * form_;
143         /** The last textclass layout list in the layout choice selector
144           This should probably be moved to the toolbar, but for now it's
145         here. (Asger) */
146         int last_textclass;
147 };
148 #endif