imstutils/imconversationview/imcvuiengine/inc/cimcvenginestoragelistener.h
branchRCL_3
changeset 28 3104fc151679
parent 27 2b7283837edb
child 29 9a48e301e94b
equal deleted inserted replaced
27:2b7283837edb 28:3104fc151679
     1 /*
       
     2 * Copyright (c) 2008-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:  active object class for interacting with servicetab for link and Display Name
       
    15 *
       
    16 */
       
    17 
       
    18 #ifndef CIMCVENGINESTORAGELISTENER_H
       
    19 #define CIMCVENGINESTORAGELISTENER_H
       
    20 
       
    21 #include <e32base.h>
       
    22 #include <e32property.h>
       
    23 #include <AknWaitDialog.h>
       
    24 #include "cimcvkeys.h"
       
    25 
       
    26 _LIT(KDelimiter, ":");
       
    27 /**
       
    28  * constant to define the size of the contact link
       
    29  */
       
    30 #define KMaxDisplayNameContactLinkLength 512
       
    31 /**
       
    32  * constant to define the size of the contact link
       
    33  */
       
    34 #define KMaxServiceIdLength 3
       
    35 
       
    36 //forword declaration.
       
    37 class MIMCVEngineStorageObserver
       
    38         {
       
    39     public : 
       
    40         virtual  void HandleServiceBuddyDetailsFetchedL(TInt aServiceId, 
       
    41                 const TDesC& aXspId,
       
    42                 const TDesC8 & aContactLink,
       
    43                 const TDesC & aDisplayName ) = 0 ;
       
    44    
       
    45         };
       
    46 
       
    47 class CIMCVEngineStorageListener : public CActive
       
    48     {
       
    49 public :
       
    50         // Constructor
       
    51         /**
       
    52          * Creates a new CIMCVEngineStorageListener.
       
    53          * @param aTabbedView, reference to tabbedview
       
    54          * @return New instance of this class         
       
    55          */
       
    56         static CIMCVEngineStorageListener* NewL(MIMCVEngineStorageObserver& aObserver);
       
    57         
       
    58           /**
       
    59            * Standard C++ destructor.
       
    60            */
       
    61          ~CIMCVEngineStorageListener();
       
    62          
       
    63          
       
    64          /**
       
    65           * Get the Display name and Contact link information.
       
    66           * @param aServiceId, service id for which info requested.
       
    67           * @param aXspID, xsp Id of contact.
       
    68           */
       
    69          void GetContactLinkInfoL(TInt aServiceId, const TDesC& aXspID);
       
    70          
       
    71 private : // From CActive
       
    72 
       
    73         /**
       
    74         *  RunL
       
    75         */
       
    76         void RunL();  
       
    77         
       
    78         /**
       
    79         *  DoCancel
       
    80         */
       
    81         void DoCancel();
       
    82         
       
    83         /*
       
    84          * RunError
       
    85          */
       
    86         TInt RunError ( TInt aError );
       
    87 
       
    88 private: // Implementation
       
    89        /**
       
    90         * Standard C++ constructor
       
    91         * @param aTabbedView, reference to tabbedview
       
    92         */
       
    93         CIMCVEngineStorageListener(MIMCVEngineStorageObserver& aObserver);
       
    94 
       
    95        /**
       
    96         * Performs the 2nd phase of construction.
       
    97         */
       
    98        void ConstructL();
       
    99        
       
   100        /**
       
   101         * start listening
       
   102         */
       
   103        void StartListening();
       
   104 
       
   105        /**
       
   106         * stop listening
       
   107         */
       
   108        void StopListening();
       
   109        
       
   110 private :
       
   111     
       
   112     // owns , property to use
       
   113     RProperty iProperty;    
       
   114     // not owned
       
   115     MIMCVEngineStorageObserver& iObserver;
       
   116     
       
   117     // own active sheduler 
       
   118     CActiveSchedulerWait    iWait;
       
   119  	
       
   120     };
       
   121 
       
   122 #endif /*CIMCVENGINESTORAGELISTENER_H*/