63
|
1 |
/*
|
|
2 |
* Copyright (c) 2006 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: Sort view control.
|
|
15 |
*
|
|
16 |
*/
|
|
17 |
|
|
18 |
|
|
19 |
#ifndef __CXSPSORTVIEWCONTROL_H
|
|
20 |
#define __CXSPSORTVIEWCONTROL_H
|
|
21 |
|
|
22 |
// INCLUDES
|
|
23 |
#include <coecntrl.h> // CCoeControl
|
|
24 |
#include <cntdef.h> // TContactItemId
|
|
25 |
|
|
26 |
|
|
27 |
// FORWARD DECLARATIONS
|
|
28 |
class CAknSingleGraphicStyleListBox;
|
|
29 |
class CxSPLoader;
|
|
30 |
class CxSPViewIdChanger;
|
|
31 |
class MGlobalNoteObserver;
|
|
32 |
class CAknGlobalNote;
|
|
33 |
class CGlobalNoteObserver;
|
|
34 |
class CPbk2UIExtensionView;
|
|
35 |
|
|
36 |
typedef CArrayPtrFlat<CxSPLoader> CxSPArray;
|
|
37 |
|
|
38 |
/**
|
|
39 |
* Sort view control for Extension manager.
|
|
40 |
* Shows sortable list of extensions.
|
|
41 |
*/
|
|
42 |
class CxSPSortViewControl : public CCoeControl
|
|
43 |
{
|
|
44 |
public: // Constructor and destructor
|
|
45 |
/**
|
|
46 |
* Creates a new CxSPSortViewControl.
|
|
47 |
*
|
|
48 |
* @param aViewIdChanger Reference to view id changer
|
|
49 |
* @param aExtensions array of extensions
|
|
50 |
*/
|
|
51 |
static CxSPSortViewControl* NewL( CxSPViewIdChanger& aViewIdChanger,
|
|
52 |
CxSPArray& aExtensions,
|
|
53 |
CPbk2UIExtensionView& aView);
|
|
54 |
|
|
55 |
/**
|
|
56 |
* Creates a new CxSPSortViewControl and leaves it to
|
|
57 |
* cleanup stack.
|
|
58 |
* @see NewL
|
|
59 |
*/
|
|
60 |
static CxSPSortViewControl* NewLC( CxSPViewIdChanger& aViewIdChanger,
|
|
61 |
CxSPArray& aExtensions,
|
|
62 |
CPbk2UIExtensionView& aView );
|
|
63 |
|
|
64 |
/**
|
|
65 |
* Destructor.
|
|
66 |
*/
|
|
67 |
~CxSPSortViewControl();
|
|
68 |
|
|
69 |
private: // From CCoeControl, standard control functionality
|
|
70 |
TKeyResponse OfferKeyEventL
|
|
71 |
( const TKeyEvent& aKeyEvent, TEventCode aType );
|
|
72 |
void SizeChanged();
|
|
73 |
TInt CountComponentControls() const;
|
|
74 |
CCoeControl* ComponentControl( TInt aIndex ) const;
|
|
75 |
|
|
76 |
void HandlePointerEventL(const TPointerEvent& aPointerEvent);
|
|
77 |
|
|
78 |
public: // Implementation
|
|
79 |
|
|
80 |
CCoeControl& CxSPSortViewControl::ComponentControl() const;
|
|
81 |
|
|
82 |
/**
|
|
83 |
* Sets the listbox data
|
|
84 |
*/
|
|
85 |
void SetListBoxContentsL();
|
|
86 |
|
|
87 |
/**
|
|
88 |
* Marks/unmarks the current item in listbox
|
|
89 |
*
|
|
90 |
* @param aMark if ETrue, mark current item, otherwise unmark it
|
|
91 |
*/
|
|
92 |
void SetCurrentItemMarkedL( TBool aMark );
|
|
93 |
|
|
94 |
/**
|
|
95 |
* Moves the marked item in list when user presses Ok
|
|
96 |
*/
|
|
97 |
void MoveMarkedItemL();
|
|
98 |
|
|
99 |
/**
|
|
100 |
* Commits the sorting operation, i.e. performs the real
|
|
101 |
* extensions sorting after user has sorted the list to his liking.
|
|
102 |
*
|
|
103 |
* @param aObserver The observer to be notified after global wait note
|
|
104 |
* informing user about phonebook exit has been closed.
|
|
105 |
* @return ETrue if real sort happened, i.e. extension order
|
|
106 |
* changed. Otherwise EFalse.
|
|
107 |
*/
|
|
108 |
TBool CommitSortL( MGlobalNoteObserver* aObserver );
|
|
109 |
|
|
110 |
private: // Implementation
|
|
111 |
|
|
112 |
/**
|
|
113 |
* C++ constructor
|
|
114 |
*
|
|
115 |
* @param aViewIdChanger Reference to view id changer
|
|
116 |
* @param aExtensions array of extensions
|
|
117 |
*/
|
|
118 |
CxSPSortViewControl( CxSPViewIdChanger& aViewIdChanger, CxSPArray& aExtensions, CPbk2UIExtensionView& aView );
|
|
119 |
|
|
120 |
/**
|
|
121 |
* Performs the 2nd phase of construction.
|
|
122 |
*/
|
|
123 |
void ConstructL();
|
|
124 |
|
|
125 |
private: // Data
|
|
126 |
|
|
127 |
/// Ref: view id changer
|
|
128 |
CxSPViewIdChanger& iViewIdChanger;
|
|
129 |
|
|
130 |
/// Own: list box control
|
|
131 |
CAknSingleGraphicStyleListBox* iListBox;
|
|
132 |
|
|
133 |
/// not own: sortview
|
|
134 |
CPbk2UIExtensionView& iView;
|
|
135 |
|
|
136 |
/// Ref: Array of extensions
|
|
137 |
CxSPArray& iExtensions;
|
|
138 |
|
|
139 |
/// Own: array that shows the sorted order
|
|
140 |
RArray<TUint32> iSortedOrder;
|
|
141 |
|
|
142 |
/// Own: Global note for informing Phonebook2 exit
|
|
143 |
CAknGlobalNote* iGlobalNote;
|
|
144 |
|
|
145 |
/// Own: Observer for global note events
|
|
146 |
CGlobalNoteObserver* iGlobalNoteObserver;
|
|
147 |
};
|
|
148 |
|
|
149 |
#endif // __CXSPSORTVIEWCONTROL_H
|
|
150 |
|
|
151 |
// End of file
|