phonebookui/Phonebook2/UIServices/inc/CPbk2AiwAssignProvider.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 assign service AIW provider.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef CPBK2AIWASSIGNPROVIDER_H
       
    20 #define CPBK2AIWASSIGNPROVIDER_H
       
    21 
       
    22 //  INCLUDES
       
    23 #include <AiwServiceIfMenu.h>
       
    24 #include "MPbk2ConnectionObserver.h"
       
    25 #include <RPbk2LocalizedResourceFile.h>
       
    26 #include <Pbk2ServerAppIPC.h>
       
    27 
       
    28 //  FORWARD DECLARATIONS
       
    29 class CPbk2ServerAppConnection;
       
    30 
       
    31 //  CLASS DECLARATION
       
    32 
       
    33 /**
       
    34  * Phonebook 2 assign service AIW provider.
       
    35  * Responsible for:
       
    36  * - Implementing AIW provider API for assign service
       
    37  * - Verifying parameters passed by the consumer
       
    38  * - Packing the consumer passed data to an IPC package
       
    39  */
       
    40 class CPbk2AiwAssignProvider : public CAiwServiceIfMenu,
       
    41                                public MPbk2ConnectionObserver
       
    42     {
       
    43     public: // Construction and destruction
       
    44 
       
    45         /**
       
    46          * Creates a new instance of this class.
       
    47          *
       
    48          * @return  A new instance of this class.
       
    49          */
       
    50         static CPbk2AiwAssignProvider* NewL();
       
    51 
       
    52         /**
       
    53          * Destructor.
       
    54          */
       
    55         ~CPbk2AiwAssignProvider();
       
    56 
       
    57     public: // From CAiwServiceIfMenu
       
    58         void InitializeMenuPaneL(
       
    59                 CAiwMenuPane& aMenuPane,
       
    60                 TInt aIndex,
       
    61                 TInt aCascadeId,
       
    62                 const CAiwGenericParamList& aInParamList );
       
    63         void HandleMenuCmdL(
       
    64                 TInt aMenuCmdId,
       
    65                 const CAiwGenericParamList& aInParamList,
       
    66                 CAiwGenericParamList& aOutParamList,
       
    67                 TUint aCmdOptions = 0,
       
    68                 const MAiwNotifyCallback* aCallback = NULL );
       
    69 
       
    70     public: // From CAiwServiceIfBase
       
    71         void InitialiseL(
       
    72                 MAiwNotifyCallback& aFrameworkCallback,
       
    73                 const RCriteriaArray& aInterest );
       
    74         void HandleServiceCmdL(
       
    75                 const TInt& aCmdId,
       
    76                 const CAiwGenericParamList& aInParamList,
       
    77                 CAiwGenericParamList& aOutParamList,
       
    78                 TUint aCmdOptions = 0,
       
    79                 const MAiwNotifyCallback* aCallback = NULL );
       
    80 
       
    81     public: // From MPbk2ConnectionObserver
       
    82         void OperationCompleteL(
       
    83                 const TDesC8& aContactLinks,
       
    84                 TInt aExtraResultData,
       
    85                 const TDesC& aField );
       
    86         void OperationCanceledL();
       
    87         void OperationErrorL(
       
    88                 TInt aError );
       
    89         TBool OkToExitL(
       
    90                 TInt aCommandId,
       
    91                 TPbk2ExitCommandParams aExitParameter );
       
    92         TBool AcceptSelectionL(
       
    93                 TInt aNumberOfSelectedContacts,
       
    94                 HBufC8& aContactLink );
       
    95 
       
    96     private: // Implementation
       
    97         CPbk2AiwAssignProvider();
       
    98         void ConstructL();
       
    99         HBufC8* PackParameterToBufferL(
       
   100                 TGenericParamId aParamId,
       
   101                 const CAiwGenericParamList& aInParamList ) const;
       
   102         HBufC16* PackParameterToBuffer16L(
       
   103                 TGenericParamId aParamId,
       
   104                 const CAiwGenericParamList& aInParamList ) const;
       
   105         HBufC8* PackSelectorToBufferL(
       
   106                 const CAiwGenericParamList& aInParamList ) const;
       
   107         HBufC8* PackFilterToBufferL(
       
   108                 const CAiwGenericParamList& aInParamList ) const;
       
   109         void CreateDataPackageL(
       
   110                 const CAiwGenericParamList& aInParamList,
       
   111                 const TGenericParamId aSemanticId );
       
   112         TPbk2AttributeAssignData CreateAttributePackageL(
       
   113                 const CAiwGenericParamList& aInParamList,
       
   114                 const TGenericParamId aSemanticId );
       
   115         void CreateConfigurationPackageL(
       
   116                 const CAiwGenericParamList& aInParamList );
       
   117         void CreateInstructionPackageL(
       
   118                 const CAiwGenericParamList& aInParamList );
       
   119         void ValidateInstructionPackageL();
       
   120         void ValidateMenuServiceL(
       
   121                 const TInt& aCmdId );
       
   122         HBufC* ClientTitlePaneL();
       
   123         HBufC* ClientOrientation() const;
       
   124         void LaunchAttributeAssignL(
       
   125                 const CAiwGenericParamList& aInParamList,
       
   126                 const TGenericParamId aSemanticId );
       
   127         void LaunchDataAssignL(
       
   128                 const CAiwGenericParamList& aInParamList,
       
   129                 const TGenericParamId aSemanticId );
       
   130         HBufC* PackImppParametersToBufferL(
       
   131                 const CAiwGenericParamList& aInParamList);
       
   132 
       
   133     private: // Data
       
   134         /// Own: Phonebook 2 UI services dll resource file
       
   135         RPbk2LocalizedResourceFile iUiServicesResourceFile;
       
   136         /// Own: Connection to server application
       
   137         CPbk2ServerAppConnection* iConnection;
       
   138         /// Own: AIW event param list for event sending
       
   139         CAiwGenericParamList* iEventParamList;
       
   140         /// Ref: AIW notify call back
       
   141         const MAiwNotifyCallback* iCallback;
       
   142         /// Ref: AIW incoming parameter list
       
   143         const CAiwGenericParamList* iInParamList;
       
   144         /// Own: Data IPC package
       
   145         HBufC8* iDataPackage;
       
   146         /// Own: Configuration IPC package
       
   147         HBufC8* iConfigurationPackage;
       
   148         /// Own: Assign instructions IPC package
       
   149         HBufC8* iInstructionsPackage;
       
   150         /// Own: Attribute assign data
       
   151         TPbk2AttributeAssignData iAttributeData;
       
   152     };
       
   153 
       
   154 #endif // CPBK2AIWASSIGNPROVIDER_H
       
   155 
       
   156 // End of File