|
1 /* |
|
2 * Copyright (c) 2008 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: Edit Contact for local store and server store |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 // INCLUDE FILES |
|
20 #include "cvimpstcmdeditcontact.h" |
|
21 |
|
22 #include "vimpstcmd.hrh" |
|
23 #include "mvimpstcmdobserver.h" |
|
24 |
|
25 #include "uiservicetabtracer.h" |
|
26 |
|
27 #include <e32def.h> |
|
28 #include "mvimpstengine.h" |
|
29 #include "mvimpstenginecontactmgmtextention.h" |
|
30 #include "mvimpstengineextentionfeatures.h" |
|
31 |
|
32 #include "cvimpststoragemanagerfactory.h" |
|
33 #include "mvimpststorageserviceview.h" |
|
34 |
|
35 // Constants |
|
36 |
|
37 // -------------------------------------------------------------------------- |
|
38 // CVIMPSTCmdEditContact::CVIMPSTCmdEditContact |
|
39 // -------------------------------------------------------------------------- |
|
40 // |
|
41 CVIMPSTCmdEditContact::CVIMPSTCmdEditContact( |
|
42 const TInt aCommandId ,MVPbkContactLink* aContactLink, |
|
43 MVIMPSTEngine& aEngine) : |
|
44 iCommandId( aCommandId ), |
|
45 iContactLink( aContactLink ), |
|
46 iEngine(aEngine) |
|
47 { |
|
48 } |
|
49 |
|
50 // -------------------------------------------------------------------------- |
|
51 // CVIMPSTCmdEditContact::~CVIMPSTCmdEditContact |
|
52 // -------------------------------------------------------------------------- |
|
53 // |
|
54 CVIMPSTCmdEditContact::~CVIMPSTCmdEditContact() |
|
55 { |
|
56 |
|
57 } |
|
58 |
|
59 // -------------------------------------------------------------------------- |
|
60 // CVIMPSTCmdEditContact::NewL |
|
61 // -------------------------------------------------------------------------- |
|
62 // |
|
63 CVIMPSTCmdEditContact* CVIMPSTCmdEditContact::NewL( |
|
64 const TInt aCommandId,MVPbkContactLink* aContactLink, |
|
65 MVIMPSTEngine& aEngine) |
|
66 { |
|
67 TRACER_AUTO; |
|
68 CVIMPSTCmdEditContact* self = new (ELeave ) CVIMPSTCmdEditContact( aCommandId ,aContactLink, aEngine); |
|
69 self->ConstructL(); //use contsurctL if necessary |
|
70 return self; |
|
71 } |
|
72 // -------------------------------------------------------------------------- |
|
73 // CVIMPSTCmdEditContact::ConstructL |
|
74 // -------------------------------------------------------------------------- |
|
75 // |
|
76 void CVIMPSTCmdEditContact::ConstructL() |
|
77 { |
|
78 |
|
79 } |
|
80 |
|
81 // -------------------------------------------------------------------------- |
|
82 // CVIMPSTCmdEditContact::ExecuteLD |
|
83 // -------------------------------------------------------------------------- |
|
84 // |
|
85 void CVIMPSTCmdEditContact::ExecuteLD() |
|
86 { |
|
87 |
|
88 TRACER_AUTO; |
|
89 //push to the cleanupstack |
|
90 CleanupStack::PushL( this ); |
|
91 /* |
|
92 MVIMPSTEngineExtentionFeatures* feature = iEngine.ExtentionFeatures(TVIMPSTEnums::EContactManagement); |
|
93 if (feature) |
|
94 { |
|
95 // to be implimented for serverstore editcontact |
|
96 iError = KErrNone; |
|
97 } |
|
98 |
|
99 MVIMPSTStorageServiceView* storage = CVIMPSTStorageManagerFactory::ContactListInterfaceL(iEngine.ServiceId()) ; |
|
100 if(storage) |
|
101 { |
|
102 storage->EditContactL(*iContactLink); |
|
103 } |
|
104 |
|
105 CHAT_DP_FUNC_ENTER("CVIMPSTEnableServiceCmd:: CommandFinished"); |
|
106 |
|
107 if(iObserver) |
|
108 { |
|
109 iObserver->CommandFinishedL(*this); |
|
110 } |
|
111 CHAT_DP_FUNC_ENTER("CVIMPSTEnableServiceCmd:: CommandFinished"); |
|
112 */ |
|
113 CleanupStack::PopAndDestroy(); |
|
114 |
|
115 } |
|
116 |
|
117 |
|
118 // -------------------------------------------------------------------------- |
|
119 // CVIMPSTCmdEditContact::AddObserver |
|
120 // -------------------------------------------------------------------------- |
|
121 // |
|
122 void CVIMPSTCmdEditContact::AddObserver( MVIMPSTCmdObserver& aObserver ) |
|
123 { |
|
124 // store the observer to notify the command completion |
|
125 iObserver = &aObserver; |
|
126 } |
|
127 |
|
128 |
|
129 // -------------------------------------------------------------------------- |
|
130 // CVIMPSTCmdEditContact::CommandId |
|
131 // -------------------------------------------------------------------------- |
|
132 // |
|
133 TInt CVIMPSTCmdEditContact::CommandId() const |
|
134 { |
|
135 return iCommandId; |
|
136 } |
|
137 |
|
138 // -------------------------------------------------------------------------- |
|
139 // CVIMPSTCmdEditContact::Result |
|
140 // -------------------------------------------------------------------------- |
|
141 // |
|
142 TInt CVIMPSTCmdEditContact::Result() const |
|
143 { |
|
144 //return valid data regd the command operation |
|
145 return iError; |
|
146 } |
|
147 |
|
148 // End of File |