|
1 /* |
|
2 * Copyright (c) 2005-2008 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: Declaration of CGSAccessoryPluginContainer class |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef GSACCESSORYPLUGINCONTAINER_H |
|
20 #define GSACCESSORYPLUGINCONTAINER_H |
|
21 |
|
22 #include <gsbasecontainer.h> |
|
23 |
|
24 class CGSAccessoryPluginModel; |
|
25 class CGSListBoxItemTextArray; |
|
26 |
|
27 /** |
|
28 * GSAccessoryPluginContainer container class |
|
29 * |
|
30 * Container class for Accessory Settings view |
|
31 */ |
|
32 class CGSAccessoryPluginContainer : public CGSBaseContainer |
|
33 { |
|
34 |
|
35 public: // Constructors and destructor |
|
36 |
|
37 /** |
|
38 * First phase constructor. |
|
39 * |
|
40 * @param aModel Data model for reading and writing settings. |
|
41 */ |
|
42 CGSAccessoryPluginContainer( CGSAccessoryPluginModel& aModel ); |
|
43 |
|
44 /** |
|
45 * Destructor. |
|
46 */ |
|
47 virtual ~CGSAccessoryPluginContainer(); |
|
48 |
|
49 public: |
|
50 |
|
51 /** |
|
52 * Retrieves the currently selected listbox feature id |
|
53 * |
|
54 * @return Feature id of the item which is currently selected in the list |
|
55 * box. |
|
56 */ |
|
57 TInt CurrentFeatureId() const; |
|
58 |
|
59 /** |
|
60 * Changes the default item - clears the dynamic text from the old item and |
|
61 * adds it to the new item. |
|
62 * |
|
63 * @param aNewDefaultItem New default item index |
|
64 * @param aOldDefaultItem Previous default item index |
|
65 */ |
|
66 void ChangeDefaultItemL( |
|
67 const TInt aNewDefaultItem, |
|
68 const TInt aOldDefaultItem ); |
|
69 |
|
70 private: // From CGSBaseContainer |
|
71 |
|
72 /** |
|
73 * @see class CGSBaseContainer. |
|
74 */ |
|
75 void ConstructL( const TRect& aRect ); |
|
76 |
|
77 /** |
|
78 * @see class CGSBaseContainer. |
|
79 */ |
|
80 void ConstructListBoxL( TInt aResLbxId ); |
|
81 |
|
82 private: // From CCoeControl |
|
83 |
|
84 /** |
|
85 * @see class CCoeControl. |
|
86 */ |
|
87 void GetHelpContext( TCoeHelpContext& aContext ) const; |
|
88 |
|
89 private: |
|
90 |
|
91 /** |
|
92 * Checks if accessory is supported and makes its listbox item visible if |
|
93 * it is. |
|
94 * |
|
95 * @param aAccessory Identifies the accessory whose support status to check. |
|
96 * @param aItemId Identifies the item to make visible. |
|
97 */ |
|
98 void MakeVisibleIfSupportedL( TInt aAccessory, TInt aItemId ); |
|
99 |
|
100 /** |
|
101 * Adds a label to an item. |
|
102 * |
|
103 * @param aFeatureId Identifies the item to set the text to. |
|
104 * @param aLabel Label to show. |
|
105 */ |
|
106 void ShowLabelL( TInt aFeatureId, const TDesC& aLabel ); |
|
107 |
|
108 protected: // data |
|
109 |
|
110 /** Data model. */ |
|
111 CGSAccessoryPluginModel& iModel; |
|
112 |
|
113 /** GS listbox model. Own. */ |
|
114 CGSListBoxItemTextArray* iListboxItemArray; |
|
115 |
|
116 /** Label for the default accessory. Own. */ |
|
117 HBufC* iDefaultText; |
|
118 |
|
119 }; |
|
120 |
|
121 #endif // GSACCESSORYPLUGINCONTAINER_H |