Merge to XFA: Use stdint.h types throughout PDFium.
[pdfium.git] / xfa / include / fwl / basewidget / fwl_monthcalendar.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 _FWL_MONTHCALENDAR_H\r
8 #define _FWL_MONTHCALENDAR_H\r
9 class IFWL_MonthCalendarDP;\r
10 class IFWL_MonthCalendar;\r
11 #define FWL_CLASS_MonthCalendar                 L"FWL_MONTHCALENDAR"\r
12 #define FWL_CLASSHASH_MonthCalendar             2733931374\r
13 #define FWL_STYLEEXT_MCD_MultiSelect            (1L << 0)\r
14 #define FWL_STYLEEXT_MCD_NoToday                        (1L << 1)\r
15 #define FWL_STYLEEXT_MCD_NoTodayCircle          (1L << 2)\r
16 #define FWL_STYLEEXT_MCD_WeekNumbers            (1L << 3)\r
17 #define FWL_WGTCAPACITY_MC_HEADER_WIDTH                 12\r
18 #define FWL_WGTCAPACITY_MC_HEADER_Height                13\r
19 #define FWL_WGTCAPACITY_MC_HEADER_BTN_WIDTH             14\r
20 #define FWL_WGTCAPACITY_MC_HEADER_BTN_HEIGHT    15\r
21 #define FWL_WGTCAPACITY_MC_HEADER_BTN_HMARGIN   16\r
22 #define FWL_WGTCAPACITY_MC_HEADER_BTN_VMARGIN   17\r
23 #define FWL_WGTCAPACITY_MC_HEADER_TEXTWIDHT             18\r
24 #define FWL_WGTCAPACITY_MC_HEADER_TEXTHEIGHT    19\r
25 #define FWL_WGTCAPACITY_MC_HEADER_TEXT_HMARGIN  20\r
26 #define FWL_WGTCAPACITY_MC_HEADER_TEXT_VMARGIN  21\r
27 #define FWL_WGTCAPACITY_MC_HSEP_WIDTH                   22\r
28 #define FWL_WGTCAPACITY_MC_HSEP_HEIGHT                  23\r
29 #define FWL_WGTCAPACITY_MC_VSEP_WIDTH                   24\r
30 #define FWL_WGTCAPACITY_MC_VSEP_HEIGHT              25\r
31 #define FWL_WGTCAPACITY_MC_WEEKNUM_WIDTH                26\r
32 #define FWL_WGTCAPACITY_MC_SEP_DOFFSET                  40\r
33 #define FWL_WGTCAPACITY_MC_SEP_X                                27\r
34 #define FWL_WGTCAPACITY_MC_SEP_Y                                28\r
35 #define FWL_WGTCAPACITY_MC_WEEKNUM_HEIGHT               29\r
36 #define FWL_WGTCAPACITY_MC_WEEK_WIDTH                   30\r
37 #define FWL_WGTCAPACITY_MC_WEEK_HEIGHT                  31\r
38 #define FWL_WGTCAPACITY_MC_DATES_CELL_WIDTH             32\r
39 #define FWL_WGTCAPACITY_MC_DATES_CELL_HEIGHT    33\r
40 #define FWL_WGTCAPACITY_MC_TODAY_WIDHT                  34\r
41 #define FWL_WGTCAPACITY_MC_TODAY_HEIGHT                 35\r
42 #define FWL_WGTCAPACITY_MC_TODAY_FLAG_WIDHT             36\r
43 #define FWL_WGTCAPACITY_MC_WIDTH                                37\r
44 #define FWL_WGTCAPACITY_MC_HEIGHT                               38\r
45 #define FWL_ITEMSTATE_MCD_Nomal                         (0L << 0)\r
46 #define FWL_ITEMSTATE_MCD_Flag                          (1L << 0)\r
47 #define FWL_ITEMSTATE_MCD_Selected                      (1L << 1)\r
48 #define FWL_ITEMSTATE_MCD_Focused                       (1L << 2)\r
49 #define FWL_PART_MCD_Border                             1\r
50 #define FWL_PART_MCD_Edge                               2\r
51 #define FWL_PART_MCD_Background                 3\r
52 #define FWL_PART_MCD_LBtn                               4\r
53 #define FWL_PART_MCD_RBtn                               5\r
54 #define FWL_PART_MCD_HSeparator                 6\r
55 #define FWL_PART_MCD_VSeparator                 7\r
56 #define FWL_PART_MCD_TodayCircle                8\r
57 #define FWL_PART_MCD_DateInCircle               9\r
58 #define FWL_PART_MCD_DateInBK               10\r
59 #define FWL_PART_MCD_Caption                    9\r
60 #define FWL_PART_MCD_DatesIn                    10\r
61 #define FWL_PART_MCD_DatesOut                   11\r
62 #define FWL_PART_MCD_Week                               12\r
63 #define FWL_PART_MCD_Today                              13\r
64 #define FWL_PART_MCD_Header                             14\r
65 #define FWL_PART_MCD_WeekNum                    15\r
66 #define FWL_PART_MCD_WeekNumSep                 16\r
67 #define FWL_PARTSTATE_MCD_Normal                (0L << 0)\r
68 #define FWL_PARTSTATE_MCD_Pressed               (1L << 0)\r
69 #define FWL_PARTSTATE_MCD_Hovered               (2L << 0)\r
70 #define FWL_PARTSTATE_MCD_Selected              (3L << 0)\r
71 #define FWL_PARTSTATE_MCD_LSelected             (1L << 2)\r
72 #define FWL_PARTSTATE_MCD_RSelected             (2L << 2)\r
73 #define FWL_PARTSTATE_MCD_Flagged               (1L << 3)\r
74 #define FWL_PARTSTATE_MCD_Focused               (1L << 4)\r
75 #define FWL_MCCAPACITY_Sun                      FWL_WGTCAPACITY_MAX + 5\r
76 #define FWL_MCCAPACITY_Mon                      FWL_WGTCAPACITY_MAX + 6\r
77 #define FWL_MCCAPACITY_Tue                      FWL_WGTCAPACITY_MAX + 7\r
78 #define FWL_MCCAPACITY_Wed                      FWL_WGTCAPACITY_MAX + 8\r
79 #define FWL_MCCAPACITY_Thu                      FWL_WGTCAPACITY_MAX + 9\r
80 #define FWL_MCCAPACITY_Fri                      FWL_WGTCAPACITY_MAX + 10\r
81 #define FWL_MCCAPACITY_Sat                      FWL_WGTCAPACITY_MAX + 11\r
82 #define FWL_MCCAPACITY_January          FWL_WGTCAPACITY_MAX + 12\r
83 #define FWL_MCCAPACITY_February         FWL_WGTCAPACITY_MAX + 13\r
84 #define FWL_MCCAPACITY_March            FWL_WGTCAPACITY_MAX + 14\r
85 #define FWL_MCCAPACITY_April            FWL_WGTCAPACITY_MAX + 15\r
86 #define FWL_MCCAPACITY_May                      FWL_WGTCAPACITY_MAX + 16\r
87 #define FWL_MCCAPACITY_June                     FWL_WGTCAPACITY_MAX + 17\r
88 #define FWL_MCCAPACITY_July                     FWL_WGTCAPACITY_MAX + 18\r
89 #define FWL_MCCAPACITY_August           FWL_WGTCAPACITY_MAX + 19\r
90 #define FWL_MCCAPACITY_September        FWL_WGTCAPACITY_MAX + 20\r
91 #define FWL_MCCAPACITY_October          FWL_WGTCAPACITY_MAX + 21\r
92 #define FWL_MCCAPACITY_November         FWL_WGTCAPACITY_MAX + 22\r
93 #define FWL_MCCAPACITY_December         FWL_WGTCAPACITY_MAX + 23\r
94 #define FWL_MCCAPACITY_Today            FWL_WGTCAPACITY_MAX + 24\r
95 #define FWL_EVENT_MCD_DATESELECTED            L"FWL_EVENT_MCD_DateSelected"\r
96 #define FWL_EVT_MCD_DateChanged                           L"FWL_EVENT_MCD_DateChanged"\r
97 #define FWL_NOTEHASH_MCD_DATASELECTED         1085596932\r
98 #define FWL_EVTHASH_MCD_DateChanged                       54212227\r
99 BEGIN_FWL_EVENT_DEF(CFWL_Event_McdDateSelected, FWL_NOTEHASH_MCD_DATASELECTED)\r
100 int32_t m_iStartDay;\r
101 int32_t m_iEndDay;\r
102 END_FWL_EVENT_DEF\r
103 BEGIN_FWL_EVENT_DEF(CFWL_EventMcdDateChanged, FWL_EVTHASH_MCD_DateChanged)\r
104 int32_t m_iOldYear;\r
105 int32_t m_iOldMonth;\r
106 int32_t m_iStartDay;\r
107 int32_t m_iEndDay;\r
108 END_FWL_EVENT_DEF\r
109 class IFWL_MonthCalendarDP : public IFWL_DataProvider\r
110 {\r
111 public:\r
112     virtual int32_t     GetCurDay(IFWL_Widget *pWidget) = 0;\r
113     virtual int32_t             GetCurMonth(IFWL_Widget *pWidget) = 0;\r
114     virtual int32_t             GetCurYear(IFWL_Widget *pWidget) = 0;\r
115 };\r
116 class IFWL_MonthCalendar : public IFWL_Widget\r
117 {\r
118 public:\r
119     static IFWL_MonthCalendar* Create();\r
120 \r
121     FWL_ERR             Initialize(IFWL_Widget *pOuter = NULL);\r
122     FWL_ERR             Initialize(const CFWL_WidgetImpProperties &properties, IFWL_Widget *pOuter = NULL);\r
123     int32_t     CountSelect();\r
124     FX_BOOL             GetSelect(int32_t &iYear, int32_t &iMonth, int32_t &iDay, int32_t nIndex = 0);\r
125     FX_BOOL             SetSelect(int32_t iYear, int32_t iMonth, int32_t iDay);\r
126 protected:\r
127     IFWL_MonthCalendar();\r
128     virtual ~IFWL_MonthCalendar();\r
129 };\r
130 #endif\r