imagehandlingutilities/thumbnailmanager/thumbnailserver/inc/thumbnaildecodetask.h
changeset 0 2014ca87e772
child 11 dea39715fc05
equal deleted inserted replaced
-1:000000000000 0:2014ca87e772
       
     1 /*
       
     2 * Copyright (c) 2006-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:  Task for decoding  a thumbnail
       
    15  *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef THUMBNAILDECODETASK_H
       
    20 #define THUMBNAILDECODETASK_H
       
    21 
       
    22 #include <apmstd.h>
       
    23 
       
    24 #include "thumbnailtask.h"
       
    25 #include "thumbnailprovider.h"
       
    26 
       
    27 
       
    28 class CThumbnailServer;
       
    29 
       
    30 /**
       
    31  *  Task for decoding a thumbnail.
       
    32  *
       
    33  *  @since S60 v5.0
       
    34  */
       
    35 class CThumbnailDecodeTask: public CThumbnailTask,
       
    36     public MThumbnailProviderObserver
       
    37     {
       
    38 public:
       
    39 
       
    40     /**
       
    41      * C++ default constructor
       
    42      *
       
    43      * @since S60 v5.0
       
    44      * @param aProcessor Processor object for running tasks.
       
    45      * @param aServer Thumbnail server in use.
       
    46      * @param aBuffer Image in JPEG mode.
       
    47      * @param aPriority Priority of the request.
       
    48      * @return New CThumbnailDecodeTask object.
       
    49      */
       
    50     CThumbnailDecodeTask( CThumbnailTaskProcessor& aProcessor, CThumbnailServer& aServer, TDesC8* aBuffer,
       
    51             TInt aPriority, TDisplayMode aDisplayMode);
       
    52 
       
    53     /**
       
    54      * Destructor.
       
    55      *
       
    56      * @since S60 v5.0
       
    57      */
       
    58     virtual ~CThumbnailDecodeTask();
       
    59 
       
    60     /**
       
    61      * StartL
       
    62      *
       
    63      * @since S60 v5.0
       
    64      */
       
    65     void StartL();
       
    66 
       
    67     /**
       
    68      * Handles an active object's request completion event.
       
    69      *
       
    70      * @since S60 v5.0
       
    71      */
       
    72     void RunL();
       
    73 
       
    74     /**
       
    75      * Implements cancellation of an outstanding request.
       
    76      *
       
    77      * @since S60 v5.0
       
    78      */
       
    79     void DoCancel();
       
    80 
       
    81 private:
       
    82 
       
    83    /**
       
    84      * For notifying when task has been finished.
       
    85      *
       
    86      * @since S60 v5.0
       
    87      * @param aError Error code.
       
    88      * @param aBitmap Thumbnail image.
       
    89      * @param aOriginalSize Original image size.
       
    90      */
       
    91     void ThumbnailProviderReady( const TInt aError, CFbsBitmap* aBitmap, const
       
    92         TSize& aOriginalSize, const TBool aEXIF, const TBool aPortait );
       
    93 
       
    94 
       
    95 private:
       
    96     // Data
       
    97 
       
    98     /**
       
    99      * Server.
       
   100      */
       
   101     CThumbnailServer& iServer;
       
   102   
       
   103     /**
       
   104      * Image buffer
       
   105      */    
       
   106     TDesC8* iBuffer;
       
   107 
       
   108     /**
       
   109      * Size of the original image.
       
   110      */
       
   111     TSize iOriginalSize;
       
   112 
       
   113     /**
       
   114      * Thumbnail provider implementation.
       
   115      * Not own.
       
   116      */
       
   117     CThumbnailProvider* iProvider;
       
   118     
       
   119     /**
       
   120      * If set, scaled bitmap must be released from pool.
       
   121      */
       
   122    TInt iBitmapHandle;
       
   123    
       
   124    /**
       
   125     * Temporary buffer for client/server parameters
       
   126     */
       
   127     TThumbnailRequestParamsPckgBuf iParamsBuf;
       
   128     
       
   129     /*
       
   130      * Displaymode of requested TN
       
   131      */
       
   132     TDisplayMode iDisplayMode;
       
   133     
       
   134 };
       
   135 
       
   136 #endif // THUMBNAILGENERATETASK_H