|
1 /* |
|
2 * Copyright (c) 2002-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: An application UI extension implementation |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 #ifndef CPBK2APPUIEXTENSION_H |
|
21 #define CPBK2APPUIEXTENSION_H |
|
22 |
|
23 // INCLUDES |
|
24 #include <e32base.h> |
|
25 #include <MPbk2AppUiExtension.h> |
|
26 #include <MPbk2StartupMonitor.h> |
|
27 #include <MPbk2StartupObserver.h> |
|
28 |
|
29 // FORWARD DECLARATIONS |
|
30 class CPbk2UIExtensionLoader; |
|
31 class CPbk2ThinUIExtensionLoader; |
|
32 class CVPbkContactManager; |
|
33 |
|
34 // CLASS DECLARATION |
|
35 |
|
36 /** |
|
37 * An application UI extension implementation. |
|
38 */ |
|
39 NONSHARABLE_CLASS(CPbk2AppUiExtension) : |
|
40 public CBase, |
|
41 public MPbk2AppUiExtension, |
|
42 public MPbk2StartupMonitor, |
|
43 private MPbk2StartupObserver |
|
44 { |
|
45 public: // Constructors and destructor |
|
46 /** |
|
47 * Two-phased constructor. |
|
48 * |
|
49 * @param aContactManager the Virtual Phonebook Contact Manager |
|
50 * @param aExtensionLoader a UI extension loader for calling extension |
|
51 * start-up point |
|
52 * @param aThinExtensionLoader a thin extension loader for calling thin |
|
53 * extension start-up point. |
|
54 * @return a new instance of this class |
|
55 */ |
|
56 static CPbk2AppUiExtension* NewL( |
|
57 CVPbkContactManager& aContactManager, |
|
58 CPbk2UIExtensionLoader& aExtensionLoader, |
|
59 CPbk2ThinUIExtensionLoader& aThinExtensionLoader); |
|
60 |
|
61 /** |
|
62 * Destructor. |
|
63 */ |
|
64 virtual ~CPbk2AppUiExtension(); |
|
65 |
|
66 public: // Functions from MPbk2AppUiExtension |
|
67 void ExtensionStartupL(MPbk2StartupMonitor& aStartupMonitor); |
|
68 void ApplyDynamicPluginTabGroupContainerChangesL( |
|
69 const CPbk2ViewNode& aNode, |
|
70 CAknTabGroup& aAknTabGroup, |
|
71 CPbk2IconInfoContainer& aTabIcons, |
|
72 TInt aViewCount); |
|
73 |
|
74 public: // Functions from MPbk2UiReleasable |
|
75 void DoRelease(); |
|
76 |
|
77 public: // Functions from MPbk2StartupMonitor |
|
78 void HandleStartupComplete(); |
|
79 void HandleStartupFailed( TInt aError ); |
|
80 void RegisterEventsL( MPbk2StartupObserver& aObserver ); |
|
81 void DeregisterEvents( MPbk2StartupObserver& aObserver ); |
|
82 void NotifyViewActivationL( TUid aViewId ); |
|
83 void NotifyViewActivationL( |
|
84 TUid aViewId, MVPbkContactViewBase& aContactView ); |
|
85 |
|
86 private: // Functions from MPbk2StartupObserver |
|
87 void ContactUiReadyL( |
|
88 MPbk2StartupMonitor& aStartupMonitor ); |
|
89 |
|
90 private: // New functions |
|
91 void StopObservingMonitor(); |
|
92 TBool AllExtensionsCompleted() const; |
|
93 TInt NumOfExtensions() const; |
|
94 |
|
95 private: // Construction |
|
96 CPbk2AppUiExtension( |
|
97 CVPbkContactManager& aContactManager, |
|
98 CPbk2UIExtensionLoader& aExtensionLoader, |
|
99 CPbk2ThinUIExtensionLoader& aThinExtensionLoader); |
|
100 void ConstructL(); |
|
101 |
|
102 private: // Data |
|
103 /// Ref: a UI extension loader for calling extension start-up point |
|
104 CPbk2UIExtensionLoader& iExtensionLoader; |
|
105 /// Ref: a thin extension loader for calling thin extension start-up point. |
|
106 CPbk2ThinUIExtensionLoader& iThinExtensionLoader; |
|
107 /// Ref: The phonebook2 contact manager |
|
108 CVPbkContactManager& iContactManager; |
|
109 /// Own: An array for extensions |
|
110 RPointerArray<MPbk2AppUiExtension> iExtensions; |
|
111 /// Ref: the actual start-up monitor |
|
112 MPbk2StartupMonitor* iStartupMonitor; |
|
113 /// Own: The number of extensions that have notified start-up complete |
|
114 TInt iNumOfCompletedExtensions; |
|
115 /// Own: The number of extensions that have notified start-up failed |
|
116 TInt iNumOfFailedExtensions; |
|
117 /// Own: An array of start-up observers |
|
118 RPointerArray<MPbk2StartupObserver> iStartupObservers; |
|
119 /// Own: the state of the core pbk2 UI. |
|
120 TBool iContactUiReady; |
|
121 }; |
|
122 |
|
123 #endif // CPBK2APPUIEXTENSION_H |
|
124 |
|
125 // End of File |