|
1 /* |
|
2 * Copyright (c) 2009-2010 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 * CGlobalQueryObserver implementation |
|
16 * |
|
17 * |
|
18 */ |
|
19 |
|
20 |
|
21 // INCLUDES |
|
22 #include <eikenv.h> |
|
23 #include <e32base.h> |
|
24 |
|
25 #include "ADMglobalqueryobserver.h" |
|
26 #include "ADMappui.h" |
|
27 |
|
28 |
|
29 // ================= MEMBER FUNCTIONS ========================================= |
|
30 |
|
31 // ---------------------------------------------------------------------------- |
|
32 // CGlobalQueryObserver::NewL() |
|
33 // Two-phased constructor. |
|
34 // ---------------------------------------------------------------------------- |
|
35 // |
|
36 CGlobalQueryObserver* |
|
37 CGlobalQueryObserver::NewL(CADMAppUi* aCBootstrapAppUiObj) |
|
38 { |
|
39 CGlobalQueryObserver* active = |
|
40 new ( ELeave ) CGlobalQueryObserver(aCBootstrapAppUiObj); |
|
41 CleanupStack::PushL( active ); |
|
42 active->ConstructL(); |
|
43 CleanupStack::Pop(); |
|
44 return active; |
|
45 } |
|
46 |
|
47 |
|
48 // ---------------------------------------------------------------------------- |
|
49 // CGlobalQueryObserver::~CGlobalQueryObserver() |
|
50 // Destructor. |
|
51 // ---------------------------------------------------------------------------- |
|
52 // |
|
53 CGlobalQueryObserver::~CGlobalQueryObserver() |
|
54 { |
|
55 Cancel(); |
|
56 } |
|
57 |
|
58 // ---------------------------------------------------------------------------- |
|
59 // CGlobalQueryObserver::Start() |
|
60 // Start the activator. |
|
61 // ---------------------------------------------------------------------------- |
|
62 // |
|
63 void CGlobalQueryObserver::Start() |
|
64 { |
|
65 SetActive(); |
|
66 } |
|
67 |
|
68 // ---------------------------------------------------------------------------- |
|
69 // CGlobalQueryObserver::CGlobalQueryObserver() |
|
70 // C++ default constructor. |
|
71 // ---------------------------------------------------------------------------- |
|
72 // |
|
73 CGlobalQueryObserver::CGlobalQueryObserver(CADMAppUi* aCBootstrapAppUiObj) |
|
74 : CActive( EActivePriorityDefault ), |
|
75 iCBootstrapAppUiObj( aCBootstrapAppUiObj ) |
|
76 { |
|
77 } |
|
78 |
|
79 // ---------------------------------------------------------------------------- |
|
80 // CGlobalQueryObserver::ConstructL() |
|
81 // Symbian default constructor can leave. |
|
82 // ---------------------------------------------------------------------------- |
|
83 // |
|
84 void CGlobalQueryObserver::ConstructL() |
|
85 { |
|
86 CActiveScheduler::Add( this ); |
|
87 } |
|
88 |
|
89 // ---------------------------------------------------------------------------- |
|
90 // CGlobalQueryObserver::RunL() |
|
91 // Handle an event. |
|
92 // ---------------------------------------------------------------------------- |
|
93 // |
|
94 void CGlobalQueryObserver::RunL() |
|
95 { |
|
96 Cancel(); |
|
97 if ( iSelectItemFlag ) |
|
98 { |
|
99 iCBootstrapAppUiObj->HandleGlobalQueryResponseL( iStatus.Int() ); |
|
100 } |
|
101 } |
|
102 |
|
103 // ---------------------------------------------------------------------------- |
|
104 // CGlobalQueryObserver::DoCancel() |
|
105 // Implement the Cancel protocol. |
|
106 // ---------------------------------------------------------------------------- |
|
107 // |
|
108 void CGlobalQueryObserver::DoCancel() |
|
109 { |
|
110 } |
|
111 |
|
112 // ---------------------------------------------------------------------------- |
|
113 // CGlobalQueryObserver::SetSelectItemFlag() |
|
114 // Set iSelectItemFlag. |
|
115 // ---------------------------------------------------------------------------- |
|
116 // |
|
117 void CGlobalQueryObserver::SetSelectItemFlag() |
|
118 { |
|
119 iSelectItemFlag = ETrue; |
|
120 } |
|
121 |
|
122 // ---------------------------------------------------------------------------- |
|
123 // CGlobalQueryObserver::SetSelectItemFlag() |
|
124 // Set iSelectItemFlag. |
|
125 // ---------------------------------------------------------------------------- |
|
126 // |
|
127 void CGlobalQueryObserver::UnsetSelectItemFlag() |
|
128 { |
|
129 iSelectItemFlag = EFalse; |
|
130 } |