-rw-r--r-- | noncore/apps/opie-console/widget_layer.h | 32 |
1 files changed, 26 insertions, 6 deletions
diff --git a/noncore/apps/opie-console/widget_layer.h b/noncore/apps/opie-console/widget_layer.h index adf2038..d821f1d 100644 --- a/noncore/apps/opie-console/widget_layer.h +++ b/noncore/apps/opie-console/widget_layer.h | |||
@@ -21,141 +21,161 @@ | |||
21 | #include <qkeycode.h> | 21 | #include <qkeycode.h> |
22 | #include <qclipboard.h> | 22 | #include <qclipboard.h> |
23 | 23 | ||
24 | 24 | ||
25 | // opie-console includes | 25 | // opie-console includes |
26 | #include "session.h" | 26 | #include "session.h" |
27 | #include "common.h" | 27 | #include "common.h" |
28 | 28 | ||
29 | /* | 29 | /* |
30 | * given a pseudo location ( column, line ), | 30 | * given a pseudo location ( column, line ), |
31 | * returns the actual index, in the QArray<Character> | 31 | * returns the actual index, in the QArray<Character> |
32 | */ | 32 | */ |
33 | #define loc(X,Y) ((Y)*m_columns+(X)) | 33 | #define loc(X,Y) ((Y)*m_columns+(X)) |
34 | 34 | ||
35 | 35 | ||
36 | 36 | ||
37 | 37 | ||
38 | class WidgetLayer : public QFrame | 38 | class WidgetLayer : public QFrame |
39 | { Q_OBJECT | 39 | { Q_OBJECT |
40 | 40 | ||
41 | public: | 41 | public: |
42 | 42 | ||
43 | /** | 43 | /** |
44 | * constructor | 44 | * constructor |
45 | * @param const Profile &config, the configuration for this widget | ||
46 | * @param QWidget *parent, the parent widget | ||
47 | * @param const char *name, the name of the widget, defaults to "" | ||
45 | */ | 48 | */ |
46 | WidgetLayer( QWidget *parent=0, const char *name=0 ); | 49 | WidgetLayer( const Profile &config, QWidget *parent=0, const char *name=0 ); |
47 | 50 | ||
48 | /** | 51 | /** |
49 | * destructor | 52 | * destructor |
50 | */ | 53 | */ |
51 | virtual ~WidgetLayer(); | 54 | virtual ~WidgetLayer(); |
52 | 55 | ||
53 | public: | 56 | public: |
54 | /** | 57 | /** |
55 | * sets the image | 58 | * sets the image |
59 | * @param QArray<Character> const newimg, the new image | ||
60 | * @param int lines, lines count of newimg | ||
61 | * @param int columns, columns count of newimg | ||
56 | */ | 62 | */ |
57 | virtual void setImage( QArray<Character> const newimg, int lines, int colums ) = 0; | 63 | virtual void setImage( QArray<Character> const newimg, int lines, int colums ) = 0; |
58 | 64 | ||
59 | /** | 65 | /** |
60 | * annoy the user | 66 | * annoy the user |
61 | */ | 67 | */ |
62 | void bell(); | 68 | void bell(); |
63 | 69 | ||
64 | /** | 70 | /** |
65 | * return the lines count | 71 | * @return int m_lines, the lines count |
66 | */ | 72 | */ |
67 | int lines(){ return m_lines; } | 73 | int lines(){ return m_lines; } |
68 | 74 | ||
69 | /** | 75 | /** |
70 | * return the columns count | 76 | * @return int m_columns, the columns count |
71 | */ | 77 | */ |
72 | int columns(){ return m_columns; } | 78 | int columns(){ return m_columns; } |
73 | 79 | ||
74 | /** | 80 | /** |
75 | * insert current selection (currently this is only the clipboard) | 81 | * insert current selection (currently this is only the clipboard) |
76 | */ | 82 | */ |
77 | void insertSelection(); | 83 | void insertSelection(); |
78 | 84 | ||
79 | /** | 85 | /** |
80 | * insert text | 86 | * insert text |
87 | * @param QString text, the text to be inserted | ||
81 | */ | 88 | */ |
82 | void insertText( QString text ); | 89 | void insertText( QString text ); |
90 | |||
83 | /** | 91 | /** |
84 | * set selection (clipboard) to text | 92 | * set selection (clipboard) to text |
93 | * @param const QString &text, the text to be selected | ||
85 | */ | 94 | */ |
86 | void setSelection( const QString &text ); | 95 | void setSelection( const QString &text ); |
87 | 96 | ||
88 | /** | 97 | /** |
89 | * paste content of clipboard | 98 | * paste content of clipboard |
90 | */ | 99 | */ |
91 | void pasteClipboard(); | 100 | void pasteClipboard(); |
92 | 101 | ||
93 | 102 | ||
94 | signals: | 103 | signals: |
95 | 104 | ||
96 | /** | 105 | /** |
97 | * key was pressed | 106 | * key was pressed |
98 | */ | 107 | */ |
99 | void keyPressed( QKeyEvent *e ); | 108 | void keyPressed( QKeyEvent *e ); |
100 | 109 | ||
101 | /** | 110 | /** |
102 | * whenever Mouse selects something | 111 | * whenever Mouse selects something |
103 | * 0left Button | 112 | * @param int button, the button that us pressed : |
104 | * 3Button released | 113 | * 0left Button |
114 | * 3Button released | ||
115 | * @param int x, x position | ||
116 | * @param int y, y position | ||
117 | * | ||
105 | * // numbering due to layout in old TEWidget | 118 | * // numbering due to layout in old TEWidget |
106 | */ | 119 | */ |
107 | void mousePressed( int button, int x, int y ); | 120 | void mousePressed( int button, int x, int y ); |
108 | 121 | ||
109 | /** | 122 | /** |
110 | * size of image changed | 123 | * size of image changed |
124 | * @param int lines, line count of new size | ||
125 | * @param int columns, column count of new size | ||
111 | */ | 126 | */ |
112 | void imageSizeChanged( int lines, int columns ); | 127 | void imageSizeChanged( int lines, int columns ); |
113 | 128 | ||
114 | /** | 129 | /** |
115 | * cursor in history changed | 130 | * cursor in history changed |
131 | * @param int value, value of history cursor | ||
116 | */ | 132 | */ |
117 | void historyCursorChanged( int value ); | 133 | void historyCursorChanged( int value ); |
118 | 134 | ||
119 | /** | 135 | /** |
120 | * selection should be cleared | 136 | * selection should be cleared |
121 | */ | 137 | */ |
122 | void selectionCleared(); | 138 | void selectionCleared(); |
123 | 139 | ||
124 | /** | 140 | /** |
125 | * selection begin | 141 | * selection begin |
142 | * @param const int x, x position | ||
143 | * @param const int y, y position | ||
126 | */ | 144 | */ |
127 | void selectionBegin( const int x, const int y ); | 145 | void selectionBegin( const int x, const int y ); |
128 | 146 | ||
129 | /** | 147 | /** |
130 | * selection extended | 148 | * selection extended |
131 | * (from begin (s.a.) to x, y) | 149 | * (from begin (s.a.) to x, y) |
150 | * @param const int x, x position | ||
151 | * @param const int y, y position | ||
132 | */ | 152 | */ |
133 | void selectionExtended( const int x, const int y ); | 153 | void selectionExtended( const int x, const int y ); |
134 | 154 | ||
135 | /** | 155 | /** |
136 | * selection end | 156 | * selection end |
137 | * bool: preserve line breaks in selection | 157 | * @param const bool lineBreakPreserve, preserve line breaks in selection |
138 | */ | 158 | */ |
139 | void selectionEnd( const bool lineBreakPreserve ); | 159 | void selectionEnd( const bool lineBreakPreserve ); |
140 | 160 | ||
141 | 161 | ||
142 | 162 | ||
143 | // protected methods | 163 | // protected methods |
144 | protected: | 164 | protected: |
145 | 165 | ||
146 | // image operations | 166 | // image operations |
147 | 167 | ||
148 | /** | 168 | /** |
149 | * changes image, to suit new size | 169 | * changes image, to suit new size |
150 | * TODO: find meaningful name! | 170 | * TODO: find meaningful name! |
151 | */ | 171 | */ |
152 | void propagateSize(); | 172 | void propagateSize(); |
153 | 173 | ||
154 | /** | 174 | /** |
155 | *determines count of lines and columns | 175 | *determines count of lines and columns |
156 | */ | 176 | */ |
157 | virtual void calcGeometry() = 0; | 177 | virtual void calcGeometry() = 0; |
158 | 178 | ||
159 | /** | 179 | /** |
160 | * makes an empty image | 180 | * makes an empty image |
161 | */ | 181 | */ |