|
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 application server entry fetcher. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef CPBK2ENTRYFETCHER_H |
|
20 #define CPBK2ENTRYFETCHER_H |
|
21 |
|
22 // INCLUDES |
|
23 #include <e32base.h> |
|
24 #include "MPbk2UiService.h" |
|
25 #include "mpbk2serverappstartupobserver.h" |
|
26 #include "MPbk2ServicePhaseObserver.h" |
|
27 |
|
28 // FORWARD DECLARATIONS |
|
29 class CVPbkContactStoreUriArray; |
|
30 class MPbk2UiServiceObserver; |
|
31 class CVPbkFieldTypeSelector; |
|
32 class CPbk2ServerAppStoreManager; |
|
33 class MPbk2ServicePhase; |
|
34 |
|
35 // CLASS DECLARATION |
|
36 |
|
37 /** |
|
38 * Phonebook 2 application server entry fetcher. |
|
39 * Responsible for driving the entry fetch service phases. |
|
40 */ |
|
41 class CPbk2EntryFetcher : public CBase, |
|
42 public MPbk2UiService, |
|
43 public MPbk2ServicePhaseObserver, |
|
44 private MPbk2ServerAppStartupObserver |
|
45 { |
|
46 public: // Construction |
|
47 |
|
48 /** |
|
49 * Creates a new instance of this class. |
|
50 * |
|
51 * @param aMessage Client-server message. |
|
52 * @param aObserver UI service observer. |
|
53 * @param aFetchType Fetch type. |
|
54 * @return A new instance of this class. |
|
55 */ |
|
56 static CPbk2EntryFetcher* NewL( |
|
57 const RMessage2& aMessage, |
|
58 MPbk2UiServiceObserver& aObserver, |
|
59 TPbk2FetchType aFetchType ); |
|
60 |
|
61 /** |
|
62 * Destructor. |
|
63 */ |
|
64 ~CPbk2EntryFetcher(); |
|
65 |
|
66 public: // From MPbk2UiService |
|
67 void LaunchServiceL(); |
|
68 void CancelService(); |
|
69 void AcceptDelayedContactsL( |
|
70 const TDesC8& aContactLinkBuffer ); |
|
71 void ExitServiceL( |
|
72 TInt aExitCommandId ); |
|
73 void ServiceResults(TServiceResults* aResults) const; |
|
74 |
|
75 public: // From MPbk2ServicePhaseObserver |
|
76 void NextPhase( |
|
77 MPbk2ServicePhase& aPhase ); |
|
78 void PreviousPhase( |
|
79 MPbk2ServicePhase& aPhase ); |
|
80 void PhaseCanceled( |
|
81 MPbk2ServicePhase& aPhase ); |
|
82 void PhaseAborted( |
|
83 MPbk2ServicePhase& aPhase ); |
|
84 void PhaseError( |
|
85 MPbk2ServicePhase& aPhase, |
|
86 TInt aErrorCode ); |
|
87 TBool PhaseOkToExit( |
|
88 MPbk2ServicePhase& aPhase, |
|
89 TInt aCommandId ); |
|
90 void PhaseAccept( |
|
91 MPbk2ServicePhase& aPhase, |
|
92 const TDesC8& aMarkedEntries, |
|
93 const TDesC8& aLinkData ); |
|
94 |
|
95 private: // From MPbk2ServerAppStartupObserver |
|
96 void ContactUiReadyL( |
|
97 MPbk2StartupMonitor& aStartupMonitor ); |
|
98 void StartupCanceled( |
|
99 TInt aErrorCode ); |
|
100 |
|
101 private: // Implementation |
|
102 CPbk2EntryFetcher( |
|
103 MPbk2UiServiceObserver& aObserver, |
|
104 TPbk2FetchType aFetchType ); |
|
105 void ConstructL( |
|
106 const RMessage2& aMessage ); |
|
107 void LaunchFetchPhaseL(); |
|
108 |
|
109 private: // Data |
|
110 /// Ref: UI service observer |
|
111 MPbk2UiServiceObserver& iObserver; |
|
112 /// Own: Fetch type |
|
113 TPbk2FetchType iFetchType; |
|
114 /// Own: Loaded store URIs |
|
115 CVPbkContactStoreUriArray* iStoreUris; |
|
116 /// Own: Initially marked contact links |
|
117 MVPbkContactLinkArray* iPreselectedContacts; |
|
118 /// Own: Fetch resource id |
|
119 TInt iFetchResId; |
|
120 /// Own: Contact view filter |
|
121 CVPbkFieldTypeSelector* iContactViewFilter; |
|
122 /// Own: Server app store manager |
|
123 CPbk2ServerAppStoreManager* iStoreManager; |
|
124 /// Own: Fetch phase |
|
125 MPbk2ServicePhase* iFetchPhase; |
|
126 /// Own: ETrue if using default store configuration |
|
127 TBool iUseDeviceConfig; |
|
128 }; |
|
129 |
|
130 #endif // CPBK2ENTRYFETCHER_H |
|
131 |
|
132 // End of File |