phonebookui/Phonebook2/ServerApplication/inc/CPbk2ContactSpeedDialAttributeAssigner.h
changeset 0 e686773b3f54
equal deleted inserted replaced
-1:000000000000 0:e686773b3f54
       
     1 /*
       
     2 * Copyright (c) 2005-2007 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:  Phonebook 2 speed dial attribute assigner.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef CPBK2CONTACTSPEEDDIALATTRIBUTEASSIGNER_H
       
    20 #define CPBK2CONTACTSPEEDDIALATTRIBUTEASSIGNER_H
       
    21 
       
    22 // INCLUDES
       
    23 #include <e32base.h>
       
    24 #include "MPbk2ContactAssigner.h"
       
    25 #include <Pbk2ServerAppIPC.h>
       
    26 #include <MVPbkContactAttributeManager.h>
       
    27 
       
    28 // FORWARD DECLARATIONS
       
    29 class MPbk2ContactAssignerObserver;
       
    30 class CVPbkContactManager;
       
    31 class MVPbkContactAttribute;
       
    32 class MVPbkContactOperationBase;
       
    33 class MVPbkStoreContact;
       
    34 class MVPbkStoreContactField;
       
    35 
       
    36 // CLASS DECLARATION
       
    37 
       
    38 /**
       
    39  * Phonebook 2 speed dial attribute assigner.
       
    40  */
       
    41 class CPbk2ContactSpeedDialAttributeAssigner : public CActive,
       
    42                                                public MPbk2ContactAssigner,
       
    43                                                private MVPbkSetAttributeObserver
       
    44     {
       
    45     public: // Construction and destruction
       
    46 
       
    47         /**
       
    48          * Creates a new instance of this class.
       
    49          *
       
    50          * @param aObserver             Observer.
       
    51          * @param aAttributeAssignData  Attribute assing data.
       
    52          * @param aContactManager       Virtual Phonebook contact manager.
       
    53          * @return  A new instance of this class.
       
    54          */
       
    55         static CPbk2ContactSpeedDialAttributeAssigner* NewL(
       
    56                 MPbk2ContactAssignerObserver& aObserver,
       
    57                 CVPbkContactManager& aContactManager );
       
    58 
       
    59         /**
       
    60          * Destructor.
       
    61          */
       
    62         ~CPbk2ContactSpeedDialAttributeAssigner();
       
    63 
       
    64     public: // From MPbk2ContactAssigner
       
    65         void AssignDataL(
       
    66                 MVPbkStoreContact& aStoreContact,
       
    67                 MVPbkStoreContactField* aContactField,
       
    68                 const MVPbkFieldType* aFieldType,
       
    69                 const HBufC* aDataBuffer );
       
    70         void AssignAttributeL(
       
    71                 MVPbkStoreContact& aStoreContact,
       
    72                 MVPbkStoreContactField* aContactField,
       
    73                 TPbk2AttributeAssignData aAttributeAssignData );
       
    74 
       
    75     private: // From MVPbkSetAttributeObserver
       
    76         void AttributeOperationComplete(
       
    77                 MVPbkContactOperationBase& aOperation);
       
    78         void AttributeOperationFailed(
       
    79                 MVPbkContactOperationBase& aOperation,
       
    80                 TInt aError );
       
    81 
       
    82     private: // From CActive
       
    83         void RunL();
       
    84         void DoCancel();
       
    85         TInt RunError(
       
    86                 TInt aError );
       
    87 
       
    88     private: // Implementation
       
    89         CPbk2ContactSpeedDialAttributeAssigner(
       
    90                 MPbk2ContactAssignerObserver& aObserver,
       
    91                 CVPbkContactManager& aContactManager );
       
    92         void AssignAttributeL();
       
    93         void IssueRequest();
       
    94 
       
    95     private: // Data
       
    96         /// Ref: Observer
       
    97         MPbk2ContactAssignerObserver& iObserver;
       
    98         /// Own: Attribute data to assign
       
    99         TPbk2AttributeAssignData iAttributeAssignData;
       
   100         /// Ref: Virtual Phonebook contact manager
       
   101         CVPbkContactManager& iContactManager;
       
   102         /// Own: Attribute assign operation
       
   103         MVPbkContactOperationBase* iAssignOperation;
       
   104         /// Own: The attribute to operate with
       
   105         MVPbkContactAttribute* iAttribute;
       
   106         /// Own: Selected store contact field
       
   107         MVPbkStoreContactField* iStoreContactField;
       
   108     };
       
   109 
       
   110 #endif // CPBK2CONTACTSPEEDDIALATTRIBUTEASSIGNER_H
       
   111 
       
   112 // End of File