meetingrequest/mrgui/inc/cesmraddressinfohandler.h
changeset 0 8466d47a6819
child 12 4ce476e64c59
equal deleted inserted replaced
-1:000000000000 0:8466d47a6819
       
     1 /*
       
     2 * Copyright (c) 2007-2009 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:  ESMR GUI address info handler
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 #ifndef CESMRADDRESSINFOHANDLER_H
       
    21 #define CESMRADDRESSINFOHANDLER_H
       
    22 
       
    23 // Includes
       
    24 #include <e32base.h>
       
    25 #include <MVPbkSingleContactOperationObserver.h>
       
    26 #include <AiwCommon.h>
       
    27 
       
    28 #include "resmrstatic.h"
       
    29 #include "cesmrcontactmanagerhandler.h"
       
    30 
       
    31 // Forward declarations
       
    32 class RESMRStatic;
       
    33 class CVPbkContactManager;
       
    34 class CAiwServiceHandler;
       
    35 class MESMRContactHandlerObserver;
       
    36 class MVPbkContactLinkArray;
       
    37 class MVPbkContactOperationBase;
       
    38 class MVPbkContactLink;
       
    39 class CAknInformationNote;
       
    40 class MESMRCalEntry;
       
    41 
       
    42 /**
       
    43 * CESMRAddressInfoHandler encapsulates the handling of search from contacts command
       
    44 * functionality
       
    45 * 
       
    46 * @lib esmrgui.lib
       
    47 */
       
    48 NONSHARABLE_CLASS(CESMRAddressInfoHandler) : public CBase, 
       
    49                                     public MVPbkSingleContactOperationObserver,
       
    50                                     public MAiwNotifyCallback
       
    51 {
       
    52 public:
       
    53     /**
       
    54      * Creates new CESMRAddressInfoHandler object. Ownership
       
    55      * is transferred to caller.
       
    56      * @return Pointer to created CESMRAddressInfoHandler object.
       
    57      */
       
    58     static CESMRAddressInfoHandler* NewL();	
       
    59     
       
    60     /**
       
    61      * C++ destructor
       
    62      */
       
    63 	virtual ~CESMRAddressInfoHandler();
       
    64 
       
    65     /**
       
    66     * Starts single item fetch from virtual phonebook
       
    67     * @param aEntry calendar entry to update.
       
    68     * @return ETrue if aEntry was modified. 
       
    69     */
       
    70     TBool SearchAddressFromContactsL( MESMRCalEntry& aEntry );
       
    71 
       
    72 protected: //From MVPbkSingleContactOperationObserver
       
    73     
       
    74     void VPbkSingleContactOperationComplete(
       
    75                     MVPbkContactOperationBase& aOperation,
       
    76                     MVPbkStoreContact* aContact );
       
    77 	
       
    78     void VPbkSingleContactOperationFailed(
       
    79                     MVPbkContactOperationBase& aOperation, 
       
    80                     TInt aError );
       
    81     
       
    82 protected: // from MAiwNotifyCallback
       
    83     
       
    84     TInt HandleNotifyL( TInt aCmdId,
       
    85                         TInt aEventId,
       
    86                         CAiwGenericParamList& aEventParamList,
       
    87                         const CAiwGenericParamList& aInParamList);
       
    88     
       
    89 private: // Implementation
       
    90     
       
    91     enum TAddressType
       
    92         {
       
    93         EHomeAddress,
       
    94         EWorkAddress,
       
    95         EGeneralAddress
       
    96         };
       
    97     
       
    98     enum TAddressFormatType
       
    99         {
       
   100         EFormatOneItem = 1,
       
   101         EFormatTwoItems,
       
   102         EFormatThreeItems,
       
   103         EFormatFourItems
       
   104         };
       
   105     
       
   106     CESMRAddressInfoHandler();
       
   107     void ConstructL();
       
   108     void VPbkSingleContactOperationCompleteL(
       
   109                     MVPbkContactOperationBase& aOperation,
       
   110                     MVPbkStoreContact* aContact );
       
   111     void GetContactFieldsL( RArray<TInt>& aFieldIds,
       
   112                             RPointerArray<HBufC>& aNumbers,
       
   113                             MVPbkStoreContact* aContact );
       
   114     void FormatAddressL( RPointerArray<HBufC>& aAddresses,
       
   115                          CESMRAddressInfoHandler::TAddressType aAddressType );
       
   116     void UpdateEntryL( TInt aIndex );
       
   117     
       
   118 private: //data
       
   119 
       
   120     RESMRStatic iESMRStatic; //not own, reference counted
       
   121     
       
   122     CVPbkContactManager* iContactManager; //not own
       
   123     
       
   124     CAiwServiceHandler* iServiceHandler; //own
       
   125     
       
   126     MVPbkContactLinkArray* iLinksSet;//own
       
   127     
       
   128     MVPbkContactOperationBase* iLinkOperationFetch;//own
       
   129     
       
   130     RArray<TInt> iAddressGeneralFields;    
       
   131     RArray<TInt> iAddressHomeFields;    
       
   132     RArray<TInt> iAddressWorkFields;
       
   133     
       
   134     RPointerArray<HBufC> iCompleteAddresses; //own
       
   135     
       
   136     MESMRCalEntry* iEntry; //not own
       
   137 
       
   138     CActiveSchedulerWait* iWait; // own
       
   139     
       
   140     TBool iEntryUpdated;
       
   141 };
       
   142 
       
   143 #endif /*CESMRADDRESSINFOHANDLER_H*/