phoneengine/PhoneCntFinder/inc/cphcntpbkthumbnailloader.h
changeset 0 5f000ab63145
equal deleted inserted replaced
-1:000000000000 0:5f000ab63145
       
     1 /*
       
     2 * Copyright (c) 2006 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:  Loads thumbnail from contact engine.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef CPHCNTPBKTHUMBNAILLOADER_H
       
    20 #define CPHCNTPBKTHUMBNAILLOADER_H
       
    21 
       
    22 #include <e32base.h>
       
    23 #include <MPbkThumbnailOperationObservers.h>
       
    24 
       
    25 #include "cphcntthumbnailloaderbase.h"
       
    26 
       
    27 class MPhoneCntPbkOwner;
       
    28 class CPhCntContactId;
       
    29 class MPbkThumbnailOperation;
       
    30 class CPbkContactItem;
       
    31 class CPbkThumbnailManager;
       
    32 class MPbkThumbnailGetObserver;
       
    33 
       
    34 
       
    35 /**
       
    36  *  Loads thumbnail from contact engine.
       
    37  *
       
    38  *  @lib S60 PhoneCntFinder
       
    39  *  @since S60 v3.1
       
    40  */
       
    41 NONSHARABLE_CLASS( CPhCntPbkThumbnailLoader ) : 
       
    42     public CPhCntThumbnailLoaderBase,
       
    43     private MPbkThumbnailGetObserver
       
    44     {
       
    45 public:
       
    46     
       
    47     /**
       
    48      * Static constructor.
       
    49      *
       
    50      * @since S60 v3.1
       
    51      * @param aOwner Owner of phone book.
       
    52      */
       
    53     static CPhCntPbkThumbnailLoader* NewL( MPhoneCntPbkOwner& aOwner );
       
    54 
       
    55     /**
       
    56      * Static constructor.
       
    57      *
       
    58      * @since S60 v3.1
       
    59      * @param aOwner Owner of phone book.
       
    60      */
       
    61     static CPhCntPbkThumbnailLoader* NewLC( MPhoneCntPbkOwner& aOwner );
       
    62 
       
    63     /**
       
    64      * Destructor.
       
    65      *
       
    66      * @since S60 v3.1
       
    67      */
       
    68     virtual ~CPhCntPbkThumbnailLoader();
       
    69 
       
    70 // From base class CPhCntThumbnailLoaderBase
       
    71     
       
    72     /**
       
    73      * Starts the loading of thumbnail from contact, which is 
       
    74      * identified by contact id.
       
    75      *
       
    76      * @since S60 v3.1
       
    77      * @param aContactId Contact id, which identifies the contact where thumbnail
       
    78      * is loaded.
       
    79      */
       
    80      void DoLoadL( const CPhCntContactId& aContactId );
       
    81      
       
    82 // From base class MPhCntThumbnailLoader
       
    83         
       
    84     /**
       
    85      * From MPhCntThumbnailLoader
       
    86      * 
       
    87      * @since S60 v3.1
       
    88      * @see MPhCntThumbnailLoader
       
    89      */
       
    90     void Release();
       
    91     
       
    92     /**
       
    93      * From MPhCntThumbnailLoader
       
    94      * 
       
    95      * @since S60 v3.1
       
    96      * @see MPhCntThumbnailLoader
       
    97      */
       
    98     void Cancel();
       
    99      
       
   100 private:
       
   101 
       
   102     /**
       
   103      * From MPbkThumbnailGetObserver, called when 
       
   104      * thumbnail loading is completed.
       
   105      *
       
   106      * @param aOperation the completed operation.
       
   107      * @param aBitmap The loaded bitmap. Callee is responsible of 
       
   108      *                the bitmap.
       
   109      */
       
   110     void PbkThumbnailGetComplete(
       
   111         MPbkThumbnailOperation& aOperation, 
       
   112         CFbsBitmap* aBitmap );
       
   113 
       
   114     /**
       
   115      * From MPbkThumbnailGetObserver, called if 
       
   116      * the thumbnail loading fails.
       
   117      *
       
   118      * @param aOperation the failed operation.
       
   119      * @param aError error code of the failure.
       
   120      */
       
   121     void PbkThumbnailGetFailed(
       
   122         MPbkThumbnailOperation& aOperation, 
       
   123         TInt aError );
       
   124    
       
   125 private:
       
   126 
       
   127     CPhCntPbkThumbnailLoader( 
       
   128         MPhoneCntPbkOwner& aOwner );
       
   129 
       
   130     void ConstructL();
       
   131     
       
   132     /**
       
   133      * Clears all pbk stuff.
       
   134      */
       
   135     void ClearPbk( TBool aMore = ETrue );
       
   136 
       
   137 private: // data
       
   138     
       
   139     /**
       
   140      * Owner of contact access.
       
   141      * Not own.
       
   142      */
       
   143     MPhoneCntPbkOwner& iOwner;
       
   144    
       
   145     /**
       
   146      * Thumnail loading operation.
       
   147      * own.
       
   148      */
       
   149     MPbkThumbnailOperation* iPbkGetOp;
       
   150     
       
   151     /**
       
   152      * Contact.
       
   153      * Own.
       
   154      */
       
   155     CPbkContactItem* iPbkItem;
       
   156     
       
   157     /**
       
   158      * Thumbnail manager.
       
   159      * Own.
       
   160      */
       
   161     CPbkThumbnailManager* iPbkManager;
       
   162     };
       
   163 
       
   164 
       
   165 #endif // CPHCNTPBKTHUMBNAILLOADER_H