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