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