imagehandling_plat/thumbnailmanager_api/inc/thumbnailobjectsource.h
branchRCL_3
changeset 58 9e8b0cc88842
parent 38 2b4b06654caa
equal deleted inserted replaced
50:60bb012f1157 58:9e8b0cc88842
   132      * @param aFile File handle.
   132      * @param aFile File handle.
   133      * @param aMimeType MIME type. Optional, but should be specified if known.
   133      * @param aMimeType MIME type. Optional, but should be specified if known.
   134      */
   134      */
   135     void ConstructL( const RFile64& aFile, const TDesC& aMimeType );
   135     void ConstructL( const RFile64& aFile, const TDesC& aMimeType );
   136 
   136 
       
   137 private:
       
   138     // data
       
   139 
       
   140     /**
       
   141      * File
       
   142      */
       
   143     RFile64 iFile;
       
   144 
       
   145     /**
       
   146      * Uri
       
   147      */
       
   148     HBufC* iUri; // own
       
   149 
       
   150     /**
       
   151      * Mime type
       
   152      */
       
   153     HBufC8* iMimeType; // own
       
   154     
       
   155     /**
       
   156      * Buffer
       
   157      */
       
   158     TDesC8* iBuffer; // own
       
   159     
       
   160     /**
       
   161      * Bitmap
       
   162      */
       
   163 
       
   164     CFbsBitmap* iBitmap; // own
       
   165     
       
   166     /**
       
   167      * ThumbnailId
       
   168      */
       
   169     
       
   170     TThumbnailId iThumbnailId; //own
       
   171 	
       
   172 public:
   137     /**
   173     /**
   138      * Symbian 2nd phase constructor can leave.
   174      * Symbian 2nd phase constructor can leave.
   139      *
   175      *
   140      * @since S60 v5.0
   176      * @since S60 v5.0
   141      * @param aURI URI.
   177      * @param aURI URI.
   142      * @param aMimeType MimeType.
   178      * @param aMimeType MimeType.
   143      * @param aThumbnailId ThumbnailId
   179      * @param aThumbnailId ThumbnailId
   144      */
   180      */
   145     void ConstructL( const TDesC& aUri, const TDesC& aMimeType, TThumbnailId aThumbnailId );
   181 	void ConstructL( const TDesC& aUri, const TDesC& aMimeType, TThumbnailId aThumbnailId );
   146 
   182 	    
       
   183     /**
       
   184      * Construct a new CThumbnailObjectSource referring to a buffer 
       
   185      * containing an image.
       
   186      *
       
   187      * @param aBuffer   Buffer.
       
   188      * @param aUri      Object URI or a full path to a file in the file system.
       
   189      * @since S60 v5.0
       
   190      * @return New CThumbnailObjectSource instance.
       
   191      */    
       
   192     IMPORT_C static CThumbnailObjectSource* NewL( CFbsBitmap*  aBitmap, const TDesC& aUri );
       
   193 
       
   194     /**
       
   195      * Construct a new CThumbnailObjectSource referring to a buffer 
       
   196      * containing an image.
       
   197      *
       
   198      * @param aFile     File handle.
       
   199      * @param aUri      Object URI or a full path to a file in the file system.
       
   200      * @since S60 v5.0
       
   201      * @return New CThumbnailObjectSource instance.
       
   202      */        
       
   203     IMPORT_C static CThumbnailObjectSource* NewLC( CFbsBitmap*  aBitmap, const TDesC& aUri );
       
   204  
       
   205     /**
       
   206      * Construct a new CThumbnailObjectSource referring to a buffer 
       
   207      * containing an image.
       
   208      *
       
   209      * @param aBuffer   Buffer.
       
   210      * @param aUri      Object URI or a full path to a file in the file system.
       
   211      * @since S60 v5.0
       
   212      * @return New CThumbnailObjectSource instance.
       
   213      */       
       
   214     IMPORT_C static CThumbnailObjectSource* NewL( TDesC8* aBuffer,  TDesC& aMimeType, const TDesC& aUri );
       
   215     
       
   216     /**
       
   217      * Construct a new CThumbnailObjectSource referring to a buffer 
       
   218      * containing an image.
       
   219      *
       
   220      * @param aBuffer   Buffer.
       
   221      * @param aMimeType MIME type. Optional, but should be specified if known.
       
   222      * @param aUri      Object URI or a full path to a file in the file system.
       
   223      * @since S60 v5.0
       
   224      * @return New CThumbnailObjectSource instance.
       
   225      */       
       
   226     IMPORT_C static CThumbnailObjectSource* NewLC( TDesC8* aBuffer,  TDesC& aMimeType, const TDesC& aUri);
       
   227 
       
   228     /**
       
   229      * Construct a new CThumbnailObjectSource referring to an URI.
       
   230      * @param aUri      Object URI or a full path to a file in the file system.
       
   231      * @param aMimeType MIME type. Optional, but should be specified if known.
       
   232      * @since S60 v5.0
       
   233      * @return New CThumbnailObjectSource instance.
       
   234      */
       
   235     IMPORT_C static CThumbnailObjectSource* NewL( const TDesC& aUri, 
       
   236             TThumbnailId aThumbnailId = 0, const TDesC& aMimeType = KNullDesC );
       
   237 
       
   238     /**
       
   239      * Construct a new CThumbnailObjectSource referring to an URI.
       
   240      * @param aUri      Object URI or a full path to a file in the file system.
       
   241      * @param aMimeType MIME type. Optional, but should be specified if known.
       
   242      * @since S60 v5.0
       
   243      * @return New CThumbnailObjectSource instance.
       
   244      */
       
   245     IMPORT_C static CThumbnailObjectSource* NewLC( const TDesC& aUri,
       
   246             TThumbnailId aThumbnailId = 0, const TDesC& aMimeType = KNullDesC );
       
   247     
       
   248 	 
       
   249     /**
       
   250      * Returns source buffer.
       
   251      *
       
   252      * @since S60 v5.0
       
   253      * @return buffer
       
   254      */  
       
   255     IMPORT_C TDesC8* Buffer();
       
   256     
       
   257     /**
       
   258      * Gets ownership of buffer from source object.
       
   259      * After that Buffer() returns NULL.
       
   260      *
       
   261      * @since S60 v5.0
       
   262      * @return buffer
       
   263      */
       
   264     IMPORT_C TDesC8* GetBufferOwnership();
       
   265     
       
   266     /**
       
   267      * Gets MIME type.
       
   268      *
       
   269      * @since S60 v5.0
       
   270      * @return MIME type
       
   271      */   
       
   272     IMPORT_C const TDesC8& MimeType();
       
   273     
       
   274     /**
       
   275      * Gets ThumbnailId.
       
   276      *
       
   277      * @since S60 v5.0
       
   278      * @return ThumbnailId 
       
   279      */ 
       
   280     
       
   281     IMPORT_C TThumbnailId Id(); 
       
   282 	    
   147     /**
   283     /**
   148      * Symbian 2nd phase constructor can leave.
   284      * Symbian 2nd phase constructor can leave.
   149      *
   285      *
   150      * @since S60 v5.0
   286      * @since S60 v5.0
   151      * @param aBitmap Bitmap.
   287      * @param aBitmap Bitmap.
   152      * @param aURI URI.
   288      * @param aURI URI.
   153      */   
   289      */   
   154     void ConstructL( CFbsBitmap* aBitmap, const TDesC& aUri );
   290     void ConstructL( CFbsBitmap* aBitmap, const TDesC&
       
   291             aUri );
   155 
   292 
   156     /**
   293     /**
   157      * Symbian 2nd phase constructor can leave.
   294      * Symbian 2nd phase constructor can leave.
   158      *
   295      *
   159      * @since S60 v5.0
   296      * @since S60 v5.0
   160      * @param aBuffer Buffer.
   297      * @param aBuffer Buffer.
   161      * @param aMimeType MIME type. Optional, but should be specified if known.
   298      * @param aMimeType MIME type. Optional, but should be specified if known.
   162      * @param aURI URI.
   299      * @param aURI URI.
   163      */
   300      */
   164     void ConstructL( TDesC8* aBuffer, const TDesC& aMimeType, const TDesC& aUri );    
   301     void ConstructL( TDesC8* aBuffer, const TDesC&
   165     
   302         aMimeType, const TDesC& aUri );
   166     /**
       
   167      * Symbian 2nd phase constructor can leave.
       
   168      *
       
   169      * @since Symbian^3
       
   170      * @param aUri Object URI or a full path to a file in the file system.
       
   171      * @param aTargetUri      For linking the thumbnail to a different URI.
       
   172      * @param aMimeType MIME type. Optional, but should be specified if known.
       
   173      */
       
   174     void ConstructL( const TDesC& aUri, const TDesC& aTargetUri, const TDesC& aMimeType );
       
   175     
       
   176 private:
       
   177     // data
       
   178 
       
   179     /**
       
   180      * File
       
   181      */
       
   182     RFile64 iFile;
       
   183 
       
   184     /**
       
   185      * Uri
       
   186      */
       
   187     HBufC* iUri; // own
       
   188 
       
   189     /**
       
   190      * Mime type
       
   191      */
       
   192     HBufC8* iMimeType; // own
       
   193     
       
   194     /**
       
   195      * Buffer
       
   196      */
       
   197     TDesC8* iBuffer; // own
       
   198     
       
   199     /**
       
   200      * Bitmap
       
   201      */
       
   202     CFbsBitmap* iBitmap; // own
       
   203     
       
   204     /**
       
   205      * ThumbnailId
       
   206      */    
       
   207     TThumbnailId iThumbnailId; //own
       
   208     
       
   209     /**
       
   210      * Uri
       
   211      */
       
   212     HBufC* iTargetUri; // own
       
   213 	
       
   214 public:
       
   215 	    
       
   216     /**
       
   217      * Construct a new CThumbnailObjectSource referring to a buffer 
       
   218      * containing an image.
       
   219      *
       
   220      * @param aBuffer   Buffer.
       
   221      * @param aUri      Object URI or a full path to a file in the file system.
       
   222      * @since S60 v5.0
       
   223      * @return New CThumbnailObjectSource instance.
       
   224      */    
       
   225     IMPORT_C static CThumbnailObjectSource* NewL( CFbsBitmap*  aBitmap, const TDesC& aUri );
       
   226 
       
   227     /**
       
   228      * Construct a new CThumbnailObjectSource referring to a buffer 
       
   229      * containing an image.
       
   230      *
       
   231      * @param aFile     File handle.
       
   232      * @param aUri      Object URI or a full path to a file in the file system.
       
   233      * @since S60 v5.0
       
   234      * @return New CThumbnailObjectSource instance.
       
   235      */        
       
   236     IMPORT_C static CThumbnailObjectSource* NewLC( CFbsBitmap*  aBitmap, const TDesC& aUri );
       
   237  
       
   238     /**
       
   239      * Construct a new CThumbnailObjectSource referring to a buffer 
       
   240      * containing an image.
       
   241      *
       
   242      * @param aBuffer   Buffer.
       
   243      * @param aUri      Object URI or a full path to a file in the file system.
       
   244      * @since S60 v5.0
       
   245      * @return New CThumbnailObjectSource instance.
       
   246      */       
       
   247     IMPORT_C static CThumbnailObjectSource* NewL( TDesC8* aBuffer,  TDesC& aMimeType, 
       
   248         const TDesC& aUri );
       
   249     
       
   250     /**
       
   251      * Construct a new CThumbnailObjectSource referring to a buffer 
       
   252      * containing an image.
       
   253      *
       
   254      * @param aBuffer   Buffer.
       
   255      * @param aMimeType MIME type. Optional, but should be specified if known.
       
   256      * @param aUri      Object URI or a full path to a file in the file system.
       
   257      * @since S60 v5.0
       
   258      * @return New CThumbnailObjectSource instance.
       
   259      */       
       
   260     IMPORT_C static CThumbnailObjectSource* NewLC( TDesC8* aBuffer,  TDesC& aMimeType, 
       
   261         const TDesC& aUri);
       
   262 
       
   263     /**
       
   264      * Construct a new CThumbnailObjectSource referring to an URI.
       
   265      * @param aUri      Object URI or a full path to a file in the file system.
       
   266      * @param aMimeType MIME type. Optional, but should be specified if known.
       
   267      * @since S60 v5.0
       
   268      * @return New CThumbnailObjectSource instance.
       
   269      */
       
   270     IMPORT_C static CThumbnailObjectSource* NewL( const TDesC& aUri, 
       
   271         TThumbnailId aThumbnailId = 0, const TDesC& aMimeType = KNullDesC );
       
   272 
       
   273     /**
       
   274      * Construct a new CThumbnailObjectSource referring to an URI.
       
   275      * @param aUri      Object URI or a full path to a file in the file system.
       
   276      * @param aMimeType MIME type. Optional, but should be specified if known.
       
   277      * @since S60 v5.0
       
   278      * @return New CThumbnailObjectSource instance.
       
   279      */
       
   280     IMPORT_C static CThumbnailObjectSource* NewLC( const TDesC& aUri,
       
   281         TThumbnailId aThumbnailId = 0, const TDesC& aMimeType = KNullDesC );
       
   282     	 
       
   283     /**
       
   284      * Returns source buffer.
       
   285      *
       
   286      * @since S60 v5.0
       
   287      * @return buffer
       
   288      */  
       
   289     IMPORT_C TDesC8* Buffer();
       
   290     
       
   291     /**
       
   292      * Gets ownership of buffer from source object.
       
   293      * After that Buffer() returns NULL.
       
   294      *
       
   295      * @since S60 v5.0
       
   296      * @return buffer
       
   297      */
       
   298     IMPORT_C TDesC8* GetBufferOwnership();
       
   299     
       
   300     /**
       
   301      * Gets MIME type.
       
   302      *
       
   303      * @since S60 v5.0
       
   304      * @return MIME type
       
   305      */   
       
   306     IMPORT_C const TDesC8& MimeType();
       
   307     
       
   308     /**
       
   309      * Gets ThumbnailId.
       
   310      *
       
   311      * @since S60 v5.0
       
   312      * @return ThumbnailId 
       
   313      */     
       
   314     IMPORT_C TThumbnailId Id(); 	    
       
   315     
   303     
   316     /**
   304     /**
   317      * Returns source bitmap.
   305      * Returns source bitmap.
   318      *
   306      *
   319      * @since S60 v5.0
   307      * @since S60 v5.0
   327      *
   315      *
   328      * @since S60 v5.0
   316      * @since S60 v5.0
   329      * @return bitmap
   317      * @return bitmap
   330      */
   318      */
   331     IMPORT_C CFbsBitmap* GetBitmapOwnership();
   319     IMPORT_C CFbsBitmap* GetBitmapOwnership();
   332     
       
   333     /**
       
   334      * Construct a new CThumbnailObjectSource referring to an URI.
       
   335      * @param aUri      Object URI or a full path to a file in the file system.
       
   336      * @param aTargetUri      For linking the thumbnail to a different URI.
       
   337      * @param aMimeType MIME type. Optional, but should be specified if known.
       
   338      * @since Symbian^3
       
   339      * @return New CThumbnailObjectSource instance.
       
   340      */
       
   341     IMPORT_C static CThumbnailObjectSource* NewL( const TDesC& aUri, 
       
   342             const TDesC& aTargetUri, const TDesC& aMimeType );
       
   343 
       
   344     /**
       
   345      * Construct a new CThumbnailObjectSource referring to an URI.
       
   346      * @param aUri      Object URI or a full path to a file in the file system.
       
   347      * @param aTargetUri      For linking the thumbnail to a different URI.
       
   348      * @param aMimeType MIME type. 
       
   349      * @since Symbian^3
       
   350      * @return New CThumbnailObjectSource instance.
       
   351      */
       
   352     IMPORT_C static CThumbnailObjectSource* NewLC( const TDesC& aUri, 
       
   353             const TDesC& aTargetUri, const TDesC& aMimeType );
       
   354     
       
   355     /**
       
   356      * Returns target uri.
       
   357      *
       
   358      * @since Symbian^3
       
   359      * @return uri
       
   360      */
       
   361     IMPORT_C const TDesC& TargetUri();
       
   362 };
   320 };
   363 
   321 
   364 #endif // THUMBNAILOBJECTSOURCE_H
   322 #endif // THUMBNAILOBJECTSOURCE_H