00001 /* 00002 * Copyright 2003, 2004, 2005 Martin Fuchs 00003 * 00004 * This library is free software; you can redistribute it and/or 00005 * modify it under the terms of the GNU Lesser General Public 00006 * License as published by the Free Software Foundation; either 00007 * version 2.1 of the License, or (at your option) any later version. 00008 * 00009 * This library is distributed in the hope that it will be useful, 00010 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00011 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00012 * Lesser General Public License for more details. 00013 * 00014 * You should have received a copy of the GNU Lesser General Public 00015 * License along with this library; if not, write to the Free Software 00016 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 00017 */ 00018 00019 00020 // 00021 // Explorer clone 00022 // 00023 // mainframe.h 00024 // 00025 // Martin Fuchs, 23.07.2003 00026 // 00027 00028 00029 #define PM_OPEN_WINDOW (WM_APP+0x07) 00030 00031 enum OPEN_WINDOW_MODE { 00032 OWM_EXPLORE=1, /// window in explore mode 00033 OWM_ROOTED=2, /// "rooted" window with special shell namespace root 00034 OWM_DETAILS=4, /// view files in detail mode 00035 OWM_PIDL=8, /// path is given as PIDL, otherwise as LPCTSTR 00036 OWM_SEPARATE=16 /// open separate subfolder windows 00037 }; 00038 00039 00040 /// Explorer frame window base class 00041 struct MainFrameBase : public PreTranslateWindow 00042 { 00043 typedef PreTranslateWindow super; 00044 00045 MainFrameBase(HWND hwnd); 00046 ~MainFrameBase(); 00047 00048 static HWND Create(const ExplorerCmd& cmd); 00049 static int OpenShellFolders(LPIDA pida, HWND hFrameWnd); 00050 00051 WindowHandle _hwndrebar; 00052 00053 WindowHandle _htoolbar; 00054 WindowHandle _hstatusbar; 00055 00056 WindowHandle _haddressedit; 00057 WindowHandle _hcommandedit; 00058 00059 WindowHandle _hsidebar; 00060 HIMAGELIST _himl; 00061 00062 HMENU _hMenuFrame; 00063 HMENU _hMenuWindow; 00064 00065 MenuInfo _menu_info; 00066 00067 protected: 00068 FullScreenParameters _fullscreen; 00069 00070 HACCEL _hAccel; 00071 HIMAGELIST _himl_old; 00072 00073 LRESULT WndProc(UINT nmsg, WPARAM wparam, LPARAM lparam); 00074 bool ProcessMessage(UINT nmsg, WPARAM wparam, LPARAM lparam, LRESULT* pres); 00075 int Command(int id, int code); 00076 int Notify(int id, NMHDR* pnmh); 00077 00078 virtual BOOL TranslateMsg(MSG* pmsg); 00079 00080 void toggle_child(HWND hwnd, UINT cmd, HWND hchild, int band_idx=-1); 00081 00082 void resize_frame_client(); 00083 virtual void resize_frame(int cx, int cy); 00084 virtual void frame_get_clientspace(PRECT prect); 00085 00086 BOOL toggle_fullscreen(); 00087 void fullscreen_move(); 00088 00089 void FillBookmarks(); 00090 virtual bool go_to(LPCTSTR url, bool new_window); 00091 00092 void ExecuteCommandbar(LPCTSTR dir); 00093 }; 00094 00095 00096 #ifndef _NO_MDI 00097 00098 struct MDIMainFrame : public MainFrameBase 00099 { 00100 typedef MainFrameBase super; 00101 00102 MDIMainFrame(HWND hwnd); 00103 00104 static HWND Create(); 00105 static HWND Create(LPCTSTR path, int mode=OWM_EXPLORE|OWM_DETAILS); 00106 static HWND Create(LPCITEMIDLIST pidl, int mode=OWM_EXPLORE|OWM_DETAILS|OWM_PIDL); 00107 00108 ChildWindow* CreateChild(LPCTSTR path=NULL, int mode=OWM_EXPLORE|OWM_DETAILS); 00109 ChildWindow* CreateChild(LPCITEMIDLIST pidl, int mode=OWM_EXPLORE|OWM_DETAILS|OWM_PIDL); 00110 00111 protected: 00112 HWND _hmdiclient; 00113 00114 WindowHandle _hextrabar; 00115 #ifndef _NO_WIN_FS 00116 WindowHandle _hdrivebar; 00117 #endif 00118 00119 protected: 00120 LRESULT WndProc(UINT nmsg, WPARAM wparam, LPARAM lparam); 00121 int Command(int id, int code); 00122 00123 virtual BOOL TranslateMsg(MSG* pmsg); 00124 00125 bool activate_drive_window(LPCTSTR path); 00126 bool activate_child_window(LPCTSTR filesys); 00127 00128 virtual void resize_frame(int cx, int cy); 00129 virtual void frame_get_clientspace(PRECT prect); 00130 00131 virtual bool go_to(LPCTSTR url, bool new_window); 00132 00133 #ifndef _NO_WIN_FS 00134 TCHAR _drives[BUFFER_LEN]; 00135 #endif 00136 }; 00137 00138 #endif 00139 00140 00141 struct SDIMainFrame : public ExtContextMenuHandlerT< 00142 ShellBrowserChildT<MainFrameBase> 00143 > 00144 { 00145 typedef ExtContextMenuHandlerT< 00146 ShellBrowserChildT<MainFrameBase> 00147 > super; 00148 00149 SDIMainFrame(HWND hwnd); 00150 00151 static HWND Create(); 00152 static HWND Create(LPCTSTR path, int mode=OWM_EXPLORE|OWM_DETAILS); 00153 static HWND Create(LPCITEMIDLIST pidl, int mode=OWM_EXPLORE|OWM_DETAILS|OWM_PIDL); 00154 00155 protected: 00156 ShellPathInfo _shellpath_info; 00157 00158 WindowHandle _left_hwnd; 00159 WindowHandle _right_hwnd; 00160 00161 /**@todo focus handling for TAB switching 00162 int _focus_pane; // 0: left 1: right 00163 */ 00164 00165 int _split_pos; 00166 int _last_split; 00167 RECT _clnt_rect; 00168 00169 String _url; 00170 00171 LRESULT WndProc(UINT nmsg, WPARAM wparam, LPARAM lparam); 00172 int Command(int id, int code); 00173 00174 void resize_frame(int cx, int cy); 00175 void resize_children(); 00176 void update_clnt_rect(); 00177 00178 void update_shell_browser(); 00179 void jump_to(LPCTSTR path, int mode); 00180 void jump_to(LPCITEMIDLIST path, int mode); 00181 00182 // interface BrowserCallback 00183 virtual void entry_selected(Entry* entry); 00184 00185 void set_url(LPCTSTR url); 00186 };
ROS Explorer Source Code Documentation
generated on 02.01.2013 by ![]() |