Home · All Classes · Main Classes · Deprecated

mwidget.h

Go to the documentation of this file.
00001 /***************************************************************************
00002 **
00003 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
00004 ** All rights reserved.
00005 ** Contact: Nokia Corporation (directui@nokia.com)
00006 **
00007 ** This file is part of libmeegotouch.
00008 **
00009 ** If you have questions regarding the use of this file, please contact
00010 ** Nokia at directui@nokia.com.
00011 **
00012 ** This library is free software; you can redistribute it and/or
00013 ** modify it under the terms of the GNU Lesser General Public
00014 ** License version 2.1 as published by the Free Software Foundation
00015 ** and appearing in the file LICENSE.LGPL included in the packaging
00016 ** of this file.
00017 **
00018 ****************************************************************************/
00019 
00020 #ifndef MWIDGET_H
00021 #define MWIDGET_H
00022 
00023 #include "mexport.h"
00024 
00025 #include <QGraphicsWidget>
00026 #include "mwindow.h"
00027 
00028 class QGestureEvent;
00029 class QTapAndHoldGesture;
00030 class QPanGesture;
00031 class QPinchGesture;
00032 class QTapGesture;
00033 class QSwipeGesture;
00034 
00035 class QGraphicsItem;
00036 class MWidgetPrivate;
00037 class MCancelEvent;
00038 class MOnDisplayChangeEvent;
00039 class MOrientationChangeEvent;
00040 class MSceneManager;
00041 class MApplicationPage;
00042 
00043 class M_CORE_EXPORT MWidget : public QGraphicsWidget
00044 {
00045     Q_OBJECT
00046 
00047     Q_PROPERTY(QSizePolicy sizePolicy READ sizePolicy WRITE setSizePolicy)
00048     Q_PROPERTY(bool selected READ isSelected WRITE setSelected)
00049     Q_PROPERTY(bool onDisplay READ isOnDisplay)
00050     Q_PROPERTY(QPointF paintOffset READ paintOffset WRITE setPaintOffset)
00051 
00052 public:
00053     MWidget(QGraphicsItem *parent = 0);
00054     virtual ~MWidget();
00055 
00057     virtual QPainterPath shape() const;
00058     virtual void paintWindowFrame(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = 0);
00065     MSceneManager *sceneManager() const;
00066 
00085     bool isOnDisplay() const;
00086 
00091     bool isSelected() const;
00092 
00101     QPointF paintOffset() const;
00102 
00116     void setPaintOffset(const QPointF & offset);
00117 
00122     void setVisible(bool visible);
00123     void hide() {
00124         setVisible(false);
00125     }
00126     void show() {
00127         setVisible(true);
00128     }
00131 public Q_SLOTS:
00148     virtual void setObjectName(const QString &name);
00149 
00156     void setSelected(bool selected);
00170     virtual void clearActions();
00171 
00172 Q_SIGNALS:
00173 
00181     void displayEntered();
00182 
00190     void displayExited();
00191 
00192 protected:
00193 
00197     virtual void enterDisplayEvent();
00198 
00202     virtual void exitDisplayEvent();
00203 
00211     virtual void onDisplayChangeEvent(MOnDisplayChangeEvent *event);
00212 
00214     bool event(QEvent *event);
00215     bool sceneEvent(QEvent *event);
00224     virtual void cancelEvent(MCancelEvent *event);
00225 
00231     virtual void orientationChangeEvent(MOrientationChangeEvent *event);
00232 
00233     virtual void actionEvent(QActionEvent *);
00234 
00240     virtual void contextMenuEvent(QGraphicsSceneContextMenuEvent *event);
00241 
00249     virtual void retranslateUi();
00250 
00259     virtual void gestureEvent(QGestureEvent *event);
00260 
00268     virtual void tapAndHoldGestureEvent(QGestureEvent *event, QTapAndHoldGesture* gesture);
00269 
00277     virtual void panGestureEvent(QGestureEvent *event, QPanGesture* gesture);
00278 
00286     virtual void pinchGestureEvent(QGestureEvent *event, QPinchGesture* gesture);
00287 
00295     virtual void tapGestureEvent(QGestureEvent *event, QTapGesture* gesture);
00296 
00304     virtual void swipeGestureEvent(QGestureEvent *event, QSwipeGesture* gesture);
00305 
00306 protected:
00307     MWidgetPrivate *const d_ptr;
00308     MWidget(MWidgetPrivate &dd, QGraphicsItem *parent);
00309 
00310 private:
00311     Q_DECLARE_PRIVATE(MWidget)
00312     Q_DISABLE_COPY(MWidget)
00313 
00314     friend class MApplicationWindow;
00315     friend class MScene;
00316     friend class MPannableViewport;
00317     friend class MApplicationPage;
00318     friend class MLayoutPrivate;
00319 
00320 #ifdef UNIT_TEST
00321     friend class Ut_MWidget;
00322 #endif
00323 };
00324 
00325 #endif

Copyright © 2010 Nokia Corporation Generated on Thu Nov 4 2010 18:14:22 (PDT)
Doxygen 1.7.1
MeeGo Touch