homescreenapp/hsapplication/inc/hsstatemachine.h
changeset 63 52b0f64eeb51
child 71 1db7cc813a4e
equal deleted inserted replaced
62:341166945d65 63:52b0f64eeb51
       
     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 HSSTATEMACHINE_H
       
    19 #define HSSTATEMACHINE_H
       
    20 
       
    21 #include <QStateMachine>
       
    22 #include <qmobilityglobal.h>
       
    23 
       
    24 #ifdef Q_OS_SYMBIAN
       
    25 #include <XQKeyCapture>
       
    26 #endif
       
    27 
       
    28 #include "hstest_global.h"
       
    29 
       
    30 class HsContentService;
       
    31 QTM_BEGIN_NAMESPACE
       
    32 class QValueSpacePublisher;
       
    33 QTM_END_NAMESPACE
       
    34 
       
    35 QTM_USE_NAMESPACE
       
    36 
       
    37 HOMESCREEN_TEST_CLASS(t_hsapplication)
       
    38 
       
    39 class HsStateMachine : public QStateMachine
       
    40 {
       
    41     Q_OBJECT
       
    42 
       
    43 public:
       
    44     HsStateMachine(QObject *parent = 0);
       
    45     ~HsStateMachine();
       
    46 
       
    47 signals:
       
    48     void event_exit();
       
    49     void event_toIdle();
       
    50 protected:
       
    51     bool eventFilter(QObject *watched, QEvent *event);
       
    52 
       
    53 private:
       
    54     Q_DISABLE_COPY(HsStateMachine)
       
    55 
       
    56 
       
    57     void registerAnimations();
       
    58     void createStatePublisher();
       
    59     void createContentServiceParts();
       
    60     void createStates();
       
    61 	void updatePSKeys();
       
    62 
       
    63 private slots:
       
    64 	void onIdleStateEntered();
       
    65 	void onIdleStateExited();
       
    66 	void activityRequested(const QString &name);
       
    67 	
       
    68 
       
    69 private:
       
    70     HsContentService *mContentService;	
       
    71 	
       
    72 	bool mHomeScreenActive;
       
    73 	bool mIdleStateActive;
       
    74 
       
    75 	QValueSpacePublisher *mPublisher;
       
    76 	
       
    77 #ifdef Q_OS_SYMBIAN
       
    78     XQKeyCapture keyCapture;
       
    79 #endif
       
    80     
       
    81     HOMESCREEN_TEST_FRIEND_CLASS(t_hsapplication)
       
    82 };
       
    83 
       
    84 #endif