cdlg.h 8.9 KB
Newer Older
1 2 3 4
/*
 *  Common Dialog Boxes interface (32 bit)
 *
 * Copyright 1998 Bertho A. Stultiens
5 6 7 8 9 10 11 12 13 14 15 16 17
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free Software
18
 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
19 20 21 22 23
 */

#ifndef _WINE_DLL_CDLG_H
#define _WINE_DLL_CDLG_H

24
#include "dlgs.h"
25
#include "wownt32.h"
26

27 28 29 30 31 32
/* Common dialogs implementation globals */
#define COMDLG32_Atom	((ATOM)0xa000)	/* MS uses this one to identify props */

extern HINSTANCE	COMDLG32_hInstance;

void	COMDLG32_SetCommDlgExtendedError(DWORD err);
33
LPVOID	COMDLG32_AllocMem(int size) __WINE_ALLOC_SIZE(1);
34

35 36
/* handle<-handle16 conversion */
#define HINSTANCE_32(h16)           ((HINSTANCE)(ULONG_PTR)(h16))
37 38 39 40 41 42 43 44 45 46 47 48 49 50

/* Find/Replace local definitions */

#define FR_WINE_UNICODE		0x80000000
#define FR_WINE_REPLACE		0x40000000

typedef struct {
	FINDREPLACEA	fr;	/* Internally used structure */
        union {
		FINDREPLACEA	*fra;	/* Reference to the user supplied structure */
		FINDREPLACEW	*frw;
        } user_fr;
} COMDLG32_FR_Data;

51
#define PD32_PRINT_TITLE        7000
52 53 54 55 56 57 58 59 60 61 62 63 64

#define PD32_VALUE_UREADABLE                  1104
#define PD32_INVALID_PAGE_RANGE               1105
#define PD32_FROM_NOT_ABOVE_TO                1106
#define PD32_MARGINS_OVERLAP                  1107
#define PD32_NR_OF_COPIES_EMPTY               1108
#define PD32_TOO_LARGE_COPIES                 1109
#define PD32_PRINT_ERROR                      1110
#define PD32_NO_DEFAULT_PRINTER               1111
#define PD32_CANT_FIND_PRINTER                1112
#define PD32_OUT_OF_MEMORY                    1113
#define PD32_GENERIC_ERROR                    1114
#define PD32_DRIVER_UNKNOWN                   1115
65
#define PD32_NO_DEVICES                       1121
66 67 68

#define PD32_PRINTER_STATUS_READY             1536
#define PD32_PRINTER_STATUS_PAUSED            1537
69
#define PD32_PRINTER_STATUS_ERROR             1538
70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95
#define PD32_PRINTER_STATUS_PENDING_DELETION  1539
#define PD32_PRINTER_STATUS_PAPER_JAM         1540
#define PD32_PRINTER_STATUS_PAPER_OUT         1541
#define PD32_PRINTER_STATUS_MANUAL_FEED       1542
#define PD32_PRINTER_STATUS_PAPER_PROBLEM     1543
#define PD32_PRINTER_STATUS_OFFLINE           1544
#define PD32_PRINTER_STATUS_IO_ACTIVE         1545
#define PD32_PRINTER_STATUS_BUSY              1546
#define PD32_PRINTER_STATUS_PRINTING          1547
#define PD32_PRINTER_STATUS_OUTPUT_BIN_FULL   1548
#define PD32_PRINTER_STATUS_NOT_AVAILABLE     1549
#define PD32_PRINTER_STATUS_WAITING           1550
#define PD32_PRINTER_STATUS_PROCESSING        1551
#define PD32_PRINTER_STATUS_INITIALIZING      1552
#define PD32_PRINTER_STATUS_WARMING_UP        1553
#define PD32_PRINTER_STATUS_TONER_LOW         1554
#define PD32_PRINTER_STATUS_NO_TONER          1555
#define PD32_PRINTER_STATUS_PAGE_PUNT         1556
#define PD32_PRINTER_STATUS_USER_INTERVENTION 1557
#define PD32_PRINTER_STATUS_OUT_OF_MEMORY     1558
#define PD32_PRINTER_STATUS_DOOR_OPEN         1559
#define PD32_PRINTER_STATUS_SERVER_UNKNOWN    1560
#define PD32_PRINTER_STATUS_POWER_SAVE        1561

#define PD32_DEFAULT_PRINTER                  1582
#define PD32_NR_OF_DOCUMENTS_IN_QUEUE         1583
96

97 98 99
#define PD32_MARGINS_IN_INCHES                1585
#define PD32_MARGINS_IN_MILIMETERS            1586
#define PD32_MILIMETERS                       1587
100

101 102 103 104
/* Charset names string IDs */

#define IDS_CHARSET_ANSI        200
#define IDS_CHARSET_SYMBOL      201
105
#define IDS_CHARSET_JIS         202
106
#define IDS_CHARSET_HANGUL      203
107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127
#define IDS_CHARSET_GB2312      204
#define IDS_CHARSET_BIG5        205
#define IDS_CHARSET_GREEK       206
#define IDS_CHARSET_TURKISH     207
#define IDS_CHARSET_HEBREW      208
#define IDS_CHARSET_ARABIC      209
#define IDS_CHARSET_BALTIC      210
#define IDS_CHARSET_VIETNAMESE  211
#define IDS_CHARSET_RUSSIAN     212
#define IDS_CHARSET_EE          213
#define IDS_CHARSET_THAI        214
#define IDS_CHARSET_JOHAB       215
#define IDS_CHARSET_MAC         216
#define IDS_CHARSET_OEM         217
#define IDS_CHARSET_VISCII      218
#define IDS_CHARSET_TCVN        219
#define IDS_CHARSET_KOI8        220
#define IDS_CHARSET_ISO3        221
#define IDS_CHARSET_ISO4        222
#define IDS_CHARSET_ISO10       223
#define IDS_CHARSET_CELTIC      224
128

129 130 131 132 133 134 135
/* Font styles */

#define IDS_FONT_REGULAR        256
#define IDS_FONT_BOLD           257
#define IDS_FONT_ITALIC         258
#define IDS_FONT_BOLD_ITALIC    259

136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154
/* Color names string IDs */

#define IDS_COLOR_BLACK                 1040
#define IDS_COLOR_MAROON                1041
#define IDS_COLOR_GREEN                 1042
#define IDS_COLOR_OLIVE                 1043
#define IDS_COLOR_NAVY                  1044
#define IDS_COLOR_PURPLE                1045
#define IDS_COLOR_TEAL                  1046
#define IDS_COLOR_GRAY                  1047
#define IDS_COLOR_SILVER                1048
#define IDS_COLOR_RED                   1049
#define IDS_COLOR_LIME                  1050
#define IDS_COLOR_YELLOW                1051
#define IDS_COLOR_BLUE                  1052
#define IDS_COLOR_FUCHSIA               1053
#define IDS_COLOR_AQUA                  1054
#define IDS_COLOR_WHITE                 1055

Jacek Caban's avatar
Jacek Caban committed
155
#define IDS_FONT_SIZE    1200
156 157 158 159 160
#define IDS_SAVE_BUTTON  1201
#define IDS_SAVE_IN      1202
#define IDS_SAVE         1203
#define IDS_SAVE_AS      1204
#define IDS_OPEN_FILE    1205
Jacek Caban's avatar
Jacek Caban committed
161

162 163
#define IDS_FAKEDOCTEXT  1300

164 165 166 167 168
#include "windef.h"
#include "winbase.h"
#include "wingdi.h"
#include "winuser.h"
#include "winnls.h"
169
#include "commctrl.h"
170
#include "shlobj.h"
171 172 173 174
#include "shellapi.h"

/* ITEMIDLIST */

175 176 177 178 179
extern LPITEMIDLIST (WINAPI *COMDLG32_PIDL_ILClone) (LPCITEMIDLIST);
extern LPITEMIDLIST (WINAPI *COMDLG32_PIDL_ILCombine)(LPCITEMIDLIST,LPCITEMIDLIST);
extern LPITEMIDLIST (WINAPI *COMDLG32_PIDL_ILGetNext)(LPITEMIDLIST);
extern BOOL (WINAPI *COMDLG32_PIDL_ILRemoveLastID)(LPCITEMIDLIST);
extern BOOL (WINAPI *COMDLG32_PIDL_ILIsEqual)(LPCITEMIDLIST, LPCITEMIDLIST);
180
extern UINT (WINAPI *COMDLG32_PIDL_ILGetSize)(LPCITEMIDLIST);
181 182

/* SHELL */
183 184 185
extern LPVOID (WINAPI *COMDLG32_SHAlloc)(DWORD);
extern DWORD (WINAPI *COMDLG32_SHFree)(LPVOID);
extern BOOL (WINAPI *COMDLG32_SHGetFolderPathA)(HWND,int,HANDLE,DWORD,LPSTR);
186
extern BOOL (WINAPI *COMDLG32_SHGetFolderPathW)(HWND,int,HANDLE,DWORD,LPWSTR);
187

188 189 190
extern BOOL  WINAPI GetFileDialog95A(LPOPENFILENAMEA ofn,UINT iDlgType);
extern BOOL  WINAPI GetFileDialog95W(LPOPENFILENAMEW ofn,UINT iDlgType);

191 192 193 194
/*
 * Internal Functions
 * Do NOT Export to other programs and dlls
 */
195

196
BOOL CC_HookCallChk( const CHOOSECOLORW *lpcc );
197 198 199 200 201 202 203
int CC_MouseCheckResultWindow( HWND hDlg, LPARAM lParam );
LRESULT CC_WMLButtonDown( HWND hDlg, WPARAM wParam, LPARAM lParam );
LRESULT CC_WMLButtonUp( HWND hDlg, WPARAM wParam, LPARAM lParam );
LRESULT CC_WMCommand( HWND hDlg, WPARAM wParam, LPARAM lParam, WORD 
						notifyCode, HWND hwndCtl );
LRESULT CC_WMMouseMove( HWND hDlg, LPARAM lParam );
LRESULT CC_WMPaint( HWND hDlg, WPARAM wParam, LPARAM lParam );
204
void CC_SwitchToFullSize( HWND hDlg, COLORREF result, LPCRECT lprect );
205 206 207 208 209 210 211 212
void CC_PaintSelectedColor( HWND hDlg, COLORREF cr );
int CC_RGBtoHSL(char c, int r, int g, int b);
void CC_PaintCross( HWND hDlg, int x, int y);
void CC_PaintTriangle( HWND hDlg, int y);
int CC_CheckDigitsInEdit( HWND hwnd, int maxval );
void CC_EditSetHSL( HWND hDlg, int h, int s, int l );
int CC_HSLtoRGB(char c, int hue, int sat, int lum);
void CC_EditSetRGB( HWND hDlg, COLORREF cr );
213
void CC_PaintUserColorArray( HWND hDlg, int rows, int cols, const COLORREF* lpcr );
214 215 216

typedef struct
{
217 218
  HWND hWnd1;
  HWND hWnd2;
Jacek Caban's avatar
Jacek Caban committed
219
  LPCHOOSEFONTW lpcf32w;
220 221 222
  int  added;
} CFn_ENUMSTRUCT, *LPCFn_ENUMSTRUCT;

Jacek Caban's avatar
Jacek Caban committed
223
INT AddFontFamily(const ENUMLOGFONTEXW *lpElfex, const NEWTEXTMETRICEXW *lpNTM,
224
                  UINT nFontType, const CHOOSEFONTW *lpcf, HWND hwnd,
225
                  LPCFn_ENUMSTRUCT e);
Jacek Caban's avatar
Jacek Caban committed
226
INT AddFontStyle(const ENUMLOGFONTEXW *lpElfex, const NEWTEXTMETRICEXW *metrics,
227
                 UINT nFontType, const CHOOSEFONTW *lpcf, HWND hcmb2, HWND hcmb3,
228 229 230 231
                 HWND hDlg, BOOL iswin16);
void _dump_cf_flags(DWORD cflags);

LRESULT CFn_WMInitDialog(HWND hDlg, WPARAM wParam, LPARAM lParam,
Jacek Caban's avatar
Jacek Caban committed
232
                         LPCHOOSEFONTW lpcf);
233 234 235
LRESULT CFn_WMMeasureItem(HWND hDlg, WPARAM wParam, LPARAM lParam);
LRESULT CFn_WMDrawItem(HWND hDlg, WPARAM wParam, LPARAM lParam);
LRESULT CFn_WMCommand(HWND hDlg, WPARAM wParam, LPARAM lParam,
Jacek Caban's avatar
Jacek Caban committed
236
                      LPCHOOSEFONTW lpcf);
237
LRESULT CFn_WMPaint(HWND hDlg, WPARAM wParam, LPARAM lParam,
238
                      const CHOOSEFONTW *lpcf);
239 240

#endif /* _WINE_DLL_CDLG_H */