ImagePrint/ImagePrintUI/imgpprintdll/inc/cimgpprintutils.h
branchRCL_3
changeset 28 d59c248c9d36
parent 0 d11fb78c4374
equal deleted inserted replaced
27:159fc2f68139 28: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 CIMGPPRINTUTILS_H
       
    20 #define CIMGPPRINTUTILS_H
       
    21 
       
    22 #include <eikapp.h>
       
    23 #include <e32std.h>
       
    24 #include <aknappui.h>
       
    25 #include <data_caging_path_literals.hrh>
       
    26 
       
    27 #include "midleprinteventobserver.h"
       
    28 #include "rimageprintclient.h"
       
    29 #include "maiwobserver.h"
       
    30 #include "mprotocolobserver.h"
       
    31 #include "mprintjobstatus.h"
       
    32 
       
    33 class CAknNavigationDecorator;
       
    34 class CImagePrintDoc;
       
    35 class CIMGPPrintDlgManager;
       
    36 class MPrintSettings;
       
    37 class CImagePrintEngine;
       
    38 class MIdlePrintEventObserver;
       
    39 class CUIProtocolController;
       
    40 
       
    41 /**
       
    42  *
       
    43  *  AppUi class
       
    44  *
       
    45  */
       
    46 class CIMGPPrintUtils
       
    47     : public CBase,
       
    48       public MProtocolObserver,
       
    49       public MPrintJobStatus
       
    50      {
       
    51 
       
    52 	public:		// Constructors and destructors
       
    53 
       
    54 
       
    55          /**
       
    56          *  Second phase constructor
       
    57          */
       
    58         IMPORT_C static CIMGPPrintUtils* NewL( MAiwObserver* aAiwObserver );
       
    59         static CIMGPPrintUtils* NewLC( MAiwObserver* aAiwObserver );
       
    60         void ConstructL( MAiwObserver* aAiwObserver );
       
    61 		virtual ~CIMGPPrintUtils();
       
    62 
       
    63         void DialogDismissedL(TInt /*aButtonId*/);
       
    64 
       
    65 public:		// from MPrintJobStatus
       
    66         void PrintJobProgress( TInt aStatus, 
       
    67         					   TInt aPercentCompletion, 
       
    68             				   TInt aJobStateCode );
       
    69         void PrintJobError( TInt aError, TInt aErrorStringCode );
       
    70         void PrinterStatus( TInt aError, TInt aErrorStringCode );
       
    71         
       
    72     public:    // New methods
       
    73 
       
    74 
       
    75         /**
       
    76          * Starts printing process
       
    77          */
       
    78         IMPORT_C void StartPrintingL( CDesCArrayFlat* aImages );
       
    79 
       
    80         /**
       
    81          * Starts the BrowserEngine for selecting images
       
    82          */
       
    83         void StartBrowser();
       
    84 
       
    85         /**
       
    86          * Method is used to forward the selected images to engine.
       
    87          *
       
    88          * @param aFileArray, array that contains the selected images.
       
    89          */
       
    90         void SetImageArrayL( CDesCArrayFlat* aFileArray );
       
    91 
       
    92          /**
       
    93          * Method is used to set the printer UID value in the UI side.
       
    94          *
       
    95          * @param aPrinterUID printer uid.
       
    96          */
       
    97         void SetPrinterUID( TInt aPrinterUID );
       
    98 
       
    99         /**
       
   100          * Method is used to get the printer UID value in the UI side.
       
   101          *
       
   102          * @return printer uid.
       
   103          */
       
   104         TInt GetPrinterUID();
       
   105 
       
   106 		CImagePrintEngine& Engine() const;
       
   107 
       
   108         /**
       
   109          * Called in aiw printing when printing is completed
       
   110          */
       
   111          void JobFinished();
       
   112 
       
   113 		/**
       
   114 		 * Called when initial printing didn't succeed because default
       
   115 		 * printer was not available. Does printing after full discovery
       
   116 		 */
       
   117 		void RestartPrintingL();
       
   118 
       
   119 	public: // static helpers
       
   120 		IMPORT_C static TBool CheckMIMEType( const TDesC8& aMimeType,
       
   121 			const TFileName& aFileName );
       
   122 
       
   123 		IMPORT_C static void GetDataFilePathL( TFileName& aFileName );
       
   124 		
       
   125    public: // Methods derived from MProtocolObserver
       
   126         void UsbCableDisconnected();
       
   127        
       
   128     private: // New methods
       
   129 
       
   130         /**
       
   131         * Print
       
   132         */
       
   133         void PrintL();
       
   134         
       
   135         static TInt IdleCallbackL( TAny* aObj );
       
   136 
       
   137     private:    // Data
       
   138 
       
   139         CIMGPPrintDlgManager* iPrintDlgManager; // use
       
   140 
       
   141         // UID of the selected printer
       
   142         TInt iPrinterUID;        
       
   143         // Application engine
       
   144         CImagePrintEngine* iEngine;
       
   145 
       
   146         TInt iResourceOffset;
       
   147         TInt iResourceOffset2;
       
   148 
       
   149         // Used in aiw printing
       
   150         MAiwObserver* iAiwObserver;
       
   151         // Interface for settings
       
   152         MPrintSettings* iSettings;
       
   153         // Protocol controller
       
   154         CUIProtocolController* iProtocolController;
       
   155         
       
   156         CIdle* iIdle;
       
   157 	};
       
   158 
       
   159 #endif // CIMGPPRINTUTILS_H
       
   160 
       
   161 //  End of File