|
1 /* |
|
2 * Copyright (c) 2002-2009 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 #ifndef WMDRMAGENTMANAGER_H |
|
21 #define WMDRMAGENTMANAGER_H |
|
22 |
|
23 // INCLUDES |
|
24 #include <caf.h> |
|
25 #include <agentinterface.h> |
|
26 #include <caf/attributeset.h> |
|
27 #include <caf/stringattributeset.h> |
|
28 |
|
29 namespace ContentAccess |
|
30 { |
|
31 |
|
32 // CLASS DECLARATION |
|
33 |
|
34 class CWmDrmAgentManager : public CAgentManager |
|
35 { |
|
36 public: // Constructors and destructor |
|
37 /** |
|
38 * Two-phased constructor. |
|
39 */ |
|
40 static CWmDrmAgentManager* NewL(); |
|
41 static CWmDrmAgentManager* NewLC(); |
|
42 |
|
43 /** |
|
44 * Destructor. |
|
45 */ |
|
46 ~CWmDrmAgentManager(); |
|
47 |
|
48 public: // New functions |
|
49 |
|
50 |
|
51 public: // Functions from base classes |
|
52 |
|
53 // From CAgentManagerBase |
|
54 TInt DeleteFile(const TDesC &aFileName); |
|
55 TInt CopyFile(const TDesC& aSource, const TDesC& aDestination); |
|
56 TInt CopyFile(RFile& aSource, const TDesC& aDestination); |
|
57 TInt RenameFile(const TDesC& aSource, const TDesC& aDestination); |
|
58 TInt MkDir(const TDesC& aPath); |
|
59 TInt MkDirAll(const TDesC& aPath); |
|
60 TInt RmDir(const TDesC& aPath); |
|
61 TInt GetDir(const TDesC& aName,TUint anEntryAttMask,TUint anEntrySortKey, CDir*& anEntryList) const; |
|
62 TInt GetDir(const TDesC& aName,TUint anEntryAttMask,TUint anEntrySortKey, CDir*& anEntryList,CDir*& aDirList) const; |
|
63 TInt GetDir(const TDesC& aName,const TUidType& anEntryUid,TUint anEntrySortKey, CDir*& aFileList) const; |
|
64 TInt GetAttribute(TInt aAttribute, TInt& aValue, const TVirtualPathPtr& aVirtualPath); |
|
65 TInt GetAttributeSet(RAttributeSet& aAttributeSet, const TVirtualPathPtr& aVirtualPath); |
|
66 TInt GetStringAttributeSet(RStringAttributeSet& aAttributeSet, const TVirtualPathPtr& aVirtualPath); |
|
67 TInt GetStringAttribute(TInt aAttribute, TDes& aValue, const TVirtualPathPtr& aVirtualPath); |
|
68 void NotifyStatusChange(const TDesC& aURI, TEventMask aMask, TRequestStatus& aStatus); |
|
69 TInt CancelNotifyStatusChange(const TDesC& aURI, TRequestStatus& aStatus); |
|
70 TInt SetProperty(TAgentProperty aProperty, TInt aValue); |
|
71 void DisplayInfoL(TDisplayInfo aInfo, const TVirtualPathPtr& aVirtualPath); |
|
72 |
|
73 // From CAgentManager |
|
74 TBool IsRecognizedL(const TDesC& aURI, TContentShareMode aShareMode) const; |
|
75 TBool IsRecognizedL(RFile& aFile) const; |
|
76 TBool RecognizeFileL(const TDesC& aFileName, const TDesC8& aBuffer, TDes8& aFileMimeType, TDes8& aContentMimeType) const; |
|
77 TInt AgentSpecificCommand(TInt aCommand, const TDesC8& aInputBuffer, TDes8& aOutputBuffer); |
|
78 void AgentSpecificCommand(TInt aCommand, const TDesC8& aInputBuffer, TDes8& aOutputBuffer, TRequestStatus& aStatus); |
|
79 void DisplayManagementInfoL(); |
|
80 void PrepareHTTPRequestHeaders(RStringPool& aStringPool, RHTTPHeaders& aRequestHeaders) const; |
|
81 TInt RenameDir(const TDesC& aOldName, const TDesC& aNewName); |
|
82 |
|
83 protected: |
|
84 |
|
85 static TBool IsProtectedL(const TDesC& aFileName); |
|
86 static TBool IsProtectedL(RFile& aFile); |
|
87 |
|
88 private: |
|
89 /** |
|
90 * C++ default constructor. |
|
91 */ |
|
92 CWmDrmAgentManager(); |
|
93 |
|
94 /** |
|
95 * By default Symbian 2nd phase constructor is private. |
|
96 */ |
|
97 void ConstructL(); |
|
98 |
|
99 /** |
|
100 * Sets up the file manager if it's needed |
|
101 * If unsuccessful return an error code |
|
102 */ |
|
103 TInt SetFileMan(); |
|
104 |
|
105 /** |
|
106 * Combined ASF file object creator and attribute getter methods. |
|
107 * Note: these are added for minimising TRAP harnesses |
|
108 * in nonleaving attribute getter member functions. |
|
109 */ |
|
110 TInt CWmDrmAgentManager::GetAttributeCreateFileL(TInt aAttribute, TInt& aValue, const TVirtualPathPtr& aVirtualPath); |
|
111 TInt CWmDrmAgentManager::GetAttributeSetCreateFileL(RAttributeSet& aAttributeSet, const TVirtualPathPtr& aVirtualPath); |
|
112 TInt CWmDrmAgentManager::GetStringAttributeCreateFileL(TInt aAttribute, TDes& aValue, const TVirtualPathPtr& aVirtualPath); |
|
113 TInt CWmDrmAgentManager::GetStringAttributeSetCreateFileL(RStringAttributeSet& aAttributeSet, const TVirtualPathPtr& aVirtualPath); |
|
114 |
|
115 |
|
116 |
|
117 protected: // Data |
|
118 |
|
119 private: |
|
120 RFs iFs; |
|
121 CFileMan *iFileMan; |
|
122 }; |
|
123 } // namespace ContentAccess |
|
124 |
|
125 #endif // WMDRMAGENTMANAGER_H |
|
126 |
|
127 // End of File |