examples/Graphics/PDRStore/PDRExample.h

00001 /*
00002 Copyright (c) 2006-2010 Nokia Corporation and/or its subsidiary(-ies). All rights reserved.
00003 
00004 Redistribution and use in source and binary forms, with or without
00005 modification, are permitted provided that the following conditions are met:
00006 
00007 * Redistributions of source code must retain the above copyright notice, this
00008   list of conditions and the following disclaimer.
00009 * Redistributions in binary form must reproduce the above copyright notice,
00010   this list of conditions and the following disclaimer in the documentation
00011   and/or other materials provided with the distribution.
00012 * Neither the name of Nokia Corporation nor the names of its contributors
00013   may be used to endorse or promote products derived from this software
00014   without specific prior written permission.
00015 
00016 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
00017 AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
00018 IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
00019 DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
00020 FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
00021 DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
00022 SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
00023 CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
00024 OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
00025 OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
00026 
00027 Description:  
00028 */
00029 
00030 
00031 #ifndef __PDREXAMPLE_H__
00032 #define __PDREXAMPLE_H__
00033 
00034 #include <e32base.h>
00035 #include <e32cons.h>
00036 
00037 #include <pdrport.h>
00038 #include <gdi.h>
00039 #include <fbs.h>
00040 #include <prnsetup.h>
00041 #include <metafile.h>
00042 
00043 #define PDD_NAME _L("ECDRV")
00044 #define LDD_NAME _L("ECOMM")
00045 
00046 _LIT( KTitle, "PdrExample" );
00047 _LIT( KDriveName, "z:" );
00048 _LIT( KEpsonFileName, "epson.pdr" );
00049 
00050 class CPdrPrint;
00051 
00052 // Demonstrates how to load of printer driver information files and creation
00053 // of printer drivers
00054 class CPdrExample :public CBase
00055         {
00056 public:
00057         static CPdrExample* NewL();
00058         ~CPdrExample();
00059         
00060         void CreatePrinterDriverL();    
00061         void DisplayTypefaces();
00062         void CreatePrinterControl();
00063         void PrintPages();
00064         
00065 
00066 private:
00067         CPdrExample();
00068         void ConstructL();
00069 
00070 private:
00071         CPdrPrint*      iStopper;
00072 
00073         CConsoleBase*   iConsole;       
00074         CPrinterDriver* iDriver;
00075         CPrinterDevice* iDevice;
00076     };
00077     
00078 // Wrapper class of CActive
00079 class CPdrPrint : public CActive
00080         {
00081 public:
00082         CPdrPrint(): CActive(EPriorityLow) {}
00083         TRequestStatus& Status();       
00084         void DoCancel() {}
00085         TRequestStatus&  Queue(); 
00086         void RunL(); 
00087         };
00088 
00089 // Inline implementation
00090 void CPdrPrint::RunL()
00091         {
00092         CActiveScheduler::Stop();
00093         }
00094                         
00095 TRequestStatus& CPdrPrint::Queue()
00096         {
00097         SetActive();
00098         return iStatus;
00099         }
00100                         
00101 TRequestStatus& CPdrPrint::Status()
00102         {
00103         return iStatus;
00104         }
00105 
00106 #endif //__PDREXAMPLE_H__

Generated by  doxygen 1.6.2