phonebookui/Phonebook2/ServerApplication/inc/CPbk2EntryFetcher.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-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 application server entry fetcher.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef CPBK2ENTRYFETCHER_H
       
    20 #define CPBK2ENTRYFETCHER_H
       
    21 
       
    22 // INCLUDES
       
    23 #include <e32base.h>
       
    24 #include "MPbk2UiService.h"
       
    25 #include "mpbk2serverappstartupobserver.h"
       
    26 #include "MPbk2ServicePhaseObserver.h"
       
    27 
       
    28 // FORWARD DECLARATIONS
       
    29 class CVPbkContactStoreUriArray;
       
    30 class MPbk2UiServiceObserver;
       
    31 class CVPbkFieldTypeSelector;
       
    32 class CPbk2ServerAppStoreManager;
       
    33 class MPbk2ServicePhase;
       
    34 
       
    35 // CLASS DECLARATION
       
    36 
       
    37 /**
       
    38  * Phonebook 2 application server entry fetcher.
       
    39  * Responsible for driving the entry fetch service phases.
       
    40  */
       
    41 class CPbk2EntryFetcher : public CBase,
       
    42                           public MPbk2UiService,
       
    43                           public MPbk2ServicePhaseObserver,
       
    44                           private MPbk2ServerAppStartupObserver
       
    45     {
       
    46     public: // Construction
       
    47 
       
    48         /**
       
    49          * Creates a new instance of this class.
       
    50          *
       
    51          * @param aMessage      Client-server message.
       
    52          * @param aObserver     UI service observer.
       
    53          * @param aFetchType    Fetch type.
       
    54          * @return  A new instance of this class.
       
    55          */
       
    56         static CPbk2EntryFetcher* NewL(
       
    57                 const RMessage2& aMessage,
       
    58                 MPbk2UiServiceObserver& aObserver,
       
    59                 TPbk2FetchType aFetchType );
       
    60 
       
    61         /**
       
    62          * Destructor.
       
    63          */
       
    64         ~CPbk2EntryFetcher();
       
    65 
       
    66     public: // From MPbk2UiService
       
    67         void LaunchServiceL();
       
    68         void CancelService();
       
    69         void AcceptDelayedContactsL(
       
    70                 const TDesC8& aContactLinkBuffer );
       
    71         void DenyDelayedContactsL(
       
    72                 const TDesC8& aContactLinkBuffer );
       
    73         void ExitServiceL(
       
    74                 TInt aExitCommandId );
       
    75         void ServiceResults(TServiceResults* aResults) const;
       
    76 
       
    77     public: // From MPbk2ServicePhaseObserver
       
    78         void NextPhase(
       
    79                 MPbk2ServicePhase& aPhase );
       
    80         void PreviousPhase(
       
    81                 MPbk2ServicePhase& aPhase );
       
    82         void PhaseCanceled(
       
    83                 MPbk2ServicePhase& aPhase );
       
    84         void PhaseAborted(
       
    85                 MPbk2ServicePhase& aPhase );
       
    86         void PhaseError(
       
    87                 MPbk2ServicePhase& aPhase,
       
    88                 TInt aErrorCode );
       
    89         TBool PhaseOkToExit(
       
    90                 MPbk2ServicePhase& aPhase,
       
    91                 TInt aCommandId );
       
    92         void PhaseAccept(
       
    93                 MPbk2ServicePhase& aPhase,
       
    94                 const TDesC8& aMarkedEntries,
       
    95                 const TDesC8& aLinkData );
       
    96 
       
    97     private: // From MPbk2ServerAppStartupObserver
       
    98         void ContactUiReadyL(
       
    99                 MPbk2StartupMonitor& aStartupMonitor );
       
   100         void  StartupCanceled(
       
   101                 TInt aErrorCode );
       
   102 
       
   103     private: // Implementation
       
   104         CPbk2EntryFetcher(
       
   105                 MPbk2UiServiceObserver& aObserver,
       
   106                 TPbk2FetchType aFetchType );
       
   107         void ConstructL(
       
   108                 const RMessage2& aMessage );
       
   109         void LaunchFetchPhaseL();
       
   110 
       
   111     private: // Data
       
   112         /// Ref: UI service observer
       
   113         MPbk2UiServiceObserver& iObserver;
       
   114         /// Own: Fetch type
       
   115         TPbk2FetchType iFetchType;
       
   116         /// Own: Loaded store URIs
       
   117         CVPbkContactStoreUriArray* iStoreUris;
       
   118         /// Own: Initially marked contact links
       
   119         MVPbkContactLinkArray* iPreselectedContacts;
       
   120         /// Own: Fetch resource id
       
   121         TInt iFetchResId;
       
   122         /// Own: Contact view filter
       
   123         CVPbkFieldTypeSelector* iContactViewFilter;
       
   124         /// Own: Server app store manager
       
   125         CPbk2ServerAppStoreManager* iStoreManager;
       
   126         /// Own: Fetch phase
       
   127         MPbk2ServicePhase* iFetchPhase;
       
   128         /// Own: ETrue if using default store configuration
       
   129         TBool iUseDeviceConfig;
       
   130     };
       
   131 
       
   132 #endif // CPBK2ENTRYFETCHER_H
       
   133 
       
   134 // End of File