terminalsecurity/SCP/DmEventNotifier/inc/MMCService.h
changeset 0 b497e44ab2fc
child 5 3f7d9dbe57c8
equal deleted inserted replaced
-1:000000000000 0:b497e44ab2fc
       
     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: This header contains the class for MMC insertion, removal service
       
    15 *
       
    16 */
       
    17 #ifndef __MMCSERVICE__H_
       
    18 #define __MMCSERVICE__H_
       
    19 
       
    20 //System includes
       
    21 #include <e32base.h>
       
    22 #include <e32property.h>
       
    23 #include <UikonInternalPSKeys.h>
       
    24 #ifndef SYMBIAN_ENABLE_SPLIT_HEADERS
       
    25 #include <schinfo.h>
       
    26 #else
       
    27 #include <schinfo.h>
       
    28 #include <schinfointernal.h>
       
    29 #endif
       
    30 
       
    31 //User includes
       
    32 #include "DmEventServiceBase.h"
       
    33 
       
    34 //The publish subscribe key with condition. Do not alter this unless absolutely needed!
       
    35 const TPSKey KMMCPSKey(KPSUidUikon,KUikMMCInserted);
       
    36 //Condition to check when MMC is removed
       
    37 const TPSKeyCondition KMMCPSKeyConditionInsert(KMMCPSKey.iConditionCategory, KMMCPSKey.iConditionKey, 1, TTaskSchedulerCondition::EEquals);
       
    38 //Condition to check when MMC is present
       
    39 const TPSKeyCondition KMMCPSKeyConditionRemove(KMMCPSKey.iConditionCategory, KMMCPSKey.iConditionKey, 0, TTaskSchedulerCondition::EEquals);
       
    40 
       
    41 //The task name for this service. Do not alter this unless absolutely needed!
       
    42 _LIT(KMmcTaskName, "MmcTask");
       
    43 
       
    44 /**
       
    45  *  Derives the base service and implementes service for MMC card insertion and removal
       
    46  *
       
    47  *  @since  S60 v5.2
       
    48  */
       
    49 NONSHARABLE_CLASS(CMmcService) : public CDmEventServiceBase
       
    50     {
       
    51 
       
    52     public:
       
    53         /** Two phase construction **/
       
    54         static CMmcService* CMmcService::NewL();
       
    55 
       
    56         static CMmcService* CMmcService::NewLC();
       
    57 
       
    58         /** Virtual destructor **/
       
    59         virtual ~CMmcService();
       
    60 
       
    61         /**
       
    62          * Waits until any MMC activity is complete
       
    63          *
       
    64          * @since   S60   v5.2
       
    65          * @return  None. Can leave with system wide error 
       
    66          */
       
    67         void WaitForRequestCompleteL();
       
    68 
       
    69         /**
       
    70          * This functions tells if the publish subscribe key exists or not. It is called
       
    71          * before registering the condition schedule. 
       
    72          *
       
    73          * @since   S60   v5.2
       
    74          * @return ETrue if exists, otherwise EFalse
       
    75          */
       
    76         TBool IsKeyValid();
       
    77 
       
    78         /**
       
    79          * Returns the task name of the service, which should be unique in this application.
       
    80          *
       
    81          * @since   S60   v5.2
       
    82          * @return task name
       
    83          */
       
    84         const TDesC& TaskName();
       
    85         
       
    86         void UpdateMmcStatus();
       
    87 
       
    88     private:
       
    89         /** Constructors **/
       
    90         CMmcService();
       
    91 
       
    92         CMmcService(const TPSKeyCondition& aPSKeyCondition);
       
    93 
       
    94     private:
       
    95         /** Initializes the members of the class **/
       
    96         void ConstructL();
       
    97         
       
    98         TInt iLookingFor;
       
    99 
       
   100     };
       
   101 
       
   102 #endif // __MMCSERVICE__H_
       
   103 // End of File