ImagePrint/ImagePrintEngine/DeviceProtocols/dpof/inc/crsdpofengine.h
branchGCC_SURGE
changeset 25 59ea2209bb67
parent 23 08cc4cc059d4
parent 15 a92d00fca574
equal deleted inserted replaced
23:08cc4cc059d4 25:59ea2209bb67
     1 /*
       
     2 * Copyright (c) 2004-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 CRsDpofEngine & TRsPhoneImage class definitions and
       
    15 * 				 the MDpofEngineObserver interface definition.
       
    16 *
       
    17 */
       
    18 
       
    19 
       
    20 #ifndef CRSDPOFENGINE_H
       
    21 #define CRSDPOFENGINE_H
       
    22 
       
    23 #include <e32base.h>
       
    24 #include <f32file.h>
       
    25 
       
    26 class CFileManager;
       
    27 
       
    28 /// Possible DPOF status.
       
    29 enum TRsDpofPrintStatus
       
    30 	{
       
    31 	ECopyImageFiles,
       
    32 	EDeleteDirectory,
       
    33 	EDPOFGenerate,
       
    34 	EJobCompleted,
       
    35 	EJobCancelled,
       
    36 	EJobError
       
    37 	};
       
    38 
       
    39 class MDpofEngineObserver
       
    40 	{
       
    41 	public:
       
    42 		virtual void HandleDpofEngineEventL(const TInt aStatus, const TInt aRetCode)=0;
       
    43 	};
       
    44 
       
    45 class TRsPhoneImage
       
    46 	{
       
    47 	public:
       
    48 		TInt	iIndex;
       
    49 		TBool	iCopied;
       
    50 	};
       
    51 
       
    52 
       
    53 /**
       
    54   * \brief Brief Description
       
    55   *
       
    56   * Detailed Description
       
    57   */
       
    58 class CRsDpofEngine : public CActive
       
    59 	{
       
    60 	public:
       
    61 	
       
    62 		enum TRsDpofImageLayout
       
    63 		{
       
    64 		EOnePerPageSmall = 0,
       
    65 		EOnePerPageMedium,
       
    66 		EOnePerPageLarge,
       
    67 		EOnePerPage4x6,
       
    68 		ETwoPerPage,
       
    69 		EFourPerPage,
       
    70 		ESixPerPage,
       
    71 		ENinePerPage,
       
    72 		ETwelvePerPage,
       
    73 		ESixteenPerPage
       
    74 		};
       
    75 
       
    76 
       
    77 		static CRsDpofEngine* NewL(MDpofEngineObserver& aObs);
       
    78 		~CRsDpofEngine();
       
    79 		
       
    80 		void SetImageFileNamesL(const RPointerArray<HBufC>& aImageList);
       
    81 		void SetImageLayout(TRsDpofImageLayout aImageLayout);
       
    82 		TInt PrintL();
       
    83 		TInt GetPrintPercentage();
       
    84 		void Stop();
       
    85 		void StartDiscovery(TRequestStatus& aStatus);
       
    86 		TBool WasCancelled() const;
       
    87 		TBool HasMmc() const;
       
    88 		TBool AutoPrintFileExists();
       
    89         void SetMMCPathL();		
       
    90 		
       
    91 		void SetNumsOfCopiesL( const RArray<TInt>& aNumsOfCopies );
       
    92 
       
    93 	protected: 	/// From CActive
       
    94 	
       
    95 	    void DoCancel();
       
    96 	    void RunL();
       
    97 
       
    98 	private:
       
    99 	
       
   100 		void ConstructL();
       
   101 		CRsDpofEngine(MDpofEngineObserver& aObs);
       
   102 		TInt WriteSpecificSizeFileL();
       
   103 		TInt WriteMultipleFileL();
       
   104 		TInt PrepareFilenamesL();
       
   105 		void CreateDpofFileL();		
       
   106 		TInt CleanupTempImages();
       
   107 		TInt CopyPhoneImagesToMMC();
       
   108 		TRsPhoneImage* GetNextImageInfoForCopy();
       
   109 		static TInt CreateDpofFileCbL(TAny *aObj);
       
   110 		void DoCreateDpofFileL();
       
   111 
       
   112 	private:
       
   113 
       
   114 		HBufC*					iMmcDrive;
       
   115 		TBool 					iHasMmc;
       
   116 		RPointerArray<HBufC> 	iFileNames;
       
   117 		TInt 					iImageLayout;
       
   118 		HBufC* 					iAutoPrintFile;
       
   119 		HBufC* 					iTempFolder;
       
   120 		MDpofEngineObserver& 	iObs;
       
   121 		TRsDpofPrintStatus	 	iStep;
       
   122 		RFs						iFs;
       
   123 		RArray<TRsPhoneImage>	iPhoneImageArray;
       
   124 		TRsPhoneImage*		 	iCurrentPhoneImage;
       
   125 		CFileManager*			iFileManager;
       
   126 		TFileName			 	iTempFile;
       
   127 		TBool				 	iShouldCancel;
       
   128 		CPeriodic*				iDpofPeriodic;
       
   129 		TInt					iPhoneImgsSize;
       
   130 		
       
   131 		RArray<TInt>			iNumsOfCopies;
       
   132 	};
       
   133 
       
   134 #endif // CRSDPOFENGINE_H
       
   135 
       
   136 //  End of File