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