ftuapplication/inc/ftufirsttimeuse.h
changeset 0 c464cd7e2753
child 2 66c26770985f
equal deleted inserted replaced
-1:000000000000 0:c464cd7e2753
       
     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:  First Time Use application main class.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef FTU_FIRSTTIMEUSE_H
       
    20 #define FTU_FIRSTTIMEUSE_H
       
    21 
       
    22 #include "ftutest_global.h"
       
    23 
       
    24 #include <QObject>
       
    25 
       
    26 FTU_TEST_CLASS(FtuFirstTimeUseTest)
       
    27 
       
    28 class QStateMachine;
       
    29 
       
    30 
       
    31 /**
       
    32  * @ingroup group_ftuapplication
       
    33  * @brief First Time Use application main class.
       
    34  * 
       
    35  * Loads a runtime from a runtime provider plugin. Manages 
       
    36  * the runtime execution.
       
    37  *
       
    38  * @lib ?library
       
    39  * @since S60 ?S60_version
       
    40  */
       
    41 class FtuFirstTimeUse : public QObject
       
    42 {
       
    43     Q_OBJECT
       
    44 
       
    45 public:
       
    46 
       
    47     /**
       
    48      * Constructor.
       
    49      * @since S60 ?S60_version.     
       
    50      * @param aParent Parent object.
       
    51      */
       
    52     FtuFirstTimeUse(QObject* aParent = 0);
       
    53     
       
    54     /**
       
    55      * Destructor.
       
    56      * @since S60 ?S60_version.     
       
    57      */
       
    58     virtual ~FtuFirstTimeUse();
       
    59 
       
    60 private:
       
    61 
       
    62     /**
       
    63      * Registers service plugins pre-installed on the device.
       
    64      */
       
    65     void registerServicePlugins();
       
    66     /**
       
    67      * Recursively registers service plugins starting from given root
       
    68      * directory. All directories containing plugins are added to
       
    69      * application's library paths at the same time.
       
    70      * @param root The root folder.
       
    71      */
       
    72     void registerServicePlugins(const QString &root);
       
    73 
       
    74     Q_DISABLE_COPY(FtuFirstTimeUse)
       
    75 
       
    76 signals:
       
    77 
       
    78     /**
       
    79      * Emitted when the FTU application needs to exit.
       
    80      * @since S60 ?S60_version.     
       
    81      */
       
    82     void exit();
       
    83 
       
    84 public slots:
       
    85 
       
    86     /**
       
    87      * Starts the runtime.
       
    88      * @since S60 ?S60_version. 
       
    89      */
       
    90     void start();
       
    91     
       
    92     /**
       
    93      * Stops the runtime.
       
    94      * @since S60 ?S60_version.     
       
    95      */
       
    96     void stop();
       
    97 
       
    98 private slots:
       
    99 
       
   100     /**
       
   101      * Called after the runtime has started.
       
   102      * @since S60 ?S60_version.     
       
   103      */
       
   104     void handleRuntimeStarted();
       
   105 
       
   106     /**
       
   107      * Called after the runtime has stopped.
       
   108      * @since S60 ?S60_version.     
       
   109      */
       
   110     void handleRuntimeStopped();
       
   111     
       
   112     /**
       
   113      * Called after the runtime has faulted.
       
   114      * @since S60 ?S60_version.     
       
   115      */
       
   116     void handleRuntimeFaulted();
       
   117 
       
   118 private:
       
   119 
       
   120     /**
       
   121      * Runtime.
       
   122      */
       
   123     QStateMachine* mRuntime;
       
   124 
       
   125     FTU_TEST_FRIEND_CLASS(FtuFirstTimeUseTest)
       
   126 
       
   127 };
       
   128 
       
   129 #endif
       
   130