|
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 OMA2AGENTMANAGER_H |
|
21 #define OMA2AGENTMANAGER_H |
|
22 |
|
23 // INCLUDES |
|
24 #include <caf/caf.h> |
|
25 #include <caf/agentinterface.h> |
|
26 #include <drmnotifier.h> |
|
27 |
|
28 class CFileMan; |
|
29 |
|
30 namespace ContentAccess |
|
31 { |
|
32 |
|
33 // CLASS DECLARATION |
|
34 |
|
35 class COma2AgentManager : public CAgentManager, public MDRMEventObserver |
|
36 { |
|
37 public: // Constructors and destructor |
|
38 |
|
39 /** |
|
40 * Two-phased constructor. |
|
41 */ |
|
42 static COma2AgentManager* NewL(); |
|
43 static COma2AgentManager* NewLC(); |
|
44 |
|
45 /** |
|
46 * Destructor. |
|
47 */ |
|
48 ~COma2AgentManager(); |
|
49 |
|
50 public: // New functions |
|
51 |
|
52 /** |
|
53 * ?member_description. |
|
54 * @since Series ?XX ?SeriesXX_version |
|
55 * @param ?arg1 ?description |
|
56 * @return ?description |
|
57 */ |
|
58 //?type ?member_function( ?type ?arg1 ); |
|
59 |
|
60 public: // Functions from base classes |
|
61 |
|
62 /** |
|
63 * From ?base_class ?member_description. |
|
64 * @since Series ?XX ?SeriesXX_version |
|
65 * @param ?arg1 ?description |
|
66 * @return ?description |
|
67 */ |
|
68 |
|
69 // From CAgentManagerBase |
|
70 TInt DeleteFile(const TDesC &aFileName); |
|
71 TInt CopyFile(const TDesC& aSource, const TDesC& aDestination); |
|
72 TInt CopyFile(RFile& aSource, const TDesC& aDestination); |
|
73 TInt RenameFile(const TDesC& aSource, const TDesC& aDestination); |
|
74 TInt MkDir(const TDesC& aPath); |
|
75 TInt MkDirAll(const TDesC& aPath); |
|
76 TInt RmDir(const TDesC& aPath); |
|
77 TInt GetDir(const TDesC& aName,TUint anEntryAttMask,TUint anEntrySortKey, CDir*& anEntryList) const; |
|
78 TInt GetDir(const TDesC& aName,TUint anEntryAttMask,TUint anEntrySortKey, CDir*& anEntryList,CDir*& aDirList) const; |
|
79 TInt GetDir(const TDesC& aName,const TUidType& anEntryUid,TUint anEntrySortKey, CDir*& aFileList) const; |
|
80 TInt GetAttribute(TInt aAttribute, TInt& aValue, const TVirtualPathPtr& aVirtualPath); |
|
81 TInt GetAttributeSet(RAttributeSet& aAttributeSet, const TVirtualPathPtr& aVirtualPath); |
|
82 TInt GetStringAttributeSet(RStringAttributeSet& aAttributeSet, const TVirtualPathPtr& aVirtualPath); |
|
83 TInt GetStringAttribute(TInt aAttribute, TDes& aValue, const TVirtualPathPtr& aVirtualPath); |
|
84 void NotifyStatusChange(const TDesC& aURI, TEventMask aMask, TRequestStatus& aStatus); |
|
85 TInt CancelNotifyStatusChange(const TDesC& aURI, TRequestStatus& aStatus); |
|
86 TInt SetProperty(TAgentProperty aProperty, TInt aValue); |
|
87 void DisplayInfoL(TDisplayInfo aInfo, const TVirtualPathPtr& aVirtualPath); |
|
88 |
|
89 // From CAgentManager |
|
90 TBool IsRecognizedL(const TDesC& aURI, TContentShareMode aShareMode) const; |
|
91 TBool IsRecognizedL(RFile& aFile) const; |
|
92 TBool RecognizeFileL(const TDesC& aFileName, const TDesC8& aBuffer, TDes8& aFileMimeType, TDes8& aContentMimeType) const; |
|
93 TInt AgentSpecificCommand(TInt aCommand, const TDesC8& aInputBuffer, TDes8& aOutputBuffer); |
|
94 void AgentSpecificCommand(TInt aCommand, const TDesC8& aInputBuffer, TDes8& aOutputBuffer, TRequestStatus& aStatus); |
|
95 void PrepareHTTPRequestHeaders(RStringPool& aStringPool, RHTTPHeaders& aRequestHeaders) const; |
|
96 void DisplayManagementInfoL(); |
|
97 |
|
98 public: // From MDRMEventObserver |
|
99 virtual void HandleEventL( |
|
100 MDRMEvent* aEvent); |
|
101 |
|
102 private: |
|
103 RFs iFs; |
|
104 |
|
105 // File manager |
|
106 CFileMan* iFileManager; |
|
107 |
|
108 // Oma based extensions |
|
109 HBufC8* iOmaBasedMimeType; |
|
110 |
|
111 private: |
|
112 |
|
113 /** |
|
114 * C++ default constructor. |
|
115 */ |
|
116 COma2AgentManager(); |
|
117 |
|
118 /** |
|
119 * By default Symbian 2nd phase constructor is private. |
|
120 */ |
|
121 void ConstructL(); |
|
122 |
|
123 void FetchOmaBasedInfoL(); |
|
124 void PrepareHTTPRequestHeadersL(RStringPool& aStringPool, RHTTPHeaders& aRequestHeaders) const; |
|
125 |
|
126 |
|
127 protected: // Data |
|
128 // Request status for change notifications |
|
129 TRequestStatus* iStatus; |
|
130 |
|
131 // Notifier for change notifications |
|
132 CDRMNotifier* iNotifier; |
|
133 |
|
134 // Watched events |
|
135 TEventMask iWatchedEvents; |
|
136 |
|
137 // Watched content ID |
|
138 HBufC8* iWatchedId; |
|
139 }; |
|
140 |
|
141 } |
|
142 |
|
143 #endif // OMA2AGENTMANAGER_H |
|
144 |
|
145 // End of File |