45
|
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 AknWaitNoteWrapper.h
|
|
15 |
*
|
|
16 |
*/
|
|
17 |
|
|
18 |
|
|
19 |
#include <aknwaitnotewrapper.h>
|
|
20 |
#include <barsread.h>
|
|
21 |
#include <coeaui.h>
|
|
22 |
#include <testsdknotes.rsg>
|
|
23 |
|
|
24 |
#include "testsdknotesbackgroundprocess.h"
|
|
25 |
#include "testsdknotes.h"
|
|
26 |
|
|
27 |
const TInt KLength = 10;
|
|
28 |
|
|
29 |
// ============================ MEMBER FUNCTIONS ===============================
|
|
30 |
|
|
31 |
// -----------------------------------------------------------------------------
|
|
32 |
// CTestSDKNotes::TestNWNWCAknWaitNoteWrapperL
|
|
33 |
// -----------------------------------------------------------------------------
|
|
34 |
TInt CTestSDKNotes::TestNWNWCAknWaitNoteWrapperL( CStifItemParser& /*aItem*/ )
|
|
35 |
{
|
|
36 |
CAknWaitNoteWrapper* noteWrapper = CAknWaitNoteWrapper::NewL();
|
|
37 |
STIF_ASSERT_NOT_NULL( noteWrapper );
|
|
38 |
|
|
39 |
delete noteWrapper;
|
|
40 |
|
|
41 |
return KErrNone;
|
|
42 |
|
|
43 |
}
|
|
44 |
|
|
45 |
|
|
46 |
// -----------------------------------------------------------------------------
|
|
47 |
// CTestSDKNotes::TestNWNWDeconstructorL
|
|
48 |
// -----------------------------------------------------------------------------
|
|
49 |
TInt CTestSDKNotes::TestNWNWDeconstructorL( CStifItemParser& /*aItem*/ )
|
|
50 |
{
|
|
51 |
CAknWaitNoteWrapper* noteWrapper = CAknWaitNoteWrapper::NewL();
|
|
52 |
STIF_ASSERT_NOT_NULL( noteWrapper );
|
|
53 |
|
|
54 |
delete noteWrapper;
|
|
55 |
|
|
56 |
return KErrNone;
|
|
57 |
|
|
58 |
}
|
|
59 |
|
|
60 |
// -----------------------------------------------------------------------------
|
|
61 |
// CTestSDKNotes::TestNWNWExecuteL
|
|
62 |
// -----------------------------------------------------------------------------
|
|
63 |
TInt CTestSDKNotes::TestNWNWExecuteL( CStifItemParser& /*aItem*/ )
|
|
64 |
{
|
|
65 |
CAknWaitNoteWrapper* noteWrapper = CAknWaitNoteWrapper::NewL();
|
|
66 |
STIF_ASSERT_NOT_NULL( noteWrapper );
|
|
67 |
|
|
68 |
CTestSDKNotesBackGroundProcess* callback = new (ELeave) CTestSDKNotesBackGroundProcess;
|
|
69 |
STIF_ASSERT_NOT_NULL( callback );
|
|
70 |
CleanupStack::PushL( callback );
|
|
71 |
|
|
72 |
noteWrapper->ExecuteL( R_TESTSDK_WAITNOTEWRAPPER, *callback );
|
|
73 |
|
|
74 |
CleanupStack::PopAndDestroy( callback );
|
|
75 |
delete noteWrapper;
|
|
76 |
|
|
77 |
return KErrNone;
|
|
78 |
|
|
79 |
}
|
|
80 |
|
|
81 |
// -----------------------------------------------------------------------------
|
|
82 |
// CTestSDKNotes::TestNWNWExecutePromptL
|
|
83 |
// -----------------------------------------------------------------------------
|
|
84 |
TInt CTestSDKNotes::TestNWNWExecutePromptL( CStifItemParser& /*aItem*/ )
|
|
85 |
{
|
|
86 |
CAknWaitNoteWrapper* noteWrapper = CAknWaitNoteWrapper::NewL();
|
|
87 |
STIF_ASSERT_NOT_NULL( noteWrapper );
|
|
88 |
|
|
89 |
CTestSDKNotesBackGroundProcess* callback = new (ELeave) CTestSDKNotesBackGroundProcess;
|
|
90 |
STIF_ASSERT_NOT_NULL( callback );
|
|
91 |
CleanupStack::PushL( callback );
|
|
92 |
|
|
93 |
_LIT( KPrompt, "waitnote" );
|
|
94 |
TBuf<KLength> prompt( KPrompt );
|
|
95 |
noteWrapper->ExecuteL( R_TESTSDK_WAITNOTEWRAPPER, *callback, prompt );
|
|
96 |
|
|
97 |
CleanupStack::PopAndDestroy( callback );
|
|
98 |
delete noteWrapper;
|
|
99 |
|
|
100 |
return KErrNone;
|
|
101 |
}
|
|
102 |
|
|
103 |
// -----------------------------------------------------------------------------
|
|
104 |
// CTestSDKNotes::TestNWNWWaitDialogL
|
|
105 |
// -----------------------------------------------------------------------------
|
|
106 |
TInt CTestSDKNotes::TestNWNWWaitDialogL( CStifItemParser& /*aItem*/ )
|
|
107 |
{
|
|
108 |
CAknWaitNoteWrapper* noteWrapper = CAknWaitNoteWrapper::NewL();
|
|
109 |
STIF_ASSERT_NOT_NULL( noteWrapper );
|
|
110 |
|
|
111 |
CTestSDKNotesBackGroundProcess* callback = new (ELeave) CTestSDKNotesBackGroundProcess;
|
|
112 |
STIF_ASSERT_NOT_NULL( callback );
|
|
113 |
CleanupStack::PushL( callback );
|
|
114 |
|
|
115 |
_LIT( KPrompt, "waitnote" );
|
|
116 |
TBuf<KLength> prompt( KPrompt );
|
|
117 |
noteWrapper->ExecuteL( R_TESTSDK_WAITNOTEWRAPPER, *callback, prompt );
|
|
118 |
|
|
119 |
CAknWaitDialog* dialog = noteWrapper->WaitDialog();
|
|
120 |
|
|
121 |
CleanupStack::PopAndDestroy( callback );
|
|
122 |
delete noteWrapper;
|
|
123 |
|
|
124 |
return KErrNone;
|
|
125 |
|
|
126 |
}
|