Home · All Classes · Main Classes · Deprecated

mscenewindowview.cpp

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 #include <mscenemanager.h>
00021 #include "mviewcreator.h"
00022 #include "mscenewindow.h"
00023 #include "mscenewindow_p.h"
00024 #include "mscenewindowview.h"
00025 #include "mscenewindowview_p.h"
00026 #include "mclassfactory.h"
00027 
00028 MSceneWindowViewPrivate::MSceneWindowViewPrivate() :
00029     controller(0)
00030 {
00031 }
00032 
00033 MSceneWindowViewPrivate::~MSceneWindowViewPrivate()
00034 {
00035 }
00036 
00037 void MSceneWindowViewPrivate::_q_playSceneWindowAppearingFeedback()
00038 {
00039     Q_Q(MSceneWindowView);
00040 
00041     // Play a feedback when scene window starts to appear
00042     q->style()->appearFeedback().play();
00043 }
00044 
00045 MSceneWindowView::MSceneWindowView(MSceneWindow *controller) :
00046     MWidgetView(*new MSceneWindowViewPrivate, controller)
00047 {
00048     Q_D(MSceneWindowView);
00049 
00050     d->controller = controller;
00051     connect(this, SIGNAL(geometryAttributesChanged()), controller, SIGNAL(repositionNeeded()));
00052     connect(controller, SIGNAL(appearing()), this, SLOT(_q_playSceneWindowAppearingFeedback()));
00053 }
00054 
00055 MSceneWindowView::MSceneWindowView(MSceneWindowViewPrivate &dd, MSceneWindow *controller) :
00056     MWidgetView(dd, controller)
00057 {
00058     Q_D(MSceneWindowView);
00059 
00060     d->controller = controller;
00061     connect(this, SIGNAL(geometryAttributesChanged()), controller, SIGNAL(repositionNeeded()));
00062     connect(controller, SIGNAL(appearing()), this, SLOT(_q_playSceneWindowAppearingFeedback()));
00063 }
00064 
00065 MSceneWindowView::~MSceneWindowView()
00066 {
00067 }
00068 
00069 void MSceneWindowView::applyStyle()
00070 {
00074     model()->setDisappearTimeout(style()->disappearTimeout());
00075     MWidgetView::applyStyle();
00076 
00077     emit geometryAttributesChanged();
00078 }
00079 
00080 void MSceneWindowView::setupModel()
00081 {
00082     MWidgetView::setupModel();
00083     emit geometryAttributesChanged();
00084 }
00085 
00086 Qt::Alignment MSceneWindowView::alignment() const
00087 {
00088     Qt::Alignment verticalAlign = style()->verticalAlign() & Qt::AlignVertical_Mask;
00089     Qt::Alignment horizontalAlign = style()->horizontalAlign() & Qt::AlignHorizontal_Mask;
00090 
00091     return verticalAlign | horizontalAlign;
00092 }
00093 
00094 QPointF MSceneWindowView::offset() const
00095 {
00096     return style()->offset();
00097 }
00098 
00099 M_REGISTER_VIEW_NEW(MSceneWindowView, MSceneWindow)
00100 
00101 #include "moc_mscenewindowview.cpp"

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