PECengine/PresenceManager2/SrcAttributeList/CPEngAttrLstPublishSyncOp.cpp
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: this class is an operation handler for performing attribute
       
    15 * list publish operation.
       
    16 *
       
    17 */
       
    18 
       
    19 
       
    20 // INCLUDE FILES
       
    21 #include "CPEngAttrLstPublishSyncOp.h"
       
    22 #include "CPEngNWSessionSlotStorageProxy.h"
       
    23 #include "MPEngAdvTransactionStatus2.h"
       
    24 
       
    25 #include <CPEngAttributeListTransaction2.h>
       
    26 #include <MPEngAttributeListTransactionObserver2.h>
       
    27 
       
    28 
       
    29 
       
    30 // ================= MEMBER FUNCTIONS =======================
       
    31 
       
    32 // Two-phased constructor.
       
    33 CPEngAttrLstPublishSyncOp* CPEngAttrLstPublishSyncOp::NewL(
       
    34     TInt aPriority,
       
    35     CPEngAttributeListTransaction2& aInterface,
       
    36     CPEngNWSessionSlotStorageProxy& aUsedSlot,
       
    37     MPEngAttributeListTransactionObserver2& aObserver,
       
    38     RPEngManagerClient& aServer )
       
    39     {
       
    40     CPEngAttrLstPublishSyncOp* self = new ( ELeave ) CPEngAttrLstPublishSyncOp( aPriority,
       
    41                                                                                 aInterface,
       
    42                                                                                 aObserver,
       
    43                                                                                 aServer );
       
    44 
       
    45     CleanupStack::PushL( self );
       
    46     self->ConstructL( aUsedSlot );
       
    47     CleanupStack::Pop();
       
    48 
       
    49     return self;
       
    50     }
       
    51 
       
    52 
       
    53 // Destructor
       
    54 CPEngAttrLstPublishSyncOp::~CPEngAttrLstPublishSyncOp()
       
    55     {
       
    56     CActive::Cancel();
       
    57     }
       
    58 
       
    59 
       
    60 // C++ default constructor can NOT contain any code, that
       
    61 // might leave.
       
    62 //
       
    63 CPEngAttrLstPublishSyncOp::CPEngAttrLstPublishSyncOp( TInt aPriority,
       
    64                                                       CPEngAttributeListTransaction2& aInterface,
       
    65                                                       MPEngAttributeListTransactionObserver2& aObserver,
       
    66                                                       RPEngManagerClient& aServer )
       
    67         : CPEngAsyncOperation( aPriority, aServer ),
       
    68         iInterface( aInterface ),
       
    69         iObserver( aObserver )
       
    70     {
       
    71     }
       
    72 
       
    73 
       
    74 
       
    75 // EPOC default constructor can leave.
       
    76 void CPEngAttrLstPublishSyncOp::ConstructL( CPEngNWSessionSlotStorageProxy& aUsedSlot )
       
    77     {
       
    78     BaseConstructL( aUsedSlot );
       
    79 
       
    80     //Attribute list publish doesn't take any data
       
    81     InitTransaction( NULL, EPEngTransOpAttrListPublish );
       
    82     }
       
    83 
       
    84 
       
    85 // -----------------------------------------------------------------------------
       
    86 // CPEngAttrLstPublishSyncOp::Publish()
       
    87 // -----------------------------------------------------------------------------
       
    88 //
       
    89 void CPEngAttrLstPublishSyncOp::Publish()
       
    90     {
       
    91     IssueTransaction();
       
    92     }
       
    93 
       
    94 
       
    95 // -----------------------------------------------------------------------------
       
    96 // CPEngAttrLstPublishSyncOp::DoHandleOpSuccessL()
       
    97 // -----------------------------------------------------------------------------
       
    98 void CPEngAttrLstPublishSyncOp::DoHandleOpSuccessL(
       
    99     MPEngAdvTransactionStatus2& /*aStatus*/,
       
   100     TInt /*aTransactionOperation*/ )
       
   101 
       
   102     {
       
   103     }
       
   104 
       
   105 
       
   106 // -----------------------------------------------------------------------------
       
   107 // CPEngAttrLstPublishSyncOp::DoHandleOpFailure()
       
   108 // -----------------------------------------------------------------------------
       
   109 void CPEngAttrLstPublishSyncOp::DoHandleOpFailure(
       
   110     MPEngAdvTransactionStatus2& /*aStatus*/,
       
   111     TInt /*aTransactionOperation*/ )
       
   112     {
       
   113     }
       
   114 
       
   115 
       
   116 // -----------------------------------------------------------------------------
       
   117 // CPEngAttrLstPublishSyncOp::DoNotifyObserver()
       
   118 // -----------------------------------------------------------------------------
       
   119 TPEngAsyncOpResult CPEngAttrLstPublishSyncOp::DoNotifyObserver(
       
   120     MPEngAdvTransactionStatus2& aStatus,
       
   121     TInt aTransactionOperation )
       
   122     {
       
   123     TRAPD( err, iObserver.HandleAttributeListTransactionCompleteL(
       
   124                aStatus,
       
   125                iInterface,
       
   126                aTransactionOperation ) );
       
   127     if ( err != KErrNone )
       
   128         {
       
   129         iObserver.HandleAttributeListTransactionError( err,
       
   130                                                        iInterface,
       
   131                                                        aTransactionOperation );
       
   132         }
       
   133 
       
   134     return EPEngAsyncOpCompleted;
       
   135     }
       
   136 
       
   137 
       
   138 //End of file
       
   139 
       
   140