PECengine/PresenceManager2/SrcAttribute/CPEngAttributePublishOp.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: this class is an operation handler for publishing user own attributes.
       
    15 *
       
    16 */
       
    17 
       
    18 #ifndef CPENGATTRIBUTEPUBLISHOP_H
       
    19 #define CPENGATTRIBUTEPUBLISHOP_H
       
    20 
       
    21 //  INCLUDES
       
    22 #include <E32Base.h>
       
    23 #include <badesca.h>
       
    24 #include "CPEngAsyncOperation.h"
       
    25 
       
    26 
       
    27 // FORWARD DECLARATIONS
       
    28 class MPEngAttributeTransactionObserver2;
       
    29 class MPEngAdvTransactionStatus2;
       
    30 class CPEngAttributeTransaction2;
       
    31 class MPEngPresenceAttrModel2;
       
    32 class MPEngPresenceAttrManager;
       
    33 
       
    34 
       
    35 
       
    36 
       
    37 // CLASS DECLARATION
       
    38 
       
    39 
       
    40 /**
       
    41  * Operation handler for publishing user own attributes.
       
    42  *
       
    43  * @lib
       
    44  * @since 3.0
       
    45  */
       
    46 NONSHARABLE_CLASS( CPEngAttributePublishOp ) : public CPEngAsyncOperation
       
    47     {
       
    48 public:  // Constructors and destructor
       
    49 
       
    50     /**
       
    51      * Two-phased constructor.
       
    52      */
       
    53     static CPEngAttributePublishOp* NewL( TInt aPriority,
       
    54     CPEngAttributeTransaction2& aInterface,
       
    55     CPEngNWSessionSlotStorageProxy& aUsedSlot,
       
    56     RPointerArray<MPEngPresenceAttrModel2>& aModels,
       
    57     MPEngAttributeTransactionObserver2& aObserver,
       
    58     RPEngManagerClient& aServer );
       
    59 
       
    60     /**
       
    61      * Destructor.
       
    62      */
       
    63     virtual ~CPEngAttributePublishOp();
       
    64 
       
    65 private:
       
    66 
       
    67     /**
       
    68      * C++ default constructor.
       
    69      */
       
    70     CPEngAttributePublishOp( TInt aPriority,
       
    71                              CPEngAttributeTransaction2& aInterface,
       
    72                              MPEngAttributeTransactionObserver2& aObserver,
       
    73                              RPEngManagerClient& aServer );
       
    74 
       
    75     /**
       
    76      * Symbian OS constructor.
       
    77      */
       
    78     void ConstructL( CPEngNWSessionSlotStorageProxy& aUsedSlot,
       
    79                      RPointerArray<MPEngPresenceAttrModel2>& aModels );
       
    80 
       
    81 
       
    82 public: //New services
       
    83 
       
    84 
       
    85     /*
       
    86      * Starts the publish operation.
       
    87      * Takes the ownership in construction
       
    88      * given attribute models.
       
    89      *
       
    90      * @since 3.0
       
    91      */
       
    92     void Publish();
       
    93 
       
    94 
       
    95 
       
    96 
       
    97 private: //Template method from base
       
    98 
       
    99     /**
       
   100      * Notifies from operation complete.
       
   101      */
       
   102     void DoHandleOpSuccessL( MPEngAdvTransactionStatus2& aStatus,
       
   103                              TInt aTransactionOperation );
       
   104 
       
   105     void DoHandleOpFailure( MPEngAdvTransactionStatus2& aStatus,
       
   106                             TInt aTransactionOperation );
       
   107 
       
   108     TPEngAsyncOpResult DoNotifyObserver( MPEngAdvTransactionStatus2& aStatus,
       
   109                                          TInt aTransactionOperation );
       
   110 
       
   111 
       
   112 
       
   113 
       
   114 private:
       
   115 
       
   116     //REF: The implemented interface
       
   117     CPEngAttributeTransaction2&     iInterface;
       
   118 
       
   119     //REF: The observer
       
   120     MPEngAttributeTransactionObserver2&     iObserver;
       
   121 
       
   122     //OWN: Models that are published
       
   123     RPointerArray< MPEngPresenceAttrModel2 >    iModels;
       
   124 
       
   125     //OWN: Are the attribute models in previous array owned?
       
   126     TBool iModelsOwned;
       
   127 
       
   128     //OWN: Attribute manager
       
   129     MPEngPresenceAttrManager*   iAttrManager;
       
   130 
       
   131 
       
   132     };
       
   133 
       
   134 #endif  // CPENGATTRIBUTEPUBLISHOP_H
       
   135 
       
   136 
       
   137