]> git.lyx.org Git - lyx.git/blob - src/BufferView_pimpl.h
remove noload/don't typeset
[lyx.git] / src / BufferView_pimpl.h
1 // -*- C++ -*-
2 /**
3  * \file BufferView_pimpl.h
4  * Copyright 2002 the LyX Team
5  * Read the file COPYING
6  *
7  * \author various
8  */
9
10 #ifndef BUFFERVIEW_PIMPL_H
11 #define BUFFERVIEW_PIMPL_H
12
13 #include "BufferView.h"
14 #include "frontends/Timeout.h"
15 #include "frontends/key_state.h"
16 #include "frontends/LyXKeySym.h"
17 #include "support/types.h"
18
19 #include <boost/scoped_ptr.hpp>
20 #include <boost/signals/trackable.hpp>
21
22 #ifdef __GNUG__
23 #pragma interface
24 #endif
25
26 class LyXView;
27 class WorkArea;
28 class LyXScreen;
29 class FuncRequest;
30
31 ///
32 struct BufferView::Pimpl : public boost::signals::trackable {
33         ///
34         Pimpl(BufferView * i, LyXView * o,
35               int xpos, int ypos, int width, int height);
36         ///
37         Painter & painter() const;
38         /// return the screen for this bview
39         LyXScreen & screen() const;
40         ///
41         void buffer(Buffer *);
42         /// Return true if the cursor was fitted.
43         bool fitCursor();
44         ///
45         void redoCurrentBuffer();
46         ///
47         int resizeCurrentBuffer();
48         ///
49         void update();
50         //
51         void update(LyXText *, BufferView::UpdateCodes);
52         /**
53          * Repaint pixmap. Used for when we've made a visible
54          * change but don't need the full update() logic
55          */
56         void repaint();
57         ///
58         void workAreaResize();
59         ///
60         void updateScrollbar();
61         ///
62         void scrollDocView(int value);
63         /// wheel mouse scroll
64         int scroll(long time);
65         ///
66         void workAreaKeyPress(LyXKeySymPtr key, key_modifier::state state);
67         ///
68         void selectionRequested();
69         ///
70         void selectionLost();
71         ///
72         void cursorToggle();
73         ///
74         bool available() const;
75         ///
76         void beforeChange(LyXText *);
77         ///
78         void savePosition(unsigned int i);
79         ///
80         void restorePosition(unsigned int i);
81         ///
82         bool isSavedPosition(unsigned int i);
83         ///
84         void switchKeyMap();
85         ///
86         void insetUnlock();
87         ///
88         void showCursor();
89         ///
90         void hideCursor();
91         ///
92         void toggleSelection(bool = true);
93         ///
94         void toggleToggle();
95         ///
96         void center();
97         ///
98         bool insertInset(Inset * inset, string const & lout = string());
99         ///
100         void updateInset(Inset * inset, bool mark_dirty);
101         ///
102         bool dispatch(FuncRequest const & ev);
103 private:
104         ///
105         friend class BufferView;
106
107         ///
108         BufferView * bv_;
109         ///
110         LyXView * owner_;
111         ///
112         Buffer * buffer_;
113         ///
114         boost::scoped_ptr<LyXScreen> screen_;
115         ///
116         boost::scoped_ptr<WorkArea> workarea_;
117         ///
118         Timeout cursor_timeout;
119         ///
120         void stuffClipboard(string const &) const;
121         ///
122         bool using_xterm_cursor;
123         ///
124         struct Position {
125                 /// Filename
126                 string filename;
127                 /// Cursor paragraph Id
128                 int par_id;
129                 /// Cursor position
130                 lyx::pos_type par_pos;
131                 ///
132                 Position() : par_id(0), par_pos(0) {}
133                 ///
134                 Position(string const & f, int id, lyx::pos_type pos)
135                         : filename(f), par_id(id), par_pos(pos) {}
136         };
137         ///
138         std::vector<Position> saved_positions;
139         /// Get next inset of this class from current cursor position
140         Inset * getInsetByCode(Inset::Code code);
141         ///
142         void MenuInsertLyXFile(string const & filen);
143         /// our workarea
144         WorkArea & workarea() const;
145 };
146 #endif // BUFFERVIEW_PIMPL_H