ImagePrint/ImagePrintEngine/ImagePrintLibrary/inc/imageprint.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:  Client include file for the ImagePrint server. Contains the 
       
    15 * 				 CImagePrint class definition, and the following interfaces:
       
    16 * 				 MIdleObserver, MPrinterDiscoveryObserver and MPrintEventObserver
       
    17 *
       
    18 */
       
    19 
       
    20 
       
    21 #ifndef IMAGEPRINT_H
       
    22 #define IMAGEPRINT_H
       
    23 
       
    24 #include <e32base.h>
       
    25 
       
    26 class TPrinter;
       
    27 class TEvent;
       
    28 
       
    29 _LIT( KTabChar, "\t" );
       
    30 _LIT( KParamFile, "\\system\\data\\T_AIW_TEMP.DAT");
       
    31 
       
    32 /// Error constant defined to indicate Invalid Sequence.
       
    33 const TInt KErrInvalidSequence = -50;
       
    34 /// Error constant defined to indicate Invalid Data.
       
    35 const TInt KErrInvalidData = -51;
       
    36 /// Error constant defined to indicate that a printer has been connected
       
    37 const TInt KErrConnected = -500;
       
    38 
       
    39 /// BPP Protocol Identifier.
       
    40 const TUint KImagePrint_PrinterProtocol_BPP = 1;
       
    41 /// BIP Protocol Identifier.
       
    42 const TUint KImagePrint_PrinterProtocol_BIP = 2;
       
    43 /// OPP Protocol Identifier (Printer).
       
    44 const TUint KImagePrint_PrinterProtocol_OPP_Printer = 4;
       
    45 /// DPOF Protocol Identifier.
       
    46 const TUint KImagePrint_PrinterProtocol_DPOF = 8;
       
    47 /// PictBridge Protocol Identifier.
       
    48 const TUint KImagePrint_PrinterProtocol_PictBridge = 16;
       
    49 /// OPP Protocol Identifier (PC).
       
    50 const TUint KImagePrint_PrinterProtocol_OPP_PC = 32;
       
    51 /// UPnP Protocol Identifier
       
    52 const TUint KImagePrint_PrinterProtocol_UPnP = 64;
       
    53 
       
    54 /// Enums used to specify the current state in the DiscoveryStatusL callback.
       
    55 enum TDiscoveryStatus
       
    56 	{
       
    57 	EDiscoverying = 0,
       
    58 	EDiscoveryFinished = 1,
       
    59 	EDiscoveryCancelling = 2
       
    60 	};
       
    61 
       
    62 /// Enums used to specify the current state in the PrintJobProgressEvent callback.
       
    63 enum TPrintJobProgressEventStatus
       
    64 	{
       
    65 	EActive = 0,
       
    66 	EDone = 1
       
    67 	};
       
    68 
       
    69 /**
       
    70  *	@brief Interface to be implemented by the class using CImagePrint. It is used by CImagePrint to report anything related
       
    71  *	to the discovery process.
       
    72  */
       
    73 class MPrinterDiscoveryObserver
       
    74 	{
       
    75 	public:
       
    76 		/**
       
    77 		 * Called by Image Printer Server to notify the client application that a printer was discovered.
       
    78 		 *  @param aPrinterInfo Contains printer information of the discovered device.
       
    79 		 */
       
    80 		virtual void FoundPrinterL( const TPrinter& aPrinterInfo ) = 0;
       
    81 		/**
       
    82 		 * Called by Image Printer Server to notify the client application that an operation 
       
    83 		 * has completed, either successfully or with an error.
       
    84 		 * @param aStatus Indicate the status of the discovery process. One of the values of \c ::TDiscoveryStatus
       
    85 		 * @param aErrorCode \c KErrNone if there was no error, otherwise another of the system-wide error codes.
       
    86 		 * @param aErrorStringCode StringCode - Descriptive text that can be used to further explain error.
       
    87 		 */
       
    88 		virtual void DiscoveryStatusL( TInt aStatus, 
       
    89 										TInt aErrorCode, 
       
    90 										TInt aErrorStringCode ) = 0;
       
    91 		/**
       
    92 		 * Called by Image Printer Server to notify the client application that a printer 
       
    93 		 * returned from the cache was not discovered during the discovery phase, 
       
    94 		 * and should be removed from the UI. If this call is needed, it will be made 
       
    95 		 * after all BPP printers have been returned, but before the discovery completes.
       
    96 		 *  @param aPrinterInfo Contains printer information of the printer that was not found during discovery
       
    97 		 */
       
    98 		virtual void RemovePrinterL( const TPrinter& aPrinterInfo ) = 0;
       
    99 	};
       
   100 
       
   101 /**
       
   102  *	@brief Interface to be implemented by the class using CImagePrint. It is used by CImagePrint to report anything related
       
   103  *	to the printing process, once it is started.
       
   104  */
       
   105 class MPrintEventObserver
       
   106 	{
       
   107 	public:
       
   108 		virtual void PrintJobProgressEvent( TInt aStatus, 
       
   109 										TInt aPercentCompletion, 
       
   110 										TInt aJobStateCode ) = 0;
       
   111 										
       
   112 		virtual void PrintJobErrorEvent( TInt aError, 
       
   113 										TInt aErrorStringCode ) = 0;
       
   114 										
       
   115 		virtual void PrinterStatusEvent( TInt aError, 
       
   116 										TInt aErrorStringCode ) = 0;
       
   117 										
       
   118 		virtual void PreviewImageEvent( TInt aFsBitmapHandle ) = 0;
       
   119 		
       
   120 		virtual void ShowMessageL( TInt aMsgLine1Code, 
       
   121 										TInt aMsgLine2Code ) = 0;
       
   122 										
       
   123 		virtual TBool AskYesNoQuestionL( TInt aMsgLine1Code, 
       
   124 										TInt aMsgLine2Code ) = 0;
       
   125 										
       
   126 		virtual const TDesC& AskForInputL( TInt aMsgLine1Code, 
       
   127 										TInt aMsgLine2Code ) = 0;
       
   128 	};
       
   129 
       
   130 /**
       
   131  *  @brief Interface to be implemented by the class using CImagePrint. It is used by CImagePrint to report
       
   132  *  anything related to status changes in the handling protocol.
       
   133  *  @sa CImagePrint::RegisterIdleObserver
       
   134  */
       
   135 class MIdleObserver
       
   136 	{
       
   137 	public:
       
   138 		/** Called by CImagePrint to notify of events. The meaning of the event and associated error and mesage codes
       
   139 		 *  is protocol dependant.
       
   140 		 */
       
   141 		virtual void StatusEvent( const TEvent &aEvent, 
       
   142 										TInt aError, 
       
   143 										TInt aMsgCode ) = 0;
       
   144 	};
       
   145 
       
   146 
       
   147 #endif // IMAGEPRINT_H
       
   148 
       
   149 //  End of File