]> git.lyx.org Git - lyx.git/blob - src/BufferView.h
paragraph-spacing, redoparagraph in deleteemptyparagraphmechanism, got rid of some...
[lyx.git] / src / BufferView.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 BUFFER_VIEW_H
13 #define BUFFER_VIEW_H
14
15 #ifdef __GNUG__
16 #pragma interface
17 #endif
18
19 #include FORMS_H_LOCATION
20 #include "undo.h"
21
22 class LyXView;
23 class LyXText;
24 class TeXErrors;
25
26 ///
27 class BufferView {
28 public:
29         ///
30         BufferView(LyXView * owner, int , int , int, int);
31         ///
32         ~BufferView();
33         ///
34         Buffer * buffer() const;
35         ///
36         Painter & painter();
37         ///
38         void buffer(Buffer * b);
39         ///
40         void resize(int, int, int, int);
41         ///
42         void resize();
43         ///
44         void redraw();
45         ///
46         void fitCursor();
47         ///
48         void update();
49         ///
50         void update(signed char f);
51         ///
52         void smallUpdate(signed char f);
53         ///
54         void updateScrollbar();
55         ///
56         void redoCurrentBuffer();
57         ///
58         int resizeCurrentBuffer();
59         ///
60         void gotoError();
61         ///
62         void cursorPrevious();
63         ///
64         void cursorNext();
65         /// 
66         bool available() const;
67         ///
68         LyXView * owner() const;
69         ///
70         void beforeChange();
71         ///
72         void savePosition();
73         ///
74         void restorePosition();
75         /** This holds the mapping between buffer paragraphs and screen rows.
76             This should be private...but not yet. (Lgb)
77         */
78         LyXText * text;
79         ///
80         unsigned short paperWidth() const;
81         ///
82         UpdatableInset * the_locking_inset;
83         ///
84         void updateInset(Inset * inset, bool mark_dirty);
85         ///
86         bool inset_slept;
87         ///
88         int slx;
89         ///
90         int sly;
91         ///
92         void insetUnlock();
93         ///
94         void insetSleep();
95         ///
96         void insetWakeup();
97         ///
98         void replaceWord(string const & replacestring);
99         ///
100         void endOfSpellCheck();
101         ///
102         void selectLastWord();
103         ///
104         char * nextWord(float & value);
105         ///
106         void insertCorrectQuote();
107         ///
108         void gotoNote();
109         ///
110         bool gotoLabel(string const & label);
111         ///
112         void paste();
113         ///
114         void cut();
115         ///
116         void copy();
117         ///
118         void pasteEnvironment();
119         ///
120         void copyEnvironment();
121         ///
122         void hfill();
123         ///
124         void protectedBlank();
125         ///
126         void newline();
127         ///
128         void menuSeparator();
129         ///
130         void endOfSentenceDot();
131         ///
132         void ldots();
133         ///
134         void hyphenationPoint();
135         ///
136         void menuUndo();
137         ///
138         void menuRedo();
139         ///
140         void toggleFloat();
141         ///
142         void openStuff();
143         ///
144         void insertNote();
145         ///
146         void allFloats(char flag, char figmar);
147         /// removes all autodeletable insets
148         bool removeAutoInsets();
149         ///
150         void insertErrors(TeXErrors & terr);
151         ///
152         void setCursorFromRow(int row);
153         /** Insert an inset into the buffer
154             Insert inset into buffer, placing it in a layout of lout,
155             if no_table make sure that it doesn't end up in a table. */
156         void insertInset(Inset * inset, string const & lout = string(),
157                          bool no_table = false);
158         /// open and lock an updatable inset
159         void open_new_inset(UpdatableInset * new_inset);
160         /// Inserts a lyx file at cursor position. Returns false if it fails.
161         bool insertLyXFile(string const & file);
162         ///
163         int lockInset(UpdatableInset * inset);
164         ///
165         void showLockedInsetCursor(long x, long y, int asc, int desc);
166         ///
167         void hideLockedInsetCursor();
168         ///
169         void fitLockedInsetCursor(long x, long y, int asc, int desc);
170         ///
171         int unlockInset(UpdatableInset * inset);
172         ///
173         void lockedInsetStoreUndo(Undo::undo_kind kind);
174         ///
175         void showCursor();
176         ///
177         void hideCursor();
178         ///
179         void toggleSelection(bool = true);
180         ///
181         void toggleToggle();
182         ///
183         void center();
184         
185         ///
186         bool focus() const;
187         ///
188         void focus(bool);
189         ///
190         bool active() const;
191         ///
192         bool belowMouse() const;
193         /// A callback for the up arrow in the scrollbar.
194         void upCB(long time, int button);
195         /// A callback for the slider in the scrollbar.
196         void scrollCB(double);
197         /// A callback for the down arrow in the scrollbar.
198         void downCB(long time, int button);
199
200         ///
201         static void cursorToggleCB(FL_OBJECT * ob, long);
202
203         ///
204         void setState();
205
206         ///
207         void pushIntoUpdateList(Inset * i);
208         ///
209         void workAreaExpose();
210         ///
211         void workAreaButtonPress(int x, int y, unsigned int button);
212         ///
213         void workAreaButtonRelease(int x, int y, unsigned int button);
214         ///
215         void workAreaMotionNotify(int x, int y, unsigned int state);
216         ///
217         void doubleClick(int x, int y, unsigned int button);
218         ///
219         void tripleClick(int x, int y, unsigned int button);
220         ///
221         void workAreaSelectionNotify(Window win, XEvent * event);
222 private:
223         struct Pimpl;
224         Pimpl * pimpl_;
225 };
226
227 #endif