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,33 +1,48 @@ - +/* -------------------------------------------------------------------------- */ /* */ /* [widget_layer.h] Widget Layer */ /* */ /* -------------------------------------------------------------------------- */ // proposal of a widget Layer in opie-console // // fellow devels: // just mail me (ibotty@web.de), what you additionally need from the main widget // (or say in chat) +#ifndef WIDGET_LAYER_H +#define WIDGET_LAYER_H + +// qt includes +#include <qapplication.h> +#include <qtimer.h> +#include <qkeycode.h> +#include <qclipboard.h> + + +// opie-console includes +#include "session.h" +#include "common.h" class WidgetLayer : public QObject -{ QObject +{ Q_OBJECT public: + /** * constructor */ - WidgetLayer(); + WidgetLayer( QObject *parent=0, const char *name=0 ); /** * destructor */ virtual ~WidgetLayer(); +public: /** * sets the image */ virtual void setImage( const Character* const newimg, int lines, int colums ); /** @@ -40,91 +55,146 @@ public: */ int lines() { return m_lines; } /** * return the columns count */ - int columns() { return m_columns } + int columns() { return m_columns; } /** - * copy selection into clipboard, etc + * insert current selection (currently this is only the clipboard) */ - void emitSelection(); + void insertSelection(); /** + * insert text + */ + void insertText( QString text ); + /** * set selection (clipboard) to text */ - void setSelection( QString &text ) + void setSelection( const QString &text ); /** * paste content of clipboard */ void pasteClipboard(); signals: /** * key was pressed */ - keyPressed( QKeyEvent *e ); + void keyPressed( QKeyEvent *e ); /** * whenever Mouse selects something * 0 left Button * 3 Button released * // numbering due to layout in old TEWidget */ - mousePressed( int button, int x, int y ); + void mousePressed( int button, int x, int y ); /** * size of image changed */ - imageSizeChanged( int lines, int columns ); + void imageSizeChanged( int lines, int columns ); /** * cursor in history changed */ - historyCursorChanged( int value ); + void historyCursorChanged( int value ); /** * selection should be cleared */ void selectionCleared(); /** * selection begin */ - void selectionBegin( const int x, const int y ) + void selectionBegin( const int x, const int y ); /** * selection extended - * (from begin s.a. to x, y) + * (from begin (s.a.) to x, y) */ void selectionExtended( const int x, const int y ); /** * selection end * bool: preserve line breaks in selection */ void selectionEnd( const bool lineBreakPreserve ); -slots: + + +// protected methods +protected: + + // image operations + + /** + * changes image, to suit new size + * TODO: find meaningful name! + */ + void propagateSize(); + + /** + * + */ + virtual void calcGeometry(); + + /** + * makes an empty image + */ + void makeImage(); + + /** + * clears the image + */ + void clearImage(); + +protected slots: /** * clear selection */ - onClearSelection(); + void onClearSelection(); + // protected vars protected: /** * current Session */ - Session m_session; + Session *m_session; + + /** + * current character image + */ + QArray<Character> m_image; /** - * other misc vars + * lines count */ + int m_lines; + /** + * columns count + */ + int m_columns; + + /** + * clipboard + */ + QClipboard* m_clipboard; + + /** + * whether widget was resized + */ + bool m_resizing; }; + +#endif // WIDGET_LAYER_H |