]> git.saurik.com Git - wxWidgets.git/blob - include/wx/osx/filedlg.h
going private for m_peer to give a foundation for better encapsulation
[wxWidgets.git] / include / wx / osx / filedlg.h
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: filedlg.h
3 // Purpose: wxFileDialog class
4 // Author: Stefan Csomor
5 // Modified by:
6 // Created: 1998-01-01
7 // RCS-ID: $Id$
8 // Copyright: (c) Stefan Csomor
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
11
12 #ifndef _WX_FILEDLG_H_
13 #define _WX_FILEDLG_H_
14
15 class WXDLLIMPEXP_FWD_CORE wxChoice;
16
17 //-------------------------------------------------------------------------
18 // wxFileDialog
19 //-------------------------------------------------------------------------
20
21 // set this system option to 1 in order to always show the filetypes popup in
22 // file open dialogs if possible
23
24 #define wxOSX_FILEDIALOG_ALWAYS_SHOW_TYPES wxT("osx.openfiledialog.always-show-types")
25
26 class WXDLLIMPEXP_CORE wxFileDialog: public wxFileDialogBase
27 {
28 DECLARE_DYNAMIC_CLASS(wxFileDialog)
29 protected:
30 wxArrayString m_fileNames;
31 wxArrayString m_paths;
32
33 public:
34 wxFileDialog(wxWindow *parent,
35 const wxString& message = wxFileSelectorPromptStr,
36 const wxString& defaultDir = wxEmptyString,
37 const wxString& defaultFile = wxEmptyString,
38 const wxString& wildCard = wxFileSelectorDefaultWildcardStr,
39 long style = wxFD_DEFAULT_STYLE,
40 const wxPoint& pos = wxDefaultPosition,
41 const wxSize& sz = wxDefaultSize,
42 const wxString& name = wxFileDialogNameStr);
43
44 virtual void GetPaths(wxArrayString& paths) const { paths = m_paths; }
45 virtual void GetFilenames(wxArrayString& files) const { files = m_fileNames ; }
46
47 virtual int ShowModal();
48
49 #if wxOSX_USE_COCOA
50 virtual void ShowWindowModal();
51 virtual void ModalFinishedCallback(void* panel, int resultCode);
52 #endif
53
54 virtual bool SupportsExtraControl() const;
55
56 // implementation only
57
58 #if wxOSX_USE_COCOA
59 // returns true if the file can be shown as active
60 bool CheckFile( const wxString& filename );
61 #endif
62
63 protected:
64 // not supported for file dialog, RR
65 virtual void DoSetSize(int WXUNUSED(x), int WXUNUSED(y),
66 int WXUNUSED(width), int WXUNUSED(height),
67 int WXUNUSED(sizeFlags) = wxSIZE_AUTO) {}
68
69 void SetupExtraControls(WXWindow nativeWindow);
70
71 #if wxOSX_USE_COCOA
72 virtual wxWindow* CreateFilterPanel(wxWindow *extracontrol);
73 virtual void OnFilterSelected(wxCommandEvent &event);
74
75 wxArrayString m_filterExtensions;
76 wxArrayString m_filterNames;
77 wxChoice* m_filterChoice;
78 wxWindow* m_filterPanel;
79 bool m_useFileTypeFilter;
80 int m_firstFileTypeFilter;
81 wxArrayString m_currentExtensions;
82 WX_NSObject m_delegate;
83 #endif
84 };
85
86 #endif // _WX_FILEDLG_H_