2fdddbd5a06046159203c75254a31f67a0d31eee
[reactos.git] / dll / cpl / timedate / timedate.h
1 #ifndef _TIMEDATE_H
2 #define _TIMEDATE_H
3
4 #include <stdarg.h>
5
6 #define _INC_WINDOWS
7 #define COM_NO_WINDOWS_H
8 #define WIN32_NO_STATUS
9
10 #include <windef.h>
11 #include <winbase.h>
12 #include <winnls.h>
13 #include <winreg.h>
14 #include <wingdi.h>
15 #include <winuser.h>
16 #include <wchar.h>
17 #include <commctrl.h>
18 #include <cpl.h>
19
20 #include "resource.h"
21
22 #define MAX_KEY_LENGTH 255
23 #define MAX_VALUE_NAME 16383
24 #define SERVERLISTSIZE 6
25 #define BUFSIZE 1024
26 #define NTPPORT 123
27 #define ID_TIMER 1
28
29 typedef struct
30 {
31 UINT idIcon;
32 UINT idName;
33 UINT idDescription;
34 APPLET_PROC AppletProc;
35 } APPLET, *PAPPLET;
36
37 extern HINSTANCE hApplet;
38
39
40 /* dateandtime.c */
41 INT_PTR CALLBACK DateTimePageProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam);
42 BOOL SystemSetLocalTime(LPSYSTEMTIME lpSystemTime);
43
44
45 /* timezone.c */
46 INT_PTR CALLBACK TimeZonePageProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam);
47
48
49 /* internettime.c */
50 INT_PTR CALLBACK InetTimePageProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam);
51
52
53 /* timedate.c */
54 #if DBG
55 VOID DisplayWin32ErrorDbg(DWORD dwErrorCode, const char *file, int line);
56 #define DisplayWin32Error(e) DisplayWin32ErrorDbg(e, __FILE__, __LINE__);
57 #else
58 VOID DisplayWin32Error(DWORD dwErrorCode);
59 #endif
60
61
62 /* clock.c */
63 #define CLM_STOPCLOCK (WM_USER + 1)
64 #define CLM_STARTCLOCK (WM_USER + 2)
65
66 BOOL RegisterClockControl(VOID);
67 VOID UnregisterClockControl(VOID);
68
69
70 /* ntpclient.c */
71 // NTP timestamp
72 typedef struct _TIMEPACKET
73 {
74 DWORD dwInteger;
75 DWORD dwFractional;
76 } TIMEPACKET, *PTIMEPACKET;
77
78 // NTP packet
79 typedef struct _NTPPACKET
80 {
81 BYTE LiVnMode;
82 BYTE Stratum;
83 char Poll;
84 char Precision;
85 long RootDelay;
86 long RootDispersion;
87 char ReferenceID[4];
88 TIMEPACKET ReferenceTimestamp;
89 TIMEPACKET OriginateTimestamp;
90 TIMEPACKET ReceiveTimestamp;
91 TIMEPACKET TransmitTimestamp;
92 }NTPPACKET, *PNTPPACKET;
93
94 ULONG GetServerTime(LPWSTR lpAddress);
95
96
97 /* w32time.c */
98 VOID SyncTimeNow(VOID);
99
100
101 /* monthcal.c */
102 #define MCCM_SETDATE (WM_USER + 1)
103 #define MCCM_GETDATE (WM_USER + 2)
104 #define MCCM_RESET (WM_USER + 3)
105 #define MCCM_CHANGED (WM_USER + 4)
106
107 #define MCCN_SELCHANGE (1)
108 typedef struct _NMMCCSELCHANGE
109 {
110 NMHDR hdr;
111 WORD OldDay;
112 WORD OldMonth;
113 WORD OldYear;
114 WORD NewDay;
115 WORD NewMonth;
116 WORD NewYear;
117 } NMMCCSELCHANGE, *PNMMCCSELCHANGE;
118 #define MCCN_AUTOUPDATE (2)
119 typedef struct _NMMCCAUTOUPDATE
120 {
121 NMHDR hdr;
122 SYSTEMTIME SystemTime;
123 } NMMCCAUTOUPDATE, *PNMMCCAUTOUPDATE;
124
125 BOOL RegisterMonthCalControl(IN HINSTANCE hInstance);
126 VOID UnregisterMonthCalControl(IN HINSTANCE hInstance);
127
128 #endif /* _TIMEDATE_H */