Send a CDN_FOLDERCHANGE message when we change folders.
[wine] / dlls / user / controls.h
1 /*
2  * User controls definitions
3  *
4  * Copyright 2000 Alexandre Julliard
5  *
6  * This library is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Lesser General Public
8  * License as published by the Free Software Foundation; either
9  * version 2.1 of the License, or (at your option) any later version.
10  *
11  * This library is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14  * Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public
17  * License along with this library; if not, write to the Free Software
18  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
19  */
20
21 #ifndef __WINE_CONTROLS_H
22 #define __WINE_CONTROLS_H
23
24 #include "winuser.h"
25 #include "winproc.h"
26
27 /* Built-in class names (see _Undocumented_Windows_ p.418) */
28 #define POPUPMENU_CLASS_ATOM MAKEINTATOMA(32768)  /* PopupMenu */
29 #define DESKTOP_CLASS_ATOM   MAKEINTATOMA(32769)  /* Desktop */
30 #define DIALOG_CLASS_ATOMA   MAKEINTATOMA(32770)  /* Dialog */
31 #define DIALOG_CLASS_ATOMW   MAKEINTATOMW(32770)  /* Dialog */
32 #define WINSWITCH_CLASS_ATOM MAKEINTATOMA(32771)  /* WinSwitch */
33 #define ICONTITLE_CLASS_ATOM MAKEINTATOMA(32772)  /* IconTitle */
34
35 /* Built-in class descriptor */
36 struct builtin_class_descr
37 {
38     LPCSTR  name;    /* class name */
39     UINT    style;   /* class style */
40     WNDPROC procA;   /* ASCII window procedure */
41     WNDPROC procW;   /* Unicode window procedure */
42     INT     extra;   /* window extra bytes */
43     LPCSTR  cursor;  /* cursor name */
44     HBRUSH  brush;   /* brush or system color */
45 };
46
47
48 /* desktop */
49 extern BOOL DESKTOP_SetPattern( LPCSTR pattern );
50
51 /* icon title */
52 extern HWND ICONTITLE_Create( HWND hwnd );
53
54 /* menu controls */
55 extern BOOL MENU_Init(void);
56 extern BOOL MENU_IsMenuActive(void);
57 extern HMENU MENU_GetSysMenu(HWND hWndOwner, HMENU hSysPopup);
58 extern UINT MENU_GetMenuBarHeight( HWND hwnd, UINT menubarWidth,
59                                      INT orgX, INT orgY );
60 extern void MENU_TrackMouseMenuBar( HWND hwnd, INT ht, POINT pt );
61 extern void MENU_TrackKbdMenuBar( HWND hwnd, UINT wParam, INT vkey );
62 extern UINT MENU_DrawMenuBar( HDC hDC, LPRECT lprect,
63                                 HWND hwnd, BOOL suppress_draw );
64 extern UINT MENU_FindSubMenu( HMENU *hmenu, HMENU hSubTarget );
65
66 /* scrollbar */
67 extern void SCROLL_DrawScrollBar( HWND hwnd, HDC hdc, INT nBar, BOOL arrows, BOOL interior );
68 extern void SCROLL_TrackScrollBar( HWND hwnd, INT scrollbar, POINT pt );
69 extern INT SCROLL_SetNCSbState( HWND hwnd, int vMin, int vMax, int vPos,
70                                 int hMin, int hMax, int hPos );
71
72 /* combo box */
73
74 #define ID_CB_LISTBOX           1000
75 #define ID_CB_EDIT              1001
76
77 /* internal flags */
78 #define CBF_DROPPED             0x0001
79 #define CBF_BUTTONDOWN          0x0002
80 #define CBF_NOROLLUP            0x0004
81 #define CBF_MEASUREITEM         0x0008
82 #define CBF_FOCUSED             0x0010
83 #define CBF_CAPTURE             0x0020
84 #define CBF_EDIT                0x0040
85 #define CBF_NORESIZE            0x0080
86 #define CBF_NOTIFY              0x0100
87 #define CBF_NOREDRAW            0x0200
88 #define CBF_SELCHANGE           0x0400
89 #define CBF_NOEDITNOTIFY        0x1000
90 #define CBF_NOLBSELECT          0x2000  /* do not change current selection */
91 #define CBF_EUI                 0x8000
92
93 /* combo state struct */
94 typedef struct
95 {
96    HWND           self;
97    HWND           owner;
98    UINT           dwStyle;
99    HWND           hWndEdit;
100    HWND           hWndLBox;
101    UINT           wState;
102    HFONT          hFont;
103    RECT           textRect;
104    RECT           buttonRect;
105    RECT           droppedRect;
106    INT            droppedIndex;
107    INT            fixedOwnerDrawHeight;
108    INT            droppedWidth;   /* last two are not used unless set */
109    INT            editHeight;     /* explicitly */
110 } HEADCOMBO,*LPHEADCOMBO;
111
112 /* Note, that CBS_DROPDOWNLIST style is actually (CBS_SIMPLE | CBS_DROPDOWN) */
113 #define CB_GETTYPE( lphc )    ((lphc)->dwStyle & (CBS_DROPDOWNLIST))
114
115 extern BOOL COMBO_FlipListbox( LPHEADCOMBO, BOOL, BOOL );
116
117 /* Dialog info structure */
118 typedef struct
119 {
120     HWND      hwndFocus;   /* Current control with focus */
121     HFONT     hUserFont;   /* Dialog font */
122     HMENU     hMenu;       /* Dialog menu */
123     UINT      xBaseUnit;   /* Dialog units (depends on the font) */
124     UINT      yBaseUnit;
125     INT       idResult;    /* EndDialog() result / default pushbutton ID */
126     UINT      flags;       /* EndDialog() called for this dialog */
127     HGLOBAL16 hDialogHeap;
128 } DIALOGINFO;
129
130 #define DF_END  0x0001
131 #define DF_OWNERENABLED 0x0002
132
133 /* offset of DIALOGINFO ptr in dialog extra bytes */
134 #define DWL_WINE_DIALOGINFO (DWL_USER+sizeof(ULONG_PTR))
135
136 inline static DIALOGINFO *DIALOG_get_info( HWND hwnd )
137 {
138     return (DIALOGINFO *)GetWindowLongW( hwnd, DWL_WINE_DIALOGINFO );
139 }
140
141 extern BOOL DIALOG_GetCharSize( HDC hdc, HFONT hFont, SIZE * pSize );
142 extern void DIALOG_EnableOwner( HWND hOwner );
143 extern BOOL DIALOG_DisableOwner( HWND hOwner );
144 extern INT DIALOG_DoDialogBox( HWND hwnd, HWND owner );
145
146 #endif  /* __WINE_CONTROLS_H */