coreapplicationuis/SysAp/Src/memorycard/sysapdriveunlockhandler.h
branchRCL_3
changeset 63 c2c61fdca848
parent 62 924385140d98
equal deleted inserted replaced
62:924385140d98 63:c2c61fdca848
    20 #define SYSAPDRIVEUNLOCKHANDLER_H
    20 #define SYSAPDRIVEUNLOCKHANDLER_H
    21 
    21 
    22 // INCLUDES
    22 // INCLUDES
    23 #include <e32std.h>
    23 #include <e32std.h>
    24 #include <aknmemorycarddialog.h>
    24 #include <aknmemorycarddialog.h>
    25 #include "hbdeviceinputdialogsymbian.h"
       
    26 
    25 
    27 // FORWARD DECLARATIONS
    26 // FORWARD DECLARATIONS
    28 class CSysApDriveList;
    27 class CSysApDriveList;
    29 class CSysApAppUi;
    28 class CSysApAppUi;
    30 
    29 
    31 // CLASS DECLARATION
    30 // CLASS DECLARATION
    32 class CSysApDriveUnlockHandler : public CBase                             
    31 class CSysApDriveUnlockHandler : public CBase,
       
    32                                  public MAknMemoryCardDialogObserver
    33 {
    33 {
    34 public:
    34 public:
    35     /**
    35     /**
    36      * Two-phased constructor.
    36      * Two-phased constructor.
    37      */
    37      */
    55     /**
    55     /**
    56      * Stops unlock notifier for given drive if currently shown.
    56      * Stops unlock notifier for given drive if currently shown.
    57      * @param aDrive Drive to stop unlock notifier if ongoing
    57      * @param aDrive Drive to stop unlock notifier if ongoing
    58      */
    58      */
    59     void StopUnlock( TInt aDrive );
    59     void StopUnlock( TInt aDrive );
    60     
       
    61     void ReleaseMemoryForInputCardDialog();
       
    62     TInt CheckMemoryDialogIfNeeded();
       
    63     void ConvertCharactersToPwd(TDesC& aWord, TDes8& aConverted);
       
    64     
       
    65     /**
       
    66     * Shows unlock query.
       
    67     */
       
    68     void ShowUnlockQueryL();
       
    69     HBufC8* Convert16to8L(TDesC16& aStr);
       
    70     void UnlockComplete( TInt aResult );
       
    71 
    60 
    72 private:
    61 private:
    73     /**
    62     /**
    74     * Constructor.
    63     * Constructor.
    75     */
    64     */
    76     CSysApDriveUnlockHandler(
    65     CSysApDriveUnlockHandler(
    77         CSysApDriveList& aSysApDriveList,
    66         CSysApDriveList& aSysApDriveList,
    78         CSysApAppUi& aSysApAppUi,
    67         CSysApAppUi& aSysApAppUi,
    79         const TBool aMemoryCardLockSupported );
    68         const TBool aMemoryCardLockSupported );
    80     
    69 
    81     /**
    70     /**
    82     * Handles query show from CAsyncCallBack.
    71     * Handles query show from CAsyncCallBack.
    83     */
    72     */
    84     static TInt QueryShowCB( TAny* aPtr );
    73     static TInt QueryShowCB( TAny* aPtr );
       
    74 
       
    75     /**
       
    76     * Shows unlock query.
       
    77     */
       
    78     void ShowUnlockQueryL();
    85 
    79 
    86     /**
    80     /**
    87     * Checks is unlock query ongoing.
    81     * Checks is unlock query ongoing.
    88     */
    82     */
    89     TBool IsQueryOngoing() const;
    83     TBool IsQueryOngoing() const;
   101     /**
    95     /**
   102     * Stops unlock.
    96     * Stops unlock.
   103     */
    97     */
   104     void DoStopUnlock( TInt aError );
    98     void DoStopUnlock( TInt aError );
   105 
    99 
       
   100 private: // From MAknMemoryCardDialogObserver
       
   101     void UnlockComplete( TInt aResult );
       
   102 
   106 private: // Data
   103 private: // Data
   107     // Reference to the drive list
   104     // Reference to the drive list
   108     CSysApDriveList& iSysApDriveList;
   105     CSysApDriveList& iSysApDriveList;
   109 
   106 
   110     // Reference to the app ui
   107     // Reference to the app ui
   111     CSysApAppUi& iSysApAppUi;
   108     CSysApAppUi& iSysApAppUi;
   112 
   109 
   113     // Indicates if memory card locking is supported
   110     // Indicates if memory card locking is supported
   114     TBool iMemoryCardLockSupported;
   111     TBool iMemoryCardLockSupported;
   115 	
   112 
   116 	CHbDeviceInputDialogSymbian* iMemCardPwdDialog;
   113     // Pointer to unlock query. Own,
   117     
   114     CAknMemoryCardDialog* iMemoryCardDialog;
   118 	// Current drive to be unlocked
   115 
       
   116     // Current drive to be unlocked
   119     TInt iDriveToUnlock;
   117     TInt iDriveToUnlock;
       
   118 
       
   119     // Pointer to the callback. Own.
       
   120     CAsyncCallBack* iQueryShowCB;
   120 
   121 
   121     // Indicates if the query result can be ignored i.e. query was canceled
   122     // Indicates if the query result can be ignored i.e. query was canceled
   122     TBool iIgnoreQueryResult;
   123     TBool iIgnoreQueryResult;
   123     
   124 
   124     TMediaPassword iPassword;
       
   125 };
   125 };
   126 
   126 
   127 #endif // SYSAPDRIVEUNLOCKHANDLER_H
   127 #endif // SYSAPDRIVEUNLOCKHANDLER_H
   128 
   128 
   129 // End of File
   129 // End of File