phoneengine/PhoneCntFinder/ContactService/inc/cphcntvpbkthumbnailloader.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:  Thumbnail loader for loading thumbnails contact store.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef CPHCNTVPBKTHUMBNAILLOADER_H
       
    20 #define CPHCNTVPBKTHUMBNAILLOADER_H
       
    21 
       
    22 #include <MPbk2ImageOperationObservers.h>
       
    23 
       
    24 #include "cphcntthumbnailloaderbase.h"
       
    25 #include "MPhCntContactFetchObserver.h"
       
    26 
       
    27 class MPhCntContactStores;
       
    28 class CPhCntContact;
       
    29 class MVPbk2ImageOperation;
       
    30 
       
    31 /**
       
    32  *  Loader for loading thumbnails from contact store.
       
    33  *
       
    34  *  @lib PhoneCntFinder
       
    35  *  @since S60 v3.1
       
    36  */
       
    37 NONSHARABLE_CLASS( CPhCntVPbkThumbnailLoader ) : 
       
    38     public CPhCntThumbnailLoaderBase,
       
    39     private MPhCntContactFetchObserver,
       
    40     private MPbk2ImageGetObserver
       
    41     {
       
    42 
       
    43 public:
       
    44 
       
    45     /**
       
    46      * Static constructor.
       
    47      *
       
    48      * @since S60 v3.1
       
    49      * @param aContactStores Contact stores, where thunbnails are loaded.
       
    50      */
       
    51     static CPhCntVPbkThumbnailLoader* NewL( 
       
    52         MPhCntContactStores& aContactStores );
       
    53 
       
    54     /**
       
    55      * Static constructor.
       
    56      *
       
    57      * @since S60 v3.1
       
    58      * @param aContactStores Contact stores, where thunbnails are loaded.
       
    59      */
       
    60     static CPhCntVPbkThumbnailLoader* NewLC(
       
    61         MPhCntContactStores& aContactStores );
       
    62 
       
    63     /** 
       
    64      * Destructor.
       
    65      *
       
    66      * @since S60 v3.1
       
    67      */
       
    68     virtual ~CPhCntVPbkThumbnailLoader();
       
    69     
       
    70 // From base class MPhCntThumbnailLoader.
       
    71 
       
    72     /**
       
    73      * From base class MPhCntThumbnailLoader.
       
    74      *
       
    75      * @since S60 v3.1
       
    76      * @see MPhCntThumbnailLoader
       
    77      */
       
    78     void Release();
       
    79     
       
    80     /**
       
    81      * From base class MPhCntThumbnailLoader.
       
    82      *
       
    83      * @since S60 v3.1
       
    84      * @see MPhCntThumbnailLoader
       
    85      */
       
    86     void Cancel();
       
    87 
       
    88 protected:
       
    89 
       
    90 // from base class CPhCntThumbnailLoaderBase
       
    91     
       
    92     /**
       
    93      * From CPhCntThumbnailLoaderBase
       
    94      *
       
    95      * @since S60 v3.1
       
    96      * @see CPhCntThumbnailLoaderBase
       
    97      */
       
    98     void DoLoadL( const CPhCntContactId& aContactId );
       
    99     
       
   100 private:
       
   101 
       
   102 // From base class MPhCntContactFetchObserver
       
   103 
       
   104     /**
       
   105      * From MPhCntContactFetchObserver
       
   106      *
       
   107      * @since S60 v3.1
       
   108      * @see MPhCntContactFectchObserver
       
   109      */
       
   110     void ContactReceived( CPhCntContact* aContact, TInt aError );
       
   111     
       
   112 // from base class MPbk2ImageGetObserver
       
   113 
       
   114     /**
       
   115      * From base class MPbk2ImageGetObserver
       
   116      *
       
   117      * @since S60 v3.1
       
   118      * @see MPbk2ImageGetObserver
       
   119      */
       
   120     void Pbk2ImageGetComplete
       
   121         (MPbk2ImageOperation& aOperation, CFbsBitmap* aBitmap);
       
   122 
       
   123     /**
       
   124      * From base class MPbk2ImageGetObserver
       
   125      *
       
   126      * @since S60 v3.1
       
   127      * @see MPbk2ImageGetObserver
       
   128      */
       
   129     void Pbk2ImageGetFailed
       
   130         (MPbk2ImageOperation& aOperation, TInt aError);
       
   131 
       
   132     CPhCntVPbkThumbnailLoader( MPhCntContactStores& aContactStores );
       
   133 
       
   134     void ConstructL();
       
   135 
       
   136 private: // data
       
   137 
       
   138     /**
       
   139      * Contact stores for fetching contact.
       
   140      * own.
       
   141      */
       
   142     MPhCntContactStores* iContactStores;
       
   143     
       
   144     /**
       
   145      * Contact received.
       
   146      * Own.
       
   147      */
       
   148     CPhCntContact* iReceivedContact;
       
   149     
       
   150     /**
       
   151      * Thumbnail loading operation
       
   152      * Own.
       
   153      */
       
   154     MPbk2ImageOperation* iOperation;
       
   155 
       
   156     };
       
   157 
       
   158 #endif // CPHCNTVPBKTHUMBNAILLOADER_H