This commit was manufactured by cvs2svn to create tag
[lyx.git] / src / LyXView.h
blobe3c929133ef401adbefe7e7d4377877f296b9351
1 // -*- C++ -*-
2 /* This file is part of
3 * ======================================================
4 *
5 * LyX, The Document Processor
6 *
7 * Copyright 1995 Matthias Ettrich
8 * Copyright 1995-1998 The LyX Team.
10 * ====================================================== */
12 #ifndef LyXView_H
13 #define LyXView_H
15 #ifdef __GNUG__
16 #pragma interface
17 #endif
19 #include FORMS_H_LOCATION
20 #include "lyx.h"
21 #include "buffer.h"
22 #include "menus.h"
23 #include "BufferView.h"
24 #include "layout.h"
26 class LyXFunc;
27 class Toolbar;
28 class MiniBuffer;
29 class Intl;
31 ///
32 struct FD_form_main {
33 ///
34 FL_FORM *form_main;
35 ///
36 FL_OBJECT *timer_autosave;
37 ///
38 FL_OBJECT *timer_update;
39 ///
40 void *vdata;
41 ///
42 long ldata;
47 /**
48 This class is the form containing the view of the buffer. The actual buffer
49 view is supposed (at least IMHO) to be another class, that shows its output
50 in one or more LyXView's.
52 class LyXView {
53 public:
54 /// constructor
55 LyXView(int w, int h);
57 /// destructor
58 ~LyXView();
60 /// Where to place the form.
61 void setPosition(int, int);
63 /// Show the main form.
64 void show(int, int, char const * t= "LyX");
66 /// init (should probably be removed later) (Lgb)
67 void init();
69 /// Redraw the main form.
70 void redraw();
72 /// returns the buffer currently shown in the main form.
73 Buffer * currentBuffer(){ return bufferview->currentBuffer();}
75 ///
76 BufferView * currentView() { return bufferview; }
78 /// returns a pointer to the form.
79 FL_FORM * getForm() { return _form; }
81 /// return a pointer to the toolbar
82 Toolbar * getToolbar() { return toolbar; }
84 /// return a pointer to the lyxfunc
85 LyXFunc * getLyXFunc() { return lyxfunc; }
87 /// return a pointer to the minibuffer
88 MiniBuffer * getMiniBuffer() { return minibuffer; }
90 ///
91 Menus * getMenus() { return menus; }
93 ///
94 Intl * getIntl() { return intl; }
96 ///
97 void updateLayoutChoice();
99 /// Updates the title of the window
100 void updateWindowTitle();
102 /// Reset autosave timer
103 void resetAutosaveTimer();
104 private:
105 ///
106 LyXFunc * lyxfunc;
107 ///
108 Toolbar * toolbar;
109 ///
110 MiniBuffer * minibuffer;
112 Menus * menus;
114 Intl * intl;
116 /** This is supposed to be a pointer or a list of pointers to the
117 BufferViews currently being shown in the LyXView. So far
118 this is not used, but that should change pretty soon. (Lgb) */
119 BufferView * bufferview;
121 void invalidateLayoutChoice();
123 void UpdateDocumentClassChoice();
124 public:
126 static int KeyPressMask_raw_callback(FL_FORM *, void * xev);
127 /** This callback is run when a close event is sent from the
128 window manager. */
129 static int atCloseMainFormCB(FL_FORM *, void *);
130 /// A callback
131 static void AutosaveTimerCB(FL_OBJECT *, long);
132 /// A callback
133 static void UpdateTimerCB(FL_OBJECT *, long);
134 private:
135 /// makes the main form.
136 FD_form_main * create_form_form_main(int width, int height);
137 /// A pointer to the form.
138 FD_form_main * _form_main;
139 /// A pointer to the form.
140 FL_FORM * _form;
142 /** The last textclass layout list in the layout choice selector
143 This should probably be moved to the toolbar, but for now it's
144 here. (Asger) */
145 int last_textclass;
149 #endif