|
1 /* |
|
2 * Copyright (c) 2003-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 the License "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 #ifndef __TESTAGENTMANAGER_H__ |
|
20 #define __TESTAGENTMANAGER_H__ |
|
21 |
|
22 #include <caf/caf.h> |
|
23 #include "agentinterface.h" |
|
24 |
|
25 |
|
26 class RHTTPHeaders; |
|
27 class RStringPool; |
|
28 |
|
29 /** A simple agent implementing a dummy DRM file format |
|
30 |
|
31 Several of the functions such as Copy, Rename and GetDir are not supported |
|
32 by this agent. |
|
33 |
|
34 */ |
|
35 class CTestAgentManager : public ContentAccess::CAgentManager |
|
36 { |
|
37 public: |
|
38 static CTestAgentManager* NewL(); |
|
39 static CTestAgentManager* NewLC(); |
|
40 |
|
41 ~CTestAgentManager(void); |
|
42 |
|
43 public: |
|
44 // From CAgentManager |
|
45 virtual TInt DeleteFile(const TDesC &aFileName); |
|
46 virtual TInt CopyFile(const TDesC& aSource, const TDesC& aDestination); |
|
47 virtual TInt CopyFile(RFile& aSource, const TDesC& aDestination); |
|
48 virtual TInt RenameFile(const TDesC& aSource, const TDesC& aDestination); |
|
49 virtual TInt MkDir(const TDesC& aPath); |
|
50 virtual TInt MkDirAll(const TDesC& aPath); |
|
51 virtual TInt RmDir(const TDesC& aPath); |
|
52 virtual TInt GetDir(const TDesC& aName,TUint aEntryAttMask,TUint aEntrySortKey, CDir*& aEntryList) const; |
|
53 virtual TInt GetDir(const TDesC& aName,TUint aEntryAttMask,TUint aEntrySortKey, CDir*& aEntryList,CDir*& aDirList) const; |
|
54 virtual TInt GetDir(const TDesC& aName,const TUidType& aEntryUid,TUint aEntrySortKey, CDir*& aFileList) const; |
|
55 virtual TInt GetAttribute(TInt aAttribute, TInt& aValue, const ContentAccess::TVirtualPathPtr& aVirtualPath); |
|
56 virtual TInt GetAttributeSet(ContentAccess::RAttributeSet& aAttributeSet, const ContentAccess::TVirtualPathPtr& aVirtualPath); |
|
57 virtual TInt GetStringAttributeSet(ContentAccess::RStringAttributeSet& aAttributeSet, const ContentAccess::TVirtualPathPtr& aVirtualPath); |
|
58 virtual TInt GetStringAttribute(TInt aAttribute, TDes& aValue, const ContentAccess::TVirtualPathPtr& aVirtualPath); |
|
59 virtual void NotifyStatusChange(const TDesC& aURI, ContentAccess::TEventMask aMask, TRequestStatus& aStatus); |
|
60 virtual TInt CancelNotifyStatusChange(const TDesC& aURI, TRequestStatus& aStatus); |
|
61 virtual TInt SetProperty(ContentAccess::TAgentProperty aProperty, TInt aValue); |
|
62 virtual void DisplayInfoL(ContentAccess::TDisplayInfo aInfo, const ContentAccess::TVirtualPathPtr& aVirtualPath); |
|
63 virtual TBool IsRecognizedL(const TDesC& aURI, ContentAccess::TContentShareMode aShareMode) const; |
|
64 virtual TBool IsRecognizedL(RFile& aFile) const; |
|
65 virtual TBool RecognizeFileL(const TDesC& aFileName, const TDesC8& aBuffer, TDes8& aFileMimeType, TDes8& aContentMimeType) const; |
|
66 virtual TInt AgentSpecificCommand(TInt aCommand, const TDesC8& aInputBuffer, TDes8& aOutputBuffer); |
|
67 virtual void AgentSpecificCommand(TInt aCommand, const TDesC8& aInputBuffer, TDes8& aOutputBuffer, TRequestStatus& aStatus); |
|
68 virtual void DisplayManagementInfoL(); |
|
69 virtual void PrepareHTTPRequestHeaders(RStringPool& aStringPool, RHTTPHeaders& aRequestHeaders) const; |
|
70 private: |
|
71 CTestAgentManager(); |
|
72 void ConstructL(); |
|
73 void GetAttributeL(TInt aAttribute, TInt& aValue, const ContentAccess::TVirtualPathPtr& aVirtualPath); |
|
74 void GetAttributeSetL(ContentAccess::RAttributeSet& aAttributeSet, const ContentAccess::TVirtualPathPtr& aVirtualPath); |
|
75 void GetStringAttributeSetL(ContentAccess::RStringAttributeSet& aAttributeSet, const ContentAccess::TVirtualPathPtr& aVirtualPath); |
|
76 void GetStringAttributeL(TInt aAttribute, TDes& aValue, const ContentAccess::TVirtualPathPtr& aVirtualPath); |
|
77 |
|
78 private: |
|
79 RFs iFs; |
|
80 CFileMan *iFileMan; |
|
81 }; |
|
82 |
|
83 #endif // __TESTAGENTMANAGER_H__ |