phonebookui/Phonebook2/ServerApplication/inc/CPbk2FetchService.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 application server fetch service.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef CPBK2FETCHSERVICE_H
       
    20 #define CPBK2FETCHSERVICE_H
       
    21 
       
    22 // INCLUDES
       
    23 #include <e32base.h>
       
    24 #include "MPbk2AppService.h"
       
    25 #include "Pbk2ServerApp.hrh"
       
    26 #include "MPbk2UiServiceObserver.h"
       
    27 
       
    28 // FORWARD DECLARATIONS
       
    29 class MPbk2UiService;
       
    30 
       
    31 // CLASS DECLARATION
       
    32 
       
    33 /**
       
    34  * Phonebook 2 application server fetch service.
       
    35  * Responsible for driving the fetch service. Selecting proper fetch
       
    36  * type and gathering fetch results afterwards.
       
    37  */
       
    38 class CPbk2FetchService : public CBase,
       
    39                           public MPbk2AppService,
       
    40                           public MPbk2UiServiceObserver
       
    41     {
       
    42     public: // Construction and destruction
       
    43 
       
    44         /**
       
    45          * Creates a new instance of this class.
       
    46          *
       
    47          * @param aExitMsg      Exit message.
       
    48          * @param aAcceptMsg    Accept message.
       
    49          * @return  A new instance of this class.
       
    50          */
       
    51         static CPbk2FetchService* NewL(
       
    52                 const RMessage2& aExitMsg,
       
    53                 const RMessage2& aAcceptMsg );
       
    54 
       
    55         /**
       
    56          * Destructor.
       
    57          */
       
    58         ~CPbk2FetchService();
       
    59 
       
    60     public: // From MPbk2AppService
       
    61         void LaunchServiceL(
       
    62                 const RMessage2& aMessage );
       
    63         void CancelService(
       
    64                 const RMessage2& aMessage );
       
    65         void GetResultsL(
       
    66                 const RMessage2& aMessage );
       
    67         void GetResultSizeL(
       
    68                 const RMessage2& aMessage );
       
    69         void TryExitServiceL(
       
    70                 const RMessage2& aMessage );
       
    71         void TryAcceptServiceL(
       
    72                 const RMessage2& aMessage );
       
    73 
       
    74     public: // From MPbk2UiServiceObserver
       
    75         void ServiceComplete();
       
    76         void ServiceCanceled();
       
    77         void ServiceAborted();
       
    78         void ServiceError(
       
    79                 TInt aErrorCode );
       
    80         void CompleteExitMessage(
       
    81                 TInt aExitCommandId );
       
    82         void CompleteAcceptMsg(
       
    83                 const TDesC8& aMarkedEntries,
       
    84                 const TDesC8& aLinkData );
       
    85 
       
    86     private: // Implementation
       
    87         CPbk2FetchService(
       
    88                 const RMessage2& aExitMsg,
       
    89                 const RMessage2& aAcceptMsg );
       
    90         void LaunchEntryFetchL(
       
    91                 const RMessage2& aMessage,
       
    92                 TPbk2FetchType aFetchType );
       
    93         void LaunchItemFetchL(
       
    94                 const RMessage2& aMessage,
       
    95                 TPbk2FetchType aFetchType );
       
    96         TPbk2FetchType FetchTypeL(
       
    97                 const RMessage2& aMessage );
       
    98 
       
    99     private: // Data
       
   100         /// Own: Fetch complete message
       
   101         RMessage2 iFetchCompleteMsg;
       
   102         /// Ref: Exit message
       
   103         const RMessage2& iExitMsg;
       
   104         /// Ref: Accept message
       
   105         const RMessage2& iAcceptMsg;
       
   106         /// Own: Ui service that performs the fetch
       
   107         MPbk2UiService* iUiService;
       
   108     };
       
   109 
       
   110 #endif // CPBK2FETCHSERVICE_H
       
   111 
       
   112 // End of File