63
|
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 tab group container.
|
|
15 |
*
|
|
16 |
*/
|
|
17 |
|
|
18 |
|
|
19 |
#ifndef CPBK2TABGROUPCONTAINER_H
|
|
20 |
#define CPBK2TABGROUPCONTAINER_H
|
|
21 |
|
|
22 |
// INCLUDES
|
|
23 |
#include <e32base.h>
|
|
24 |
#include <AknTabObserver.h>
|
|
25 |
#include <w32std.h>
|
|
26 |
#include <Pbk2ViewInfo.hrh>
|
|
27 |
#include <AknNaviDecoratorObserver.h>
|
|
28 |
|
|
29 |
// FORWARD DECLARATIONS
|
|
30 |
class MPbk2ViewExplorer;
|
|
31 |
class CAknNavigationDecorator;
|
|
32 |
class CAknTabGroup;
|
|
33 |
class CPbk2IconInfoContainer;
|
|
34 |
class CPbk2ViewNode;
|
|
35 |
class MPbk2TabGroupContainerCallback;
|
|
36 |
|
|
37 |
// CLASS DECLARATION
|
|
38 |
|
|
39 |
/**
|
|
40 |
* Phonebook 2 tab group container.
|
|
41 |
* Responsible for creating Phonebook 2 application tab groups
|
|
42 |
* and managing the tab groups. The tab groups are created
|
|
43 |
* from the view graph data. Clients may also add new tab groups
|
|
44 |
* to the container.
|
|
45 |
*/
|
|
46 |
class CPbk2TabGroupContainer : public CBase,
|
|
47 |
private MAknTabObserver,
|
|
48 |
private MAknNaviDecoratorObserver
|
|
49 |
{
|
|
50 |
public: // Constructors and destructor
|
|
51 |
|
|
52 |
/**
|
|
53 |
* Creates a new instance of this class.
|
|
54 |
*
|
|
55 |
* @param aViewExplorer Phonebook 2 view explorer.
|
|
56 |
* @param aCallback Tab group callback.
|
|
57 |
* @return A new instance of this class.
|
|
58 |
*/
|
|
59 |
IMPORT_C static CPbk2TabGroupContainer* NewL(
|
|
60 |
MPbk2ViewExplorer& aViewExplorer,
|
|
61 |
MPbk2TabGroupContainerCallback& aCallback );
|
|
62 |
|
|
63 |
/**
|
|
64 |
* Destructor.
|
|
65 |
*/
|
|
66 |
~CPbk2TabGroupContainer();
|
|
67 |
|
|
68 |
public: // Interface
|
|
69 |
/**
|
|
70 |
* Returns the tab group associated with given id.
|
|
71 |
*
|
|
72 |
* @param aId Id of the tab group.
|
|
73 |
* @return Tab group with given id or
|
|
74 |
* NULL if no tab group was found.
|
|
75 |
*/
|
|
76 |
IMPORT_C CAknNavigationDecorator* TabGroupFromViewId(
|
|
77 |
TInt aId ) const;
|
|
78 |
|
|
79 |
/**
|
|
80 |
* Handles navigation key events.
|
|
81 |
*
|
|
82 |
* @param aKeyEvent Key event to handle.
|
|
83 |
* @param aType Type of the key event.
|
|
84 |
* @return ETrue if event was navigation event and it was consumed,
|
|
85 |
* EFalse otherwise.
|
|
86 |
*/
|
|
87 |
IMPORT_C TBool HandleNavigationKeyEventL(
|
|
88 |
const TKeyEvent& aKeyEvent,
|
|
89 |
TEventCode aType );
|
|
90 |
|
|
91 |
/**
|
|
92 |
* Returns the tab icons.
|
|
93 |
*
|
|
94 |
* @return Tab icons.
|
|
95 |
*/
|
|
96 |
IMPORT_C CPbk2IconInfoContainer& TabIcons() const;
|
|
97 |
|
|
98 |
private: // From MAknTabObserver
|
|
99 |
void TabChangedL(
|
|
100 |
TInt aIndex );
|
|
101 |
|
|
102 |
private: // From MAknNaviDecoratorObserver
|
|
103 |
void HandleNaviDecoratorEventL(
|
|
104 |
TInt aEventID );
|
|
105 |
|
|
106 |
private: // Implementation
|
|
107 |
CPbk2TabGroupContainer(
|
|
108 |
MPbk2ViewExplorer& aViewExplorer,
|
|
109 |
MPbk2TabGroupContainerCallback& aCallback );
|
|
110 |
void ConstructL();
|
|
111 |
TInt DoCalculateTabGroupWidth(
|
|
112 |
TInt aViewCount ) const;
|
|
113 |
void DoReadViewNodeTabResourcesL(
|
|
114 |
const CPbk2ViewNode& aNode,
|
|
115 |
CAknTabGroup& aAknTabGroup,
|
|
116 |
TInt aViewCount );
|
|
117 |
void CreateTabGroupsL();
|
|
118 |
CAknTabGroup& FindTabGroupWithIdL(
|
|
119 |
TPbk2TabGroupId aTabGroupId );
|
|
120 |
void SkinTabGroupsL();
|
|
121 |
|
|
122 |
private: // Data
|
|
123 |
/// Ref: Phonebook 2 view explorer
|
|
124 |
MPbk2ViewExplorer& iViewExplorer;
|
|
125 |
/// Own: View navigation tab groups
|
|
126 |
class CPbk2TabGroupEntry;
|
|
127 |
RPointerArray<CPbk2TabGroupEntry> iViewTabGroups;
|
|
128 |
/// Own: Tab icons
|
|
129 |
CPbk2IconInfoContainer* iTabIcons;
|
|
130 |
///Ref: Tab group callback
|
|
131 |
MPbk2TabGroupContainerCallback& iCallback;
|
|
132 |
};
|
|
133 |
|
|
134 |
#endif // CPBK2TABGROUPCONTAINER_H
|
|
135 |
|
|
136 |
// End of File
|