filebrowser/engine/FBFileUtils.h
changeset 28 4cc0d1a608c1
parent 27 271e901a9423
child 31 e7a04a6385be
equal deleted inserted replaced
27:271e901a9423 28:4cc0d1a608c1
    26 #include <coedef.h>
    26 #include <coedef.h>
    27 #include <AknServerApp.h>
    27 #include <AknServerApp.h>
    28 #include <msvapi.h>
    28 #include <msvapi.h>
    29 #include <AknProgressDialog.h>
    29 #include <AknProgressDialog.h>
    30 #include <tz.h>
    30 #include <tz.h>
       
    31 #include "FB.hrh"
    31 
    32 
    32 _LIT(KIRAppPath, "z:\\sys\\bin\\irapp.exe");
    33 _LIT(KIRAppPath, "z:\\sys\\bin\\irapp.exe");
    33 _LIT(KBTAppPath, "z:\\sys\\bin\\btui.exe");
    34 _LIT(KBTAppPath, "z:\\sys\\bin\\btui.exe");
    34 _LIT(KUSBAppPath, "z:\\sys\\bin\\usbclasschangeui.exe");
    35 _LIT(KUSBAppPath, "z:\\sys\\bin\\usbclasschangeui.exe");
    35 _LIT(KErrRdPath, "c:\\resource\\ErrRd");
    36 _LIT(KErrRdPath, "c:\\resource\\ErrRd");
   179 
   180 
   180 typedef CArrayFixSeg<TCommand> CCommandArray;
   181 typedef CArrayFixSeg<TCommand> CCommandArray;
   181 
   182 
   182 
   183 
   183 
   184 
   184 class CFileBrowserFileUtils : public CActive, public MAknServerAppExitObserver, public MMsvSessionObserver, public MProgressDialogCallback 
   185 class CFileBrowserFileUtils : public CActive, public MAknServerAppExitObserver, public MMsvSessionObserver//, public MProgressDialogCallback
   185 	{
   186 	{
   186 private:
   187 private:
   187     enum TState // active object states
   188     enum TState // active object states
   188     	{
   189     	{
   189     	EIdle = 0,              // do nothing
   190     	EIdle = 0,              // do nothing
   193     	{
   194     	{
   194     	EClipBoardModeCut = 0,
   195     	EClipBoardModeCut = 0,
   195     	EClipBoardModeCopy
   196     	EClipBoardModeCopy
   196     	};
   197     	};
   197 
   198 
   198     enum TListingMode
       
   199     	{
       
   200     	ENormalEntries = 0,
       
   201     	ESearchResults,
       
   202     	EOpenFiles,
       
   203     	EMsgAttachmentsInbox,
       
   204     	EMsgAttachmentsDrafts,
       
   205     	EMsgAttachmentsSentItems,
       
   206     	EMsgAttachmentsOutbox
       
   207     	};
       
   208     	    	
       
   209 public:
   199 public:
   210 	static CFileBrowserFileUtils* NewL(CEngine* aEngine);
   200 	static CFileBrowserFileUtils* NewL(CEngine* aEngine);
   211 	~CFileBrowserFileUtils();
   201 	~CFileBrowserFileUtils();
   212 
   202 
   213 private:
   203 private:
   214 	CFileBrowserFileUtils(CEngine* aEngine);
   204 	CFileBrowserFileUtils(CEngine* aEngine);
   215 	void ConstructL();
   205 	void ConstructL();
   216 
   206 
   217 private: // from CActive
   207 private: // from CActive
   218 	void RunL();
   208 	void RunL();
   219     TInt RunError(TInt aError);
   209         TInt RunError(TInt aError);
   220 	void DoCancel();
   210 	void DoCancel();
   221 
   211 
   222 private: // from MAknServerAppExitObserver
   212 private: // from MAknServerAppExitObserver
   223     void HandleServerAppExit(TInt aReason);
   213     void HandleServerAppExit(TInt aReason);
   224 
   214 
   225 private: // from MMsvSessionObserver
   215 private: // from MMsvSessionObserver
   226     void HandleSessionEventL(TMsvSessionEvent aEvent, TAny* aArg1, TAny* aArg2, TAny* aArg3);
   216     void HandleSessionEventL(TMsvSessionEvent aEvent, TAny* aArg1, TAny* aArg2, TAny* aArg3);
   227 
   217 
   228 private:  //from MProgressDialogCallback
   218 public:  //from MProgressDialogCallback
   229     void DialogDismissedL(TInt aButtonId);  
   219     void DialogDismissedL(/*TInt aButtonId*/);
   230     
   220     
   231 public: // command handling
   221 public: // command handling
   232     void StartExecutingCommandsL(const TDesC& aLabel);
   222     void StartExecutingCommandsL(const TDesC& aLabel);
   233 private: // command handling
   223 private: // command handling
   234     void ExecuteCommand();
   224     void ExecuteCommand();
   341     inline TInt OrderMode() { return iOrderMode; }
   331     inline TInt OrderMode() { return iOrderMode; }
   342     inline CFileEntryList* ClipBoardList() { return iClipBoardList; }
   332     inline CFileEntryList* ClipBoardList() { return iClipBoardList; }
   343     inline CFileEntryList* CurrentSelectionList() { return iCurrentSelectionList; }
   333     inline CFileEntryList* CurrentSelectionList() { return iCurrentSelectionList; }
   344     inline TBool IsDriveListViewActive() { return iCurrentPath==KNullDesC && iListingMode==ENormalEntries; }
   334     inline TBool IsDriveListViewActive() { return iCurrentPath==KNullDesC && iListingMode==ENormalEntries; }
   345     inline TBool IsNormalModeActive() { return iListingMode==ENormalEntries; }
   335     inline TBool IsNormalModeActive() { return iListingMode==ENormalEntries; }
       
   336     inline TListingMode ListingMode() { return iListingMode; }
   346     inline TFileName CurrentPath() { return iCurrentPath; }
   337     inline TFileName CurrentPath() { return iCurrentPath; }
   347 	
   338 	
   348     inline TSearchAttributes GetSearchAttributes(){ return iSearchAttributes; };
   339     inline TSearchAttributes GetSearchAttributes(){ return iSearchAttributes; };
   349     inline void ChangeAttributes(TSearchAttributes attributes) { iSearchAttributes = attributes; };
   340     inline void ChangeAttributes(TSearchAttributes attributes) { iSearchAttributes = attributes; };
   350     inline TSearchResults SearchResults(){ return iFileSearchResults; };
   341     inline TSearchResults SearchResults(){ return iFileSearchResults; };
   354 private:
   345 private:
   355     TState                          iState;
   346     TState                          iState;
   356     CEngine*                        iEngine;
   347     CEngine*                        iEngine;
   357     CFileBrowserFileOps*            iFileOps;
   348     CFileBrowserFileOps*            iFileOps;
   358 //    CAknWaitDialog*                 iWaitDialog;
   349 //    CAknWaitDialog*                 iWaitDialog;
       
   350     TBool                           isWaitDialog;
       
   351     TBool                           isProgressDialog;
   359 //    CAknProgressDialog*             iProgressDialog;
   352 //    CAknProgressDialog*             iProgressDialog;
   360     CEikProgressInfo*               iProgressInfo;
   353     CEikProgressInfo*               iProgressInfo;
   361     CCommandArray*                  iCommandArray;
   354     CCommandArray*                  iCommandArray;
   362     TInt                            iCurrentEntry;
   355     TInt                            iCurrentEntry;
   363     TInt                            iSucceededOperations;
   356     TInt                            iSucceededOperations;