sysstatemgmt/ssmcustcmds/ssmsystemcmds/inc/ssmsystemcmdsfactory.h
changeset 0 4e1aa6a622a0
equal deleted inserted replaced
-1:000000000000 0:4e1aa6a622a0
       
     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 * Declaration of SsmSystemCmdsFactory class.
       
    16 *
       
    17 */
       
    18 
       
    19 #ifndef SSMSYSTEMCMDSFACTORY_H
       
    20 #define SSMSYSTEMCMDSFACTORY_H
       
    21 
       
    22 #include <e32def.h>
       
    23 
       
    24 class MSsmCustomCommand;
       
    25 
       
    26 /**
       
    27  *  Creates custom command objects.
       
    28  *
       
    29  *  Custom commands are loaded by system state manager based on DLL name and
       
    30  *  function ordinal.
       
    31  *  Each DLL containing custom commands must offer factory methods for each
       
    32  *  custom command.
       
    33  *  The function ordinals must be exactly the same in emulator and HW builds
       
    34  *  or loading the custom command may have unpredictable results.
       
    35  *
       
    36  *  SsmSystemCmdsFactory is a static class containing factory method of one
       
    37  *  custom command. It can be easily extended to contain factory methods of
       
    38  *  multiple custom commands by adding more member functions.
       
    39  *
       
    40  *  It is better to implement own factory method for each separate command
       
    41  *  than to try to use command parameters to distinguis between them.
       
    42  *  Note that similar commands can be implemented in the same command class -
       
    43  *  just the factory methods need to be different.
       
    44  */
       
    45 class SsmSystemCmdsFactory
       
    46     {
       
    47 
       
    48 public:
       
    49 
       
    50     /**
       
    51      * Creates and returns a custom command of type CSsmsInitPsKeys.
       
    52      * This method has function ordinal 1 in ssmsystemcmds.dll.
       
    53      *
       
    54      * @return A custom command object.
       
    55      */
       
    56 	IMPORT_C static MSsmCustomCommand* InitPsKeysNewL();
       
    57 
       
    58     /**
       
    59      *  Creates and returns a custom command of type CSsmInitStartupReason.
       
    60      * This method has function ordinal 2 in ssmsystemcmds.dll.
       
    61      *
       
    62      * @return A custom command object.
       
    63      */
       
    64     IMPORT_C static MSsmCustomCommand* InitStartupReasonNewL();
       
    65     
       
    66     /**
       
    67      * Creates and returns a custom command of type CSsmInitCriticalLevels.
       
    68      * This method has function ordinal 3 in ssmsystemcmds.dll.
       
    69      *
       
    70      * @return A custom command object.
       
    71      */
       
    72     IMPORT_C static MSsmCustomCommand* InitCriticalLevelsNewL();
       
    73     
       
    74 
       
    75     /**
       
    76      * Creates and returns a custom command of type CSsmWaitPsKey.
       
    77      * This method has function ordinal 5 in ssmsystemcmds.dll.
       
    78      *
       
    79      * @return A custom command object.
       
    80      */
       
    81     IMPORT_C static MSsmCustomCommand* WaitForPsKeyExactNewL();
       
    82 
       
    83     /**
       
    84      * Creates and returns a custom command of type CSsmWaitPsKey.
       
    85      * This method has function ordinal 6 in ssmsystemcmds.dll.
       
    86      *
       
    87      * @return A custom command object.
       
    88      */
       
    89     IMPORT_C static MSsmCustomCommand* WaitForPsKeyRangeNewL();
       
    90 
       
    91     /**
       
    92      * Creates and returns a custom command of type CSsmSaShutdown.
       
    93      * This method has function ordinal 7 in ssmsystemcmds.dll.
       
    94      *
       
    95      * @return A custom command object.
       
    96      */
       
    97     IMPORT_C static MSsmCustomCommand* SaShutdownNewL();
       
    98     };
       
    99 
       
   100 #endif // SSMSYSTEMCMDSFACTORY