update for HEAD-2003091401
[reactos.git] / lib / shell32 / control / control.h
1 /*
2  *  ReactOS shell32 - Control Panel
3  *
4  *  control.h
5  *
6  *  Copyright (C) 2002  Robert Dickenson <robd@reactos.org>
7  *
8  *  This program is free software; you can redistribute it and/or modify
9  *  it under the terms of the GNU General Public License as published by
10  *  the Free Software Foundation; either version 2 of the License, or
11  *  (at your option) any later version.
12  *
13  *  This program is distributed in the hope that it will be useful,
14  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
15  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16  *  GNU General Public License for more details.
17  *
18  *  You should have received a copy of the GNU General Public License
19  *  along with this program; if not, write to the Free Software
20  *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
21  */
22
23 #ifndef __CONTROL_H__
24 #define __CONTROL_H__
25
26 #ifdef __cplusplus
27 extern "C" {
28 #endif
29
30     
31 #include "resource.h"
32
33 #define STATUS_WINDOW   2001
34 #define TREE_WINDOW     2002
35 #define LIST_WINDOW     2003
36
37 #define MAX_LOADSTRING  100
38 #define SPLIT_WIDTH             5
39 #define MAX_NAME_LEN    500
40
41 #define MAX_CPL_NAME 128
42 #define MAX_CPL_INFO 128
43
44 ////////////////////////////////////////////////////////////////////////////////
45 /*
46 typedef struct tagNEWCPLINFO { 
47     DWORD dwSize; 
48     DWORD dwFlags; 
49     DWORD dwHelpContext; 
50     LONG  lData; 
51     HICON hIcon; 
52     TCHAR  szName[32]; 
53     TCHAR  szInfo[64]; 
54     TCHAR  szHelpFile[128]; 
55 } NEWCPLINFO; 
56     
57  */
58 typedef struct tagCPLAppletINFO {
59     DWORD dwSize;
60     DWORD dwFlags;
61     DWORD dwHelpContext;
62     LONG  lData;
63     HICON hIcon;
64     TCHAR  szName[32];
65     TCHAR  szInfo[192];
66 //    TCHAR  szHelpFile[128];
67 } CPLAppletINFO; 
68     
69
70 typedef struct CPlApplet {
71     struct CPlApplet* next;     /* linked list */
72     HWND              hWnd;
73     unsigned          count;    /* number of subprograms */
74     HMODULE           hModule;  /* module of loaded applet */
75     TCHAR             filename[MAX_PATH];
76     APPLET_PROC       proc;     /* entry point address */
77     NEWCPLINFO        info[1];  /* array of count information. dwSize field is 0 if entry is invalid */
78 } CPlApplet;
79
80 typedef struct CPlEntry {
81     CPlApplet* pCPlApplet;      /* which cpl module we are associated with (contained in) */
82     HWND       hWnd;            /* handle to existing window if we are already launched */
83     unsigned   nSubProg;        /* which sub-program we are within the CPlApplet */
84     unsigned   nIconIndex;      /*  */
85     long       lData;
86 //    union {
87 //        NEWCPLINFO    NewCplInfo;
88 //        CPLAppletINFO AppletInfo;
89 //    } info;
90 } CPlEntry;
91
92 typedef struct CPanel {
93     CPlApplet* first;           /* linked list */
94     HWND       hWnd;
95     unsigned   status;
96     CPlApplet* clkApplet;
97     unsigned   clkSP;
98 } CPanel;
99
100 #ifndef CPL_STARTWPARMSW
101 #undef CPL_STARTWPARMS
102 #define CPL_STARTWPARMSW 10
103 #ifdef UNICODE
104 #define CPL_STARTWPARMS CPL_STARTWPARMSW
105 #else
106 #define CPL_STARTWPARMS CPL_STARTWPARMSA
107 #endif
108 #endif
109
110
111 enum OPTION_FLAGS {
112     OPTIONS_AUTO_REFRESH               = 0x01,
113     OPTIONS_READ_ONLY_MODE             = 0x02,
114     OPTIONS_CONFIRM_ON_DELETE          = 0x04,
115     OPTIONS_SAVE_ON_EXIT                   = 0x08,
116     OPTIONS_DISPLAY_BINARY_DATA            = 0x10,
117     OPTIONS_VIEW_TREE_ONLY                 = 0x20,
118     OPTIONS_VIEW_DATA_ONLY                 = 0x40,
119 };
120
121 typedef struct {
122         HWND    hWnd;
123     HWND    hTreeWnd;
124     HWND    hListWnd;
125     int     nFocusPanel;      // 0: left  1: right
126         int             nSplitPos;
127         WINDOWPLACEMENT pos;
128         TCHAR   szPath[MAX_PATH];
129 } ChildWnd;
130
131 ////////////////////////////////////////////////////////////////////////////////
132 // Global Variables:
133 //
134 extern HINSTANCE hInst;
135 extern HWND      hFrameWnd;
136 extern HMENU     hMenuFrame;
137 extern HWND      hStatusBar;
138 extern HFONT     hFont;
139 extern enum OPTION_FLAGS Options;
140
141 extern TCHAR szTitle[];
142 extern TCHAR szWindowClass[];
143
144 void Control_DoLaunch(CPlApplet** pListHead, HWND hWnd, LPCTSTR cmd);
145 CPlApplet* Control_LoadApplet(HWND hWnd, LPCTSTR cmd, CPlApplet** pListHead);
146 CPlApplet* Control_UnloadApplet(CPlApplet* applet);
147
148
149 #ifdef __GNUC__
150 /*
151 typedef struct tagNMITEMACTIVATE{
152     NMHDR   hdr;
153     int     iItem;
154     int     iSubItem;
155     UINT    uNewState;
156     UINT    uOldState;
157     UINT    uChanged;
158     POINT   ptAction;
159     LPARAM  lParam;
160     UINT    uKeyFlags;
161 } NMITEMACTIVATE, FAR *LPNMITEMACTIVATE;
162 */
163 #define HDITEM HD_ITEM
164 #define LPNMLISTVIEW LPNM_LISTVIEW
165 #define NMLISTVIEW NM_LISTVIEW
166 /*
167 #define HDN_ENDDRAG TBN_ENDDRAG
168 #define LVSICF_NOSCROLL LVS_NOSCROLL
169 */
170 #define HDM_GETORDERARRAY       (HDM_FIRST+19)   // TODO: FIX ME
171 #endif
172
173
174 #ifdef __cplusplus
175 };
176 #endif
177
178 #endif // __CONTROL_H__