coreapplicationuis/SysAp/Src/memorycard/sysapdriveunlockhandler.h
changeset 61 224b21efc2d4
parent 0 2e3d3ce01487
child 63 c2c61fdca848
equal deleted inserted replaced
60:d55467af0fda 61:224b21efc2d4
    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"
    25 
    26 
    26 // FORWARD DECLARATIONS
    27 // FORWARD DECLARATIONS
    27 class CSysApDriveList;
    28 class CSysApDriveList;
    28 class CSysApAppUi;
    29 class CSysApAppUi;
    29 
    30 
    30 // CLASS DECLARATION
    31 // CLASS DECLARATION
    31 class CSysApDriveUnlockHandler : public CBase,
    32 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 );
    60 
    71 
    61 private:
    72 private:
    62     /**
    73     /**
    63     * Constructor.
    74     * Constructor.
    64     */
    75     */
    65     CSysApDriveUnlockHandler(
    76     CSysApDriveUnlockHandler(
    66         CSysApDriveList& aSysApDriveList,
    77         CSysApDriveList& aSysApDriveList,
    67         CSysApAppUi& aSysApAppUi,
    78         CSysApAppUi& aSysApAppUi,
    68         const TBool aMemoryCardLockSupported );
    79         const TBool aMemoryCardLockSupported );
    69 
    80     
    70     /**
    81     /**
    71     * Handles query show from CAsyncCallBack.
    82     * Handles query show from CAsyncCallBack.
    72     */
    83     */
    73     static TInt QueryShowCB( TAny* aPtr );
    84     static TInt QueryShowCB( TAny* aPtr );
    74 
       
    75     /**
       
    76     * Shows unlock query.
       
    77     */
       
    78     void ShowUnlockQueryL();
       
    79 
    85 
    80     /**
    86     /**
    81     * Checks is unlock query ongoing.
    87     * Checks is unlock query ongoing.
    82     */
    88     */
    83     TBool IsQueryOngoing() const;
    89     TBool IsQueryOngoing() const;
    95     /**
   101     /**
    96     * Stops unlock.
   102     * Stops unlock.
    97     */
   103     */
    98     void DoStopUnlock( TInt aError );
   104     void DoStopUnlock( TInt aError );
    99 
   105 
   100 private: // From MAknMemoryCardDialogObserver
       
   101     void UnlockComplete( TInt aResult );
       
   102 
       
   103 private: // Data
   106 private: // Data
   104     // Reference to the drive list
   107     // Reference to the drive list
   105     CSysApDriveList& iSysApDriveList;
   108     CSysApDriveList& iSysApDriveList;
   106 
   109 
   107     // Reference to the app ui
   110     // Reference to the app ui
   108     CSysApAppUi& iSysApAppUi;
   111     CSysApAppUi& iSysApAppUi;
   109 
   112 
   110     // Indicates if memory card locking is supported
   113     // Indicates if memory card locking is supported
   111     TBool iMemoryCardLockSupported;
   114     TBool iMemoryCardLockSupported;
   112 
   115 	
   113     // Pointer to unlock query. Own,
   116 	CHbDeviceInputDialogSymbian* iMemCardPwdDialog;
   114     CAknMemoryCardDialog* iMemoryCardDialog;
   117     
   115 
   118 	// Current drive to be unlocked
   116     // Current drive to be unlocked
       
   117     TInt iDriveToUnlock;
   119     TInt iDriveToUnlock;
   118 
       
   119     // Pointer to the callback. Own.
       
   120     CAsyncCallBack* iQueryShowCB;
       
   121 
   120 
   122     // Indicates if the query result can be ignored i.e. query was canceled
   121     // Indicates if the query result can be ignored i.e. query was canceled
   123     TBool iIgnoreQueryResult;
   122     TBool iIgnoreQueryResult;
   124 
   123     
       
   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