00001 // Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies). 00002 // All rights reserved. 00003 // This component and the accompanying materials are made available 00004 // under the terms of "Eclipse Public License v1.0" 00005 // which accompanies this distribution, and is available 00006 // at the URL "http://www.eclipse.org/legal/epl-v10.html". 00007 // 00008 // Initial Contributors: 00009 // Nokia Corporation - initial contribution. 00010 // 00011 // Contributors: 00012 // 00013 // Description: 00014 // 00015 00016 #ifndef __PDREXAMPLE_H__ 00017 #define __PDREXAMPLE_H__ 00018 00019 #include <e32base.h> 00020 #include <e32cons.h> 00021 00022 #include <pdrport.h> 00023 #include <gdi.h> 00024 #include <fbs.h> 00025 #include <prnsetup.h> 00026 #include <metafile.h> 00027 00028 #define PDD_NAME _L("ECDRV") 00029 #define LDD_NAME _L("ECOMM") 00030 00031 _LIT( KTitle, "PdrExample" ); 00032 _LIT( KDriveName, "z:" ); 00033 _LIT( KEpsonFileName, "epson.pdr" ); 00034 00035 class CPdrPrint; 00036 00037 // Demonstrates how to load of printer driver information files and creation 00038 // of printer drivers 00039 class CPdrExample :public CBase 00040 { 00041 public: 00042 static CPdrExample* NewL(); 00043 ~CPdrExample(); 00044 00045 void CreatePrinterDriverL(); 00046 void DisplayTypefaces(); 00047 void CreatePrinterControl(); 00048 void PrintPages(); 00049 00050 00051 private: 00052 CPdrExample(); 00053 void ConstructL(); 00054 00055 private: 00056 CPdrPrint* iStopper; 00057 00058 CConsoleBase* iConsole; 00059 CPrinterDriver* iDriver; 00060 CPrinterDevice* iDevice; 00061 }; 00062 00063 // Wrapper class of CActive 00064 class CPdrPrint : public CActive 00065 { 00066 public: 00067 CPdrPrint(): CActive(EPriorityLow) {} 00068 TRequestStatus& Status(); 00069 void DoCancel() {} 00070 TRequestStatus& Queue(); 00071 void RunL(); 00072 }; 00073 00074 // Inline implementation 00075 void CPdrPrint::RunL() 00076 { 00077 CActiveScheduler::Stop(); 00078 } 00079 00080 TRequestStatus& CPdrPrint::Queue() 00081 { 00082 SetActive(); 00083 return iStatus; 00084 } 00085 00086 TRequestStatus& CPdrPrint::Status() 00087 { 00088 return iStatus; 00089 } 00090 00091 #endif //__PDREXAMPLE_H__
Copyright ©2010 Nokia Corporation and/or its subsidiary(-ies).
All rights
reserved. Unless otherwise stated, these materials are provided under the terms of the Eclipse Public License
v1.0.