williamr@2: /* williamr@2: * Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). williamr@2: * All rights reserved. williamr@2: * This component and the accompanying materials are made available williamr@2: * under the terms of the License "Symbian Foundation License v1.0" to Symbian Foundation members and "Symbian Foundation End User License Agreement v1.0" to non-members williamr@2: * which accompanies this distribution, and is available williamr@2: * at the URL "http://www.symbianfoundation.org/legal/licencesv10.html". williamr@2: * williamr@2: * Initial Contributors: williamr@2: * Nokia Corporation - initial contribution. williamr@2: * williamr@2: * Contributors: williamr@2: * williamr@2: * Description: Geographical cellular area class declaration. williamr@2: * williamr@2: */ williamr@2: williamr@2: williamr@2: williamr@2: williamr@2: #ifndef C_LBTGEOCELL_H williamr@2: #define C_LBTGEOCELL_H williamr@2: williamr@2: williamr@2: #include williamr@2: #include "lbtgeoareabase.h" williamr@2: williamr@2: williamr@2: /** williamr@2: * A typedef'd buffer to hold the network country code. williamr@2: */ williamr@2: typedef TBuf<4> TNetworkCountryCode; williamr@2: williamr@2: /** williamr@2: * A typedef'd buffer to hold the network identity. williamr@2: */ williamr@2: typedef TBuf<8> TNetworkIdentity; williamr@2: williamr@2: williamr@2: /** williamr@2: * Geographical cellular area. williamr@2: * williamr@2: * Geographical cellular area is defined by the area covered by a network williamr@2: * cell. Client applications must specify complete CGI information of the williamr@2: * serving cell while defining a geographical cellular area. This includes williamr@2: * the Mobile Country Code (MCC), Mobile Network Code (MNC), williamr@2: * Location Area Code (LAI) and the Cell Identity (CI). In addition client williamr@2: * applications must also mention the the Network Type. williamr@2: * williamr@2: * @lib lbt.lib williamr@2: * williamr@2: * @since S60 5.1 williamr@2: */ williamr@2: class CLbtGeoCell: public CLbtGeoAreaBase williamr@2: { williamr@2: public: williamr@2: /** williamr@2: * Allocates and constructs a new geographical cellular area object. williamr@2: * In the returned object,the country code,network code,location area code and williamr@2: * cell id are set to zero. williamr@2: * @return Pointer to the new geographical cellular area object. williamr@2: * @leave Other standard Symbian error code, such as KErrNoMemory williamr@2: */ williamr@2: IMPORT_C static CLbtGeoCell* NewL(); williamr@2: williamr@2: /** williamr@2: * Allocates and constructs a new geographical cellular area object and williamr@2: * pushes it onto cleanup stack. williamr@2: * In the returned object,the country code,network code,location area code and williamr@2: * cell id are set to zero. williamr@2: * @return Pointer to the new geographical cellular area object. williamr@2: * @leave Other standard Symbian error code, such as KErrNoMemory williamr@2: */ williamr@2: IMPORT_C static CLbtGeoCell* NewLC(); williamr@2: williamr@2: /** williamr@2: * Allocates and constructs a new geographical cellular area object. williamr@2: * williamr@2: * @panic ELbtErrArgument If inputs are negative or zero. williamr@2: * williamr@2: * @param[in] aNetworkType The network type williamr@2: * @param[in] aCountryCode The network country code williamr@2: * @param[in] aNetworkId The network identity code williamr@2: * @param[in] aLocationAreaCode The location area code williamr@2: * @param[in] aCellId The cell id williamr@2: * @return Pointer to the new geographical cellular area object. williamr@2: * @leave Other standard Symbian error code, such as KErrNoMemory williamr@2: */ williamr@2: IMPORT_C static CLbtGeoCell* NewL(RMobilePhone::TMobilePhoneNetworkMode aNetworkType, williamr@2: TNetworkCountryCode aCountryCode, williamr@2: TNetworkIdentity aNetworkId, williamr@2: TUint aLocationAreaCode, williamr@2: TUint aCellId); williamr@2: williamr@2: /** williamr@2: * Allocates and constructs a new geographical cellular area object and williamr@2: * pushes it onto cleanup stack. williamr@2: * williamr@2: * @panic ELbtErrArgument If inputs are negative or zero. williamr@2: * williamr@2: * @param[in] aNetworkType The network type williamr@2: * @param[in] aCountryCode The network country code williamr@2: * @param[in] aNetworkId The network identity code williamr@2: * @param[in] aLocationAreaCode The location area code williamr@2: * @param[in] aCellId The cell id williamr@2: * @return Pointer to the new geographical cellular area object. williamr@2: * @leave Other standard Symbian error code, such as KErrNoMemory williamr@2: */ williamr@2: IMPORT_C static CLbtGeoCell* NewLC(RMobilePhone::TMobilePhoneNetworkMode aNetworkType, williamr@2: TNetworkCountryCode aCountryCode, williamr@2: TNetworkIdentity aNetworkId, williamr@2: TUint aLocationAreaCode, williamr@2: TUint aCellId); williamr@2: williamr@2: williamr@2: /** williamr@2: * Destructor williamr@2: */ williamr@2: IMPORT_C virtual ~CLbtGeoCell(); williamr@2: williamr@2: /** williamr@2: * Returns the type of geographical area, CLbtGeoAreaBase::ECellular williamr@2: * williamr@2: * @return CLbtGeoAreaBase::ECellular. williamr@2: */ williamr@2: virtual TGeoAreaType Type() const; williamr@2: williamr@2: /** williamr@2: * Sets the network type. williamr@2: * williamr@2: * @param[in] aNetworkType The type of network williamr@2: */ williamr@2: IMPORT_C void SetNetworkType( RMobilePhone::TMobilePhoneNetworkMode aNetworkType ); williamr@2: williamr@2: /** williamr@2: * Returns the type of network williamr@2: * williamr@2: * @return The type of network. If the Network Type is not set earlier, williamr@2: * this method would return RMobilePhone::ENetworkModeUnknown. williamr@2: */ williamr@2: IMPORT_C RMobilePhone::TMobilePhoneNetworkMode NetworkType() const; williamr@2: williamr@2: /** williamr@2: * Sets the network country code. williamr@2: * @panic ELbtErrArgument If the input location area code is negative or zero. williamr@2: * williamr@2: * @param[in] aCountryCode The network country code. williamr@2: */ williamr@2: IMPORT_C void SetNetworkCountryCode( TNetworkCountryCode aCountryCode); williamr@2: williamr@2: /** williamr@2: * Gets the network country code. If the country code has not been williamr@2: * set before, the returned value is zero. williamr@2: * williamr@2: * @return The network country code. williamr@2: */ williamr@2: IMPORT_C TNetworkCountryCode NetworkCountryCode() const; williamr@2: williamr@2: /** williamr@2: * Sets the network identity code. williamr@2: * @panic ELbtErrArgument If the input location area code is negative or zero. williamr@2: * williamr@2: * @param[in] aNetworkId The network identity code. williamr@2: */ williamr@2: IMPORT_C void SetNetworkIdentityCode( TNetworkIdentity aNetworkId ); williamr@2: williamr@2: /** williamr@2: * Gets the network identity code. If the network identity code has not been williamr@2: * set before, the returned value is zero. williamr@2: * williamr@2: * @return The network identity code. williamr@2: */ williamr@2: IMPORT_C TNetworkIdentity NetworkIdentityCode() const; williamr@2: williamr@2: /** williamr@2: * Sets the location area code. williamr@2: * williamr@2: * @param[in] aLocationAreaCode The location area code. williamr@2: */ williamr@2: IMPORT_C void SetLocationAreaCode(TUint aLocationAreaCode); williamr@2: williamr@2: /** williamr@2: * Gets the location area code. If the location area code has not been williamr@2: * set before, the returned value is zero. williamr@2: * williamr@2: * @return The location area code. williamr@2: */ williamr@2: IMPORT_C TUint LocationAreaCode() const; williamr@2: williamr@2: /** williamr@2: * Sets the cell id. williamr@2: * williamr@2: * @param[in] aCellId The cell id. williamr@2: */ williamr@2: IMPORT_C void SetCellId( TUint aCellId ); williamr@2: williamr@2: /** williamr@2: * Gets the cell id. If the cell code has not been williamr@2: * set before, the returned value is zero. williamr@2: * williamr@2: * @return The cell id. williamr@2: */ williamr@2: IMPORT_C TUint CellId() const; williamr@2: williamr@2: /** williamr@2: * This method is for furture use and is currently not supported. williamr@2: */ williamr@2: virtual TBool CGISpecifiedDuringCreation() const; williamr@2: williamr@2: /** williamr@2: * Validates create cell information. williamr@2: * williamr@2: * @leave KErrArgument if any of the mandatory parameters have not williamr@2: * been specified. williamr@2: */ williamr@2: void ValidateCreateCellInformationL(); williamr@2: williamr@2: /** williamr@2: * Validates cell information. williamr@2: * williamr@2: * @leave KErrArgument if any of the mandatory parameters have not williamr@2: * been specified. williamr@2: */ williamr@2: void ValidateCellInformationL(); williamr@2: williamr@2: protected: williamr@2: williamr@2: /** williamr@2: * default constructor williamr@2: */ williamr@2: CLbtGeoCell(); williamr@2: williamr@2: /** williamr@2: * By default, prohibit copy constructor williamr@2: */ williamr@2: CLbtGeoCell( const CLbtGeoCell& ); williamr@2: williamr@2: /** williamr@2: * Prohibit assigment operator williamr@2: */ williamr@2: CLbtGeoCell& operator= ( const CLbtGeoCell& ); williamr@2: williamr@2: /** williamr@2: * Symbian 2nd phase constructor. williamr@2: */ williamr@2: void ConstructL(); williamr@2: williamr@2: /** williamr@2: * Symbian 2nd phase constructor. williamr@2: */ williamr@2: void ConstructL(RMobilePhone::TMobilePhoneNetworkMode aNetworkType, williamr@2: TNetworkCountryCode aCountryCode, williamr@2: TNetworkIdentity aNetworkId, williamr@2: TUint aLocationAreaCode, williamr@2: TUint aCellId); williamr@2: williamr@2: /** williamr@2: * Externalize method that subclass must implement. williamr@2: * @param[in] aStream Stream to which the object should be externalized. williamr@2: */ williamr@2: virtual void DoExternalizeL(RWriteStream& aStream) const; williamr@2: williamr@2: /** williamr@2: * Internalize method that subclass must implement. williamr@2: * @param[in] aStream Stream from which the object should be internalized. williamr@2: */ williamr@2: virtual void DoInternalizeL(RReadStream& aStream); williamr@2: williamr@2: williamr@2: private: // data williamr@2: /** williamr@2: * Network type williamr@2: */ williamr@2: RMobilePhone::TMobilePhoneNetworkMode iNetworkType; williamr@2: /** williamr@2: * Network country code williamr@2: */ williamr@2: TUint iCountryCode; williamr@2: /** williamr@2: * Network identity code williamr@2: */ williamr@2: TUint iNetworkId; williamr@2: /** williamr@2: * Location area code williamr@2: */ williamr@2: TUint iLocationAreaCode; williamr@2: /** williamr@2: * Cell id williamr@2: */ williamr@2: TUint iCellId; williamr@2: williamr@2: }; williamr@2: williamr@2: williamr@2: williamr@2: #endif // C_LBTGEOCELLBASE_H