Home · All Classes · Main Classes · Deprecated

mwindow.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 MWINDOW_H
00021 #define MWINDOW_H
00022 
00023 #include "mexport.h"
00024 #include "mnamespace.h"
00025 
00026 #include <QGraphicsView>
00027 
00028 class MWindowPrivate;
00029 class MWidget;
00030 class MOrientationChangeParameters;
00031 class MScene;
00032 class MSceneManager;
00033 class MOnDisplayChangeEvent;
00034 
00078 class M_CORE_EXPORT MWindow : public QGraphicsView
00079 {
00080 
00081     Q_OBJECT
00086     Q_PROPERTY(bool orientationAngleLocked READ isOrientationAngleLocked WRITE setOrientationAngleLocked)
00091     Q_PROPERTY(bool orientationLocked READ isOrientationLocked WRITE setOrientationLocked)
00092 
00097     Q_PROPERTY(qreal globalAlpha READ globalAlpha WRITE setGlobalAlpha)
00098 
00103     Q_PROPERTY(qreal videoGlobalAlpha READ videoGlobalAlpha WRITE setVideoGlobalAlpha)
00104 
00105 public:
00118     explicit MWindow(QWidget *parent = 0);
00119 
00127     explicit MWindow(MSceneManager *sceneManager,
00128                        QWidget *parent = 0);
00129 
00135     virtual ~MWindow();
00136 
00156     void setTranslucentBackground(bool enabled);
00157 
00178     void setGlobalAlpha(qreal level);
00179 
00184     qreal globalAlpha();
00185 
00204     void setVideoGlobalAlpha(qreal level);
00205 
00209     qreal videoGlobalAlpha();
00210 
00214     MScene *scene();
00215 
00224     void setSceneManager(MSceneManager *sceneManager);
00225 
00233     MSceneManager *sceneManager() const;
00234 
00243     MSceneManager *sceneManager();
00244 
00248     M::Orientation orientation() const;
00249 
00253     M::OrientationAngle orientationAngle() const;
00254 
00259     QSize visibleSceneSize(M::Orientation) const;
00260 
00264     QSize visibleSceneSize() const;
00265 
00274     bool isOrientationAngleLocked() const;
00275 
00301     void setOrientationAngleLocked(bool locked);
00302 
00311     bool isOrientationLocked() const;
00312 
00346     void setOrientationLocked(bool locked);
00347 
00349     bool isOnDisplay() const;
00350 
00355     bool isInSwitcher() const;
00356 
00360     void setCloseOnLazyShutdown(bool enable);
00361 
00363     bool closeOnLazyShutdown() const;
00364 
00365 public Q_SLOTS:
00373     void setOrientationAngle(M::OrientationAngle angle);
00374 
00385     void setLandscapeOrientation();
00386 
00397     void setPortraitOrientation();
00398 
00404     void lockOrientationAngle();
00405 
00411     void unlockOrientationAngle();
00412 
00418     void lockOrientation();
00419 
00425     void unlockOrientation();
00426 
00427 Q_SIGNALS:
00438     void orientationAngleChanged(M::OrientationAngle);
00439 
00450     void orientationChanged(M::Orientation);
00451 
00463     void orientationChangeFinished(M::Orientation);
00464 
00470     void displayEntered();
00471 
00477     void displayExited();
00478 
00482     void switcherEntered();
00483 
00487     void switcherExited();
00488 
00489 protected:
00491     bool event(QEvent *event);
00492     virtual void paintEvent(QPaintEvent *event);
00494 
00501     virtual void onDisplayChangeEvent(MOnDisplayChangeEvent *event);
00502 
00508     virtual void enterDisplayEvent();
00509 
00515     virtual void exitDisplayEvent();
00516 
00518     explicit MWindow(MWindowPrivate &dd, QWidget *parent = 0);
00519     explicit MWindow(MWindowPrivate &dd, MScene *scene, QWidget *parent = 0);
00520     explicit MWindow(MWindowPrivate &dd, MSceneManager *sceneManager, QWidget *parent = 0);
00521 
00522     virtual void setVisible(bool visible);
00523 
00524     MWindowPrivate *const d_ptr;
00526 
00527 private:
00528     Q_DISABLE_COPY(MWindow)
00529     Q_DECLARE_PRIVATE(MWindow)
00530     Q_PRIVATE_SLOT(d_func(), void _q_onPixmapRequestsFinished())
00531     Q_PRIVATE_SLOT(d_func(), void _q_enablePaintUpdates())
00532     Q_PRIVATE_SLOT(d_func(), void _q_exitDisplayStabilized())
00533 #ifdef HAVE_GCONF
00534     Q_PRIVATE_SLOT(d_func(), void _q_updateMinimizedSoftwareSwitch())
00535 #endif
00536 
00537     friend class MApplicationPrivate;
00538     friend class MSceneManagerPrivate;
00539 #ifdef UNIT_TEST
00540     // to call orientationAngleChanged()
00541     friend class Ut_MWindow;
00542     friend class Ut_MSceneManager;
00543 #endif
00544 };
00545 
00546 #endif

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