hswidgetmodel/tsrc/testwidgetprovider/inc/testwidgetprovider.h
changeset 117 c63ee96dbe5f
equal deleted inserted replaced
115:3ab5c078b490 117:c63ee96dbe5f
       
     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 HOMESCREEN_TEST_TESTWIDGETPROVIDER_H
       
    19 #define HOMESCREEN_TEST_TESTWIDGETPROVIDER_H
       
    20 
       
    21 #include "hsiwidgetprovider.h"
       
    22 #include "hswidget.h"
       
    23 
       
    24 
       
    25 
       
    26 
       
    27 
       
    28 
       
    29 class TestWidget : public HsWidget
       
    30 {
       
    31     Q_OBJECT
       
    32 
       
    33 public:
       
    34 
       
    35     TestWidget(QGraphicsItem* aParent = 0, Qt::WindowFlags aFlags = 0)
       
    36         : HsWidget(aParent, aFlags) {}
       
    37     
       
    38 protected:
       
    39 
       
    40     StartResult onStart()
       
    41     {
       
    42         return StartResultFinished;
       
    43     }   
       
    44 
       
    45     StopResult onStop()
       
    46     {
       
    47         return StopResultFinished;
       
    48     }
       
    49 
       
    50 };
       
    51 
       
    52 
       
    53 class TestWidgetProvider : public QObject, public IHsWidgetProvider
       
    54 {
       
    55 
       
    56     Q_OBJECT
       
    57     Q_INTERFACES(IHsWidgetProvider)
       
    58 
       
    59 public:
       
    60 
       
    61     TestWidgetProvider();    
       
    62 	virtual ~TestWidgetProvider();
       
    63 
       
    64 public:
       
    65 
       
    66     QList<HsWidgetToken> widgets();
       
    67     HsWidget* createWidget(const HsWidgetToken& aToken);
       
    68 
       
    69 private:
       
    70 
       
    71     HsWidgetToken mTestWidgetToken;
       
    72 
       
    73 };
       
    74 
       
    75 
       
    76 
       
    77 
       
    78 #endif