|
1 /* |
|
2 * Copyright (c) 2002-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 "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: Query launcher for Voice mailbox application. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 // INCLUDE FILES |
|
20 #include <bldvariant.hrh> |
|
21 #include <e32std.h> |
|
22 #include <featmgr.h> |
|
23 #include "VmQueryLauncher.h" |
|
24 #include "VmContainer.h" |
|
25 #include "vmnumber.h" |
|
26 #include "VMBLogger.h" |
|
27 |
|
28 // ================= MEMBER FUNCTIONS ======================= |
|
29 |
|
30 // C++ default constructor can't leave |
|
31 // ----------------------------------------------------------------------------- |
|
32 // CVmQueryLauncher::CVmQueryLauncher |
|
33 // C++ default constructor can NOT contain any code, that |
|
34 // might leave. |
|
35 // ----------------------------------------------------------------------------- |
|
36 // |
|
37 CVmQueryLauncher::CVmQueryLauncher( CVmContainer& aContainer, |
|
38 MVmQueryLauncher& aObserver, |
|
39 TInt aPriority ) |
|
40 : CActive( aPriority ), iContainer( aContainer ), |
|
41 iObserver( aObserver ) |
|
42 { |
|
43 } |
|
44 |
|
45 // ----------------------------------------------------------------------------- |
|
46 // CVmQueryLauncher::~CVmQueryLauncher |
|
47 // Destructor |
|
48 // ----------------------------------------------------------------------------- |
|
49 // |
|
50 CVmQueryLauncher::~CVmQueryLauncher() |
|
51 { |
|
52 } |
|
53 |
|
54 // ---------------------------------------------------------------------------- |
|
55 // CVmQueryLauncher::NewL |
|
56 // Two-phased constructor. |
|
57 // ----------------------------------------------------------------------------- |
|
58 // |
|
59 CVmQueryLauncher* CVmQueryLauncher::NewL( CVmContainer& aContainer, |
|
60 MVmQueryLauncher& aObserver, TInt aPriority) |
|
61 { |
|
62 CVmQueryLauncher* self = new( ELeave ) CVmQueryLauncher( aContainer, |
|
63 aObserver, aPriority ); |
|
64 CActiveScheduler::Add( self ); |
|
65 self->SetActive(); |
|
66 TRequestStatus* status = &(self->iStatus); |
|
67 |
|
68 // The idea is to activate this object as soon as the application has |
|
69 // been fully constructed. |
|
70 User::RequestComplete( status, KErrNone ); |
|
71 |
|
72 return self; |
|
73 } |
|
74 |
|
75 // ---------------------------------------------------------------------------- |
|
76 // CVmQueryLauncher::RunL |
|
77 // Handles an active object's request completion event |
|
78 // ---------------------------------------------------------------------------- |
|
79 // |
|
80 void CVmQueryLauncher::RunL() |
|
81 { |
|
82 VMBLOGSTRING( "VMBX: CVmQueryLauncher::RunL: =>" ); |
|
83 if ( iStatus == KErrNone ) |
|
84 { |
|
85 TInt type( EVmbx ); |
|
86 |
|
87 type = iContainer.AskTypeL(); |
|
88 |
|
89 if ( type == EVmbx ) //if CS vmbx is selected |
|
90 { |
|
91 iContainer.QueryNumberL( EVmbxNotDefinedQuery ); |
|
92 } |
|
93 else if ( type == EVmbxVideo ) |
|
94 { |
|
95 iContainer.QueryVideoNumberL( EVmbxNotDefinedQuery ); |
|
96 } |
|
97 } |
|
98 iObserver.NumberQueryComplete(); |
|
99 VMBLOGSTRING( "VMBX: CVmQueryLauncher::RunL: <=" ); |
|
100 } |
|
101 |
|
102 // ---------------------------------------------------------------------------- |
|
103 // CVmQueryLauncher::DoCancel |
|
104 // Implements cancellation of an outstanding request |
|
105 // ---------------------------------------------------------------------------- |
|
106 // |
|
107 void CVmQueryLauncher::DoCancel() |
|
108 { |
|
109 VMBLOGSTRING( "VMBX: CVmQueryLauncher::DoCancel: =>" ); |
|
110 TRequestStatus* status = &iStatus; |
|
111 User::RequestComplete( status, KErrCancel ); |
|
112 VMBLOGSTRING( "VMBX: CVmQueryLauncher::DoCancel: <=" ); |
|
113 } |
|
114 |
|
115 // End of File |