inc/MPEngTransactionStatus2.h
branchRCL_3
changeset 13 a941bc465d9f
parent 0 094583676ce7
equal deleted inserted replaced
12:6ca72c0fe49a 13:a941bc465d9f
       
     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:  Transaction status container interfaces.
       
    15 *
       
    16 */
       
    17 
       
    18 #ifndef __MPENGTRANSACTIONSTATUS2_H__
       
    19 #define __MPENGTRANSACTIONSTATUS2_H__
       
    20 
       
    21 //  INCLUDES
       
    22 #include <E32Std.h>
       
    23 
       
    24 
       
    25 //FORWARD DECLARATION
       
    26 class MPEngDetailedResultEntryExtension2;
       
    27 class MPEngTransactionStatusExtension2;
       
    28 class MPEngTransactionStatusCopy2;
       
    29 
       
    30 
       
    31 
       
    32 // CLASS DECLARATION
       
    33 /**
       
    34  * Enumeration defining different description
       
    35  * texts inside detailed result.
       
    36  *
       
    37  * @since 3.0
       
    38  */
       
    39 enum TPEngDetailedResultDescriptionText2
       
    40     {
       
    41     // The failed presence id
       
    42     EPEngDTPresenceID = 1,
       
    43 
       
    44     // The failed contact list id
       
    45     EPEngDTContactListID = 2,
       
    46 
       
    47     //Description of the error if present
       
    48     EPEngDTErrorDescription = 3
       
    49     };
       
    50 
       
    51 
       
    52 /**
       
    53  * Enumeration defining different description
       
    54  * integers inside detailed result.
       
    55  *
       
    56  * @since 3.0
       
    57  */
       
    58 enum TPEngDetailedResultDescriptionInteger2
       
    59     {
       
    60     //The failed attribute id
       
    61     EPEngDIAttributeID = 1
       
    62     };
       
    63 
       
    64 
       
    65 
       
    66 
       
    67 /**
       
    68  * Detailed result entry.
       
    69  *
       
    70  * This interface offers access to one detailed
       
    71  * result entry.
       
    72  *
       
    73  * @since 3.0
       
    74  */
       
    75 class MPEngDetailedResultEntry2
       
    76     {
       
    77 
       
    78     public:
       
    79 
       
    80         /**
       
    81          * Gets the transaction operation that produced
       
    82          * this detailed error.
       
    83          *
       
    84          * @since 3.0
       
    85          * @return Error operation.
       
    86          */
       
    87         virtual TInt Operation() const = 0;
       
    88 
       
    89 
       
    90         /**
       
    91          * Gets the error code for this detailed error.
       
    92          *
       
    93          * Might be error code from common Symbian OS
       
    94          * error codes, or error code from network transaction.
       
    95          *
       
    96          * @since 3.0
       
    97          * @return Error code.
       
    98          */
       
    99         virtual TInt Error() const = 0;
       
   100 
       
   101 
       
   102 
       
   103         /**
       
   104          * Gets descriptive text from detailed result entry.
       
   105          * If requested description text isn't set, returns
       
   106          * KErrNotFound, else returns KErrNone and aDescriptionText
       
   107          * is set to point description value.
       
   108          *
       
   109          * @since 3.0
       
   110          * @param aDescriptionText On the return contains requested
       
   111          * description text. If requested text isn't set,
       
   112          * contains on the return empty descriptor. Note:
       
   113          * No need to construct a local buffer for descriptor,
       
   114          * pass just TPtrC and on the return TPtrC is set to point
       
   115          * correct data.
       
   116          *
       
   117          * @param aDescriptionID Which description text to get.
       
   118          * @return If description isn't set: KErrNotFound.
       
   119          * Else KErrNone.
       
   120          */
       
   121         virtual TInt GetDetailedDesc( TPtrC& aDescriptionText,
       
   122                                       TPEngDetailedResultDescriptionText2 aDescriptionID ) const = 0;
       
   123 
       
   124 
       
   125         /**
       
   126          * Gets description integer from detailed result entry.
       
   127          * If requested description integer isn't set, returns
       
   128          * KErrNotFound, else returns KErrNone and aDescriptionInt
       
   129          * is set to contain description value.
       
   130          *
       
   131          * @since 3.0
       
   132          * @param aDescriptionInt On the return contains requested
       
   133          * description integer. If requested integer isn't set,
       
   134          * contains 0 on the return.
       
   135          * @param aDescriptionID Which description integer to get.
       
   136          * @return If description isn't set: KErrNotFound:
       
   137          * Else KErrNone.
       
   138          */
       
   139         virtual TInt GetDetailedInt( TUint32& aDescriptionInt,
       
   140                                      TPEngDetailedResultDescriptionInteger2 aDescriptionID ) const = 0;
       
   141 
       
   142 
       
   143 
       
   144     protected: //Extensions interface
       
   145 
       
   146         /**
       
   147          * Detailed result entry extension interface.
       
   148          *
       
   149          * @since 3.0
       
   150          * @return Detailed result entry extension.
       
   151          * Currently NULL.
       
   152          */
       
   153         virtual MPEngDetailedResultEntryExtension2* EntryExtension() = 0;
       
   154 
       
   155 
       
   156 
       
   157     protected:
       
   158 
       
   159         /**
       
   160          * Virtual destructor.
       
   161          *
       
   162          * Detailed result entries can't be destroyed
       
   163          * using this interface.
       
   164          */
       
   165         virtual ~MPEngDetailedResultEntry2() {};
       
   166     };
       
   167 
       
   168 
       
   169 
       
   170 
       
   171 
       
   172 // CLASS DECLARATION
       
   173 /**
       
   174  * Enumeration defining different description
       
   175  * texts inside MPEngTransactionStatus2 container.
       
   176  *
       
   177  * Reserved for future use. Currently no texts.
       
   178  *
       
   179  * @since 3.0
       
   180  */
       
   181 enum TPEngTransStatusDescriptionText2
       
   182     {
       
   183     };
       
   184 
       
   185 
       
   186 /**
       
   187  * Enumeration defining different description
       
   188  * integers inside MPEngTransactionStatus2 container.
       
   189  *
       
   190  * Reserved for future use. Currently no integers.
       
   191  *
       
   192  * @since 3.0
       
   193  */
       
   194 enum TPEngTransStatusDescriptionInteger2
       
   195     {
       
   196     };
       
   197 
       
   198 
       
   199 
       
   200 // CLASS DECLARATION
       
   201 /**
       
   202  * Transaction status container interface. Transaction
       
   203  * status contains errors from presence transaction
       
   204  * with the network SAP.
       
   205  *
       
   206  * Transaction error might be something like
       
   207  * partial failure when adding contacts to
       
   208  * contacts lists or it might be OOM error coming
       
   209  * from initiating or handling the transaction.
       
   210  *
       
   211  * @since 3.0
       
   212  */
       
   213 class MPEngTransactionStatus2
       
   214     {
       
   215     public: // New functions
       
   216 
       
   217         /**
       
   218          * Transaction result status.
       
   219          *
       
   220          * If transaction went ok, without any
       
   221          * errors, status is KErrNone.
       
   222          *
       
   223          * If error code is something else than
       
   224          * KErrNone, there might be detailed
       
   225          * result entry giving the more detailed
       
   226          * information from the error.
       
   227          *
       
   228          * @since 3.0
       
   229          * @return The error code.
       
   230          */
       
   231         virtual TInt Status() const = 0;
       
   232 
       
   233 
       
   234         /**
       
   235          * Getter to transaction detailed result count.
       
   236          *
       
   237          * If transaction was partially successful, there will
       
   238          * be one or more detailed results, which describe what went
       
   239          * wrong in transaction. If the transaction was succesful,
       
   240          * there isn't any detailed results.
       
   241          *
       
   242          * Detailed results are presented by MPEngDetailedResultEntry2.
       
   243          *
       
   244          * @since 3.0
       
   245          * @return The detailed result count.
       
   246          */
       
   247         virtual TInt DetailedResultCount() const = 0;
       
   248 
       
   249 
       
   250         /**
       
   251          * Getter for detailed result object.
       
   252          *
       
   253          * Gets a detailed result entry. Client may not assume anything
       
   254          * about the ordering of returned detailed entries.
       
   255          *
       
   256          * @since 3.0
       
   257          * @param aIndex Defines which detailed result element to access
       
   258          *        within the transaction status. The index is relative to
       
   259          *        zero. Zero implies the first detailed result entry.
       
   260          *        If passed index is out of bounds, panics with
       
   261          *        "PEngTransStat", 1.
       
   262          *
       
   263          * @return Asked detailed result. Lifetime of returned detailed
       
   264          *         result entry is same as originating MPEngTransactionStatus2 object.
       
   265          *         No ownership transfered.
       
   266          */
       
   267         virtual const MPEngDetailedResultEntry2& DetailedResult( TInt aIndex ) const = 0;
       
   268 
       
   269 
       
   270 
       
   271         /**
       
   272          * Getter for detailed result object.
       
   273          *
       
   274          * Gets a pointer to "first" detailed result entry of asked operation ID.
       
   275          * If there isn't any detailed result of asked operation, returns
       
   276          * KErrNotFound. Else returns KErrNone.
       
   277          * Subsequent detailed results can be obtained by calling
       
   278          * GetNextDetailedResultByOperation().
       
   279          *
       
   280          * @since 3.0
       
   281          * @param aTransactionOperation By which transaction operation type
       
   282          *        to get detailed entries. Transaction operation IDs are listed in
       
   283          *        PEngPresenceEngineConsts2.h. TPEngTransactionOperation enumeration
       
   284          *        defines transaction IDs for presence data transactions.
       
   285          *        TPEngNWSessionSlotOperations enumeration defines IDs for NWSessionSlot
       
   286          *        operations.
       
   287          *
       
   288          * @param aDetailedResult Pointer to first found detailed result entry
       
   289          *        of asked operation type is returned here. Lifetime of
       
   290          *        returned detailed result entry is same as originating
       
   291          *        MPEngTransactionStatus2 object. If no detailed result of asked
       
   292          *        operation isn't found, NULL is returned. No ownership transfered.
       
   293          *
       
   294          * @return Status of getting the detailed result. KErrNone if a
       
   295          *         detailed result of the asked operation is found. Else KErrNotFound.
       
   296          */
       
   297         virtual TInt GetFirstDetailedResultByOperation( TInt aTransactionOperation,
       
   298                                                         const MPEngDetailedResultEntry2*& aDetailedResult ) = 0;
       
   299 
       
   300 
       
   301         /**
       
   302          * Getter for detailed result object.
       
   303          *
       
   304          * Gets a pointer to "next" detailed result entry
       
   305          * of asked operation. (Operation criteria is set by calling
       
   306          * first GetFirstDetailedResultByOperation(). Once setted operation
       
   307          * criteria stays in use untill new criteria is set by
       
   308          * GetFirstDetailedResultByOperation().)
       
   309          *
       
   310          * If there isn't any more detailed results of required operation,
       
   311          * returns KErrNotFound. Else returns KErrNone.
       
   312          *
       
   313          * If operation criteria hasn't been set previously, panics with
       
   314          * "PEngTransStat", 2.
       
   315          *
       
   316          * @since 3.0
       
   317          * @param aDetailedResult Pointer to next found detailed result entry
       
   318          *        of asked operation is returned here. Lifetime of returned detailed
       
   319          *        result entry is same as originating MPEngTransactionStatus2 object.
       
   320          *        If no more detailed results of asked operation isn't found,
       
   321          *        NULL is returned.
       
   322          *
       
   323          * @return Status of getting the detailed result. KErrNone if a
       
   324          *         detailed result of the asked operation is found. Else KErrNotFound.
       
   325          */
       
   326         virtual TInt GetNextDetailedResultByOperation( const MPEngDetailedResultEntry2*& aDetailedResult ) = 0;
       
   327 
       
   328 
       
   329 
       
   330 
       
   331 
       
   332     public: // Access to description fields
       
   333 
       
   334         /**
       
   335          * Gets descriptive text from transaction status.
       
   336          * If requested description text isn't set, returns
       
   337          * KErrNotFound, else returns KErrNone and aDescriptionText
       
   338          * is set to point description value.
       
   339          *
       
   340          * @since 3.0
       
   341          * @param aDescriptionText On the return contains requested
       
   342          * description text. If requested text isn't set, contains on
       
   343          * the return empty descriptor.
       
   344          * @param aDescriptionID Which description text to get.
       
   345          * @return If description isn't set KErrNotFound.
       
   346          * Else KErrNone.
       
   347          */
       
   348         virtual TInt GetDesc( TPtrC& aDescriptionText,
       
   349                               TPEngTransStatusDescriptionText2 aDescriptionID ) const = 0;
       
   350 
       
   351 
       
   352         /**
       
   353          * Gets descriptive integer value from transaction status.
       
   354          * If requested description integer isn't set, returns
       
   355          * KErrNotFound, else returns KErrNone and aDescriptionInt
       
   356          * is set to contain description value.
       
   357          *
       
   358          * @since 3.0
       
   359          * @param aDescriptionInt On the return contains requested
       
   360          * description integer. If requested integer isn't set,
       
   361          * contains on the return 0.
       
   362          * @param aDescriptionID Which description integer to get.
       
   363          * @return If description isn't set KErrNotFound.
       
   364          * Else KErrNone.
       
   365          */
       
   366         virtual TInt GetInt( TUint32& aDescriptionInt,
       
   367                              TPEngTransStatusDescriptionInteger2 aDescriptionID ) const = 0;
       
   368 
       
   369 
       
   370 
       
   371 
       
   372 
       
   373     public: // Cloning support
       
   374 
       
   375         /**
       
   376          * Creates a new deep copy from transaction status object.
       
   377          *
       
   378          * Creates a deep copy from transaction status object and
       
   379          * returns it ownership to client. Created object is placed
       
   380          * on the CleanupStack.
       
   381          *
       
   382          * Created copy is derived from MPEngTransactionStatus2Copy
       
   383          * interface to allow client to delete created object.
       
   384          *
       
   385          * Only data is copied. Cached settings like criterias
       
   386          * used by GetFirstDetailedResultByOperation() and
       
   387          * GetNextDetailedResultByOperation() are not copied.
       
   388          *
       
   389          * @since 3.0
       
   390          * @return New copy from MPEngTransactionStatus2.
       
   391          * Ownership of created object is returned to calling client.
       
   392          */
       
   393         virtual MPEngTransactionStatusCopy2* CloneLC() const = 0;
       
   394 
       
   395 
       
   396 
       
   397         /**
       
   398           * Transaction status extension interface.
       
   399           *
       
   400           * @since 3.0
       
   401           * @return Transaction status extension.
       
   402           * Currently NULL.
       
   403           */
       
   404         virtual MPEngTransactionStatusExtension2* StatusExtension() = 0;
       
   405 
       
   406 
       
   407 
       
   408 
       
   409     protected:
       
   410 
       
   411         /**
       
   412          * Virtual inline destructor.
       
   413          *
       
   414          * Concrete transaction status can't be
       
   415          * destroyed using this interface.
       
   416          */
       
   417         virtual ~MPEngTransactionStatus2() {};
       
   418 
       
   419     };
       
   420 
       
   421 
       
   422 
       
   423 /**
       
   424  * This interface offers possibility to client to
       
   425  * control cloned transaction status object lifetime.
       
   426  *
       
   427  * @since 3.0
       
   428  */
       
   429 class MPEngTransactionStatusCopy2 : public MPEngTransactionStatus2
       
   430     {
       
   431     public:
       
   432         /**
       
   433          * Cleanup support.
       
   434          *
       
   435          * Cloned transaction status objects can be
       
   436          * pushed on the CleanupStack using
       
   437          * CleanupClosePushL().
       
   438          *
       
   439          * @since 3.0
       
   440          */
       
   441         virtual void Close() = 0;
       
   442 
       
   443 
       
   444     public:
       
   445 
       
   446         /**
       
   447          * Virtual destructor.
       
   448          *
       
   449          * Transaction status copies can be destroyed
       
   450          * using this interface.
       
   451          */
       
   452         virtual ~MPEngTransactionStatusCopy2() {};
       
   453     };
       
   454 
       
   455 
       
   456 
       
   457 #endif      //  __MPENGTRANSACTIONSTATUS2_H__
       
   458 
       
   459 //  End of File
       
   460 
       
   461