Qt 4.8
qfiledialog_win_p.h
Go to the documentation of this file.
1 /****************************************************************************
2 **
3 ** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
4 ** Contact: http://www.qt-project.org/legal
5 **
6 ** This file is part of the QtGui module of the Qt Toolkit.
7 **
8 ** $QT_BEGIN_LICENSE:LGPL$
9 ** Commercial License Usage
10 ** Licensees holding valid commercial Qt licenses may use this file in
11 ** accordance with the commercial license agreement provided with the
12 ** Software or, alternatively, in accordance with the terms contained in
13 ** a written agreement between you and Digia. For licensing terms and
14 ** conditions see http://qt.digia.com/licensing. For further information
15 ** use the contact form at http://qt.digia.com/contact-us.
16 **
17 ** GNU Lesser General Public License Usage
18 ** Alternatively, this file may be used under the terms of the GNU Lesser
19 ** General Public License version 2.1 as published by the Free Software
20 ** Foundation and appearing in the file LICENSE.LGPL included in the
21 ** packaging of this file. Please review the following information to
22 ** ensure the GNU Lesser General Public License version 2.1 requirements
23 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
24 **
25 ** In addition, as a special exception, Digia gives you certain additional
26 ** rights. These rights are described in the Digia Qt LGPL Exception
27 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
28 **
29 ** GNU General Public License Usage
30 ** Alternatively, this file may be used under the terms of the GNU
31 ** General Public License version 3.0 as published by the Free Software
32 ** Foundation and appearing in the file LICENSE.GPL included in the
33 ** packaging of this file. Please review the following information to
34 ** ensure the GNU General Public License version 3.0 requirements will be
35 ** met: http://www.gnu.org/copyleft/gpl.html.
36 **
37 **
38 ** $QT_END_LICENSE$
39 **
40 ****************************************************************************/
41 
42 #include <objbase.h>
43 #ifndef QFILEDIAG_WIN_P_H
44 #define QFILEDIAG_WIN_P_H
45 
46 //these are the interface declarations needed for the file dialog on Vista and up
47 
48 //At some point we can hope that all compilers/sdk will support that interface
49 //and we won't have to declare it ourselves
50 
51 //declarations
52 #define FOS_OVERWRITEPROMPT 0x2
53 #define FOS_STRICTFILETYPES 0x4
54 #define FOS_NOCHANGEDIR 0x8
55 #define FOS_PICKFOLDERS 0x20
56 #define FOS_FORCEFILESYSTEM 0x40
57 #define FOS_ALLNONSTORAGEITEMS 0x80
58 #define FOS_NOVALIDATE 0x100
59 #define FOS_ALLOWMULTISELECT 0x200
60 #define FOS_PATHMUSTEXIST 0x800
61 #define FOS_FILEMUSTEXIST 0x1000
62 #define FOS_CREATEPROMPT 0x2000
63 #define FOS_SHAREAWARE 0x4000
64 #define FOS_NOREADONLYRETURN 0x8000
65 #define FOS_NOTESTFILECREATE 0x10000
66 #define FOS_HIDEMRUPLACES 0x20000
67 #define FOS_HIDEPINNEDPLACES 0x40000
68 #define FOS_NODEREFERENCELINKS 0x100000
69 #define FOS_DONTADDTORECENT 0x2000000
70 #define FOS_FORCESHOWHIDDEN 0x10000000
71 #define FOS_DEFAULTNOMINIMODE 0x20000000
72 #define FOS_FORCEPREVIEWPANEON 0x40000000
73 
75 #define GPS_DEFAULT 0x00000000
76 #define GPS_HANDLERPROPERTIESONLY 0x00000001
77 #define GPS_READWRITE 0x00000002
78 #define GPS_TEMPORARY 0x00000004
79 #define GPS_FASTPROPERTIESONLY 0x00000008
80 #define GPS_OPENSLOWITEM 0x00000010
81 #define GPS_DELAYCREATION 0x00000020
82 #define GPS_BESTEFFORT 0x00000040
83 #define GPS_MASK_VALID 0x0000007F
84 
85 typedef int (QT_WIN_CALLBACK* BFFCALLBACK)(HWND hwnd, UINT uMsg, LPARAM lParam, LPARAM lpData);
86 // message from browser
87 #define BFFM_INITIALIZED 1
88 #define BFFM_SELCHANGED 2
89 #define BFFM_ENABLEOK (WM_USER + 101)
90 #define BFFM_SETSELECTION (WM_USER + 103)
91 #define BFFM_SETSTATUSTEXT (WM_USER + 104)
92 
93 // Browsing for directory.
94 #define BIF_RETURNONLYFSDIRS 0x0001
95 #define BIF_DONTGOBELOWDOMAIN 0x0002
96 #define BIF_STATUSTEXT 0x0004
97 #define BIF_RETURNFSANCESTORS 0x0008
98 #define BIF_EDITBOX 0x0010
99 #define BIF_VALIDATE 0x0020
100 #define BIF_NEWDIALOGSTYLE 0x0040
101 #define BIF_BROWSEINCLUDEURLS 0x0080
102 #define BIF_UAHINT 0x0100
103 #define BIF_NONEWFOLDERBUTTON 0x0200
104 #define BIF_NOTRANSLATETARGETS 0x0400
105 #define BIF_BROWSEFORCOMPUTER 0x1000
106 #define BIF_BROWSEFORPRINTER 0x2000
107 #define BIF_BROWSEINCLUDEFILES 0x4000
108 #define BIF_SHAREABLE 0x8000
109 
110 //the enums
111 typedef enum {
116 } SIATTRIBFLAGS;
117 typedef enum {
118  SIGDN_NORMALDISPLAY = 0x00000000,
124  SIGDN_FILESYSPATH = 0x80058000,
125  SIGDN_URL = 0x80068000
126 } SIGDN;
127 typedef enum {
128  FDAP_BOTTOM = 0x00000000,
129  FDAP_TOP = 0x00000001
130 } FDAP;
131 typedef enum {
132  FDESVR_DEFAULT = 0x00000000,
133  FDESVR_ACCEPT = 0x00000001,
134  FDESVR_REFUSE = 0x00000002
137 
138 //the structs
139 typedef struct {
140  LPCWSTR pszName;
141  LPCWSTR pszSpec;
143 typedef struct {
145  DWORD pid;
147 
148 typedef struct {
149  USHORT cb;
150  BYTE abID[1];
152 typedef struct {
156 typedef struct {
157  HWND hwndOwner;
160  LPCWSTR lpszTitle;
161  UINT ulFlags;
163  LPARAM lParam;
164  int iImage;
165 } qt_BROWSEINFO;
166 
167 DECLARE_INTERFACE(IFileDialogEvents);
168 DECLARE_INTERFACE_(IShellItem, IUnknown)
169 {
170  STDMETHOD(BindToHandler)(THIS_ IBindCtx *pbc, REFGUID bhid, REFIID riid, void **ppv) PURE;
171  STDMETHOD(GetParent)(THIS_ IShellItem **ppsi) PURE;
172  STDMETHOD(GetDisplayName)(THIS_ SIGDN sigdnName, LPWSTR *ppszName) PURE;
173  STDMETHOD(GetAttributes)(THIS_ ULONG sfgaoMask, ULONG *psfgaoAttribs) PURE;
174  STDMETHOD(Compare)(THIS_ IShellItem *psi, DWORD hint, int *piOrder) PURE;
175 };
176 DECLARE_INTERFACE_(IShellItemFilter, IUnknown)
177 {
178  STDMETHOD(IncludeItem)(THIS_ IShellItem *psi) PURE;
179  STDMETHOD(GetEnumFlagsForItem)(THIS_ IShellItem *psi, DWORD *pgrfFlags) PURE;
180 };
181 DECLARE_INTERFACE_(IEnumShellItems, IUnknown)
182 {
183  STDMETHOD(Next)(THIS_ ULONG celt, IShellItem **rgelt, ULONG *pceltFetched) PURE;
184  STDMETHOD(Skip)(THIS_ ULONG celt) PURE;
185  STDMETHOD(Reset)(THIS_) PURE;
186  STDMETHOD(Clone)(THIS_ IEnumShellItems **ppenum) PURE;
187 };
188 DECLARE_INTERFACE_(IShellItemArray, IUnknown)
189 {
190  STDMETHOD(BindToHandler)(THIS_ IBindCtx *pbc, REFGUID rbhid, REFIID riid, void **ppvOut) PURE;
191  STDMETHOD(GetPropertyStore)(THIS_ GETPROPERTYSTOREFLAGS flags, REFIID riid, void **ppv) PURE;
192  STDMETHOD(GetPropertyDescriptionList)(THIS_ const qt_PROPERTYKEY *keyType, REFIID riid, void **ppv) PURE;
193  STDMETHOD(GetAttributes)(THIS_ SIATTRIBFLAGS dwAttribFlags, ULONG sfgaoMask, ULONG *psfgaoAttribs) PURE;
194  STDMETHOD(GetCount)(THIS_ DWORD *pdwNumItems) PURE;
195  STDMETHOD(GetItemAt)(THIS_ DWORD dwIndex, IShellItem **ppsi) PURE;
196  STDMETHOD(EnumItems)(THIS_ IEnumShellItems **ppenumShellItems) PURE;
197 };
198 DECLARE_INTERFACE_(IModalWindow, IUnknown)
199 {
200  STDMETHOD(Show)(THIS_ HWND hwndParent) PURE;
201 };
202 DECLARE_INTERFACE_(IFileDialog, IModalWindow)
203 {
204  STDMETHOD(SetFileTypes)(THIS_ UINT cFileTypes, const qt_COMDLG_FILTERSPEC *rgFilterSpec) PURE;
205  STDMETHOD(SetFileTypeIndex)(THIS_ UINT iFileType) PURE;
206  STDMETHOD(GetFileTypeIndex)(THIS_ UINT *piFileType) PURE;
207  STDMETHOD(Advise)(THIS_ IFileDialogEvents *pfde, DWORD *pdwCookie) PURE;
208  STDMETHOD(Unadvise)(THIS_ DWORD dwCookie) PURE;
209  STDMETHOD(SetOptions)(THIS_ DWORD fos) PURE;
210  STDMETHOD(GetOptions)(THIS_ DWORD *pfos) PURE;
211  STDMETHOD(SetDefaultFolder)(THIS_ IShellItem *psi) PURE;
212  STDMETHOD(SetFolder)(THIS_ IShellItem *psi) PURE;
213  STDMETHOD(GetFolder)(THIS_ IShellItem **ppsi) PURE;
214  STDMETHOD(GetCurrentSelection)(THIS_ IShellItem **ppsi) PURE;
215  STDMETHOD(SetFileName)(THIS_ LPCWSTR pszName) PURE;
216  STDMETHOD(GetFileName)(THIS_ LPWSTR *pszName) PURE;
217  STDMETHOD(SetTitle)(THIS_ LPCWSTR pszTitle) PURE;
218  STDMETHOD(SetOkButtonLabel)(THIS_ LPCWSTR pszText) PURE;
219  STDMETHOD(SetFileNameLabel)(THIS_ LPCWSTR pszLabel) PURE;
220  STDMETHOD(GetResult)(THIS_ IShellItem **ppsi) PURE;
221  STDMETHOD(AddPlace)(THIS_ IShellItem *psi, FDAP fdap) PURE;
222  STDMETHOD(SetDefaultExtension)(THIS_ LPCWSTR pszDefaultExtension) PURE;
223  STDMETHOD(Close)(THIS_ HRESULT hr) PURE;
224  STDMETHOD(SetClientGuid)(THIS_ REFGUID guid) PURE;
225  STDMETHOD(ClearClientData)(THIS_) PURE;
226  STDMETHOD(SetFilter)(THIS_ IShellItemFilter *pFilter) PURE;
227 };
228 DECLARE_INTERFACE_(IFileDialogEvents, IUnknown)
229 {
230  STDMETHOD(OnFileOk)(THIS_ IFileDialog *pfd) PURE;
231  STDMETHOD(OnFolderChanging)(THIS_ IFileDialog *pfd, IShellItem *psiFolder) PURE;
232  STDMETHOD(OnFolderChange)(THIS_ IFileDialog *pfd) PURE;
233  STDMETHOD(OnSelectionChange)(THIS_ IFileDialog *pfd) PURE;
234  STDMETHOD(OnShareViolation)(THIS_ IFileDialog *pfd, IShellItem *psi, FDE_SHAREVIOLATION_RESPONSE *pResponse) PURE;
235  STDMETHOD(OnTypeChange)(THIS_ IFileDialog *pfd) PURE;
236  STDMETHOD(OnOverwrite)(THIS_ IFileDialog *pfd, IShellItem *psi, FDE_OVERWRITE_RESPONSE *pResponse) PURE;
237 };
238 DECLARE_INTERFACE_(IFileOpenDialog, IFileDialog)
239 {
240  STDMETHOD(GetResults)(THIS_ IShellItemArray **ppenum) PURE;
241  STDMETHOD(GetSelectedItems)(THIS_ IShellItemArray **ppsai) PURE;
242 };
243 #endif
DECLARE_INTERFACE(IFileDialogEvents)
#define BYTE
Definition: quuid.h:52
int GETPROPERTYSTOREFLAGS
BFFCALLBACK lpfn
#define QT_WIN_CALLBACK
Definition: qglobal.h:1178
FDE_SHAREVIOLATION_RESPONSE FDE_OVERWRITE_RESPONSE
qt_SHITEMID mkid
DECLARE_INTERFACE_(IShellItem, IUnknown)
SIATTRIBFLAGS
long HRESULT
struct qt_ITEMIDLIST * qt_LPITEMIDLIST
qt_LPCITEMIDLIST pidlRoot
const qt_ITEMIDLIST * qt_LPCITEMIDLIST
FDE_SHAREVIOLATION_RESPONSE
int(QT_WIN_CALLBACK * BFFCALLBACK)(HWND hwnd, UINT uMsg, LPARAM lParam, LPARAM lpData)
struct qt_SHITEMID * qt_LPSHITEMID