homescreenapp/hsdomainmodel/inc/hswidgethostvisual.h
changeset 77 4b195f3bea29
child 92 6727c5d0afc7
equal deleted inserted replaced
61:2b1b11a301d2 77:4b195f3bea29
       
     1 /*
       
     2 * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:
       
    15 *
       
    16 */
       
    17 
       
    18 #ifndef HSWIDGETHOSTVISUAL_H
       
    19 #define HSWIDGETHOSTVISUAL_H
       
    20 
       
    21 #include <HbWidget>
       
    22 #include <QMetaMethod>
       
    23 #include <QMetaProperty>
       
    24 
       
    25 #include "hsdomainmodel_global.h"
       
    26 #include "hsdomainmodeldatastructures.h"
       
    27 
       
    28 #include "hstest_global.h"
       
    29 HOMESCREEN_TEST_CLASS(TestHsDomainModel)
       
    30 
       
    31 class QStateMachine;
       
    32 
       
    33 class HsWidgetTouchArea;
       
    34 class HsWidgetComponent;
       
    35 class HsPage;
       
    36 class HsWidgetHost;
       
    37 
       
    38 class HSDOMAINMODEL_EXPORT HsWidgetHostVisual : public HbWidget
       
    39 {
       
    40     Q_OBJECT
       
    41 
       
    42 public:
       
    43     HsWidgetHostVisual(QGraphicsItem *parent = 0);
       
    44     ~HsWidgetHostVisual();
       
    45     
       
    46     QPainterPath shape() const;
       
    47     void setWidget(QObject *widget);
       
    48     void setVisualModel(HsWidgetHost *model);
       
    49     HsWidgetHost *visualModel() const;
       
    50 signals:
       
    51     void resized();
       
    52 
       
    53 public slots:
       
    54     void startDragEffect();
       
    55     void startDropEffect();
       
    56 
       
    57 protected:
       
    58     bool eventFilter(QObject *watched, QEvent *event);
       
    59     void gestureEvent(QGestureEvent *event);
       
    60     void mousePressEvent(QGraphicsSceneMouseEvent *) {}
       
    61 
       
    62 private:
       
    63     Q_DISABLE_COPY(HsWidgetHostVisual)
       
    64     void setupTouchArea();
       
    65     void setupEffects();
       
    66 
       
    67     void setNewSize(const QSizeF &size);
       
    68 
       
    69 private:
       
    70     HsWidgetTouchArea *mTouchArea;
       
    71     HsWidgetHost *mVisualModel;
       
    72     QGraphicsWidget *mWidget;
       
    73     HOMESCREEN_TEST_FRIEND_CLASS(TestHsDomainModel)
       
    74 };
       
    75 
       
    76 #endif // HSWIDGETHOST_H