homescreenapp/runtimeplugins/hsdefaultruntimeplugin/inc/hsdefaultruntime.h
changeset 77 4b195f3bea29
parent 61 2b1b11a301d2
child 85 35368b604b28
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:  Default implementation of the home screen runtime.
       
    15 *
       
    16 */
       
    17 
       
    18 #ifndef HSDEFAULTRUNTIME_H
       
    19 #define HSDEFAULTRUNTIME_H
       
    20 
       
    21 #include <QStateMachine>
       
    22 #include <qmobilityglobal.h>
       
    23 
       
    24 #ifdef Q_OS_SYMBIAN
       
    25 #include <xqkeycapture.h>
       
    26 #endif
       
    27 
       
    28 #ifndef HSDEFAULTRUNTIMEPLUGIN_UNITTEST
       
    29 	#define TEST_CLASS_FWD
       
    30 	#define TEST_FRIEND
       
    31 #else
       
    32 	#define TEST_CLASS_FWD class DefaultRuntimePluginTest;
       
    33     #define TEST_FRIEND friend class DefaultRuntimePluginTest;
       
    34 #endif
       
    35 
       
    36 class HsContentService;
       
    37 QTM_BEGIN_NAMESPACE
       
    38 class QValueSpacePublisher;
       
    39 QTM_END_NAMESPACE
       
    40 
       
    41 QTM_USE_NAMESPACE
       
    42 
       
    43 TEST_CLASS_FWD
       
    44 
       
    45 class HsDefaultRuntime : public QStateMachine
       
    46 {
       
    47     Q_OBJECT
       
    48 
       
    49 public:
       
    50     HsDefaultRuntime(QObject *parent = 0);
       
    51     ~HsDefaultRuntime();
       
    52 
       
    53 signals:
       
    54     void event_exit();
       
    55     void event_toIdle();
       
    56 protected:
       
    57     bool eventFilter(QObject *watched, QEvent *event);
       
    58 
       
    59 private:
       
    60     Q_DISABLE_COPY(HsDefaultRuntime)
       
    61 
       
    62     void registerAnimations();
       
    63     void createStatePublisher();
       
    64     void createContentServiceParts();
       
    65     void createStates();
       
    66     void assignServices();
       
    67 	void updatePSKeys();
       
    68 
       
    69 private slots:
       
    70 	void onIdleStateEntered();
       
    71 	void onIdleStateExited();
       
    72 	void activityRequested(const QString &name);
       
    73 	
       
    74 
       
    75 private:
       
    76     HsContentService *mContentService;	
       
    77 	
       
    78 	bool mHomeScreenActive;
       
    79 	bool mIdleStateActive;
       
    80 
       
    81 	QValueSpacePublisher *mPublisher;
       
    82 	
       
    83 #ifdef Q_OS_SYMBIAN
       
    84     XqKeyCapture keyCapture;
       
    85 #endif
       
    86     
       
    87     TEST_FRIEND
       
    88 };
       
    89 
       
    90 #endif