epoc32/include/mw/lbtgeocell.h
author William Roberts <williamr@symbian.org>
Tue, 16 Mar 2010 16:12:26 +0000
branchSymbian2
changeset 2 2fe1408b6811
child 4 837f303aceeb
permissions -rw-r--r--
Final list of Symbian^2 public API header files
     1 /*
     2 * Copyright (c) 2008 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 the License "Symbian Foundation License v1.0" to Symbian Foundation members and "Symbian Foundation End User License Agreement v1.0" to non-members
     6 * which accompanies this distribution, and is available
     7 * at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
     8 *
     9 * Initial Contributors:
    10 * Nokia Corporation - initial contribution.
    11 *
    12 * Contributors:
    13 *
    14 * Description:  Geographical cellular area class declaration.
    15 *
    16 */
    17 
    18 
    19 
    20 
    21 #ifndef C_LBTGEOCELL_H
    22 #define C_LBTGEOCELL_H
    23 
    24 
    25 #include <etelmm.h>
    26 #include "lbtgeoareabase.h"
    27 
    28 
    29 /**
    30  * A typedef'd buffer to hold the network country code. 
    31  */ 
    32 typedef TBuf<4> TNetworkCountryCode;
    33 
    34 /**
    35  * A typedef'd buffer to hold the network identity.
    36  */
    37 typedef TBuf<8> TNetworkIdentity;
    38 
    39 
    40 /**
    41  * Geographical cellular area.
    42  *  
    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.
    49  *  
    50  * @lib lbt.lib
    51  *
    52  * @since S60 5.1
    53  */
    54 class CLbtGeoCell: public CLbtGeoAreaBase
    55     {
    56 public:
    57     /**
    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
    63      */
    64     IMPORT_C static CLbtGeoCell* NewL();
    65     
    66     /**
    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
    73      */
    74     IMPORT_C static CLbtGeoCell* NewLC();
    75     
    76     /**
    77      * Allocates and constructs a new geographical cellular area object.
    78      * 
    79      * @panic ELbtErrArgument If inputs are negative or zero.
    80      * 
    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
    88      */
    89     IMPORT_C static CLbtGeoCell* NewL(RMobilePhone::TMobilePhoneNetworkMode aNetworkType,
    90                                       TNetworkCountryCode aCountryCode,
    91                                       TNetworkIdentity aNetworkId,
    92                                       TUint aLocationAreaCode,
    93                                       TUint aCellId);
    94     
    95     /**
    96      * Allocates and constructs a new geographical cellular area object and
    97      * pushes it onto cleanup stack. 
    98      *
    99      * @panic ELbtErrArgument If inputs are negative or zero.
   100      * 
   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
   108      */                                      
   109     IMPORT_C static CLbtGeoCell* NewLC(RMobilePhone::TMobilePhoneNetworkMode aNetworkType,
   110                                        TNetworkCountryCode aCountryCode,
   111                                        TNetworkIdentity aNetworkId,
   112                                        TUint aLocationAreaCode,
   113                                        TUint aCellId);
   114    
   115      
   116     /**
   117      * Destructor
   118      */
   119     IMPORT_C virtual ~CLbtGeoCell();
   120     
   121     /**
   122      * Returns the type of geographical area, CLbtGeoAreaBase::ECellular
   123      *
   124      * @return CLbtGeoAreaBase::ECellular.
   125      */
   126     virtual TGeoAreaType Type() const;
   127     
   128     /**
   129      * Sets the network type.
   130      *
   131      * @param[in] aNetworkType The type of network
   132      */ 
   133     IMPORT_C void SetNetworkType( RMobilePhone::TMobilePhoneNetworkMode aNetworkType );
   134      
   135     /**
   136      * Returns the type of network
   137      *
   138      * @return The type of network. If the Network Type is not set earlier, 
   139      * this method would return RMobilePhone::ENetworkModeUnknown.
   140      */
   141     IMPORT_C RMobilePhone::TMobilePhoneNetworkMode NetworkType() const;
   142     
   143     /**
   144      * Sets the network country code.
   145      * @panic ELbtErrArgument If the input location area code  is negative or zero.
   146      *
   147      * @param[in] aCountryCode The network country code.
   148      */   
   149     IMPORT_C void SetNetworkCountryCode( TNetworkCountryCode aCountryCode);
   150     
   151     /**
   152      * Gets the network country code. If the country code has not been
   153      * set before, the returned value is zero.
   154      *
   155      * @return The network country code.
   156      */
   157     IMPORT_C TNetworkCountryCode NetworkCountryCode() const;
   158     
   159     /**
   160      * Sets the network identity code.
   161      * @panic ELbtErrArgument If the input location area code  is negative or zero.
   162      *
   163      * @param[in] aNetworkId The network identity code.
   164      */ 
   165     IMPORT_C void SetNetworkIdentityCode( TNetworkIdentity aNetworkId );
   166     
   167     /**
   168      * Gets the network identity code. If the network identity code has not been
   169      * set before, the returned value is zero.
   170      *
   171      * @return The network identity code.
   172      */
   173     IMPORT_C TNetworkIdentity NetworkIdentityCode() const;
   174     
   175     /**
   176      * Sets the location area code.
   177      *
   178      * @param[in] aLocationAreaCode The location area code.
   179      */
   180     IMPORT_C void SetLocationAreaCode(TUint aLocationAreaCode);  
   181     
   182     /**
   183      * Gets the location area code. If the location area code has not been
   184      * set before, the returned value is zero.
   185      *
   186      * @return The location area code.
   187      */    
   188     IMPORT_C TUint LocationAreaCode() const;    
   189     
   190     /**
   191      * Sets the cell id.
   192      *
   193      * @param[in] aCellId The cell id.
   194      */
   195     IMPORT_C void SetCellId( TUint aCellId ); 
   196     
   197     /**
   198      * Gets the cell id. If the cell code has not been
   199      * set before, the returned value is zero.
   200      *
   201      * @return The cell id.
   202      */  
   203     IMPORT_C TUint CellId() const; 
   204     
   205     /**
   206      * This method is for furture use and is currently not supported.
   207      */
   208     virtual TBool CGISpecifiedDuringCreation() const;
   209     
   210     /**
   211      * Validates create cell information.
   212      *
   213      * @leave KErrArgument if any of the mandatory parameters have not
   214      * been specified.
   215      */
   216     void ValidateCreateCellInformationL();  
   217     
   218     /**
   219      * Validates cell information.
   220      *
   221      * @leave KErrArgument if any of the mandatory parameters have not
   222      * been specified.
   223      */
   224     void ValidateCellInformationL(); 
   225     
   226 protected:
   227   
   228     /**
   229      * default constructor
   230      */
   231     CLbtGeoCell();
   232     
   233     /**
   234      * By default, prohibit copy constructor
   235      */ 
   236     CLbtGeoCell( const CLbtGeoCell& );
   237    
   238     /**
   239      * Prohibit assigment operator
   240      */ 
   241     CLbtGeoCell& operator= ( const CLbtGeoCell& );
   242     
   243     /**
   244      * Symbian 2nd phase constructor.
   245      */
   246     void ConstructL();
   247     
   248     /**
   249      * Symbian 2nd phase constructor.
   250      */
   251     void ConstructL(RMobilePhone::TMobilePhoneNetworkMode aNetworkType,
   252                     TNetworkCountryCode aCountryCode,
   253                     TNetworkIdentity aNetworkId,
   254                     TUint aLocationAreaCode,
   255                     TUint aCellId);
   256     
   257     /**
   258      * Externalize method that subclass must implement.
   259      * @param[in] aStream Stream to which the object should be externalized.
   260      */
   261     virtual void DoExternalizeL(RWriteStream& aStream) const;
   262     
   263     /**
   264      * Internalize method that subclass must implement.
   265      * @param[in] aStream Stream from which the object should be internalized.
   266      */
   267     virtual void DoInternalizeL(RReadStream& aStream);
   268 
   269            
   270 private: // data
   271     /**
   272      * Network type
   273      */
   274     RMobilePhone::TMobilePhoneNetworkMode iNetworkType;
   275     /**
   276      * Network country code
   277      */
   278     TUint iCountryCode;
   279     /**
   280      * Network identity code
   281      */
   282     TUint iNetworkId;
   283     /**
   284      * Location area code
   285      */
   286     TUint	iLocationAreaCode;
   287     /**
   288      * Cell id
   289      */ 
   290     TUint	iCellId; 
   291     
   292    };
   293 
   294 
   295 
   296 #endif // C_LBTGEOCELLBASE_H