|
1 /* |
|
2 * Copyright (c) 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: A contact editor strategy for the new own contact creation. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 #ifndef CPBK2CONTACTEDITORNEWOWNCONTACT_H |
|
21 #define CPBK2CONTACTEDITORNEWOWNCONTACT_H |
|
22 |
|
23 // INCLUDES |
|
24 #include <e32base.h> |
|
25 #include <MVPbkContactObserver.h> |
|
26 #include "MPbk2ContactEditorStrategy.h" |
|
27 |
|
28 // FORWARD DECLARATIONS |
|
29 class TPbk2ContactEditorParams; |
|
30 class CPbk2PresentationContact; |
|
31 class CPbk2InputAbsorber; |
|
32 |
|
33 // CLASS DECLARATION |
|
34 |
|
35 /** |
|
36 * A contact editor strategy for the new own contact creation. |
|
37 */ |
|
38 NONSHARABLE_CLASS( CPbk2ContactEditorNewOwnContact ) : |
|
39 public CActive, |
|
40 public MPbk2ContactEditorStrategy, |
|
41 private MVPbkContactObserver |
|
42 { |
|
43 public: // Constructors and destructor |
|
44 |
|
45 /** |
|
46 * Two-phased constructor. |
|
47 * |
|
48 * @param aParams The contact editor parameters. |
|
49 * @param aContact Presentation level contact. |
|
50 * @return A new instance of this class. |
|
51 */ |
|
52 static CPbk2ContactEditorNewOwnContact* NewL( |
|
53 TPbk2ContactEditorParams& aParams, |
|
54 CPbk2PresentationContact* aContact); |
|
55 |
|
56 /** |
|
57 * Destructor. |
|
58 */ |
|
59 ~CPbk2ContactEditorNewOwnContact(); |
|
60 |
|
61 private: // From CActive |
|
62 void RunL(); |
|
63 void DoCancel(); |
|
64 |
|
65 public: // From MPbk2ContactEditorStrategy |
|
66 void SaveContactL( |
|
67 MPbk2ContactEditorEventObserver& aObserver, |
|
68 MPbk2ContactEditorEventObserver::TParams& aParams); |
|
69 void DeleteContactL( |
|
70 MPbk2ContactEditorEventObserver& aObserver, |
|
71 MPbk2ContactEditorEventObserver::TParams& aParams); |
|
72 const TDesC& DefaultTitle() const; |
|
73 void SwitchContactL( |
|
74 CPbk2PresentationContact* aContact); |
|
75 void GetHelpContext(TCoeHelpContext &aContext) const; |
|
76 TBool StopQuery(); |
|
77 |
|
78 private: // From MVPbkContactObserver |
|
79 void ContactOperationCompleted( |
|
80 MVPbkContactObserver::TContactOpResult aResult); |
|
81 void ContactOperationFailed( |
|
82 MVPbkContactObserver::TContactOp aOpCode, |
|
83 TInt aErrorCode, TBool aErrorNotified); |
|
84 |
|
85 private: // Implementation |
|
86 CPbk2ContactEditorNewOwnContact( CPbk2PresentationContact* aContact ); |
|
87 void ConstructL(); |
|
88 static TInt IdleDeleteCallBack( TAny* aSelf ); |
|
89 void HandleIdleDelete(); |
|
90 |
|
91 private: // Data |
|
92 /// Ref: The new contact |
|
93 CPbk2PresentationContact* iContact; |
|
94 /// Own: For absorbing user input while saving the contact |
|
95 CPbk2InputAbsorber* iInputAbsorber; |
|
96 /// Ref: The current contact event observer |
|
97 MPbk2ContactEditorEventObserver* iObserver; |
|
98 /// Own: Parameters for the event observer |
|
99 MPbk2ContactEditorEventObserver::TParams iEditorParams; |
|
100 /// Own: For asynchronously completing DeleteContactL |
|
101 CIdle* iIdleDelete; |
|
102 /// Own: Last result of completed event |
|
103 MVPbkContactObserver::TContactOpResult iLatestResult; |
|
104 }; |
|
105 |
|
106 #endif // CPBK2CONTACTEDITORNEWOWNCONTACT_H |
|
107 |
|
108 // End of File |