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