resourcemgmt/hwrmfmtxwatcherplugin/inc/hwrmfmtxplugintimer.h
changeset 0 4e1aa6a622a0
equal deleted inserted replaced
-1:000000000000 0:4e1aa6a622a0
       
     1 /*
       
     2 * Copyright (c) 2008 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:  Plugin timer definition.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef HWRMFMTXPLUGINTIMER_H
       
    20 #define HWRMFMTXPLUGINTIMER_H
       
    21 
       
    22 #include <hwrmpluginservice.h>
       
    23 
       
    24 /**
       
    25 * An interface for handling timer expiration events.
       
    26 *
       
    27 * @since S60 3.2
       
    28 * @lib fmtxwatcherplugin.lib
       
    29 */
       
    30 class MHWRMFmtxPluginTimerCallback
       
    31     {
       
    32 public:
       
    33 
       
    34     /** 
       
    35     * Called when the timer fires
       
    36     */
       
    37     virtual void GenericTimerFired( TInt aCommandId,
       
    38                                     TUint8 aTransId,
       
    39                                     TInt aRetVal) = 0;
       
    40     };
       
    41 
       
    42 
       
    43 /**
       
    44 * Timer implementation class.
       
    45 *
       
    46 * @since S60 3.2
       
    47 * @lib fmtxwatcherplugin.lib
       
    48 */
       
    49 class CHWRMFmtxPluginTimer : public CTimer
       
    50     {
       
    51 public:
       
    52 
       
    53     /**
       
    54     * This is a two-phase constructor method that is used to create a new
       
    55     * instance plugin timer.
       
    56     *
       
    57     * @param aCommandId Command ID
       
    58     * @param aTransId   Transaction ID
       
    59     * @param aRetVal    Return value for response
       
    60     * @param aCallback  Reference to plugin callback handler
       
    61     *
       
    62 	* @leave One of the Symbian OS error codes.
       
    63     */
       
    64     static CHWRMFmtxPluginTimer* NewL( TInt aCommandId, TUint8 aTransId, TInt aRetVal,
       
    65                                MHWRMFmtxPluginTimerCallback& aCallback );
       
    66                      
       
    67     /**
       
    68     * Destructor.
       
    69     */
       
    70     ~CHWRMFmtxPluginTimer();
       
    71 
       
    72     /**
       
    73     * Returns transaction ID.
       
    74     */
       
    75     TUint8 TransId() const;
       
    76 
       
    77 protected:
       
    78     
       
    79     // from CActive  
       
    80     void RunL();
       
    81     
       
    82 private:
       
    83 
       
    84     /**
       
    85     * C++ default constructor.
       
    86     * Declaration only, no implementation.
       
    87     */
       
    88     CHWRMFmtxPluginTimer();
       
    89     
       
    90     /**
       
    91     * Constructor.
       
    92     *
       
    93     *
       
    94     * @param aCommandId Command ID
       
    95     * @param aTransId   Transaction ID
       
    96     * @param aRetVal    Return value for response
       
    97     * @param aCallback  Reference to plugin callback handler
       
    98     */
       
    99     CHWRMFmtxPluginTimer( TInt aCommandId, TUint8 aTransId, 
       
   100                   TInt aRetVal, MHWRMFmtxPluginTimerCallback& aCallback );
       
   101     
       
   102     /**
       
   103     * By default Symbian OS constructor is private.
       
   104     */
       
   105     void ConstructL();
       
   106     
       
   107 private:
       
   108 
       
   109     /**
       
   110     * Command ID.
       
   111     */
       
   112     TInt iCommandId;
       
   113 
       
   114     /**
       
   115     * Transaction ID.
       
   116     */
       
   117     TUint8 iTransId;
       
   118 
       
   119     /**
       
   120     * Return value for response.
       
   121     */
       
   122     TInt iRetVal;
       
   123    
       
   124     /**
       
   125     * Callback reference to be used with responses to commands.
       
   126     */
       
   127     MHWRMFmtxPluginTimerCallback& iCallback;
       
   128     };
       
   129 
       
   130 
       
   131 #endif // __PLUGINTIMER_H_