2 * Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies).
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".
9 * Initial Contributors:
10 * Nokia Corporation - initial contribution.
14 * Description: Geographical cellular area class declaration.
21 #ifndef C_LBTGEOCELL_H
22 #define C_LBTGEOCELL_H
26 #include "lbtgeoareabase.h"
30 * A typedef'd buffer to hold the network country code.
32 typedef TBuf<4> TNetworkCountryCode;
35 * A typedef'd buffer to hold the network identity.
37 typedef TBuf<8> TNetworkIdentity;
41 * Geographical cellular area.
43 * Geographical cellular area is defined by the area covered by a network
44 * cell. Client applications must specify complete CGI information of the
45 * serving cell while defining a geographical cellular area. This includes
46 * the Mobile Country Code (MCC), Mobile Network Code (MNC),
47 * Location Area Code (LAI) and the Cell Identity (CI). In addition client
48 * applications must also mention the the Network Type.
54 class CLbtGeoCell: public CLbtGeoAreaBase
58 * Allocates and constructs a new geographical cellular area object.
59 * In the returned object,the country code,network code,location area code and
60 * cell id are set to zero.
61 * @return Pointer to the new geographical cellular area object.
62 * @leave Other standard Symbian error code, such as KErrNoMemory
64 IMPORT_C static CLbtGeoCell* NewL();
67 * Allocates and constructs a new geographical cellular area object and
68 * pushes it onto cleanup stack.
69 * In the returned object,the country code,network code,location area code and
70 * cell id are set to zero.
71 * @return Pointer to the new geographical cellular area object.
72 * @leave Other standard Symbian error code, such as KErrNoMemory
74 IMPORT_C static CLbtGeoCell* NewLC();
77 * Allocates and constructs a new geographical cellular area object.
79 * @panic ELbtErrArgument If inputs are negative or zero.
81 * @param[in] aNetworkType The network type
82 * @param[in] aCountryCode The network country code
83 * @param[in] aNetworkId The network identity code
84 * @param[in] aLocationAreaCode The location area code
85 * @param[in] aCellId The cell id
86 * @return Pointer to the new geographical cellular area object.
87 * @leave Other standard Symbian error code, such as KErrNoMemory
89 IMPORT_C static CLbtGeoCell* NewL(RMobilePhone::TMobilePhoneNetworkMode aNetworkType,
90 TNetworkCountryCode aCountryCode,
91 TNetworkIdentity aNetworkId,
92 TUint aLocationAreaCode,
96 * Allocates and constructs a new geographical cellular area object and
97 * pushes it onto cleanup stack.
99 * @panic ELbtErrArgument If inputs are negative or zero.
101 * @param[in] aNetworkType The network type
102 * @param[in] aCountryCode The network country code
103 * @param[in] aNetworkId The network identity code
104 * @param[in] aLocationAreaCode The location area code
105 * @param[in] aCellId The cell id
106 * @return Pointer to the new geographical cellular area object.
107 * @leave Other standard Symbian error code, such as KErrNoMemory
109 IMPORT_C static CLbtGeoCell* NewLC(RMobilePhone::TMobilePhoneNetworkMode aNetworkType,
110 TNetworkCountryCode aCountryCode,
111 TNetworkIdentity aNetworkId,
112 TUint aLocationAreaCode,
119 IMPORT_C virtual ~CLbtGeoCell();
122 * Returns the type of geographical area, CLbtGeoAreaBase::ECellular
124 * @return CLbtGeoAreaBase::ECellular.
126 virtual TGeoAreaType Type() const;
129 * Sets the network type.
131 * @param[in] aNetworkType The type of network
133 IMPORT_C void SetNetworkType( RMobilePhone::TMobilePhoneNetworkMode aNetworkType );
136 * Returns the type of network
138 * @return The type of network. If the Network Type is not set earlier,
139 * this method would return RMobilePhone::ENetworkModeUnknown.
141 IMPORT_C RMobilePhone::TMobilePhoneNetworkMode NetworkType() const;
144 * Sets the network country code.
145 * @panic ELbtErrArgument If the input location area code is negative or zero.
147 * @param[in] aCountryCode The network country code.
149 IMPORT_C void SetNetworkCountryCode( TNetworkCountryCode aCountryCode);
152 * Gets the network country code. If the country code has not been
153 * set before, the returned value is zero.
155 * @return The network country code.
157 IMPORT_C TNetworkCountryCode NetworkCountryCode() const;
160 * Sets the network identity code.
161 * @panic ELbtErrArgument If the input location area code is negative or zero.
163 * @param[in] aNetworkId The network identity code.
165 IMPORT_C void SetNetworkIdentityCode( TNetworkIdentity aNetworkId );
168 * Gets the network identity code. If the network identity code has not been
169 * set before, the returned value is zero.
171 * @return The network identity code.
173 IMPORT_C TNetworkIdentity NetworkIdentityCode() const;
176 * Sets the location area code.
178 * @param[in] aLocationAreaCode The location area code.
180 IMPORT_C void SetLocationAreaCode(TUint aLocationAreaCode);
183 * Gets the location area code. If the location area code has not been
184 * set before, the returned value is zero.
186 * @return The location area code.
188 IMPORT_C TUint LocationAreaCode() const;
193 * @param[in] aCellId The cell id.
195 IMPORT_C void SetCellId( TUint aCellId );
198 * Gets the cell id. If the cell code has not been
199 * set before, the returned value is zero.
201 * @return The cell id.
203 IMPORT_C TUint CellId() const;
206 * This method is for furture use and is currently not supported.
208 virtual TBool CGISpecifiedDuringCreation() const;
211 * Validates create cell information.
213 * @leave KErrArgument if any of the mandatory parameters have not
216 void ValidateCreateCellInformationL();
219 * Validates cell information.
221 * @leave KErrArgument if any of the mandatory parameters have not
224 void ValidateCellInformationL();
229 * default constructor
234 * By default, prohibit copy constructor
236 CLbtGeoCell( const CLbtGeoCell& );
239 * Prohibit assigment operator
241 CLbtGeoCell& operator= ( const CLbtGeoCell& );
244 * Symbian 2nd phase constructor.
249 * Symbian 2nd phase constructor.
251 void ConstructL(RMobilePhone::TMobilePhoneNetworkMode aNetworkType,
252 TNetworkCountryCode aCountryCode,
253 TNetworkIdentity aNetworkId,
254 TUint aLocationAreaCode,
258 * Externalize method that subclass must implement.
259 * @param[in] aStream Stream to which the object should be externalized.
261 virtual void DoExternalizeL(RWriteStream& aStream) const;
264 * Internalize method that subclass must implement.
265 * @param[in] aStream Stream from which the object should be internalized.
267 virtual void DoInternalizeL(RReadStream& aStream);
274 RMobilePhone::TMobilePhoneNetworkMode iNetworkType;
276 * Network country code
280 * Network identity code
286 TUint iLocationAreaCode;
296 #endif // C_LBTGEOCELLBASE_H