Main Page   Class Hierarchy   Compound List   File List   Compound Members  

view.h

00001 /* 
00002     KWinTV view class
00003     Copyright (C) 2002 George Staikos (staikos@kde.org)
00004 
00005     This program is free software; you can redistribute it and/or modify
00006     it under the terms of the GNU General Public License as published by
00007     the Free Software Foundation; either version 2 of the License, or
00008     (at your option) any later version.
00009 
00010     This program is distributed in the hope that it will be useful,
00011     but WITHOUT ANY WARRANTY; without even the implied warranty of
00012     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00013     GNU General Public License for more details.
00014 
00015     You should have received a copy of the GNU General Public License
00016     along with this program; if not, write to the Free Software
00017     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00018 */
00019 
00020 
00021 #ifndef KWINTV_VIEW_H
00022 #define KWINTV_VIEW_H
00023 
00024 #define ASPECT_RATIO_NORMAL     1.3333  /* 4:3 aspect ratio  */
00025 #define ASPECT_RATIO_WIDESCREEN 1.7777  /* 16:9 aspect ratio */
00026 #define ASPECT_RATIO_NONE       0.0     /* no aspect ratio   */
00027 #define ASPECT_H_TO_W           0       /* fix height to width */
00028 #define ASPECT_W_TO_H           1       /* fix width to height */
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 

Generated at Thu Jan 30 02:56:02 2003 for QtVision by doxygen1.2.9.1 written by Dimitri van Heesch, © 1997-2001