2 * Copyright 2003, 2004, 2005 Martin Fuchs
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
25 // Martin Fuchs, 23.07.2003
29 #define PM_OPEN_WINDOW (WM_APP+0x07)
31 enum OPEN_WINDOW_MODE
{
32 OWM_EXPLORE
=1, /// window in explore mode
33 OWM_ROOTED
=2, /// "rooted" window with special shell namespace root
34 OWM_DETAILS
=4, /// view files in detail mode
35 OWM_PIDL
=8, /// path is given as PIDL, otherwise as LPCTSTR
36 OWM_SEPARATE
=16 /// open separate subfolder windows
40 /// Explorer frame window base class
41 struct MainFrameBase
: public PreTranslateWindow
43 typedef PreTranslateWindow super
;
45 MainFrameBase(HWND hwnd
);
48 static HWND
Create(const ExplorerCmd
& cmd
);
49 static int OpenShellFolders(LPIDA pida
, HWND hFrameWnd
);
51 WindowHandle _hwndrebar
;
53 WindowHandle _htoolbar
;
54 WindowHandle _hstatusbar
;
56 WindowHandle _haddressedit
;
57 WindowHandle _hcommandedit
;
59 WindowHandle _hsidebar
;
68 FullScreenParameters _fullscreen
;
73 LRESULT
WndProc(UINT nmsg
, WPARAM wparam
, LPARAM lparam
);
74 bool ProcessMessage(UINT nmsg
, WPARAM wparam
, LPARAM lparam
, LRESULT
* pres
);
75 int Command(int id
, int code
);
76 int Notify(int id
, NMHDR
* pnmh
);
78 virtual BOOL
TranslateMsg(MSG
* pmsg
);
80 void toggle_child(HWND hwnd
, UINT cmd
, HWND hchild
, int band_idx
=-1);
82 void resize_frame_client();
83 virtual void resize_frame(int cx
, int cy
);
84 virtual void frame_get_clientspace(PRECT prect
);
86 BOOL
toggle_fullscreen();
87 void fullscreen_move();
90 virtual bool go_to(LPCTSTR url
, bool new_window
);
92 void ExecuteCommandbar(LPCTSTR dir
);
98 struct MDIMainFrame
: public MainFrameBase
100 typedef MainFrameBase super
;
102 MDIMainFrame(HWND hwnd
);
104 static HWND
Create();
105 static HWND
Create(LPCTSTR path
, int mode
=OWM_EXPLORE
|OWM_DETAILS
);
106 static HWND
Create(LPCITEMIDLIST pidl
, int mode
=OWM_EXPLORE
|OWM_DETAILS
|OWM_PIDL
);
108 ChildWindow
* CreateChild(LPCTSTR path
=NULL
, int mode
=OWM_EXPLORE
|OWM_DETAILS
);
109 ChildWindow
* CreateChild(LPCITEMIDLIST pidl
, int mode
=OWM_EXPLORE
|OWM_DETAILS
|OWM_PIDL
);
114 WindowHandle _hextrabar
;
115 WindowHandle _hdrivebar
;
118 LRESULT
WndProc(UINT nmsg
, WPARAM wparam
, LPARAM lparam
);
119 int Command(int id
, int code
);
121 virtual BOOL
TranslateMsg(MSG
* pmsg
);
123 bool activate_drive_window(LPCTSTR path
);
124 bool activate_child_window(LPCTSTR filesys
);
126 virtual void resize_frame(int cx
, int cy
);
127 virtual void frame_get_clientspace(PRECT prect
);
129 virtual bool go_to(LPCTSTR url
, bool new_window
);
131 TCHAR _drives
[BUFFER_LEN
];
137 struct SDIMainFrame
: public ExtContextMenuHandlerT
<
138 ShellBrowserChildT
<MainFrameBase
>
141 typedef ExtContextMenuHandlerT
<
142 ShellBrowserChildT
<MainFrameBase
>
145 SDIMainFrame(HWND hwnd
);
147 static HWND
Create();
148 static HWND
Create(LPCTSTR path
, int mode
=OWM_EXPLORE
|OWM_DETAILS
);
149 static HWND
Create(LPCITEMIDLIST pidl
, int mode
=OWM_EXPLORE
|OWM_DETAILS
|OWM_PIDL
);
152 ShellPathInfo _shellpath_info
;
154 WindowHandle _left_hwnd
;
155 WindowHandle _right_hwnd
;
157 /**@todo focus handling for TAB switching
158 int _focus_pane; // 0: left 1: right
167 LRESULT
WndProc(UINT nmsg
, WPARAM wparam
, LPARAM lparam
);
168 int Command(int id
, int code
);
170 void resize_frame(int cx
, int cy
);
171 void resize_children();
172 void update_clnt_rect();
174 void update_shell_browser();
175 void jump_to(LPCTSTR path
, int mode
);
176 void jump_to(LPCITEMIDLIST path
, int mode
);
178 // interface BrowserCallback
179 virtual void entry_selected(Entry
* entry
);
181 void set_url(LPCTSTR url
);