25
|
1 |
/*
|
|
2 |
* Copyright (c) 2003-2009 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: Container for Restricted Call Divert's view.
|
|
15 |
*
|
|
16 |
*/
|
|
17 |
|
|
18 |
|
|
19 |
// INCLUDE FILES
|
|
20 |
#include "GSRestrictedDivertContainer.h"
|
|
21 |
#include "CallDivertPlugin.hrh"
|
|
22 |
|
|
23 |
#include <aknlists.h>
|
|
24 |
#include <gscalldivertpluginrsc.rsg>
|
|
25 |
#include <featmgr.h>
|
|
26 |
#include <csxhelp/cp.hlp.hrh> // for help context of Divert
|
|
27 |
#include <gslistbox.h>
|
|
28 |
#include <gsfwviewuids.h>
|
|
29 |
|
|
30 |
|
|
31 |
// ========================= MEMBER FUNCTIONS ================================
|
|
32 |
// ---------------------------------------------------------------------------
|
|
33 |
// CGSRestrictedDivertContainer::ConstructL
|
|
34 |
// Symbian OS two phased constructor
|
|
35 |
//
|
|
36 |
// ---------------------------------------------------------------------------
|
|
37 |
void CGSRestrictedDivertContainer::ConstructL( const TRect& aRect )
|
|
38 |
{
|
|
39 |
iListBox = new ( ELeave ) CAknSettingStyleListBox;
|
|
40 |
BaseConstructL( aRect, R_CF_MAIN_VIEW_TITLE, R_CF_RESTRICTED_MAIN_LBX );
|
|
41 |
}
|
|
42 |
|
|
43 |
// ---------------------------------------------------------------------------
|
|
44 |
// CGSRestrictedDivertContainer::~CGSRestrictedDivertContainer
|
|
45 |
// Destructor
|
|
46 |
//
|
|
47 |
// ---------------------------------------------------------------------------
|
|
48 |
CGSRestrictedDivertContainer::~CGSRestrictedDivertContainer()
|
|
49 |
{
|
|
50 |
if ( iListboxItemArray )
|
|
51 |
{
|
|
52 |
delete iListboxItemArray;
|
|
53 |
}
|
|
54 |
}
|
|
55 |
|
|
56 |
// ---------------------------------------------------------------------------
|
|
57 |
// CGSRestrictedDivertContainer::GetHelpContext
|
|
58 |
// This function is called when Help application is launched.
|
|
59 |
// Only available, when __SERIES60_HELP is defined.
|
|
60 |
// ---------------------------------------------------------------------------
|
|
61 |
//
|
|
62 |
void CGSRestrictedDivertContainer::GetHelpContext(
|
|
63 |
TCoeHelpContext& aContext ) const
|
|
64 |
{
|
|
65 |
aContext.iMajor = KUidGS;
|
|
66 |
aContext.iContext = KDIV_HLP_CALL_FORW_MAIN;
|
|
67 |
}
|
|
68 |
|
|
69 |
|
|
70 |
// ---------------------------------------------------------------------------
|
|
71 |
// CGSRestrictedDivertContainer::ConstructListBoxL
|
|
72 |
// Creates list box from resources.
|
|
73 |
//
|
|
74 |
// ---------------------------------------------------------------------------
|
|
75 |
//
|
|
76 |
void CGSRestrictedDivertContainer::ConstructListBoxL( TInt aResLbxId )
|
|
77 |
{
|
|
78 |
iListBox->ConstructL( this, EAknListBoxSelectionList );
|
|
79 |
|
|
80 |
iListboxItemArray = CGSListBoxItemTextArray::NewL( aResLbxId,
|
|
81 |
*iListBox, *iCoeEnv );
|
|
82 |
iListBox->Model()->SetItemTextArray( iListboxItemArray );
|
|
83 |
iListBox->Model()->SetOwnershipType( ELbmDoesNotOwnItemArray );
|
|
84 |
|
|
85 |
CreateListBoxItemsL();
|
|
86 |
}
|
|
87 |
|
|
88 |
// ---------------------------------------------------------------------------
|
|
89 |
// CGSRestrictedDivertContainer::CreateListBoxItemsL
|
|
90 |
// Creates List box items
|
|
91 |
//
|
|
92 |
// ---------------------------------------------------------------------------
|
|
93 |
void CGSRestrictedDivertContainer::CreateListBoxItemsL()
|
|
94 |
{
|
|
95 |
MakeRestrictedDivertItemL();
|
|
96 |
}
|
|
97 |
|
|
98 |
// ---------------------------------------------------------------------------
|
|
99 |
// CGSRestrictedDivertContainer::UpdateListBoxL
|
|
100 |
//
|
|
101 |
//
|
|
102 |
// ---------------------------------------------------------------------------
|
|
103 |
void CGSRestrictedDivertContainer::UpdateListBoxL( TInt aFeatureId )
|
|
104 |
{
|
|
105 |
switch( aFeatureId )
|
|
106 |
{
|
|
107 |
case EGSSettIdVoiceDivert:
|
|
108 |
MakeRestrictedDivertItemL();
|
|
109 |
break;
|
|
110 |
default:
|
|
111 |
break;
|
|
112 |
}
|
|
113 |
|
|
114 |
// Update the listbox
|
|
115 |
iListBox->HandleItemAdditionL();
|
|
116 |
}
|
|
117 |
|
|
118 |
|
|
119 |
// ---------------------------------------------------------------------------
|
|
120 |
// CGSRestrictedDivertContainer::CurrentFeatureId
|
|
121 |
//
|
|
122 |
//
|
|
123 |
// ---------------------------------------------------------------------------
|
|
124 |
TInt CGSRestrictedDivertContainer::CurrentFeatureId() const
|
|
125 |
{
|
|
126 |
return iListboxItemArray->CurrentFeature( );
|
|
127 |
}
|
|
128 |
|
|
129 |
|
|
130 |
// ---------------------------------------------------------------------------
|
|
131 |
// CGSRestrictedDivertContainer::MakeVoiceDivertsItemL
|
|
132 |
//
|
|
133 |
//
|
|
134 |
// ---------------------------------------------------------------------------
|
|
135 |
void CGSRestrictedDivertContainer::MakeRestrictedDivertItemL()
|
|
136 |
{
|
|
137 |
iListboxItemArray->SetItemVisibilityL( EGSSettIdVoiceDivert,
|
|
138 |
CGSListBoxItemTextArray::EVisible );
|
|
139 |
}
|
|
140 |
|
|
141 |
|
|
142 |
//End of file
|