00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef KWINTV_VIEW_H
00022 #define KWINTV_VIEW_H
00023
00024 #define ASPECT_RATIO_NORMAL 1.3333
00025 #define ASPECT_RATIO_WIDESCREEN 1.7777
00026 #define ASPECT_RATIO_NONE 0.0
00027 #define ASPECT_H_TO_W 0
00028 #define ASPECT_W_TO_H 1
00029
00030 #include <qwidget.h>
00031 #include <qcursor.h>
00032
00033 class QTimer;
00034
00038 class QtVisionView : public QWidget {
00039 Q_OBJECT
00040 public:
00041 QtVisionView(QWidget *parent, const char *name=0);
00042 virtual ~QtVisionView();
00043
00056 void setAspectRatio( double aspect, int mode );
00057
00058 public slots:
00059
00065 void setFixedAspectRatio( bool fixed, int mode );
00066
00067 protected:
00068 virtual bool eventFilter(QObject *o, QEvent *e);
00069 virtual void resizeEvent(QResizeEvent *e);
00070 virtual void mouseMoveEvent(QMouseEvent *e);
00071 virtual void focusOutEvent( QFocusEvent * );
00072 virtual void mouseDoubleClickEvent(QMouseEvent *);
00073 #ifndef QT_NO_WHEELEVENT
00074 virtual void wheelEvent( QWheelEvent * );
00075 #endif
00076 virtual void keyPressEvent(QKeyEvent *);
00077
00078 private:
00079 double aspectRatio;
00080 int aspectMode;
00081
00082 void resizeWithFixedAR();
00083
00084 protected slots:
00085 virtual void hideEvent(QHideEvent*);
00086 virtual void showEvent(QShowEvent*);
00087
00088 signals:
00089 void doubleClicked();
00090 void channelUp();
00091 void channelDown();
00093 void numberKeyPressed(int);
00094
00095 void resized(int w, int h);
00096 void moved(int x, int y);
00097 void visibilityChanged( bool visible );
00098
00099 };
00100
00101
00102 #endif
00103