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