Qtopia library API Documentation

qpedecoration_qws.h

00001 /**********************************************************************
00002 ** Copyright (C) 2000-2002 Trolltech AS.  All rights reserved.
00003 **
00004 ** This file is part of the Qtopia Environment.
00005 **
00006 ** This file may be distributed and/or modified under the terms of the
00007 ** GNU General Public License version 2 as published by the Free Software
00008 ** Foundation and appearing in the file LICENSE.GPL included in the
00009 ** packaging of this file.
00010 **
00011 ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
00012 ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
00013 **
00014 ** See http://www.trolltech.com/gpl/ for GPL licensing information.
00015 **
00016 ** Contact info@trolltech.com if any conditions of this licensing are
00017 ** not clear to you.
00018 **
00019 **********************************************************************/
00020 #ifndef QPE_DECORATION_QWS_H__
00021 #define QPE_DECORATION_QWS_H__
00022 
00023 
00024 #ifdef QWS
00025 #include <qpe/global.h>
00026 #include <qwsdefaultdecoration_qws.h>
00027 #include <qimage.h>
00028 #include <qdatetime.h>
00029 #include <qguardedptr.h>
00030 #include "windowdecorationinterface.h"
00031 
00032 
00033 #ifndef QT_NO_QWS_QPE_WM_STYLE
00034 
00035 class QPEManager;
00036 class QTimer;
00037 #include <qwidget.h>
00038 
00039 class QPEDecoration : public QWSDefaultDecoration
00040 {
00041 public:
00042     QPEDecoration();
00043     QPEDecoration( const QString &plugin );
00044     virtual ~QPEDecoration();
00045 
00046     virtual QRegion region(const QWidget *, const QRect &rect, Region);
00047     virtual void paint(QPainter *, const QWidget *);
00048     virtual void paintButton(QPainter *, const QWidget *, Region, int state);
00049 
00050     void maximize( QWidget * );
00051     void minimize( QWidget * );
00052     virtual QPopupMenu *menu( const QWidget *, const QPoint & );
00053     virtual void help( QWidget * );
00054 
00055     enum QPERegion { Help=LastRegion+1 };
00056     void buttonClicked( QPERegion r );
00057 
00058 protected:
00059     virtual int getTitleHeight(const QWidget *);
00060     virtual const char **menuPixmap();
00061     virtual const char **closePixmap();
00062     virtual const char **minimizePixmap();
00063     virtual const char **maximizePixmap();
00064     virtual const char **normalizePixmap();
00065 
00066 private:
00067     void windowData( const QWidget *w, WindowDecorationInterface::WindowData &wd ) const;
00068 
00069     bool helpExists() const;
00070 
00071 protected:
00072     QImage imageOk;
00073     QImage imageClose;
00074     QImage imageHelp;
00075     QString helpFile;
00076     bool helpexists : 1;
00077     QPEManager *qpeManager;
00078 };
00079 
00080 
00081 class QPEManager : public QObject
00082 {
00083     Q_OBJECT
00084     friend class QPEDecoration;
00085 public:
00086     QPEManager( QPEDecoration *d, QObject *parent=0 );
00087 
00088     void updateActive();
00089     const QWidget *activeWidget() const { return (const QWidget *)active; }
00090     const QWidget *whatsThisWidget() const { return (const QWidget *)whatsThis; }
00091 
00092 protected:
00093     int pointInQpeRegion( QWidget *w, const QPoint &p );
00094     virtual bool eventFilter( QObject *, QEvent * );
00095     void drawButton( QWidget *w, QPEDecoration::QPERegion r, int state );
00096     void drawTitle( QWidget *w );
00097 
00098 protected slots:
00099     void whatsThisTimeout();
00100 
00101 protected:
00102     QPEDecoration *decoration;
00103     QGuardedPtr<QWidget> active;
00104     int helpState;
00105     QTime pressTime;
00106     QTimer *wtTimer;
00107     bool inWhatsThis : 1;
00108     QGuardedPtr<QWidget> whatsThis;
00109 };
00110 
00111 
00112 #endif // QT_NO_QWS_QPE_WM_STYLE
00113 
00114 
00115 #endif // QPE_DECORATION_QWS_H__
00116 #endif // QWS
KDE Logo
This file is part of the documentation for OPIE Version 1.5.5.
Documentation copyright © 1997-2003 the KDE developers. 2003 OPIE developers
Generated on Tue Feb 10 20:24:07 2004 by doxygen 1.3.5 written by Dimitri van Heesch, © 1997-2001