|
1 /* |
|
2 * Copyright (c) 2002 - 2007 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: Test aknglobalconfirmationquery.h |
|
15 * |
|
16 */ |
|
17 |
|
18 /* |
|
19 * Include files |
|
20 */ |
|
21 |
|
22 #include <aknglobalconfirmationquery.h> |
|
23 #include <e32cmn.h> |
|
24 #include <aknsddata.h> |
|
25 |
|
26 #include "testsdknotifiers.hrh" |
|
27 #include "activeexample.h" |
|
28 #include "testsdknotifiers.h" |
|
29 |
|
30 // ----------------------------------------------------------------------------- |
|
31 // Ctestsdknotifiers::TestNotifiersCFMQueryNewLL |
|
32 // ----------------------------------------------------------------------------- |
|
33 // |
|
34 TInt CTestSDKNotifiers::TestNotifiersCFMQueryNewLL( CStifItemParser& /*aItem*/ ) |
|
35 { |
|
36 CAknGlobalConfirmationQuery* confirmationquery = CAknGlobalConfirmationQuery::NewL(); |
|
37 CleanupStack::PushL( confirmationquery ); |
|
38 STIF_ASSERT_NOT_NULL( confirmationquery ); |
|
39 CleanupStack::PopAndDestroy( confirmationquery ); |
|
40 |
|
41 return KErrNone; |
|
42 } |
|
43 |
|
44 // ----------------------------------------------------------------------------- |
|
45 // Ctestsdknotifiers::TestNotifiersCFMQueryNewLCL |
|
46 // ----------------------------------------------------------------------------- |
|
47 // |
|
48 TInt CTestSDKNotifiers::TestNotifiersCFMQueryNewLCL( CStifItemParser& /*aItem*/ ) |
|
49 { |
|
50 CAknGlobalConfirmationQuery* confirmationquery = CAknGlobalConfirmationQuery::NewLC(); |
|
51 STIF_ASSERT_NOT_NULL( confirmationquery ); |
|
52 CleanupStack::PopAndDestroy( confirmationquery ); |
|
53 |
|
54 return KErrNone; |
|
55 } |
|
56 |
|
57 // ----------------------------------------------------------------------------- |
|
58 // Ctestsdknotifiers::TestNotifiersCFMQueryDestructorL |
|
59 // ----------------------------------------------------------------------------- |
|
60 // |
|
61 TInt CTestSDKNotifiers::TestNotifiersCFMQueryDestructorL( CStifItemParser& /*aItem*/ ) |
|
62 { |
|
63 CAknGlobalConfirmationQuery* confirmationquery = CAknGlobalConfirmationQuery::NewL(); |
|
64 CleanupStack::PushL( confirmationquery ); |
|
65 STIF_ASSERT_NOT_NULL( confirmationquery ); |
|
66 CleanupStack::PopAndDestroy( confirmationquery ); |
|
67 |
|
68 return KErrNone; |
|
69 } |
|
70 |
|
71 // ----------------------------------------------------------------------------- |
|
72 // Ctestsdknotifiers::TestNotifiersCFMQueryShowConfirmationQueryLL |
|
73 // ----------------------------------------------------------------------------- |
|
74 // |
|
75 TInt CTestSDKNotifiers::TestNotifiersCFMQueryShowConfirmationQueryLL( CStifItemParser& /*aItem*/ ) |
|
76 { |
|
77 TBuf<KBufSize> prompt( KTestString ); |
|
78 CAknGlobalConfirmationQuery* confirmationquery = CAknGlobalConfirmationQuery::NewL(); |
|
79 CleanupStack::PushL( confirmationquery ); |
|
80 |
|
81 RTimer timer; |
|
82 CleanupClosePushL( timer ); |
|
83 TRequestStatus timerStatus; |
|
84 timer.CreateLocal(); |
|
85 timer.After( timerStatus, KTimeDelay ); |
|
86 User::WaitForRequest( timerStatus ); |
|
87 |
|
88 confirmationquery->ShowConfirmationQueryL( timerStatus, prompt ); |
|
89 |
|
90 timer.Close(); |
|
91 CleanupStack::PopAndDestroy( &timer ); |
|
92 CleanupStack::PopAndDestroy( confirmationquery ); |
|
93 |
|
94 CAknGlobalConfirmationQuery* confirmationquerytwo = CAknGlobalConfirmationQuery::NewL(); |
|
95 CleanupStack::PushL( confirmationquerytwo ); |
|
96 CAknSDData* sddata = new( ELeave ) CAknSDData; |
|
97 confirmationquerytwo->SetSecondaryDisplayData( sddata ); |
|
98 |
|
99 RTimer timertwo; |
|
100 CleanupClosePushL( timertwo ); |
|
101 TRequestStatus status; |
|
102 timertwo.CreateLocal(); |
|
103 timertwo.After( status, KTimeDelay ); |
|
104 User::WaitForRequest( status ); |
|
105 |
|
106 confirmationquerytwo->ShowConfirmationQueryL( status, prompt, KZero, KZero, prompt, |
|
107 KZero, KZero, CAknQueryDialog::ENoTone, ETrue ); |
|
108 |
|
109 timertwo.Close(); |
|
110 CleanupStack::PopAndDestroy( &timertwo ); |
|
111 CleanupStack::PopAndDestroy( confirmationquerytwo ); |
|
112 return KErrNone; |
|
113 } |
|
114 |
|
115 // ----------------------------------------------------------------------------- |
|
116 // Ctestsdknotifiers::TestNotifiersCFMQueryUpdateConfirmationQueryL |
|
117 // ----------------------------------------------------------------------------- |
|
118 // |
|
119 TInt CTestSDKNotifiers::TestNotifiersCFMQueryUpdateConfirmationQueryL( CStifItemParser& /*aItem*/ ) |
|
120 { |
|
121 CAknGlobalConfirmationQuery* confirmationquery = CAknGlobalConfirmationQuery::NewL(); |
|
122 CleanupStack::PushL( confirmationquery ); |
|
123 |
|
124 confirmationquery->UpdateConfirmationQuery( KTwo ); |
|
125 |
|
126 CleanupStack::PopAndDestroy( confirmationquery ); |
|
127 return KErrNone; |
|
128 } |
|
129 |
|
130 // ----------------------------------------------------------------------------- |
|
131 // Ctestsdknotifiers::TestNotifiersCFMQueryCancelConfirmationQueryL |
|
132 // ----------------------------------------------------------------------------- |
|
133 // |
|
134 TInt CTestSDKNotifiers::TestNotifiersCFMQueryCancelConfirmationQueryL( CStifItemParser& /*aItem*/ ) |
|
135 { |
|
136 TBuf<KBufSize> buf( KTestString ); |
|
137 CActiveExample* observer = CActiveExample::NewLC(); |
|
138 observer->ShowAndCancelConfirmationQueryLL( buf ); |
|
139 CleanupStack::PopAndDestroy( observer ); |
|
140 |
|
141 return KErrNone; |
|
142 } |
|
143 |
|
144 // ----------------------------------------------------------------------------- |
|
145 // Ctestsdknotifiers::TestNotifiersCFMQuerySetImageSkinIdL |
|
146 // ----------------------------------------------------------------------------- |
|
147 // |
|
148 TInt CTestSDKNotifiers::TestNotifiersCFMQuerySetImageSkinIdL( CStifItemParser& /*aItem*/ ) |
|
149 { |
|
150 CAknGlobalConfirmationQuery* confirmationquery = CAknGlobalConfirmationQuery::NewL(); |
|
151 CleanupStack::PushL( confirmationquery ); |
|
152 TAknsItemID testid = KAknsIIDNone; |
|
153 confirmationquery->SetImageSkinId( testid ); |
|
154 |
|
155 CleanupStack::PopAndDestroy( confirmationquery ); |
|
156 return KErrNone; |
|
157 } |
|
158 |
|
159 // ----------------------------------------------------------------------------- |
|
160 // Ctestsdknotifiers::TestNotifiersCFMQuerySetSecondaryDisplayDataL |
|
161 // ----------------------------------------------------------------------------- |
|
162 // |
|
163 TInt CTestSDKNotifiers::TestNotifiersCFMQuerySetSecondaryDisplayDataL( CStifItemParser& /*aItem*/ ) |
|
164 { |
|
165 CAknGlobalConfirmationQuery* confirmationquery = CAknGlobalConfirmationQuery::NewL(); |
|
166 CleanupStack::PushL( confirmationquery ); |
|
167 CAknSDData* sddata = new( ELeave ) CAknSDData; |
|
168 confirmationquery->SetSecondaryDisplayData( sddata ); |
|
169 |
|
170 CleanupStack::PopAndDestroy( confirmationquery ); |
|
171 return KErrNone; |
|
172 } |
|
173 |
|
174 //End file |