phonebookui/Phonebook2/ServerApplication/inc/CPbk2SelectUpdateEmptyPropertyPhase.h
changeset 0 e686773b3f54
child 58 d4f567ce2e7c
equal deleted inserted replaced
-1:000000000000 0:e686773b3f54
       
     1 /*
       
     2 * Copyright (c) 2005-2008 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 server app assign update
       
    15 *              : empty property phase.
       
    16 *
       
    17 */
       
    18 
       
    19 
       
    20 #ifndef CPBK2SELECTUPDATEEMPTYPROPERTYPHASE_H
       
    21 #define CPBK2SELECTUPDATEEMPTYPROPERTYPHASE_H
       
    22 
       
    23 // INCLUDES
       
    24 #include <e32base.h>
       
    25 #include "MPbk2ServicePhase.h"
       
    26 #include <MVPbkSingleContactOperationObserver.h>
       
    27 
       
    28 // FORWARD DECLARATIONS
       
    29 class MPbk2ServicePhaseObserver;
       
    30 class MPbk2SelectFieldProperty;
       
    31 class MVPbkStoreContact;
       
    32 class MVPbkContactLinkArray;
       
    33 class MVPbkContactOperationBase;
       
    34 class CVPbkContactLinkArray;
       
    35 
       
    36 
       
    37 // CLASS DECLARATION
       
    38 
       
    39 /**
       
    40  * Phonebook 2 server app assign update empty property phase.
       
    41  * Responsible for implementing the select property service
       
    42  * phase in no data / empty data cases for entry update service.
       
    43  */
       
    44 class CPbk2SelectUpdateEmptyPropertyPhase : public CBase,
       
    45                                    public MPbk2ServicePhase,
       
    46                                    private MVPbkSingleContactOperationObserver
       
    47     {
       
    48     public: // Construction
       
    49 
       
    50         /**
       
    51          * Creates a new instance of this class.
       
    52          *
       
    53          * @param aObserver             Observer.
       
    54          * @param aContactLinks         Contact links.
       
    55          * @param aSelectFieldProperty  Select field property.
       
    56          * @param aResult               Selection result.
       
    57          * @param aNoteFlags            Information note flags.
       
    58          * @return  A new instance of this class.
       
    59          */
       
    60         static CPbk2SelectUpdateEmptyPropertyPhase* NewL(
       
    61                 MPbk2ServicePhaseObserver& aObserver,
       
    62                 MVPbkContactLinkArray& aContactLinks,
       
    63                 MPbk2SelectFieldProperty*& aSelectFieldProperty,
       
    64                 TInt& aResult,
       
    65                 TUint& aNoteFlags );
       
    66 
       
    67         /**
       
    68          * Destructor.
       
    69          */
       
    70         ~CPbk2SelectUpdateEmptyPropertyPhase();
       
    71 
       
    72     public: // From MPbk2ServicePhase
       
    73         void LaunchServicePhaseL();
       
    74         void CancelServicePhase();
       
    75         void RequestCancelL(
       
    76                 TInt aExitCommandId );
       
    77         void AcceptDelayedL(
       
    78                 const TDesC8& aContactLinkBuffer );
       
    79         MVPbkContactLinkArray* Results() const;
       
    80         MVPbkStoreContact* TakeStoreContact();
       
    81         TInt ExtraResultData() const; 
       
    82         HBufC* FieldContent() const;
       
    83 
       
    84     private: // From MVPbkSingleContactOperationObserver
       
    85         void VPbkSingleContactOperationComplete(
       
    86                 MVPbkContactOperationBase& aOperation,
       
    87                 MVPbkStoreContact* aContact );
       
    88         void VPbkSingleContactOperationFailed(
       
    89                 MVPbkContactOperationBase& aOperation,
       
    90                 TInt aError );
       
    91 
       
    92     private: // Implementation
       
    93         CPbk2SelectUpdateEmptyPropertyPhase(
       
    94                 MPbk2ServicePhaseObserver& aObserver,
       
    95                 MPbk2SelectFieldProperty*& aSelectFieldProperty,
       
    96                 TInt& aResult,
       
    97                 TUint& aNoteFlags );
       
    98         void ConstructL(
       
    99         		MVPbkContactLinkArray& aContactLinks );
       
   100         void RetrieveContactL();
       
   101 
       
   102     private: // Data
       
   103         /// Ref: Observer
       
   104         MPbk2ServicePhaseObserver& iObserver;
       
   105         /// Own: Store contact
       
   106         MVPbkStoreContact* iStoreContact;
       
   107         /// Ref: Select field property
       
   108         MPbk2SelectFieldProperty*& iSelectFieldProperty;
       
   109         /// Own: Contact links
       
   110         CVPbkContactLinkArray* iContactLinks;
       
   111         /// Own: Contact retrieve operation
       
   112         MVPbkContactOperationBase* iRetrieveOperation;
       
   113         /// Own: Selected field index
       
   114         TInt& iResult;
       
   115     };
       
   116 
       
   117 #endif // CPBK2SELECTUPDATEEMPTYPROPERTYPHASE_H
       
   118 
       
   119 // End of File