ImagePrint/ImagePrintEngine/DeviceProtocols/xhtmlfilecomposer/inc/cimageinfo.h
branchRCL_3
changeset 21 d59c248c9d36
parent 0 d11fb78c4374
equal deleted inserted replaced
20:159fc2f68139 21:d59c248c9d36
       
     1 /*
       
     2 * Copyright (c) 2002-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:  Contains the declarations for miscellanous image information.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef CIMAGEINFO_H
       
    20 #define CIMAGEINFO_H
       
    21 
       
    22 #include "xhtmlfilecomposerconst.h"
       
    23 
       
    24 /**
       
    25 * @class 		CImageInfo
       
    26 * @brief		A simple class for miscellaneous information of an image to be printed.
       
    27 *
       
    28 * This class contains information of the image, required in several phases of the process.
       
    29 * The data included is not all required for composing XHTML file but also for other use of the
       
    30 * image data from the printing job creation to the end of job printing.
       
    31 */
       
    32 class CImageInfo : public CBase
       
    33 {
       
    34 	public:
       
    35 		IMPORT_C CImageInfo();
       
    36 		IMPORT_C CImageInfo(const CImageInfo& a);
       
    37 		IMPORT_C ~CImageInfo();
       
    38 
       
    39 		// statics
       
    40 		IMPORT_C static CImageInfo* NewL();
       
    41 		IMPORT_C static CImageInfo* NewL(const CImageInfo& a);
       
    42 		IMPORT_C static CImageInfo* NewLC();
       
    43 		IMPORT_C static CImageInfo* NewLC(const CImageInfo& a);
       
    44 
       
    45 
       
    46 		IMPORT_C static void ConvertToUTF8L(const TDesC& aSource, TDes8& aResult);
       
    47 
       
    48 		IMPORT_C static void ConvertToUnicodeL(const TDesC8& aSource, TDes& aResult);
       
    49 
       
    50 		IMPORT_C static void AppendL(HBufC8* aWhere, const TDesC8& aWhat);
       
    51 		
       
    52 		IMPORT_C static void UriLog(const TDesC8& aUri);
       
    53 		IMPORT_C static void UriLog(const TDesC& aUri);
       
    54 		IMPORT_C static void UriLog(const TDesC8& aUri, TDes8& aConvert);
       
    55 		IMPORT_C static void UriLog(const TDesC& aUri, TDes& aConvert);
       
    56 
       
    57 		// non-statics
       
    58 		IMPORT_C void EncodeUriL(const TDesC16& aDecodedUri, TDes8& aEncodedUri);
       
    59 		IMPORT_C void EncodeUriL(const TDesC8& aDecodedUri, TDes8& aEncodedUri);
       
    60 
       
    61 		IMPORT_C void SetUri(const TDesC8& aUri, const TBool aEncoded=EFalse);
       
    62 		IMPORT_C void SetUriL(const TDesC& aUri);
       
    63 
       
    64 		IMPORT_C void GetUri(TDes8& aUri) const;
       
    65 		IMPORT_C void GetUriL(TDes& aUri) const;
       
    66 		IMPORT_C void GetEncodedUriL(TDes8& aUri);
       
    67 		IMPORT_C TBool CompareUri(const TDesC& aUri);
       
    68 		IMPORT_C TBool CompareUri(const TDesC8& aUri);
       
    69 
       
    70 		IMPORT_C void SetFilePath(const TDesC8& aFilePath);
       
    71 		IMPORT_C void SetFilePathL(const TDesC& aFilePath);
       
    72 
       
    73 		IMPORT_C void GetFilePath(TDes8& aFilePath) const;
       
    74 		IMPORT_C void GetFilePathL(TDes& aFilePath) const;
       
    75 		IMPORT_C TBool CompareFilePath(const TDesC& aFilePath);
       
    76 		IMPORT_C TBool CompareFilePath(const TDesC8& aFilePath);
       
    77 
       
    78 		IMPORT_C void SetId(const TInt aId);
       
    79 		IMPORT_C TInt Id() const;
       
    80 
       
    81 		IMPORT_C void SetCopies(const TInt aCopies);
       
    82 		IMPORT_C TInt Copies() const;
       
    83 
       
    84 		IMPORT_C void SetIndex(const TInt aIndex);
       
    85 		IMPORT_C TInt Index() const;
       
    86 
       
    87 
       
    88 	protected:
       
    89 		IMPORT_C void ConstructL();
       
    90 
       
    91 	private:
       
    92 		IMPORT_C void EncodeFileNameL(TDes8& aString);
       
    93 
       
    94 		/** @var 	TFileName8 iUri
       
    95 		 *  @brief 	Image's shared uri used as a reference to the image. */
       
    96 		TFileName8 iUri;
       
    97 		TBool iEncoded;
       
    98 
       
    99 		/** @var 	TFileName8 iFilePath
       
   100 		 *  @brief	File location in local file system otherway zero length. */
       
   101 		TFileName8 iFilePath;
       
   102 
       
   103 		/** @var 	TInt iId
       
   104 		 *  @brief 	Id of shared image. */
       
   105 		TInt iId;
       
   106 
       
   107 		/**  @var 	TInt iCopies
       
   108 		 *  @brief 	Number of copies to print of this image */
       
   109 		TInt iCopies;
       
   110 
       
   111 		/** @var 	TInt iIndex
       
   112 		 *  @brief 	Index for mapping the number of copies to correct image */
       
   113 		TInt iIndex;
       
   114 };
       
   115 
       
   116 #endif // CIMAGEINFO_H
       
   117 
       
   118 //  End of File