Tizen 2.1 base
[platform/upstream/hplip.git] / prnt / hpijs / PrinterProperties.h
1 /*****************************************************************************\
2   Copyright (c) 2002 - 2006, Hewlett-Packard Co.
3   All rights reserved.
4
5   Redistribution and use in source and binary forms, with or without
6   modification, are permitted provided that the following conditions
7   are met:
8   1. Redistributions of source code must retain the above copyright
9      notice, this list of conditions and the following disclaimer.
10   2. Redistributions in binary form must reproduce the above copyright
11      notice, this list of conditions and the following disclaimer in the
12      documentation and/or other materials provided with the distribution.
13   3. Neither the name of Hewlett-Packard nor the names of its
14      contributors may be used to endorse or promote products derived
15      from this software without specific prior written permission.
16
17   THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR IMPLIED
18   WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
19   MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.  IN
20   NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
21   SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
22   TO, PATENT INFRINGEMENT; PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
23   OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
24   ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25   (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
26   THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 \*****************************************************************************/
28 #include <stdio.h>
29
30 #include "hpprintapi.h"
31
32 APDK_USING_NAMESPACE
33
34 class PlatformServices : public SystemServices
35 {
36 public:
37     PlatformServices ();
38     ~PlatformServices ();
39     void            DisplayPrinterStatus (DISPLAY_STATUS ePrinterStatus);
40     DRIVER_ERROR    BusyWait (DWORD msec);
41     DRIVER_ERROR    ReadDeviceID (BYTE *strID, int iSize);
42     BYTE            *AllocMem (int iMemSize);
43     void            FreeMem (BYTE* pMem);
44     BOOL            GetStatusInfo (BYTE *bStatReg);
45     DRIVER_ERROR    ToDevice (const BYTE *pBuffer, DWORD *dwCount);
46     DRIVER_ERROR    FromDevice (BYTE *pReadBuff, DWORD *wReadCount);
47     DWORD           GetSystemTickCount (void);
48     float           power (float x, float y);
49 };
50
51 typedef struct
52 {
53     PAPER_SIZE      iPaperSize;
54     const char      *szName;
55 } PaperSizeInfo;
56
57 PaperSizeInfo   PaperSizeInfoData[] =
58 {
59     {LETTER, "Letter"},
60     {LEGAL,  "Legal"},
61     {EXECUTIVE, "Executive"},
62     {A3,        "A3"},
63     {A4,        "A4"},
64     {A5,        "A5"},
65     {A6,        "A6"},
66     {PHOTO_SIZE,     "Photo"},
67     {PHOTO_5x7,       "5x7"},
68     {B4,        "B4"},
69     {B5,        "B5"},
70     {OUFUKU,    "Oufuku-Hagaki"},
71     {HAGAKI,    "Hagaki"},
72     {SUPERB_SIZE,   "Super B"},
73     {FLSA,      "Flsa"},
74     {ENVELOPE_NO_10,   "Number 10 Envelope"},
75     {ENVELOPE_A2,   "A2 Envelope"},
76     {ENVELOPE_C6,   "C6 Envelope"},
77     {ENVELOPE_DL,   "DL Envelope"},
78     {ENVELOPE_JPN3,    "Japanese Envelope #3"},
79     {ENVELOPE_JPN4,    "Japanese Envelope #4"}
80 };
81
82 typedef struct
83 {
84     char    szClassName[16];
85     char    szPaperSize[32];
86     float   fPhysicalWidth;
87     float   fPhysicalHeight;
88     float   fPrintableWidth;
89     float   fPrintableHeight;
90     float   fTopLeftX;
91     float   fTopLeftY;
92 } PrinterProperties;
93
94 PlatformServices    *pSys = NULL;
95 PrintContext        *pPC  = NULL;
96 BOOL                CreatePrinterProperties ();
97 int                 iCurrentPrinter = UNSUPPORTED;
98 int                 iPrinterClasses[MAX_PRINTER_TYPE];
99 int                 iLastPrinter = 0;
100
101 #if 0
102 char    *szPaperSizeNames[] =
103 {
104     "Letter",
105     "A4",
106     "Legal"
107     "4x6 with tear-off tab",
108     "A6",
109     "4x6 Index Card",
110     "B4",
111     "B5",
112     "Oufuku-Hagaki",
113     "Hagaki",
114     "A6 with tear-off tab",
115     "A3",
116     "A5",
117     "Ledger",
118     "Super B",
119     "Executive",
120     "Flsa",
121     "CUSTOM_SIZE",
122         "Number 10 Envelope",
123         "A2 Envelope",
124         "C6 Envelope",
125         "DL Envelope",
126         "Japanese Envelope #3",
127         "Japanese Envelope #4",
128     "5x7"
129 };
130 #endif