|
1 /* |
|
2 * Copyright (c) 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: Abstract base class for queries. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 // INCLUDE FILES |
|
20 |
|
21 #include "lpdquerylauncherbase.h" |
|
22 #include "lpdresulthandler.h" |
|
23 #include "lpdrequestorprocessor.h" |
|
24 |
|
25 #include "lpdglobalplugindialog.h" |
|
26 |
|
27 |
|
28 // CONSTANTS |
|
29 |
|
30 // Unnamed namespace for local definitions |
|
31 |
|
32 #ifdef _DEBUG |
|
33 //_LIT( KPanicText, "CLpdQueryLauncherBase" ); |
|
34 enum TPanicCode |
|
35 { |
|
36 KLpdErrGeneral = 1 |
|
37 }; |
|
38 #endif |
|
39 |
|
40 // INCLUDE FILES |
|
41 #include <s32mem.h> |
|
42 |
|
43 // ============================ MEMBER FUNCTIONS =============================== |
|
44 |
|
45 // ----------------------------------------------------------------------------- |
|
46 // CLpdQueryLauncherBase::CLpdQueryLauncherBase |
|
47 // C++ default constructor can NOT contain any code, that |
|
48 // might leave. |
|
49 // ----------------------------------------------------------------------------- |
|
50 // |
|
51 CLpdQueryLauncherBase::CLpdQueryLauncherBase( MLpdResultHandler& aHandler ) |
|
52 : iHandler( aHandler ), |
|
53 iResult( KErrArgument ), |
|
54 iQueryDlg( NULL ) |
|
55 { |
|
56 } |
|
57 |
|
58 |
|
59 |
|
60 // ----------------------------------------------------------------------------- |
|
61 // CLpdQueryLauncherBase::~CLpdQueryLauncherBase |
|
62 // Destructor |
|
63 // ----------------------------------------------------------------------------- |
|
64 // |
|
65 CLpdQueryLauncherBase::~CLpdQueryLauncherBase() |
|
66 { |
|
67 delete iQueryDlg; |
|
68 iQueryDlg = NULL; |
|
69 } |
|
70 |
|
71 |
|
72 // ----------------------------------------------------------------------------- |
|
73 // CLpdQueryLauncherBase::ConstructL |
|
74 // (other items were commented in a header). |
|
75 // ----------------------------------------------------------------------------- |
|
76 // |
|
77 void CLpdQueryLauncherBase::ConstructL() |
|
78 { |
|
79 iQueryDlg = CLpdGlobalPluginDialog::NewL(*this); |
|
80 } |
|
81 // ----------------------------------------------------------------------------- |
|
82 // CLpdQueryLauncherBase::SetQueryTextArray |
|
83 // (other items were commented in a header). |
|
84 // ----------------------------------------------------------------------------- |
|
85 // |
|
86 void CLpdQueryLauncherBase::SetRequestInfoL( CLpdRequestorProcessor* aRequestInfo ) |
|
87 { |
|
88 iQueryDlg->SetRequestInfoL(aRequestInfo); |
|
89 } |
|
90 |
|
91 void CLpdQueryLauncherBase::RequestType(TRequestType& aRequestType) |
|
92 { |
|
93 aRequestType = EUnknown; |
|
94 } |
|
95 // ----------------------------------------------------------------------------- |
|
96 // CLpdQueryLauncherBase::StartQueryL |
|
97 // (other items were commented in a header). |
|
98 // ----------------------------------------------------------------------------- |
|
99 // |
|
100 void CLpdQueryLauncherBase::StartQueryL() |
|
101 { |
|
102 TRequestType type; |
|
103 RequestType( type ); |
|
104 if( EVerification == type ) |
|
105 { |
|
106 iQueryDlg->RunVerificationQueryL(); |
|
107 } |
|
108 else if( ENotification == type ) |
|
109 { |
|
110 iQueryDlg->RunNotificationL(); |
|
111 } |
|
112 else |
|
113 { |
|
114 // do nothing now |
|
115 } |
|
116 |
|
117 } |
|
118 |
|
119 void CLpdQueryLauncherBase::Cancel() |
|
120 { |
|
121 iQueryDlg->Cancel(); |
|
122 } |
|
123 // ----------------------------------------------------------------------------- |
|
124 // CLpdQueryLauncherBase::HandleDlgDismissedL |
|
125 // (other items were commented in a header). |
|
126 // ----------------------------------------------------------------------------- |
|
127 // |
|
128 void CLpdQueryLauncherBase::HandleDlgDismissedL( |
|
129 TInt aResult ) |
|
130 { |
|
131 |
|
132 iResult = aResult; |
|
133 |
|
134 TRAPD( err, ExtendedHandleDlgDismissedL() ); |
|
135 if ( err ) |
|
136 { |
|
137 iHandler.HandleLeave( err ); |
|
138 } |
|
139 |
|
140 } |
|
141 |
|
142 // End of File |