Diffstat (limited to 'noncore/apps/opie-console/widget_layer.h') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/apps/opie-console/widget_layer.h | 104 |
1 files changed, 87 insertions, 17 deletions
diff --git a/noncore/apps/opie-console/widget_layer.h b/noncore/apps/opie-console/widget_layer.h index cf2a1e5..3cdd6aa 100644 --- a/noncore/apps/opie-console/widget_layer.h +++ b/noncore/apps/opie-console/widget_layer.h | |||
@@ -1,2 +1,2 @@ | |||
1 | 1 | /* -------------------------------------------------------------------------- */ | |
2 | /* */ | 2 | /* */ |
@@ -12,7 +12,21 @@ | |||
12 | 12 | ||
13 | #ifndef WIDGET_LAYER_H | ||
14 | #define WIDGET_LAYER_H | ||
15 | |||
16 | // qt includes | ||
17 | #include <qapplication.h> | ||
18 | #include <qtimer.h> | ||
19 | #include <qkeycode.h> | ||
20 | #include <qclipboard.h> | ||
21 | |||
22 | |||
23 | // opie-console includes | ||
24 | #include "session.h" | ||
25 | #include "common.h" | ||
13 | 26 | ||
14 | class WidgetLayer : public QObject | 27 | class WidgetLayer : public QObject |
15 | { QObject | 28 | { Q_OBJECT |
16 | 29 | ||
17 | public: | 30 | public: |
31 | |||
18 | /** | 32 | /** |
@@ -20,3 +34,3 @@ public: | |||
20 | */ | 34 | */ |
21 | WidgetLayer(); | 35 | WidgetLayer( QObject *parent=0, const char *name=0 ); |
22 | 36 | ||
@@ -27,2 +41,3 @@ public: | |||
27 | 41 | ||
42 | public: | ||
28 | /** | 43 | /** |
@@ -45,13 +60,17 @@ public: | |||
45 | */ | 60 | */ |
46 | int columns(){ return m_columns } | 61 | int columns(){ return m_columns; } |
47 | 62 | ||
48 | /** | 63 | /** |
49 | * copy selection into clipboard, etc | 64 | * insert current selection (currently this is only the clipboard) |
50 | */ | 65 | */ |
51 | void emitSelection(); | 66 | void insertSelection(); |
52 | 67 | ||
53 | /** | 68 | /** |
69 | * insert text | ||
70 | */ | ||
71 | void insertText( QString text ); | ||
72 | /** | ||
54 | * set selection (clipboard) to text | 73 | * set selection (clipboard) to text |
55 | */ | 74 | */ |
56 | void setSelection( QString &text ) | 75 | void setSelection( const QString &text ); |
57 | 76 | ||
@@ -68,3 +87,3 @@ signals: | |||
68 | */ | 87 | */ |
69 | keyPressed( QKeyEvent *e ); | 88 | void keyPressed( QKeyEvent *e ); |
70 | 89 | ||
@@ -76,3 +95,3 @@ signals: | |||
76 | */ | 95 | */ |
77 | mousePressed( int button, int x, int y ); | 96 | void mousePressed( int button, int x, int y ); |
78 | 97 | ||
@@ -81,3 +100,3 @@ signals: | |||
81 | */ | 100 | */ |
82 | imageSizeChanged( int lines, int columns ); | 101 | void imageSizeChanged( int lines, int columns ); |
83 | 102 | ||
@@ -86,3 +105,3 @@ signals: | |||
86 | */ | 105 | */ |
87 | historyCursorChanged( int value ); | 106 | void historyCursorChanged( int value ); |
88 | 107 | ||
@@ -96,3 +115,3 @@ signals: | |||
96 | */ | 115 | */ |
97 | void selectionBegin( const int x, const int y ) | 116 | void selectionBegin( const int x, const int y ); |
98 | 117 | ||
@@ -100,3 +119,3 @@ signals: | |||
100 | * selection extended | 119 | * selection extended |
101 | * (from begin s.a. to x, y) | 120 | * (from begin (s.a.) to x, y) |
102 | */ | 121 | */ |
@@ -110,3 +129,31 @@ signals: | |||
110 | 129 | ||
111 | slots: | 130 | |
131 | |||
132 | // protected methods | ||
133 | protected: | ||
134 | |||
135 | // image operations | ||
136 | |||
137 | /** | ||
138 | * changes image, to suit new size | ||
139 | * TODO: find meaningful name! | ||
140 | */ | ||
141 | void propagateSize(); | ||
142 | |||
143 | /** | ||
144 | * | ||
145 | */ | ||
146 | virtual void calcGeometry(); | ||
147 | |||
148 | /** | ||
149 | * makes an empty image | ||
150 | */ | ||
151 | void makeImage(); | ||
152 | |||
153 | /** | ||
154 | * clears the image | ||
155 | */ | ||
156 | void clearImage(); | ||
157 | |||
158 | protected slots: | ||
112 | 159 | ||
@@ -115,3 +162,4 @@ slots: | |||
115 | */ | 162 | */ |
116 | onClearSelection(); | 163 | void onClearSelection(); |
164 | |||
117 | 165 | ||
@@ -123,8 +171,30 @@ protected: | |||
123 | */ | 171 | */ |
124 | Session m_session; | 172 | Session *m_session; |
173 | |||
174 | /** | ||
175 | * current character image | ||
176 | */ | ||
177 | QArray<Character> m_image; | ||
125 | 178 | ||
126 | /** | 179 | /** |
127 | * other misc vars | 180 | * lines count |
128 | */ | 181 | */ |
182 | int m_lines; | ||
129 | 183 | ||
184 | /** | ||
185 | * columns count | ||
186 | */ | ||
187 | int m_columns; | ||
188 | |||
189 | /** | ||
190 | * clipboard | ||
191 | */ | ||
192 | QClipboard* m_clipboard; | ||
193 | |||
194 | /** | ||
195 | * whether widget was resized | ||
196 | */ | ||
197 | bool m_resizing; | ||
130 | }; | 198 | }; |
199 | |||
200 | #endif // WIDGET_LAYER_H | ||