|         |      1 /* | 
|         |      2 * Copyright (c) 2004-2007 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:  Wraps document handler functions | 
|         |     15 * | 
|         |     16 */ | 
|         |     17  | 
|         |     18  | 
|         |     19  | 
|         |     20 #ifndef CFILEMANAGERDOCHANDLER_H | 
|         |     21 #define CFILEMANAGERDOCHANDLER_H | 
|         |     22  | 
|         |     23 // INCLUDES | 
|         |     24 #include <apparc.h> | 
|         |     25 #include <AknServerApp.h> | 
|         |     26 #include <apgcli.h> | 
|         |     27 #include "MFileManagerThreadFunction.h" | 
|         |     28  | 
|         |     29 // FORWARD DECLARATIONS | 
|         |     30 class CDocumentHandler; | 
|         |     31 class CFileManagerEngine; | 
|         |     32 class CFileManagerUtils; | 
|         |     33 class CEikProcess; | 
|         |     34 class CFileManagerThreadWrapper; | 
|         |     35 class MFileManagerProcessObserver; | 
|         |     36  | 
|         |     37  | 
|         |     38 // CLASS DECLARATION | 
|         |     39 /** | 
|         |     40 *  This class wraps dochandler functions | 
|         |     41 * | 
|         |     42 *  @lib FileManagerEngine.lib | 
|         |     43 *  @since 2.7 | 
|         |     44 */ | 
|         |     45 NONSHARABLE_CLASS(CFileManagerDocHandler) : public CBase, | 
|         |     46                                             public MAknServerAppExitObserver, | 
|         |     47                                             public MFileManagerThreadFunction | 
|         |     48     { | 
|         |     49     public: | 
|         |     50  | 
|         |     51         /** | 
|         |     52         * Two-phased constructor. | 
|         |     53         */ | 
|         |     54         static CFileManagerDocHandler* NewL( | 
|         |     55             CFileManagerEngine& aEngine, | 
|         |     56              CFileManagerUtils& aUtils ); | 
|         |     57              | 
|         |     58         /** | 
|         |     59         * Destructor. | 
|         |     60         */ | 
|         |     61         ~CFileManagerDocHandler(); | 
|         |     62  | 
|         |     63     private: // From MAknServerAppExitObserver | 
|         |     64         void HandleServerAppExit( TInt aReason ); | 
|         |     65  | 
|         |     66     private: // From MFileManagerThreadFunction | 
|         |     67  | 
|         |     68         void ThreadStepL(); | 
|         |     69  | 
|         |     70         TBool IsThreadDone(); | 
|         |     71  | 
|         |     72         void NotifyThreadClientL( TNotifyType aType, TInt aValue ); | 
|         |     73  | 
|         |     74     public: // New functions | 
|         |     75         void OpenFileL( | 
|         |     76             const TDesC& aFullPath, MFileManagerProcessObserver* aObserver ); | 
|         |     77  | 
|         |     78         void CancelFileOpen(); | 
|         |     79  | 
|         |     80     private: | 
|         |     81         /** | 
|         |     82         * C++ default constructor. | 
|         |     83         */ | 
|         |     84         CFileManagerDocHandler( | 
|         |     85             CFileManagerEngine& aEngine, | 
|         |     86             CFileManagerUtils& aUtils ); | 
|         |     87  | 
|         |     88         /** | 
|         |     89         * By default Symbian 2nd phase constructor is private. | 
|         |     90         */ | 
|         |     91         void ConstructL(); | 
|         |     92  | 
|         |     93         void OpenShareableFileL( RFile64& aShareableFile, const TDesC8& aMime ); | 
|         |     94  | 
|         |     95     private: | 
|         |     96  | 
|         |     97         // Ref: To notify engine of embedded application | 
|         |     98         CFileManagerEngine& iEngine; | 
|         |     99          | 
|         |    100         // Ref: For using utilities | 
|         |    101         CFileManagerUtils& iUtils; | 
|         |    102  | 
|         |    103         // Ref: Shareable file server session | 
|         |    104         RFs& iFs; | 
|         |    105  | 
|         |    106         // Own: For launching files | 
|         |    107         CDocumentHandler* iDocHandler; | 
|         |    108  | 
|         |    109         // Own: Shareable file | 
|         |    110         RFile64 iFile; | 
|         |    111  | 
|         |    112         // Own: File ready indicator | 
|         |    113         TBool iFileReady; | 
|         |    114  | 
|         |    115         // Own: File fullpath | 
|         |    116         HBufC* iFileFullPath; | 
|         |    117  | 
|         |    118         // Own: File MIME type | 
|         |    119         HBufC8* iFileMime; | 
|         |    120  | 
|         |    121         // Ref: Observer for document open status | 
|         |    122         MFileManagerProcessObserver* iObserver; | 
|         |    123  | 
|         |    124         // Own: For async file open for downloading file to cache | 
|         |    125         CFileManagerThreadWrapper* iThreadWrapper; | 
|         |    126  | 
|         |    127         // Own: For getting app uids | 
|         |    128         RApaLsSession iApaSession; | 
|         |    129  | 
|         |    130         // Own: Indicates the file open status | 
|         |    131         TBool iEmbeddedAppOpen; | 
|         |    132  | 
|         |    133     }; | 
|         |    134  | 
|         |    135 #endif // CFILEMANAGERDOCHANDLER_H |