Initial commit.
[pdfium.git] / fpdfsdk / include / javascript / color.h
1 // Copyright 2014 PDFium Authors. All rights reserved.\r
2 // Use of this source code is governed by a BSD-style license that can be\r
3 // found in the LICENSE file.\r
4  \r
5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com\r
6 \r
7 #ifndef _COLOR_H_\r
8 #define _COLOR_H_\r
9 \r
10 class color : public CJS_EmbedObj\r
11 {\r
12 public:\r
13         color(CJS_Object* pJSObject);\r
14         virtual ~color(void);\r
15 \r
16         FX_BOOL black(OBJ_PROP_PARAMS);\r
17         FX_BOOL blue(OBJ_PROP_PARAMS);\r
18         FX_BOOL cyan(OBJ_PROP_PARAMS);  \r
19         FX_BOOL dkGray(OBJ_PROP_PARAMS);\r
20         FX_BOOL gray(OBJ_PROP_PARAMS);\r
21         FX_BOOL green(OBJ_PROP_PARAMS);\r
22         FX_BOOL ltGray(OBJ_PROP_PARAMS);\r
23         FX_BOOL magenta(OBJ_PROP_PARAMS);\r
24         FX_BOOL red(OBJ_PROP_PARAMS);   \r
25         FX_BOOL transparent(OBJ_PROP_PARAMS);\r
26         FX_BOOL white(OBJ_PROP_PARAMS);\r
27         FX_BOOL yellow(OBJ_PROP_PARAMS);\r
28 \r
29         FX_BOOL convert(OBJ_METHOD_PARAMS);\r
30         FX_BOOL equal(OBJ_METHOD_PARAMS);\r
31 \r
32 public:  \r
33         static void             ConvertPWLColorToArray(const CPWL_Color& color, CJS_Array& array);\r
34         static void             ConvertArrayToPWLColor(CJS_Array& array, CPWL_Color& color);\r
35 \r
36 private:\r
37         CPWL_Color              m_crTransparent;\r
38         CPWL_Color              m_crBlack;\r
39         CPWL_Color              m_crWhite;\r
40         CPWL_Color              m_crRed;\r
41         CPWL_Color              m_crGreen;\r
42         CPWL_Color              m_crBlue;\r
43         CPWL_Color              m_crCyan;\r
44         CPWL_Color              m_crMagenta;\r
45         CPWL_Color              m_crYellow;\r
46         CPWL_Color              m_crDKGray;\r
47         CPWL_Color              m_crGray;\r
48         CPWL_Color              m_crLTGray;\r
49 };\r
50 \r
51 class CJS_Color : public CJS_Object\r
52 {\r
53 public:\r
54         CJS_Color(JSFXObject  pObject) : CJS_Object(pObject) {};\r
55         virtual ~CJS_Color(void){};\r
56 \r
57         DECLARE_JS_CLASS(CJS_Color);\r
58 \r
59         JS_STATIC_PROP(black, color);\r
60         JS_STATIC_PROP(blue, color);\r
61         JS_STATIC_PROP(cyan, color);    \r
62         JS_STATIC_PROP(dkGray, color);\r
63         JS_STATIC_PROP(gray, color);\r
64         JS_STATIC_PROP(green, color);\r
65         JS_STATIC_PROP(ltGray, color);\r
66         JS_STATIC_PROP(magenta, color);\r
67         JS_STATIC_PROP(red, color);     \r
68         JS_STATIC_PROP(transparent, color);\r
69         JS_STATIC_PROP(white, color);\r
70         JS_STATIC_PROP(yellow, color);\r
71 \r
72         JS_STATIC_METHOD(convert,color);\r
73         JS_STATIC_METHOD(equal,color);\r
74 \r
75 };\r
76 \r
77 #endif //_COLOR_H_\r
78 \r