presadap12/Parser2/Inc/MPEngAdvTransactionStatus2.h
changeset 0 094583676ce7
equal deleted inserted replaced
-1:000000000000 0:094583676ce7
       
     1 /*
       
     2 * Copyright (c) 2004 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:  Advanced transaction status container interfaces.
       
    15 *
       
    16 */
       
    17 
       
    18 #ifndef __MPENGADVTRANSACTIONSTATUS2_H__
       
    19 #define __MPENGADVTRANSACTIONSTATUS2_H__
       
    20 
       
    21 //  INCLUDES
       
    22 #include <E32Base.h>
       
    23 #include "MPEngTransactionStatus2.h"
       
    24 
       
    25 
       
    26 // CLASS DECLARATION
       
    27 /**
       
    28  * Advanced transaction status container interface.
       
    29  * Transaction status contains errors from presence
       
    30  * transactions with the network SAP.
       
    31  *
       
    32  * Advanced interface allows to add new detailed results.
       
    33  *
       
    34  * @since 3.0
       
    35  */
       
    36 class MPEngAdvTransactionStatus2 : public MPEngTransactionStatusCopy2
       
    37     {
       
    38     public: // Setter functions
       
    39 
       
    40         /**
       
    41          * Sets the transaction result status.
       
    42          *
       
    43          * If transaction went ok, without any
       
    44          * errors, transaction result status is KErrNone.
       
    45          * Else a error code from PresenceErrors.h
       
    46          *
       
    47          * @since 3.0
       
    48          * @param aStatus The overall error code.
       
    49          */
       
    50         virtual void SetStatus( TInt aStatus ) = 0;
       
    51 
       
    52 
       
    53         /**
       
    54          * Adds a new detailed result entry.
       
    55          *
       
    56          * Stores a new detailed result entry inside
       
    57          * the transaction status object.
       
    58          *
       
    59          * @since 3.0
       
    60          *
       
    61          * @param aOperationID The ID of operation producing
       
    62          *                    this detailed result entry.
       
    63          * @param aErrorCode Error code.
       
    64          * @param aAttributeTypeID Possible attribute type ID.
       
    65          *                         Pass NULL if no attribute type ID.
       
    66          * @param aPresenceID Possible presence ID.
       
    67          *                    Pass NULL if no presence ID.
       
    68          * @param aContactListID Possible contact list ID.
       
    69          *                       Pass NULL if no contact list ID.
       
    70          * @aDescription Possible description of the error.
       
    71          *               Pass NULL if no description.
       
    72          */
       
    73         virtual void AddDetailedResultL( TInt aOperationID,
       
    74                                          TInt aErrorCode,
       
    75                                          const TUint32* aAttributeTypeID,
       
    76                                          const TDesC* aPresenceID,
       
    77                                          const TDesC* aContactListID,
       
    78                                          const TDesC* aDescription ) = 0;
       
    79 
       
    80         /**
       
    81          * Adds a new data result entry.
       
    82          *
       
    83          * Stores a new data result entry inside
       
    84          * the transaction status object.
       
    85          *
       
    86          * @since 3.0
       
    87          *
       
    88          * @param aOperationID The ID of operation producing
       
    89          * this data  result entry.
       
    90          * @param aDataResult The data result. Function takes the ownership
       
    91          * of given buffer only in full success. Buffer may not be NULL.
       
    92          */
       
    93         virtual void AddDataResultL( TInt aOperationID,
       
    94                                      HBufC16* aDataResult ) = 0;
       
    95 
       
    96 
       
    97 
       
    98     public: // Getter functions
       
    99 
       
   100 
       
   101         /**
       
   102          * Getter for data result.
       
   103          *
       
   104          * Gets a "first" data result entry of asked operation ID.
       
   105          * If there isn't any data result of asked operation, returns
       
   106          * KErrNotFound. Else returns KErrNone.
       
   107          * Subsequent detailed results can be obtained by calling
       
   108          * GetNextDetailedResultByOperation().
       
   109          *
       
   110          * @since 3.0
       
   111          * @param aOperationID Defines which transaction operation type to get.
       
   112          * @param aDataResult On the return contains first found data result.
       
   113          * If no data result is found, contains on the return empty descriptor.
       
   114          * Note: No need to construct a local buffer for descriptor,
       
   115          * pass just TPtrC and on the return TPtrC is set to point
       
   116          * correct data.
       
   117          *
       
   118          * @return Status of getting the data result.
       
   119          * KErrNone if a data result of the asked operation is found.
       
   120          * Else KErrNotFound.
       
   121          */
       
   122         virtual TInt GetFirstDataResultByOperation( TInt aOperationID,
       
   123                                                     TPtrC16& aDataResult ) = 0;
       
   124 
       
   125 
       
   126         /**
       
   127          * Getter for data result.
       
   128          *
       
   129          * Gets a "next" data result entry of asked operation.
       
   130          * (Operation criteria is set by calling first GetFirstDataResultByOperation().
       
   131          * Once setted operation criteria stays in use untill new criteria is set by
       
   132          * GetFirstDataResultByOperation().)
       
   133          *
       
   134          * If there isn't any more data results of required operation,
       
   135          * returns KErrNotFound. Else returns KErrNone.
       
   136          *
       
   137          * If operation criteria hasn't been set previously, panics with
       
   138          * "PEngTransStat", 3.
       
   139          *
       
   140          * @since 3.0
       
   141          * @param aDataResult On the return contains first found data result.
       
   142          * If no data result is found, contains on the return empty descriptor.
       
   143          * Note: No need to construct a local buffer for descriptor,
       
   144          * pass just TPtrC and on the return TPtrC is set to point
       
   145          * correct data.
       
   146          *
       
   147          * @return Status of getting the data result.
       
   148          * KErrNone if a data result of the asked operation is found.
       
   149          * Else KErrNotFound.
       
   150          */
       
   151         virtual TInt GetNextDataResultByOperation( TPtrC16& aDataResult ) = 0;
       
   152 
       
   153 
       
   154 
       
   155 
       
   156     public:  //Destructor
       
   157 
       
   158 
       
   159         /**
       
   160          * Virtual inline destructor.
       
   161          *
       
   162          * Transaction status objects can be
       
   163          * destroyed using this interface.
       
   164          */
       
   165         virtual ~MPEngAdvTransactionStatus2() {};
       
   166 
       
   167     };
       
   168 
       
   169 #endif      //  __MPENGADVTRANSACTIONSTATUS2_H__
       
   170 
       
   171 //  End of File
       
   172