|
1 /* |
|
2 * Copyright (c) 2005-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: Phonebook 2 call command object. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef CPBK2CALLCMD_H |
|
20 #define CPBK2CALLCMD_H |
|
21 |
|
22 // INCLUDES |
|
23 #include <e32base.h> |
|
24 #include <MPbk2Command.h> |
|
25 #include <VPbkFieldTypeSelectorFactory.h> |
|
26 #include <spdefinitions.h> |
|
27 |
|
28 // FORWARD DECLARATIONS |
|
29 class CAiwServiceHandler; |
|
30 class MPbk2ContactUiControl; |
|
31 class MVPbkStoreContactField; |
|
32 class MVPbkStoreContact; |
|
33 class CPbk2CallTypeSelector; |
|
34 class CAiwDialDataExt; |
|
35 class MVPbkContactFieldData; |
|
36 |
|
37 // CLASS DECLARATION |
|
38 |
|
39 /** |
|
40 * Phonebook 2 call command object. |
|
41 * Responsible for setting up dial data and launching the call by using AIW. |
|
42 */ |
|
43 NONSHARABLE_CLASS(CPbk2CallCmd) : public CBase, |
|
44 public MPbk2Command |
|
45 { |
|
46 public: // Construction and destruction |
|
47 |
|
48 /** |
|
49 * Creates a new instance of this class. |
|
50 * |
|
51 * @param aContact Reference to the contact. |
|
52 * @param aSelectField Selected contact field, |
|
53 * ownership is taken. |
|
54 * @param aControl Contact UI control. |
|
55 * @param aCommandId Command id. |
|
56 * @param aServiceHandler Reference to service handler. |
|
57 * @param aSelector Reference to call type selector. |
|
58 * @return A new instance of this class. |
|
59 */ |
|
60 static CPbk2CallCmd* NewL( |
|
61 MVPbkStoreContact*& aContact, |
|
62 MVPbkStoreContactField* aSelectedField, |
|
63 MPbk2ContactUiControl& aControl, |
|
64 const TInt aCommandId, |
|
65 CAiwServiceHandler& aServiceHandler, |
|
66 CPbk2CallTypeSelector& aSelector ); |
|
67 |
|
68 /** |
|
69 * Creates a new instance of this class. |
|
70 * |
|
71 * @param aContact Reference to the contact. |
|
72 * @param aSelectField Selected contact field, |
|
73 * ownership is taken. |
|
74 * @param aControl Contact UI control. |
|
75 * @param aCommandId Command id. |
|
76 * @param aServiceHandler Reference to service handler. |
|
77 * @param aSelector Reference to call type selector. |
|
78 * @param aActionSelector Action type selector. |
|
79 * @return A new instance of this class. |
|
80 */ |
|
81 static CPbk2CallCmd* NewL( |
|
82 MVPbkStoreContact*& aContact, |
|
83 MVPbkStoreContactField* aSelectedField, |
|
84 MPbk2ContactUiControl& aControl, |
|
85 const TInt aCommandId, |
|
86 CAiwServiceHandler& aServiceHandler, |
|
87 CPbk2CallTypeSelector& aSelector, |
|
88 VPbkFieldTypeSelectorFactory::TVPbkContactActionTypeSelector aActionSelector ); |
|
89 |
|
90 |
|
91 /** |
|
92 * Destructor. |
|
93 */ |
|
94 ~CPbk2CallCmd(); |
|
95 |
|
96 public: // From MPbkCommand |
|
97 void ExecuteLD(); |
|
98 void ResetUiControl( |
|
99 MPbk2ContactUiControl& aUiControl ); |
|
100 void AddObserver( |
|
101 MPbk2CommandObserver& aObserver ); |
|
102 |
|
103 private: // Implementation |
|
104 CPbk2CallCmd( |
|
105 MVPbkStoreContact*& aContact, |
|
106 MVPbkStoreContactField* aSelectedField, |
|
107 MPbk2ContactUiControl& aControl, |
|
108 const TInt aCommandId, |
|
109 CAiwServiceHandler& aServiceHandler, |
|
110 CPbk2CallTypeSelector& aSelector, |
|
111 VPbkFieldTypeSelectorFactory::TVPbkContactActionTypeSelector aActionSelector ); |
|
112 |
|
113 void SetCallTypeL( CAiwDialDataExt& dialData ); |
|
114 TBool ExtractXspId( |
|
115 const MVPbkStoreContactField* aSelectedField, |
|
116 TPtrC& aXSPId) const; |
|
117 TServiceId GetMatchedServiceIdL( const TDesC& aXSPId ); |
|
118 TPtrC GetFieldData( const MVPbkContactFieldData& aFieldData ) const; |
|
119 |
|
120 private: // Data |
|
121 /// Ref: Contact to call to |
|
122 MVPbkStoreContact*& iContact; |
|
123 /// Own: Phone number field to call |
|
124 MVPbkStoreContactField* iSelectedField; |
|
125 /// Ref: Contact UI control |
|
126 MPbk2ContactUiControl* iControl; |
|
127 /// Own: Command id |
|
128 const TInt iCommandId; |
|
129 /// Ref: AIW service handler |
|
130 CAiwServiceHandler& iServiceHandler; |
|
131 /// Ref: Call type selector |
|
132 CPbk2CallTypeSelector& iSelector; |
|
133 /// Own: Action type selector |
|
134 VPbkFieldTypeSelectorFactory::TVPbkContactActionTypeSelector iActionSelector; |
|
135 }; |
|
136 |
|
137 #endif // CPBK2CALLCMD_H |
|
138 |
|
139 // End of File |