35
|
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: Presence Settings UI view container implementation
|
|
15 |
*
|
|
16 |
*/
|
|
17 |
|
|
18 |
|
|
19 |
|
|
20 |
|
|
21 |
// INCLUDE FILES
|
|
22 |
#include <psuigspluginrsc.rsg>
|
|
23 |
#include <aknlists.h>
|
|
24 |
#include <aknnavi.h>
|
|
25 |
#include <akntitle.h>
|
|
26 |
#include <AknUtils.h>
|
|
27 |
#include "psuigspluginsettingviewcontainer.h"
|
|
28 |
#include "psuigspluginsettingview.h"
|
|
29 |
#include "psuigspluginmodel.h"
|
|
30 |
#include "psuisipxdmsettingitem.h"
|
|
31 |
#include "psuiintegersettingitem.h"
|
|
32 |
#include "psuigsplugin.h"
|
|
33 |
#include "psuigspluginids.hrh"
|
|
34 |
#include <csxhelp/pre.hlp.hrh>
|
|
35 |
#include <akntextsettingpage.h>
|
|
36 |
|
|
37 |
|
|
38 |
// ========================= MEMBER FUNCTIONS ================================
|
|
39 |
|
|
40 |
// ---------------------------------------------------------------------------
|
|
41 |
// CPSUIGSPluginSettingViewContainer::CPSUIGSPluginSettingViewContainer()
|
|
42 |
// Default constructor.
|
|
43 |
// ---------------------------------------------------------------------------
|
|
44 |
//
|
|
45 |
CPSUIGSPluginSettingViewContainer::CPSUIGSPluginSettingViewContainer(
|
|
46 |
CPSUIGSPluginSettingView* aView )
|
|
47 |
: iView ( aView )
|
|
48 |
{
|
|
49 |
}
|
|
50 |
|
|
51 |
// ---------------------------------------------------------------------------
|
|
52 |
// CPSUIGSPluginSettingViewContainer::ConstructL(const TRect& aRect)
|
|
53 |
// Symbian OS phase 2 constructor
|
|
54 |
// ---------------------------------------------------------------------------
|
|
55 |
//
|
|
56 |
void CPSUIGSPluginSettingViewContainer::ConstructL( const TRect& aRect )
|
|
57 |
{
|
|
58 |
UpdateTitleL();
|
|
59 |
CreateWindowL();
|
|
60 |
ConstructFromResourceL( R_PSUI_SETTING_ITEMS );
|
|
61 |
SetRect( aRect );
|
|
62 |
ActivateL();
|
|
63 |
}
|
|
64 |
|
|
65 |
// ---------------------------------------------------------------------------
|
|
66 |
// CPSUIGSPluginSettingViewContainer::~CPSUIGSPluginSettingViewContainer()
|
|
67 |
// Destructor
|
|
68 |
// ---------------------------------------------------------------------------
|
|
69 |
//
|
|
70 |
CPSUIGSPluginSettingViewContainer::~CPSUIGSPluginSettingViewContainer()
|
|
71 |
{
|
|
72 |
// iView is deleted elsewhere
|
|
73 |
}
|
|
74 |
|
|
75 |
// ---------------------------------------------------------------------------
|
|
76 |
// CPSUIGSPluginSettingViewContainer::CreateSettingItemL()
|
|
77 |
// See header for details.
|
|
78 |
// ---------------------------------------------------------------------------
|
|
79 |
//
|
|
80 |
CAknSettingItem* CPSUIGSPluginSettingViewContainer::CreateSettingItemL(
|
|
81 |
TInt aSettingId )
|
|
82 |
{
|
|
83 |
CAknSettingItem* settingItem = NULL;
|
|
84 |
TPresSettingsSet& settingSet = iView->MainView()->PSModel()->SettingsSet();
|
|
85 |
|
|
86 |
switch ( aSettingId )
|
|
87 |
{
|
|
88 |
case EPSUIServerNameId:
|
|
89 |
settingItem = new (ELeave) CAknTextSettingItem(
|
|
90 |
aSettingId, settingSet.iSetName );
|
|
91 |
break;
|
|
92 |
case EPSUISIPProfileId:
|
|
93 |
settingItem = new (ELeave) CPSUISipXdmSettingItem(
|
|
94 |
aSettingId, settingSet.iSipProfile, iView->MainView()->PSModel() );
|
|
95 |
break;
|
|
96 |
case EPSUIXDMSettingsId:
|
|
97 |
settingItem = new (ELeave) CPSUISipXdmSettingItem(
|
|
98 |
aSettingId, settingSet.iXDMSetting, iView->MainView()->PSModel() );
|
|
99 |
break;
|
|
100 |
case EPSUIObjectSizeId:
|
|
101 |
settingItem = new (ELeave) CPSUIIntegerSettingItem(
|
|
102 |
aSettingId, settingSet.iObjectSize );
|
|
103 |
break;
|
|
104 |
/* server address disabled
|
|
105 |
case EPSUIServerAddrId:
|
|
106 |
settingItem = new (ELeave) CAknTextSettingItem(
|
|
107 |
aSettingId, settingSet.iContSrvrAdd );
|
|
108 |
break;*/
|
|
109 |
case EPSUIPublishingIntervalId:
|
|
110 |
settingItem = new (ELeave) CPSUIIntegerSettingItem(
|
|
111 |
aSettingId, settingSet.iPublicationInt );
|
|
112 |
break;
|
|
113 |
case EPSUIMaxSubscriptionsId:
|
|
114 |
settingItem = new (ELeave) CPSUIIntegerSettingItem(
|
|
115 |
aSettingId, settingSet.iMaxSubscriptions );
|
|
116 |
settingItem->SetSettingPageFlags(
|
|
117 |
CAknIntegerSettingPage::EEmptyValueAllowed);// Empty input allowed
|
|
118 |
break;
|
|
119 |
case EPSUIMaxContactsInListId:
|
|
120 |
settingItem = new (ELeave) CPSUIIntegerSettingItem(
|
|
121 |
aSettingId, settingSet.iMaxContactsInList );
|
|
122 |
settingItem->SetSettingPageFlags(
|
|
123 |
CAknIntegerSettingPage::EEmptyValueAllowed);// Empty input allowed
|
|
124 |
break;
|
|
125 |
case EPSUIDomainSyntaxId:
|
|
126 |
settingItem = new (ELeave) CAknTextSettingItem(
|
|
127 |
aSettingId, settingSet.iDomainSyntax );
|
|
128 |
break;
|
|
129 |
default:
|
|
130 |
__ASSERT_DEBUG( 0, User::Panic( KPSUIGSPluginPanicCategory, KErrNotFound ));
|
|
131 |
break;
|
|
132 |
}
|
|
133 |
|
|
134 |
return settingItem;
|
|
135 |
}
|
|
136 |
|
|
137 |
// ---------------------------------------------------------------------------
|
|
138 |
// CPSUIGSPluginSettingViewContainer::EditItemL()
|
|
139 |
// See header for details.
|
|
140 |
// ---------------------------------------------------------------------------
|
|
141 |
//
|
|
142 |
void CPSUIGSPluginSettingViewContainer::EditItemL(
|
|
143 |
TInt aIndex, TBool aCalledFromMenu )
|
|
144 |
{
|
|
145 |
CAknSettingItemList::EditItemL( aIndex, aCalledFromMenu );
|
|
146 |
|
|
147 |
// update setting to setting-object
|
|
148 |
(*SettingItemArray())[aIndex]->StoreL();
|
|
149 |
(*SettingItemArray())[aIndex]->UpdateListBoxTextL();
|
|
150 |
ListBox()->DrawNow();
|
|
151 |
|
|
152 |
if ( EPSUIServerNameId == aIndex )
|
|
153 |
{
|
|
154 |
UpdateTitleL();
|
|
155 |
}
|
|
156 |
}
|
|
157 |
|
|
158 |
// ---------------------------------------------------------------------------
|
|
159 |
// CPSUIGSPluginSettingViewContainer::EditCurrentItemL()
|
|
160 |
// See header for details.
|
|
161 |
// ---------------------------------------------------------------------------
|
|
162 |
//
|
|
163 |
void CPSUIGSPluginSettingViewContainer::EditCurrentItemL()
|
|
164 |
{
|
|
165 |
EditItemL( ListBox()->CurrentItemIndex(), ETrue );
|
|
166 |
}
|
|
167 |
|
|
168 |
// ---------------------------------------------------------------------------
|
|
169 |
// CPSUIGSPluginSettingViewContainer::UpdateTitleL()
|
|
170 |
// See header for details.
|
|
171 |
// ---------------------------------------------------------------------------
|
|
172 |
//
|
|
173 |
void CPSUIGSPluginSettingViewContainer::UpdateTitleL()
|
|
174 |
{
|
|
175 |
// title construction
|
|
176 |
static_cast<CAknTitlePane*>(
|
|
177 |
iAvkonAppUi->StatusPane()->ControlL( TUid::Uid(
|
|
178 |
EEikStatusPaneUidTitle )))->SetTextL(
|
|
179 |
iView->MainView()->PSModel()->SettingsSet().iSetName );
|
|
180 |
}
|
|
181 |
|
|
182 |
// -----------------------------------------------------------------------------
|
|
183 |
// CPSUIGSPluginSettingViewContainer::GetHelpContext()
|
|
184 |
// See header for details.
|
|
185 |
// -----------------------------------------------------------------------------
|
|
186 |
//
|
|
187 |
void CPSUIGSPluginSettingViewContainer::GetHelpContext( TCoeHelpContext& aContext ) const
|
|
188 |
{
|
|
189 |
aContext.iMajor = TUid::Uid( PSUIGSPluginDllUid );
|
|
190 |
aContext.iContext = KPRE_HLP_EDIT_SET;
|
|
191 |
}
|
|
192 |
|
|
193 |
// -----------------------------------------------------------------------------
|
|
194 |
// CPSUIGSPluginSettingViewContainer::HandleResourceChange()
|
|
195 |
// See header for details.
|
|
196 |
// -----------------------------------------------------------------------------
|
|
197 |
//
|
|
198 |
void CPSUIGSPluginSettingViewContainer::HandleResourceChange(TInt aType)
|
|
199 |
{
|
|
200 |
CAknSettingItemList::HandleResourceChange( aType );
|
|
201 |
if ( aType == KAknsMessageSkinChange ||
|
|
202 |
aType == KEikDynamicLayoutVariantSwitch )
|
|
203 |
{
|
|
204 |
TRect mainPaneRect;
|
|
205 |
AknLayoutUtils::LayoutMetricsRect( AknLayoutUtils::EMainPane,
|
|
206 |
mainPaneRect);
|
|
207 |
SetRect( mainPaneRect );
|
|
208 |
}
|
|
209 |
}
|
|
210 |
|
|
211 |
// -----------------------------------------------------------------------------
|
|
212 |
// CPSUIGSPluginSettingViewContainer::SizeChanged()
|
|
213 |
// See header for details.
|
|
214 |
// -----------------------------------------------------------------------------
|
|
215 |
//
|
|
216 |
void CPSUIGSPluginSettingViewContainer::SizeChanged()
|
|
217 |
{
|
|
218 |
ListBox()->SetRect( Rect() );
|
|
219 |
}
|
|
220 |
|
|
221 |
// End of File
|