photosgallery/viewframework/uiutilities/inc/glxmmcnotifier.h
branchRCL_3
changeset 13 bcb43dc84c44
child 24 ea65f74e6de4
equal deleted inserted replaced
12:ce1c7ad1f18b 13:bcb43dc84c44
       
     1 /*
       
     2 * Copyright (c) 2008-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:    MMC Notifier
       
    15 *
       
    16 */
       
    17 
       
    18 #ifndef GLXMMCNOTIFIER_H_
       
    19 #define GLXMMCNOTIFIER_H_
       
    20 
       
    21 #include <f32file.h>  
       
    22 
       
    23 //observer class to notify events
       
    24 class MStorageNotifierObserver
       
    25     {
       
    26 public:
       
    27     virtual void HandleMMCInsertionL() =0;
       
    28     virtual void HandleMMCRemovalL() =0;
       
    29     };
       
    30 /**
       
    31  * states for MMC card
       
    32  */
       
    33 enum TGlxMMCState
       
    34     {
       
    35     EMMCStateReset,
       
    36     EMMCStateInsert
       
    37     };
       
    38 /**
       
    39  * class declaration
       
    40  */
       
    41 class CGlxMMCNotifier : public CActive   
       
    42     {  
       
    43 public: 
       
    44     /**
       
    45      * Two-phased constructor.
       
    46      */
       
    47     IMPORT_C static CGlxMMCNotifier* NewL(MStorageNotifierObserver& aNotify);
       
    48     
       
    49     /**
       
    50      * Two-phased constructor.
       
    51      */
       
    52     static CGlxMMCNotifier* NewLC(MStorageNotifierObserver& aNotify);    
       
    53     /**
       
    54      * Destructor
       
    55      */
       
    56     ~CGlxMMCNotifier ();  
       
    57     
       
    58 private:
       
    59     /**
       
    60      * Default constructor
       
    61      */
       
    62     CGlxMMCNotifier (MStorageNotifierObserver& aNotify);    
       
    63     /**
       
    64      * By default Symbian 2nd phase constructor is private.
       
    65      */
       
    66     void ConstructL(); 
       
    67     
       
    68 private:
       
    69     /**
       
    70      * active object's default implelemtaions
       
    71      */    
       
    72     void RunL();    
       
    73     void DoCancel();      
       
    74     
       
    75     /**
       
    76      * IssueRequest 
       
    77      */
       
    78     void IssueRequest();   
       
    79     
       
    80 private:    
       
    81     /**
       
    82      * file session
       
    83      */
       
    84     RFs  iFs;
       
    85     /**
       
    86      * reference of observer
       
    87      */
       
    88     MStorageNotifierObserver& iNotify;
       
    89     /**
       
    90      * MMC state
       
    91      */
       
    92     TGlxMMCState istate;
       
    93     };
       
    94 
       
    95 #endif /* GLXMMCNOTIFIER_H_ */