|
1 /* |
|
2 * Copyright (c) 2004-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 |
|
20 |
|
21 /** |
|
22 @file |
|
23 @internalComponent |
|
24 @released |
|
25 */ |
|
26 |
|
27 #ifndef __F32AGENTCONTENT_H__ |
|
28 #define __F32AGENTCONTENT_H__ |
|
29 |
|
30 #include <f32file.h> |
|
31 #include <caf/agentinterface.h> |
|
32 |
|
33 namespace ContentAccess |
|
34 { |
|
35 class TVirtualPathPtr; |
|
36 class CF32AgentUi; |
|
37 |
|
38 /** |
|
39 F32 agent implementation of the CAgentContent class used to browse |
|
40 plaintext files. The browsing will not return any embedded objects since |
|
41 the F32 agent only enables access to the entire file |
|
42 |
|
43 @internalComponent |
|
44 @released |
|
45 */ |
|
46 class CF32AgentContent : public CAgentContent |
|
47 { |
|
48 public: |
|
49 // Two phase constructor used when the file is opened |
|
50 // using a file name |
|
51 static CF32AgentContent* NewL(const TDesC& aURI, TContentShareMode aShareMode); |
|
52 |
|
53 // Two phase constructor used when the file is opened with |
|
54 // a file handle |
|
55 static CF32AgentContent* NewL(RFile& aFile); |
|
56 |
|
57 virtual ~CF32AgentContent(); |
|
58 |
|
59 public: |
|
60 // From CAgentContent |
|
61 virtual TInt OpenContainer(const TDesC& aUniqueId); |
|
62 virtual TInt CloseContainer(); |
|
63 virtual void GetEmbeddedObjectsL(RStreamablePtrArray<CEmbeddedObject>& aArray); |
|
64 virtual void GetEmbeddedObjectsL(RStreamablePtrArray<CEmbeddedObject>& aArray, TEmbeddedType aType); |
|
65 virtual TInt Search(RStreamablePtrArray<CEmbeddedObject>& aArray, const TDesC8& aMimeType, TBool aRecursive); |
|
66 virtual TInt GetAttribute(TInt aAttribute, TInt& aValue, const TDesC& aUniqueId); |
|
67 virtual TInt GetAttributeSet(RAttributeSet& aAttributeSet, const TDesC& aUniqueId); |
|
68 virtual TInt GetStringAttribute(TInt aAttribute, TDes& aValue, const TDesC& aUniqueId); |
|
69 virtual TInt GetStringAttributeSet(RStringAttributeSet& aStringAttributeSet, const TDesC& aUniqueId); |
|
70 virtual TInt AgentSpecificCommand(TInt aCommand, const TDesC8& aInputBuffer, TDes8& aOutputBuffer); |
|
71 virtual void AgentSpecificCommand(TInt aCommand, const TDesC8& aInputBuffer, TDes8& aOutputBuffer, TRequestStatus& aStatus); |
|
72 virtual void NotifyStatusChange(TEventMask aMask, TRequestStatus& aStatus, const TDesC& aUniqueId); |
|
73 virtual TInt CancelNotifyStatusChange(TRequestStatus& aStatus, const TDesC& aUniqueId); |
|
74 virtual void RequestRights(TRequestStatus& aStatus, const TDesC& aUniqueId); |
|
75 virtual TInt CancelRequestRights(TRequestStatus& aStatus, const TDesC& aUniqueId); |
|
76 virtual void DisplayInfoL(TDisplayInfo aInfo, const TDesC& aUniqueId); |
|
77 virtual TInt SetProperty(TAgentProperty aProperty, TInt aValue); |
|
78 |
|
79 private: |
|
80 CF32AgentContent(); |
|
81 void ConstructL(const TDesC& aURI, TContentShareMode aShareMode); |
|
82 void ConstructL(RFile& aFile); |
|
83 |
|
84 CF32AgentUi& AgentUiL(); |
|
85 void SearchL(RStreamablePtrArray<CEmbeddedObject>& aArray, const TDesC8& aMimeType, TBool aRecursive); |
|
86 |
|
87 private: |
|
88 HBufC* iURI; |
|
89 TContentShareMode iShareMode; |
|
90 RFs iFs; |
|
91 RFile iFile; |
|
92 CF32AgentUi* iAgentUi; |
|
93 }; |
|
94 } // namespace ContentAccess |
|
95 #endif // __F32AgentContent_H__ |