phoneclientserver/phoneserver/Inc/Ussd/CUssdExtensionInterface.h
branchRCL_3
changeset 18 594d59766373
child 21 0a6dd2dc9970
equal deleted inserted replaced
17:c58fd5f0c240 18:594d59766373
       
     1 /*
       
     2  * Copyright (c) 2002-2005 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:  Extends the ussd functionality.
       
    15  *
       
    16  */
       
    17 #ifndef __CUSSDEXTENSIONINTERFACE_H__
       
    18 #define __CUSSDEXTENSIONINTERFACE_H__
       
    19 
       
    20 // INCLUDES
       
    21 
       
    22 #include<ecom\ecom.h>
       
    23 #include<etelmm.h>
       
    24 #include<ussdinterfaceconstants.hrh>
       
    25 // FORWARD DECLARATIONS
       
    26 
       
    27 // CONSTANTS
       
    28 const TUid KUssdExtensionInterfaceUid =
       
    29     {
       
    30     KUssdExtensionInterfaceUidValue
       
    31     };
       
    32 
       
    33 // CLASS DECLARATION
       
    34 
       
    35 /**
       
    36  *  Base class for Ussd Extension Plugin.
       
    37  *
       
    38  *  This API allows customizing the USSD sending feature of the S60 Telephony 
       
    39  *  applications at runtime.
       
    40  *
       
    41  *  The API defines two roles:
       
    42  *  1) Validates the USSD string while sending. if it is unauthorized 
       
    43  *  in the context shall terminate the request.
       
    44  *  2) Validates the USSD string while receiving, the extension will get the first chance to consume the reply if needed
       
    45  *
       
    46  *
       
    47  *  Note:
       
    48  *  The customizer needs only one plug-in implementation for a variant, and so supports only rom-only plug-in.
       
    49  */
       
    50 class CUssdExtensionInterface : public CBase
       
    51     {
       
    52 public:
       
    53     // Constructors and destructor
       
    54     /**
       
    55      * NewL
       
    56      * Wraps ECom object instantitation. Will return the
       
    57      * default interface implementation, which matches to
       
    58      * given aOperationName.
       
    59      */
       
    60     static CUssdExtensionInterface* NewL();
       
    61 
       
    62     /**
       
    63      * NewL
       
    64      * Wraps ECom object instantitation. Will search for
       
    65      * interface implementation, which matches to given
       
    66      * aOperationName.
       
    67      * @param aOperationName name of requested implementation.
       
    68      * Implementations advertise their "name" as specified
       
    69      * in their resource file field
       
    70      * IMPLEMENTATION_INFO::default_data.
       
    71      */
       
    72     static CUssdExtensionInterface* NewL(const TDesC8& aMatch);
       
    73 
       
    74 public:
       
    75     // API to be implemented by ECOM plug-in
       
    76 
       
    77     /**
       
    78      * Validate/Authenticate the Ussd string Before Sending from
       
    79      * the USSD Send handler
       
    80      * When Ussd Extention plugin return true, then ussd manager will continue sending of the ussd
       
    81      * Otherwise the transaction will be terminated with KErrAccessDenined 
       
    82      *
       
    83      * @param aMessageData  
       
    84      * @param aMessageAttributes .
       
    85      */
       
    86     virtual TBool
       
    87             ValidateUssdMsgSending(
       
    88                     const TDesC8& aMessageData,
       
    89                     const RMobileUssdMessaging::TMobileUssdAttributesV1& aMsgAttribute) = 0;
       
    90     /**
       
    91      * Validate/Authenticate the Ussd response received by the 
       
    92      * USSD receive handler
       
    93      *
       
    94      * @param aMessageData  
       
    95      * @return true implies that the ussd response is valid for the extension.
       
    96      * otherwise pass it to the observer. .
       
    97      */
       
    98     virtual TBool ValidateUssdResponse(const TDesC8& aMessage) = 0;
       
    99     /**
       
   100      * if ValidateUssdResponse returns true, then the extension plugin is waiting for the response 
       
   101      * so invoke the interface to deligate to the plugin.
       
   102      * Example:
       
   103      * ...
       
   104      *  TBool isValidForExtension = iUssdExtnInterface->ValidateUssdResponse(aMsgData);
       
   105      *  TInt errfromextension = KErrNone;
       
   106      *  if (isValidForExtension)
       
   107      *     {
       
   108      *     TRAPD(err, iUssdExtnInterface->ProcessReceivedUssdL(iDecodedMessage, errfromextension));
       
   109      *     ...
       
   110      *     
       
   111      * @param aMessageData  
       
   112      * @return error code
       
   113      * @leave On typical leave level problems. 
       
   114      */
       
   115     virtual void
       
   116             ProcessReceivedUssdL(const TDesC& aMessageData, TInt aError) = 0;
       
   117 
       
   118     /**
       
   119      * Notify the any network error to the extension, so that it can handle the internal states if required
       
   120      * @param aError 
       
   121      */
       
   122     virtual void NotifyNWError(TInt aError)=0;
       
   123 
       
   124 public:
       
   125     /**
       
   126      * ~CUssdExtensionInterface
       
   127      *
       
   128      * Cleans up resources, specifically notify ECOM server that this
       
   129      * instance is being deleted.
       
   130      */
       
   131     virtual ~CUssdExtensionInterface();
       
   132 
       
   133 private:
       
   134     TUid iDtor_ID_Key; // Identification on cleanup
       
   135     };
       
   136 #include "CUssdExtensionInterface.inl"    
       
   137 #endif // __CUSSDEXTENSIONINTERFACE_H__