00001 /* 00002 ** ClanLib SDK 00003 ** Copyright (c) 1997-2011 The ClanLib Team 00004 ** 00005 ** This software is provided 'as-is', without any express or implied 00006 ** warranty. In no event will the authors be held liable for any damages 00007 ** arising from the use of this software. 00008 ** 00009 ** Permission is granted to anyone to use this software for any purpose, 00010 ** including commercial applications, and to alter it and redistribute it 00011 ** freely, subject to the following restrictions: 00012 ** 00013 ** 1. The origin of this software must not be misrepresented; you must not 00014 ** claim that you wrote the original software. If you use this software 00015 ** in a product, an acknowledgment in the product documentation would be 00016 ** appreciated but is not required. 00017 ** 2. Altered source versions must be plainly marked as such, and must not be 00018 ** misrepresented as being the original software. 00019 ** 3. This notice may not be removed or altered from any source distribution. 00020 ** 00021 ** Note: Some of the libraries ClanLib may link to may have additional 00022 ** requirements or restrictions. 00023 ** 00024 ** File Author(s): 00025 ** 00026 ** Magnus Norddahl 00027 */ 00028 00031 00032 #pragma once 00033 00034 #include "../api_gui.h" 00035 #include "../gui_component.h" 00036 #include "../../Core/Signals/callback_v0.h" 00037 #include "../../Display/Render/graphic_context.h" 00038 00039 class CL_MenuBar; 00040 class CL_ToolBar; 00041 class CL_StatusBar; 00042 class CL_DockWindow; 00043 class CL_MainWindow_Impl; 00044 00048 class CL_API_GUI CL_MainWindow : public CL_GUIComponent 00049 { 00052 00053 public: 00054 00059 CL_MainWindow(CL_GUIManager *manager, const CL_GUITopLevelDescription &description); 00060 00065 CL_MainWindow(CL_GUIComponent *owner, const CL_GUITopLevelDescription &description); 00066 00067 virtual ~CL_MainWindow(); 00068 00072 00073 public: 00074 00078 CL_Callback_v0 &func_close(); 00079 00080 CL_Callback_v1<CL_Rect&> &func_resize(); 00081 00085 00086 public: 00087 00088 using CL_GUIComponent::get_named_item; 00089 00093 static CL_MainWindow *get_named_item(CL_GUIComponent *reference_component, const CL_StringRef &id); 00094 00098 CL_StringRef get_title() const; 00099 00103 CL_MenuBar *get_menubar() const; 00104 00108 CL_StatusBar *get_statusbar() const; 00109 00110 std::vector<CL_ToolBar *> get_toolbars() const; 00111 00115 00116 public: 00117 00121 void set_title(const CL_StringRef &str); 00122 00126 00127 private: 00128 CL_SharedPtr<CL_MainWindow_Impl> impl; 00130 }; 00131