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