1 /* |
|
2 * Copyright (c) 2008 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: |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 |
|
21 #ifndef __CREATORFiles_H__ |
|
22 #define __CREATORFiles_H__ |
|
23 |
|
24 #include "creator_model.h" |
|
25 #include "creator_modulebase.h" |
|
26 |
|
27 #include <caf/caf.h> |
|
28 using namespace ContentAccess; |
|
29 |
|
30 #include <e32base.h> |
|
31 #include <bautils.h> |
|
32 #include <pathinfo.h> |
|
33 #include <apgcli.h> // RApaLsSession |
|
34 |
|
35 class CCreatorEngine; |
|
36 class CFilesParameters; |
|
37 class CDRMPermission; |
|
38 class CDRMConstraint; |
|
39 |
|
40 class CCreatorFiles : public CBase, public MCreatorModuleBase |
|
41 { |
|
42 public: |
|
43 static CCreatorFiles* NewL(CCreatorEngine* aEngine); |
|
44 static CCreatorFiles* NewLC(CCreatorEngine* aEngine); |
|
45 ~CCreatorFiles(); |
|
46 |
|
47 private: |
|
48 CCreatorFiles(); |
|
49 void ConstructL(CCreatorEngine* aEngine); // from MCreatorModuleBase |
|
50 |
|
51 public: |
|
52 TBool AskDataFromUserL(TInt aCommand, TInt& aNumberOfEntries); // from MCreatorModuleBase |
|
53 TInt CreateFileEntryL(CFilesParameters *aParameters, TInt aCommand); |
|
54 void DeleteAllL(); |
|
55 void DeleteAllCreatedByCreatorL(); |
|
56 |
|
57 private: |
|
58 |
|
59 void EncryptFileL( const TDesC& aFileName, const TDesC& aOutFileName, CFilesParameters *aParameters ); |
|
60 void SetPermissionsL( CMetaDataArray* aMetaData, const TDesC& aOutFileName, CFilesParameters *aParameters ); |
|
61 void SetMimeTypeL( const TDesC& aFileName, TDes8& aMime, CFilesParameters *aParameters ); |
|
62 TBool AskDRMDataFromUserL(); |
|
63 TBool AskDRMCDDataFromUserL(); |
|
64 void StorePathsForDeleteL( CDesCArray& aPaths ); |
|
65 void GenerateFileNameL( TFileName& aRootName ); |
|
66 |
|
67 private: |
|
68 CFilesParameters* iParameters; |
|
69 CFilesParameters* iUserParameters; |
|
70 HBufC* iDirectoryQueriedFromUser; |
|
71 RFs& iFs; |
|
72 RApaLsSession iApaLs; |
|
73 CDesCArray* iFilePaths; |
|
74 TInt iFileId; |
|
75 |
|
76 public: |
|
77 }; |
|
78 |
|
79 |
|
80 class CFilesParameters : public CCreatorModuleBaseParameters |
|
81 { |
|
82 public: |
|
83 HBufC* iFullFilePath; |
|
84 TInt iFileCommand; |
|
85 CDRMPermission* iPermission; |
|
86 TBool iEncrypt; |
|
87 |
|
88 public: |
|
89 CFilesParameters(); |
|
90 CFilesParameters( CFilesParameters& aCopy ); |
|
91 ~CFilesParameters(); |
|
92 }; |
|
93 |
|
94 |
|
95 |
|
96 #endif // __CREATORFiles_H__ |
|