Main Page   Class Hierarchy   Compound List   File List   Compound Members  

qtvisionwidget.h

00001 // -*- c++ -*-
00002 
00003 /*
00004  *
00005  * Copyright (C) 2002 Richard Moore <rich@kde.org>
00006  *
00007  * This library is free software; you can redistribute it and/or
00008  * modify it under the terms of the GNU Library General Public
00009  * License as published by the Free Software Foundation; either
00010  * version 2 of the License, or (at your option) any later version.
00011  *
00012  * This library is distributed in the hope that it will be useful,
00013  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00014  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00015  * Library General Public License for more details.
00016  *
00017  * You should have received a copy of the GNU Library General Public License
00018  * along with this library; see the file COPYING.LIB.  If not, write to
00019  * the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
00020  * Boston, MA 02111-1307, USA.
00021  */
00022 
00023 #ifndef QTVISIONWIDGET_H
00024 #define QTVISIONWIDGET_H
00025 
00026 #include <qhbox.h>
00027 #include <qvbox.h>
00028 
00029 #include "qtvision.h"
00030 #include "qtvisionviewiface.h"
00031 
00032 class QPopupMenu;
00033 class QtVisionView;
00034 class QtVisionWidget;
00035 
00042 class QtVisionWidgetFrame : public QVBox
00043 {
00044     Q_OBJECT
00045 
00046 public:
00047     QtVisionWidgetFrame( QtVisionWidget *parent, const char *name=0 );
00048     ~QtVisionWidgetFrame();
00049 
00050 protected:
00051     virtual void closeEvent( QCloseEvent *ev );
00052     virtual void moveEvent( QMoveEvent *ev );
00053     virtual void resizeEvent( QResizeEvent *ev );
00054 
00055 private:
00056     QtVisionWidget *parent;
00057 };
00058 
00064 class QtVisionWidget : public QHBox, virtual public QtVisionViewIface
00065 {
00066     Q_OBJECT
00067 
00068 friend class QtVisionWidgetFrame;
00069 public:
00073     enum ViewMode { 
00074         ViewNormal=0, ViewFullScreen=1, ViewTopLevel=2,
00075         ViewMaxIterable=ViewTopLevel,
00076         ViewNone=128, ViewVideoDesktop=129
00077     };
00078 
00082     QtVisionWidget( QWidget *parent=0, const char *name=0, int wflags=0 );
00083 
00087     QtVisionWidget( QtVision *qtv, QWidget *parent=0, const char *name=0, int wflags=0 );
00088 
00092     virtual ~QtVisionWidget();
00093 
00097     QtVision *driver() const { return qtv; }
00098 
00102     QtVisionView *view() const { return screen; }
00103 
00107     DCOPRef driverIface() const;
00108 
00112     ChannelStore *channels() const { return (qtv ? qtv->channels() : 0); }
00113 
00117     ViewManager *views() const { return (qtv ? qtv->views() : 0); }
00118 
00124     void addContextMenu( QPopupMenu *pop );
00125 
00129     int viewMode() const { return mode; }
00130 
00134     bool isShowNormal() const { return mode == ViewNormal; }
00135 
00139     bool isShowTopLevel() const { return mode == ViewTopLevel; }
00140 
00144     bool isShowFullScreen() const { return mode == ViewFullScreen; }
00145 
00149     bool isShowVideoDesktop() const { return mode == ViewVideoDesktop; }
00150 
00154     bool isShowNone() const { return mode == ViewNone; }
00155 
00160     bool isFloating() const { return floating; }
00161 
00162 public slots:
00166     void setDriver( QtVision *qtv );
00167 
00171     void resetViewMode();
00172 
00176     void nextViewMode();
00177 
00183     void toggleFullScreen();
00184 
00188     void setViewMode( int mode );
00189 
00196     void setShowNone( bool active );
00197 
00198     void setShowNormal( bool active );
00199     void setShowTopLevel( bool active );
00200     void setShowFullScreen( bool active );
00201     void setShowVideoDesktop( bool active );
00202 
00206     void stayOnTopCfgChanged(bool);
00207 
00211     void bringToFront();
00212 
00213 signals:
00214     void viewModeChanged( int mode );
00215 
00216     void showNone( bool enabled );
00217     void showNormal( bool enabled );
00218     void showTopLevel( bool enabled );
00219     void showFullScreen( bool enabled );
00220     void showVideoDesktop( bool enabled );
00221 
00222     void floatingAboutToChange( bool oldval );
00223     void floatingChanged( bool newval );
00224     void frameCloseEvent();
00225 
00226 
00227 protected slots:
00228     void setFloating( bool enable );
00229 
00230 protected:
00231     void attachScreen();
00232     void detachScreen();
00233 
00234 private:
00235     QtVision *qtv;
00236     QtVisionWidgetFrame *frame;
00237     QtVisionView *screen;
00238     int mode;
00239     bool floating;
00240     bool reparenting;
00241     int oldMode;
00242     bool staysOnTop;
00243 };
00244 
00245 #endif // QTVISIONWIDGET_H

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