33
|
1 |
/*
|
|
2 |
* Copyright (c) 2002-2004 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: This module contains the implementation of CCbsSatRefresh
|
|
15 |
* class member functions.
|
|
16 |
*
|
|
17 |
*/
|
|
18 |
|
|
19 |
|
|
20 |
|
|
21 |
// INCLUDE FILES
|
|
22 |
#include "CCbsSatRefresh.h"
|
|
23 |
#include "CCbsServer.h"
|
|
24 |
#include <rsatrefresh.h>
|
|
25 |
#include <rsatsession.h>
|
|
26 |
|
|
27 |
#include "CbsLogger.h"
|
|
28 |
|
|
29 |
// Constants
|
|
30 |
|
|
31 |
// ============================ MEMBER FUNCTIONS ===============================
|
|
32 |
|
|
33 |
// -----------------------------------------------------------------------------
|
|
34 |
// CCbsSatRefresh::CCbsSatRefresh
|
|
35 |
// C++ default constructor can NOT contain any code, that
|
|
36 |
// might leave.
|
|
37 |
// -----------------------------------------------------------------------------
|
|
38 |
//
|
|
39 |
CCbsSatRefresh::CCbsSatRefresh( CCbsServer& aCbsServer ):
|
|
40 |
iCbsServer ( aCbsServer )
|
|
41 |
{
|
|
42 |
CBSLOGSTRING( ">>> CBSSERVER: CCbsSatRefresh::CCbsSatRefresh" );
|
|
43 |
CBSLOGSTRING( "<<< CBSSERVER: CCbsSatRefresh::CCbsSatRefresh" );
|
|
44 |
}
|
|
45 |
|
|
46 |
// -----------------------------------------------------------------------------
|
|
47 |
// CCbsSatRefresh::ConstructL
|
|
48 |
// Symbian 2nd phase constructor can leave.
|
|
49 |
// -----------------------------------------------------------------------------
|
|
50 |
//
|
|
51 |
void CCbsSatRefresh::ConstructL()
|
|
52 |
{
|
|
53 |
CBSLOGSTRING( ">>> CBSSERVER: CCbsSatRefresh::ConstructL" );
|
|
54 |
|
|
55 |
iSatSession = new ( ELeave ) RSatSession;
|
|
56 |
iSatSession->ConnectL();
|
|
57 |
iSatRefresh = new ( ELeave ) RSatRefresh( *this );
|
|
58 |
iSatRefresh->OpenL( *iSatSession );
|
|
59 |
|
|
60 |
TSatRefreshFiles file;
|
|
61 |
file.Append( KCbmiEf );
|
|
62 |
iSatRefresh->NotifyFileChangeL( file );
|
|
63 |
|
|
64 |
CBSLOGSTRING( "<<< CBSSERVER: CCbsSatRefresh::ConstructL" );
|
|
65 |
}
|
|
66 |
|
|
67 |
// -----------------------------------------------------------------------------
|
|
68 |
// CCbsSatRefresh::NewL
|
|
69 |
// Two-phased constructor.
|
|
70 |
// -----------------------------------------------------------------------------
|
|
71 |
//
|
|
72 |
CCbsSatRefresh* CCbsSatRefresh::NewL( CCbsServer& aCbsServer )
|
|
73 |
{
|
|
74 |
CCbsSatRefresh* self = new (ELeave) CCbsSatRefresh( aCbsServer );
|
|
75 |
CleanupStack::PushL( self );
|
|
76 |
self->ConstructL();
|
|
77 |
CleanupStack::Pop( self );
|
|
78 |
return self;
|
|
79 |
}
|
|
80 |
|
|
81 |
|
|
82 |
// Destructor
|
|
83 |
CCbsSatRefresh::~CCbsSatRefresh()
|
|
84 |
{
|
|
85 |
CBSLOGSTRING( ">>> CBSSERVER: CCbsSatRefresh::~CCbsSatRefresh" );
|
|
86 |
|
|
87 |
if ( iSatRefresh )
|
|
88 |
{
|
|
89 |
// Cancel notifications.
|
|
90 |
iSatRefresh->Cancel();
|
|
91 |
// Close SubSession.
|
|
92 |
iSatRefresh->Close();
|
|
93 |
}
|
|
94 |
delete iSatRefresh;
|
|
95 |
|
|
96 |
if ( iSatSession )
|
|
97 |
{
|
|
98 |
iSatSession->Close();
|
|
99 |
}
|
|
100 |
delete iSatSession;
|
|
101 |
|
|
102 |
CBSLOGSTRING( "<<< CBSSERVER: CCbsSatRefresh::~CCbsSatRefresh" );
|
|
103 |
}
|
|
104 |
|
|
105 |
// -----------------------------------------------------------------------------
|
|
106 |
// CCbsSatRefresh::AllowRefresh
|
|
107 |
// Refresh query. Determines whether it allow the refresh to happen.
|
|
108 |
// -----------------------------------------------------------------------------
|
|
109 |
//
|
|
110 |
TBool CCbsSatRefresh::AllowRefresh( TSatRefreshType aType, const TSatRefreshFiles& /*aFiles*/ )
|
|
111 |
{
|
|
112 |
// Refresh is always allowed
|
|
113 |
CBSLOGSTRING( ">>> CBSSERVER: CCbsSatRefresh::AllowRefresh()" );
|
|
114 |
CBSLOGSTRING2( "CBSSERVER: CCbsSatRefresh::AllowRefresh() Refresh type: %d", aType );
|
|
115 |
CBSLOGSTRING( "<<< CBSSERVER: CCbsSatRefresh::AllowRefresh complete, returning ETrue." );
|
|
116 |
|
|
117 |
// To prevent ARMV5 compiler warnings
|
|
118 |
if ( aType )
|
|
119 |
{
|
|
120 |
aType = ERefreshTypeNotSet;
|
|
121 |
}
|
|
122 |
return ETrue;
|
|
123 |
}
|
|
124 |
|
|
125 |
// -----------------------------------------------------------------------------
|
|
126 |
// CCbsSatRefresh::Refresh
|
|
127 |
// Notification of refresh. In this method the client should not close
|
|
128 |
// or cancel the RSatRefresh subsession.
|
|
129 |
// -----------------------------------------------------------------------------
|
|
130 |
//
|
|
131 |
void CCbsSatRefresh::Refresh( TSatRefreshType aType, const TSatRefreshFiles& /*aFiles*/ )
|
|
132 |
{
|
|
133 |
// Reload SIM Topics in case of refresh
|
|
134 |
CBSLOGSTRING( ">>> CBSSERVER: CCbsSatRefresh::Refresh" );
|
|
135 |
CBSLOGSTRING2( "CBSSERVER: CCbsSatRefresh::Refresh Type: %d", aType );
|
|
136 |
|
|
137 |
TRAP_IGNORE( iCbsServer.ReLoadSimTopicsL() );
|
|
138 |
|
|
139 |
// Notify SAT Server that refresh initiated file read is done
|
|
140 |
iSatRefresh->RefreshEFRead( EFalse );
|
|
141 |
|
|
142 |
// To prevent ARMV5 compiler warnings
|
|
143 |
if ( aType )
|
|
144 |
{
|
|
145 |
aType = ERefreshTypeNotSet;
|
|
146 |
}
|
|
147 |
|
|
148 |
CBSLOGSTRING( "<<< CBSSERVER: CCbsSatRefresh::Refresh complete " );
|
|
149 |
}
|
|
150 |
|
|
151 |
// End of File
|