javamanager/javaregistry/legacy/server/inc/javaregmmcobserver.h
branchRCL_3
changeset 19 04becd199f91
equal deleted inserted replaced
16:f5050f1da672 19:04becd199f91
       
     1 /*
       
     2 * Copyright (c) 2005-2006 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:  javaregmmcobserver definition
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef JAVAREGMMCOBSERVER_H
       
    20 #define JAVAREGMMCOBSERVER_H
       
    21 
       
    22 #include <f32file.h>
       
    23 
       
    24 
       
    25 namespace Java
       
    26 {
       
    27 namespace Manager
       
    28 {
       
    29 namespace Registry
       
    30 {
       
    31 
       
    32 // FORWARD DECLARATIONS
       
    33 class MMemoryCardObserver;
       
    34 
       
    35 /**
       
    36  * CMmcObserver class registers to file server for receiving mmc status
       
    37  * change events and passes this events to the registered observer object.
       
    38  *
       
    39  * @since S60 v3.2
       
    40  */
       
    41 class CMmcObserver : public CActive
       
    42 {
       
    43 public:
       
    44 
       
    45     /**
       
    46      * Creates new mmc observer object.
       
    47      *
       
    48      * @since S60 v3.2
       
    49      * @param aDrive drive number to watch
       
    50      * @param aObserver observer object
       
    51      * @param aFileServerSession file server session object
       
    52      */
       
    53     static CMmcObserver* NewL(TInt aDrive,
       
    54                               MMemoryCardObserver* aObserver,
       
    55                               RFs* aFileServerSession);
       
    56 
       
    57     /**
       
    58      * Creates new mmc observer object and leave it on cleanup stack
       
    59      *
       
    60      * @since S60 v3.2
       
    61      * @param aDrive drive number to watch
       
    62      * @param aObserver observer object
       
    63      * @param aFileServerSession file server session object
       
    64      */
       
    65     static CMmcObserver* NewLC(TInt aDrive,
       
    66                                MMemoryCardObserver* aObserver,
       
    67                                RFs* aFileServerSession);
       
    68 
       
    69     /**
       
    70      * Starts MMC event observing.
       
    71      *
       
    72      * @since S60 v3.2
       
    73      */
       
    74     void StartObserver();
       
    75 
       
    76     /**
       
    77      * Gets the id of the inserted mmc.
       
    78      *
       
    79      * @since S60 v3.2
       
    80      * @return the unique id of the inserted MMC or 0 if MMC not present
       
    81      */
       
    82     TUint MmcId();
       
    83 
       
    84 public:     // from CActive
       
    85 
       
    86     /**
       
    87      * RunL
       
    88      */
       
    89     void RunL();
       
    90 
       
    91     /**
       
    92      * DoCancel
       
    93      */
       
    94     void DoCancel();
       
    95 
       
    96     /**
       
    97      * Destructor
       
    98      */
       
    99     ~CMmcObserver();
       
   100 
       
   101 private:
       
   102 
       
   103     /**
       
   104      * ConstructL
       
   105      *
       
   106      * @since S60 v3.2
       
   107      * @param aObserver observer object
       
   108      * @param aFileServerSession file server session object
       
   109      */
       
   110     void ConstructL(MMemoryCardObserver* aObserver, RFs* aFileServerSession);
       
   111 
       
   112     /**
       
   113      * Constructor
       
   114      *
       
   115      * @since S60 v3.2
       
   116      * @param aDrive drive number to watch
       
   117      */
       
   118     CMmcObserver(TInt aDrive);
       
   119 
       
   120 private:    //data
       
   121 
       
   122     // observer object
       
   123     MMemoryCardObserver* iObserver;
       
   124 
       
   125     // file server session object
       
   126     RFs* iFsSession;
       
   127 
       
   128     // drive number we are watching
       
   129     TInt iDrive;
       
   130 
       
   131     // notification path
       
   132     TPath iNotificationPath;
       
   133 
       
   134 };
       
   135 
       
   136 }//namespace Registry
       
   137 }//namespace Manager
       
   138 }//namespace Java
       
   139 
       
   140 #endif // JAVAREGMMCOBSERVER_H
       
   141 
       
   142 // End of File