telephonyserverplugins/common_tsy/commontsy/inc/mmcustomtsy/CMmPacketTsy.h
changeset 0 3553901f7fa8
child 24 6638e7f4bd8f
child 69 b982c3e940f3
equal deleted inserted replaced
-1:000000000000 0:3553901f7fa8
       
     1 /*
       
     2 * Copyright (c) 2006-2009 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:
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 #ifndef CMMPACKETTSY_H
       
    21 #define CMMPACKETTSY_H
       
    22 
       
    23 // INCLUDES
       
    24 #include "CMmCustomTsy.h"
       
    25 #include "cmmtsyreqhandlestore.h"
       
    26 #include "CMmSubTsyBase.h"
       
    27 #include <ctsy/rmmcustomapi.h>
       
    28 #include "cmmpacketservicegsmwcdmaext.h"
       
    29 
       
    30 // FORWARD DECLARATIONS
       
    31 class CMmCustomTsy;
       
    32 class CMmPacketContextTsy;
       
    33 class CMmTsyReqHandleStore;
       
    34 
       
    35 // CLASS DECLARATION
       
    36 
       
    37 /**
       
    38 *  CMmPacketTsy contains GPRS related functionality
       
    39 *  It does not contain an extension. Instead it calls functions from 
       
    40 *  CMmPacketContextTsy
       
    41 *
       
    42 */
       
    43 NONSHARABLE_CLASS( CMmPacketTsy ) : public CMmSubTsyBase
       
    44     {
       
    45     public: // Enumerations
       
    46 
       
    47         // TPacketRequestType enumerates indexes to Packet's request handle
       
    48         // table. Request handles are stored there while waiting for 
       
    49         // completion of the request.
       
    50         enum TPacketRequestType
       
    51             {
       
    52             EMultimodePacketContextReqHandleUnknown,
       
    53             EMultimodePacketContextSetAuthenticationInfo,
       
    54             EMultimodePacketContextNotifyEGprsInfoChange,
       
    55 
       
    56             // ATTENTION: Declare constant for those requests that need
       
    57             // own request handle record in iTsyReqHandleStore above the
       
    58             // following!
       
    59             EMultimodePacketMaxNumOfRequests
       
    60             };
       
    61 
       
    62     public: // Constructors and destructor
       
    63 
       
    64         /**
       
    65          * Two-phased constructor.
       
    66          */
       
    67         static CMmPacketTsy* NewL( CMmCustomTsy* aMmCustomTsy, 
       
    68             CMmPhoneTsy* aMmPhoneTsy );
       
    69 
       
    70         /**
       
    71          * Destructor
       
    72          */
       
    73         virtual ~CMmPacketTsy();
       
    74 
       
    75     public: // New functions
       
    76 
       
    77         /**
       
    78          * Initialisation method
       
    79          *          
       
    80          *
       
    81          */
       
    82         virtual void Init();
       
    83 
       
    84         /**
       
    85          * Register given notification.
       
    86          *          
       
    87          *
       
    88          * @param aIpc IPC of the request
       
    89          * @return Error value
       
    90          */
       
    91         virtual TInt RegisterNotification( const TInt aIpc );
       
    92 
       
    93         /**
       
    94          * Deregister given notification.
       
    95          *          
       
    96          *
       
    97          * @param aIpc IPC of the request
       
    98          * @return Error value
       
    99          */
       
   100         virtual TInt DeregisterNotification( const TInt aIpc );
       
   101 
       
   102         /**
       
   103          * Tells whether the object supports given IPC.
       
   104          *          
       
   105          *
       
   106          * @param aIpc IPC of the request
       
   107          * @return true or false
       
   108          */
       
   109         virtual TBool SupportingIPC( const TInt aIpc );
       
   110 
       
   111         /**
       
   112          * Handles extended client requests.
       
   113          *          
       
   114          *
       
   115          * @param aTsyReqHandle Request handle
       
   116          * @param aIpc IPC number of request
       
   117          * @param aPackage Contains parameters for request
       
   118          * @return Error value
       
   119          */
       
   120         TInt DoExtFuncL( const TTsyReqHandle aTsyReqHandle, 
       
   121             const TInt aIpc,
       
   122             const TDataPackage& aPackage );
       
   123 
       
   124         /**
       
   125          * Returns request mode for given IPC number.
       
   126          *          
       
   127          *
       
   128          * @param aIpc IPC number of request
       
   129          * @return Request mode
       
   130          */
       
   131         virtual CTelObject::TReqMode ReqModeL( const TInt aIpc );
       
   132 
       
   133         /**
       
   134          * Returns number of slots to be used for given IPC.
       
   135          *          
       
   136          *
       
   137          * @param aIpc IPC number of request
       
   138          * @return Number of slots to be used
       
   139          */
       
   140         virtual TInt NumberOfSlotsL( const TInt aIpc );
       
   141 
       
   142         /**
       
   143          * Cancels request of which IPC number and request handle are given in
       
   144          * parameters.
       
   145          *          
       
   146          *
       
   147          * @param aIpc IPC number of request
       
   148          * @param aTsyReqHandle Request handle
       
   149          * @return Error value
       
   150          */
       
   151         virtual TInt CancelService( const TInt aIpc, 
       
   152             const TTsyReqHandle aTsyReqHandle );
       
   153 
       
   154         /**
       
   155          * Completes notification to client.
       
   156          *          
       
   157          *
       
   158          * @param aGprsSupporsInCell
       
   159          */
       
   160         virtual void CompleteNotifyEGprsInfoChange( 
       
   161             const TBool aGprsSupporsInCell );
       
   162         /** 
       
   163          * Request Set Always On
       
   164          *
       
   165          * @param aTsyReqHandle TSY ReqHandle
       
   166          * @param aMode pointer to requested mode
       
   167          * @return error value
       
   168          */ 
       
   169         TInt SetAlwaysOnL( TTsyReqHandle aTsyReqHandle, 
       
   170         	RMmCustomAPI::TSetAlwaysOnMode* aMode );
       
   171  
       
   172         /** 
       
   173          * Completes SetAlwaysOn request
       
   174          * 
       
   175          * @param aError error value from LTSY 
       
   176          */
       
   177         void CompleteSetAlwaysOn( TTsyReqHandle aReqHandle, TInt aError );
       
   178         
       
   179         /** 
       
   180          * Cancels Set Always On
       
   181          *
       
   182          * @param aTsyReqHandle TSY reghandle
       
   183          */
       
   184         void CancelSetAlwaysOn( TTsyReqHandle aReqHandle );
       
   185         
       
   186 #ifdef REQHANDLE_TIMER
       
   187         /**
       
   188          * Calls the needed complete method due the timer expiration
       
   189          *          
       
   190          *
       
   191          * @param aReqHandleType Request handle type
       
   192          * @param aError
       
   193          */
       
   194         virtual void Complete( TInt aReqHandleType, TInt aError );
       
   195 #endif // REQHANDLE_TIMER
       
   196 
       
   197     private:
       
   198 
       
   199         /**
       
   200          * C++ default constructor.
       
   201          */
       
   202         CMmPacketTsy();
       
   203 
       
   204         /**
       
   205          * By default Symbian 2nd phase constructor is private.
       
   206          */
       
   207         void ConstructL();
       
   208 
       
   209         /**
       
   210          * Overload the original ReqCompleted for logging purposes.
       
   211          *          
       
   212          *
       
   213          * @param aTsyReqHandle Request handle
       
   214          * @param aError
       
   215          */
       
   216         virtual void ReqCompleted( const TTsyReqHandle aTsyReqHandle, 
       
   217             const TInt aError );
       
   218 
       
   219         /**
       
   220          * Request Notification when EGprs information changes.
       
   221          *          
       
   222          *
       
   223          * @param aTsyReqHandle Request handle
       
   224          * @param aGprsInformation GPRS Information
       
   225          * @return Error value
       
   226          */
       
   227         TInt NotifyEGprsInfoChange( const TTsyReqHandle aTsyReqHandle, 
       
   228             TDes8* aGprsInformation );
       
   229 
       
   230         /**
       
   231          * Get EGprs information.
       
   232          *          
       
   233          *
       
   234          * @param aTsyReqHandle Request handle
       
   235          * @param aGprsInformation GPRS information
       
   236          * @return Error value
       
   237          */
       
   238         TInt GetEGprsInfo( const TTsyReqHandle aTsyReqHandle, 
       
   239             TDes8* aGprsInformation );
       
   240 
       
   241 #ifdef REQHANDLE_TIMER
       
   242         /**
       
   243          * Chooses the type of response, automatic or common
       
   244          *          
       
   245          *
       
   246          * @param aReqHandleType Request handle type
       
   247          * @param aTsyReqHandle Request handle
       
   248          */
       
   249         void SetTypeOfResponse( const TInt aReqHandleType, 
       
   250             const TTsyReqHandle aTsyReqHandle );
       
   251 #endif // REQHANDLE_TIMER
       
   252 
       
   253     private: // Data
       
   254 
       
   255         /**
       
   256          * Pointer to CMmCustomTsy
       
   257          * Not own.         
       
   258          */
       
   259         CMmCustomTsy* iMmCustomTsy;
       
   260 
       
   261         /**
       
   262          * Pointer to the Phone TSY
       
   263          * Not own.         
       
   264          */
       
   265         CMmPhoneTsy* iMmPhone;
       
   266 
       
   267         /**
       
   268          * Pointer to the Req handle store
       
   269          * Own.         
       
   270          */
       
   271         CMmTsyReqHandleStore* iTsyReqHandleStore;
       
   272 
       
   273         // Table for packet context request handles
       
   274         TTsyReqHandle iPacketReqHandles[EMultimodePacketMaxNumOfRequests];
       
   275 
       
   276         /**
       
   277          * Gprs connection information
       
   278          * Not Own.         
       
   279          */
       
   280         RMmCustomAPI::TGprsInformationPckg* iGprsInformationPckg;
       
   281         
       
   282         /**
       
   283          * Allways on mode parameter
       
   284          * Not Own
       
   285          */
       
   286         RMmCustomAPI::TSetAlwaysOnMode iAllwaysOnMode;
       
   287         
       
   288     };
       
   289 
       
   290 #endif // CMMPACKETTSY_H
       
   291 
       
   292 //  End of File