|
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 __UT_DEVSTAPLG_H__ |
|
20 #define __UT_DEVSTAPLG_H__ |
|
21 |
|
22 // EXTERNAL INCLUDES |
|
23 #include <digia/eunit/ceunittestsuiteclass.h> |
|
24 #include <hscontentpublisher.h> |
|
25 |
|
26 // INTERNAL INCLUDES |
|
27 #include "aicontentobserver.h" |
|
28 #include "stubdataholder.h" |
|
29 #include "ccontentcache.h" |
|
30 #include "aiprioritizer.h" |
|
31 #include "aipublisherbroadcaster.h" |
|
32 #include "ccontentcache.h" |
|
33 |
|
34 // FORWARD DECLARATIONS |
|
35 class CAiContentPublisher; |
|
36 class CContentObserver; |
|
37 class CStubDataHolder; |
|
38 class CAiOperatorLogoPublisher; |
|
39 class CAiOperatorNamePublisher; |
|
40 class CAiMultiContentObserver; |
|
41 class CAiBTSAPPublisher; |
|
42 class CAiProfilePublisher; |
|
43 class CAiDatePublisher; |
|
44 |
|
45 |
|
46 #include <e32def.h> |
|
47 #ifndef NONSHARABLE_CLASS |
|
48 #define NONSHARABLE_CLASS(x) class x |
|
49 #endif |
|
50 |
|
51 |
|
52 // CLASS DEFINITION |
|
53 /** |
|
54 * |
|
55 * EUnitWizard generated test class. |
|
56 * |
|
57 */ |
|
58 NONSHARABLE_CLASS( UT_DevStaPlg2 ) |
|
59 : public CEUnitTestSuiteClass, |
|
60 public MAiPublishPrioritizer, |
|
61 public MAiPublisherBroadcaster, |
|
62 public MAiContentObserver |
|
63 |
|
64 { |
|
65 public: // Constructors and destructors |
|
66 |
|
67 /** |
|
68 * Two phase construction |
|
69 */ |
|
70 static UT_DevStaPlg2* NewL(); |
|
71 static UT_DevStaPlg2* NewLC(); |
|
72 /** |
|
73 * Destructor |
|
74 */ |
|
75 ~UT_DevStaPlg2(); |
|
76 |
|
77 private: // Constructors and destructors |
|
78 |
|
79 UT_DevStaPlg2(); |
|
80 void ConstructL(); |
|
81 |
|
82 public: // MAiPublishPrioritizer |
|
83 |
|
84 void TryToPublishL( MAiPublisherBroadcaster& aBroadcaster, |
|
85 TInt aContent, |
|
86 TInt aResource, |
|
87 TInt aPriority ); |
|
88 void TryToPublishL( MAiPublisherBroadcaster& aBroadcaster, |
|
89 TInt aContent, |
|
90 const TDesC16& aText, |
|
91 TInt aPriority ); |
|
92 void TryToPublishL( MAiPublisherBroadcaster& aBroadcaster, |
|
93 TInt aContent, |
|
94 const TDesC8& aBuf, |
|
95 TInt aPriority ); |
|
96 void TryToCleanL( MAiPublisherBroadcaster& aBroadcaster, |
|
97 TInt aContent, |
|
98 TInt aPriority ); |
|
99 |
|
100 |
|
101 TInt NextPriority() const |
|
102 { |
|
103 return 0; |
|
104 }; |
|
105 |
|
106 public: // MAiPublisherBroadcaster |
|
107 |
|
108 TBool RefreshPriorizedPublishersL( TInt , TInt ) |
|
109 { |
|
110 return ETrue; |
|
111 }; |
|
112 |
|
113 public: // MAiContentObserver |
|
114 void Reset(); |
|
115 CContentCache* GetContent( TInt aContentId, TBool aClean = EFalse ); |
|
116 CContentCache* GetLastContent( TInt aContentId, TBool aClean = EFalse ); |
|
117 |
|
118 TInt StartTransaction(TInt aTxId); |
|
119 TInt Commit(TInt aTxId); |
|
120 TInt CancelTransaction(TInt aTxId); |
|
121 TBool CanPublish(CHsContentPublisher& aPlugin, TInt aContent, TInt aIndex ); |
|
122 TInt Publish(CHsContentPublisher& aPlugin, TInt aContent, TInt aResource, TInt aIndex ); |
|
123 TInt Publish(CHsContentPublisher& aPlugin, TInt aContent, const TDesC16& aText, TInt aIndex ); |
|
124 TInt Publish(CHsContentPublisher& aPlugin, TInt aContent, const TDesC8& aBuf, TInt aIndex ); |
|
125 TInt Publish(CHsContentPublisher& aPlugin, TInt aContent, RFile& aFile, TInt aIndex ); |
|
126 TInt Clean(CHsContentPublisher& aPlugin, TInt aContent, TInt aIndex); |
|
127 TAny* Extension(TUid aUid); |
|
128 TBool RequiresSubscription( const THsPublisherInfo& aPublisherInfo ) const; |
|
129 |
|
130 TInt SetProperty( CHsContentPublisher& aPlugin, |
|
131 const TDesC8& aElementId, |
|
132 const TDesC8& aPropertyName, |
|
133 const TDesC8& aPropertyValue ); |
|
134 |
|
135 TInt SetProperty( CHsContentPublisher& aPlugin, |
|
136 const TDesC8& aElementId, |
|
137 const TDesC8& aPropertyName, |
|
138 const TDesC8& aPropertyValue, |
|
139 MAiContentObserver::TValueType aValueType); |
|
140 |
|
141 private: // New methods |
|
142 |
|
143 void SetupL(); |
|
144 void SetupEmptyL(); |
|
145 |
|
146 void Teardown(); |
|
147 |
|
148 void TestOperatorLogoPublisherL(); |
|
149 |
|
150 void TestOperatorProgNamePublisherL(); |
|
151 |
|
152 void TestMultiObserverL(); |
|
153 |
|
154 void TestBTSAPPublisherL(); |
|
155 |
|
156 // void TestProfilePublisherL(); |
|
157 |
|
158 void TestDatePublisherL(); |
|
159 |
|
160 void TestPluginL(); |
|
161 |
|
162 private: // Data |
|
163 |
|
164 EUNIT_DECLARE_TEST_TABLE; |
|
165 |
|
166 CHsContentPublisher* iPublisher; |
|
167 |
|
168 UT_DevStaPlg2* iCache; |
|
169 |
|
170 CStubDataHolder* iStubDataHolder; |
|
171 |
|
172 CAiOperatorLogoPublisher* iLogoPublisher; |
|
173 |
|
174 CAiOperatorNamePublisher* iNamePublisher; |
|
175 |
|
176 CAiMultiContentObserver* iMultiObserver; |
|
177 |
|
178 CAiBTSAPPublisher* iBTSAP; |
|
179 |
|
180 CAiProfilePublisher* iProfilePublisher; |
|
181 |
|
182 CAiDatePublisher* iDatePublisher; |
|
183 |
|
184 RPointerArray<CContentCache> iInternalCache; |
|
185 |
|
186 TBool iFilePublished; |
|
187 |
|
188 TBool iBufPublished; |
|
189 |
|
190 }; |
|
191 |
|
192 #endif // __UT_DEVSTAPLG_H__ |
|
193 |
|
194 // End of file |