ImagePrint/ImagePrintUI/imgpprintdll/inc/cimgpprintdlgmanager.h
branchRCL_3
changeset 21 d59c248c9d36
parent 0 d11fb78c4374
equal deleted inserted replaced
20:159fc2f68139 21:d59c248c9d36
       
     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:  
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef CIMGPPRINTDLGMANAGER_H
       
    20 #define CIMGPPRINTDLGMANAGER_H
       
    21 
       
    22 #include <e32std.h>
       
    23 #include <e32base.h>
       
    24 #include <AknProgressDialog.h>
       
    25 
       
    26 #include "mprintjobobserver.h"
       
    27 #include "mprintjob.h"
       
    28 
       
    29 class CAknProgressDialog;
       
    30 class CAknWaitDialog;
       
    31 class CIMGPPrintUtils;
       
    32 class MPrintingObserver;
       
    33 
       
    34 /**
       
    35  *
       
    36  *   Print progress dialog manager - handles the user interface of the printing
       
    37  *
       
    38  */
       
    39 class CIMGPPrintDlgManager
       
    40     : public CBase,
       
    41       public MPrintJobObserver,
       
    42       public MProgressDialogCallback
       
    43 
       
    44     {
       
    45     public:     // Constructors and destructors
       
    46 
       
    47         /**
       
    48          *  Two-phase constructor
       
    49          *
       
    50          *  @param aPrintJob Pointer to print job interface   
       
    51          *  @param aNumOfPages Number of printed pages
       
    52          *  @param aMMCPrinting Flag to índicate if "printing" to MMC
       
    53          *  @param aVendor printer brand
       
    54          *  @param aPrintUtils pointer to CIMGPPrintUtils class
       
    55          *  @param aPrintingObserver pointer to MPrintingObserver interface
       
    56          *
       
    57          *  @return Initialized instance of print dialog manager
       
    58          */
       
    59         IMPORT_C static CIMGPPrintDlgManager* NewL( 
       
    60         	TInt aNoc,
       
    61             MPrintJob* aPrintJob, 
       
    62             TUint aNumOfPages, 
       
    63             TBool aMMCPrinting, 
       
    64             TUint aVendor,
       
    65             CIMGPPrintUtils* aPrintUtils = NULL, 
       
    66             MPrintingObserver* aPrintingObserver = NULL );
       
    67 
       
    68         /**
       
    69          *  Two-phase constructor
       
    70          *
       
    71          *  @param aPrintJob Pointer to print job interface   
       
    72          *  @param aNumOfPages Number of printed pages
       
    73          *  @param aMMCPrinting Flag to índicate if "printing" to MMC 
       
    74          *  @param aVendor printer brand       
       
    75          *  @param aPrintUtils pointer to CIMGPPrintUtils class
       
    76          *  @param aPrintingObserver pointer to MPrintingObserver interface
       
    77          *
       
    78          *  @return Initialized instance of print dialog manager
       
    79          */
       
    80         static CIMGPPrintDlgManager* NewLC( 
       
    81         	TInt aNoc,
       
    82             MPrintJob* aPrintJob, 
       
    83             TUint aNumOfPages, 
       
    84             TBool aMMCPrinting, 
       
    85             TUint aVendor,
       
    86             CIMGPPrintUtils* aPrintUtils = NULL, 
       
    87             MPrintingObserver* aPrintingObserver = NULL  );
       
    88         
       
    89         /**
       
    90          *  Destructor
       
    91          */
       
    92         virtual ~CIMGPPrintDlgManager();
       
    93 
       
    94     protected: // Constructors and destructors
       
    95 
       
    96         /**
       
    97          *  Default constructor
       
    98          *
       
    99          *  @param aPrintJob Pointer to print job interface
       
   100          *  @param aNumOfPages Number of printed pages
       
   101          *  @param aMMCPrinting Flag to índicate if "printing" to MMC   
       
   102          *  @param aVendor printer brand     
       
   103          *  @param aPrintUtils pointer to CIMGPPrintUtils class
       
   104          *  @param aPrintingObserver pointer to MPrintingObserver interface
       
   105          *
       
   106          */
       
   107         CIMGPPrintDlgManager( TInt aNoc,
       
   108         				  MPrintJob* aPrintJob, 
       
   109                           TUint aNumOfPages, 
       
   110                           TBool aMMCPrinting, 
       
   111                           TUint	aVendor,
       
   112                           CIMGPPrintUtils* aPrintUtils = NULL, 
       
   113             			  MPrintingObserver* aPrintingObserver = NULL );
       
   114             			  
       
   115     private: // Constructor
       
   116         void ConstructL();
       
   117 
       
   118             
       
   119     protected: // Methods derived from MPrintJobObserver
       
   120 
       
   121         void PrintProgress( TUint aComplete );
       
   122         void PrintProgressL( TUint aComplete );
       
   123         void JobFinished();
       
   124         void JobError( TInt aErrCode, TInt aErrorStringCode );
       
   125         void JobStatusEvent ( TInt aErrCode, TInt aErrorStringCode );
       
   126 
       
   127     protected: // Methods derived from MProgressDialogCallback
       
   128 
       
   129         void DialogDismissedL( TInt aButtonId );
       
   130 
       
   131     public: // New methods
       
   132 
       
   133         /**
       
   134          *  Executes the printing, displays print progress dialog
       
   135          */
       
   136         IMPORT_C void StartPrintingL();
       
   137 
       
   138     protected: // New methods
       
   139 
       
   140         /**
       
   141          *  Shows the MMC printing completed dialog
       
   142          */
       
   143         void ShowMMCPrintingCompletedDlgL();
       
   144 
       
   145 		/**
       
   146 		* Pop up cancellation wait note
       
   147 		*/
       
   148 		void ShowCancelWaitNoteL();
       
   149         
       
   150         /**
       
   151          * prepares the progress dialog for showing
       
   152          */
       
   153         void PrepareProgressDialogL();
       
   154         
       
   155     private:
       
   156 
       
   157     protected:  //  Data
       
   158 
       
   159         // Pointer to the print job instance
       
   160         MPrintJob* iPrintJob;
       
   161 
       
   162         // Progress dialog
       
   163         CAknProgressDialog* iDialog;
       
   164 
       
   165 		// Cancelling dialog
       
   166 		CAknWaitDialog* iCancellingDialog;
       
   167 
       
   168 		// Cancelling status
       
   169 		TBool iCancelling;
       
   170 		
       
   171 		// Printing cancelled
       
   172 		TBool iPrintingCancelled;
       
   173 
       
   174         // Number of pages
       
   175         TUint iNumOfPages;
       
   176 
       
   177         // Is printing from MMC or not (different text displayed)
       
   178         TBool iMMCPrinting;
       
   179 
       
   180         // printer brand
       
   181         TUint iVendor;
       
   182 
       
   183         // Flag to tell if print was cancelled
       
   184         TBool iCancelled;
       
   185 
       
   186         // Used in aiw printing
       
   187         CIMGPPrintUtils* iPrintUtils;
       
   188 
       
   189 		// Used in preview printing
       
   190 		MPrintingObserver* iPrintingObserver; // not owned
       
   191 		
       
   192 		// Used to observe is this first time job done note is displayed / 1 job. 
       
   193 		TBool iFirstNote;
       
   194 		
       
   195 		// Number of copies to MMC print job done note.
       
   196 		TInt iNoc;
       
   197 	
       
   198     };
       
   199 
       
   200 #endif  // CIMGPPRINTDLGMANAGER_H
       
   201 
       
   202 //  End of File