|
1 /* |
|
2 * Copyright (c) 2004 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 #ifndef C_CONTENTOBSERVER_H |
|
20 #define C_CONTENTOBSERVER_H |
|
21 |
|
22 #include <e32base.h> |
|
23 #include <aicontentobserver.h> |
|
24 |
|
25 #include "ccontentcache.h" |
|
26 |
|
27 class CContentObserver : public CBase, public MAiContentObserver |
|
28 { |
|
29 public: |
|
30 |
|
31 static CContentObserver& InstanceL(); |
|
32 static void Release(); |
|
33 static void Reset(); |
|
34 CContentCache* GetContent( TInt aContentId, TBool aClean = EFalse ); |
|
35 CContentCache* GetLastContent( TInt aContentId, TBool aClean = EFalse ); |
|
36 |
|
37 /** |
|
38 * |
|
39 */ |
|
40 TInt SetProperty( CHsContentPublisher& aPlugin, |
|
41 const TDesC8& aElementId, |
|
42 const TDesC8& aPropertyName, |
|
43 const TDesC8& aPropertyValue ); |
|
44 |
|
45 /** |
|
46 * |
|
47 */ |
|
48 TInt SetProperty( CHsContentPublisher& aPlugin, |
|
49 const TDesC8& aElementId, |
|
50 const TDesC8& aPropertyName, |
|
51 const TDesC8& aPropertyValue, |
|
52 MAiContentObserver::TValueType aValueType); |
|
53 |
|
54 private: |
|
55 |
|
56 ~CContentObserver(); |
|
57 TInt StartTransaction(TInt aTxId); |
|
58 TInt Commit(TInt aTxId); |
|
59 TInt CancelTransaction(TInt aTxId); |
|
60 TBool CanPublish(CHsContentPublisher& aPlugin, TInt aContent, TInt aIndex ); |
|
61 TInt Publish(CHsContentPublisher& aPlugin, TInt aContent, TInt aResource, TInt aIndex ); |
|
62 TInt Publish(CHsContentPublisher& aPlugin, TInt aContent, const TDesC16& aText, TInt aIndex ); |
|
63 TInt Publish(CHsContentPublisher& aPlugin, TInt aContent, const TDesC8& aBuf, TInt aIndex ); |
|
64 TInt Publish(CHsContentPublisher& aPlugin, TInt aContent, RFile& aFile, TInt aIndex ); |
|
65 TInt Clean(CHsContentPublisher& aPlugin, TInt aContent, TInt aIndex); |
|
66 TAny* Extension(TUid aUid); |
|
67 TBool RequiresSubscription( const THsPublisherInfo& aPublisherInfo ) const; |
|
68 |
|
69 private: |
|
70 |
|
71 RPointerArray<CContentCache> iCache; |
|
72 }; |
|
73 |
|
74 |
|
75 #endif // C_CONTENTOBSERVER_H |
|
76 |
|
77 // End of file |