PixelLightAPI
.
|
00001 /*********************************************************\ 00002 * File: Modifier.h * 00003 * 00004 * Copyright (C) 2002-2012 The PixelLight Team (http://www.pixellight.org/) 00005 * 00006 * This file is part of PixelLight. 00007 * 00008 * PixelLight is free software: you can redistribute it and/or modify 00009 * it under the terms of the GNU Lesser General Public License as published by 00010 * the Free Software Foundation, either version 3 of the License, or 00011 * (at your option) any later version. 00012 * 00013 * PixelLight is distributed in the hope that it will be useful, 00014 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00015 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00016 * GNU Lesser General Public License for more details. 00017 * 00018 * You should have received a copy of the GNU Lesser General Public License 00019 * along with PixelLight. If not, see <http://www.gnu.org/licenses/>. 00020 \*********************************************************/ 00021 00022 00023 #ifndef __PLGUI_MODIFIER_H__ 00024 #define __PLGUI_MODIFIER_H__ 00025 #pragma once 00026 00027 00028 //[-------------------------------------------------------] 00029 //[ Includes ] 00030 //[-------------------------------------------------------] 00031 #include <PLCore/Base/Object.h> 00032 #include "PLGui/Gui/Base/WidgetFunctions.h" 00033 00034 00035 //[-------------------------------------------------------] 00036 //[ Namespace ] 00037 //[-------------------------------------------------------] 00038 namespace PLGui { 00039 00040 00041 //[-------------------------------------------------------] 00042 //[ Forward declarations ] 00043 //[-------------------------------------------------------] 00044 class Widget; 00045 00046 00047 //[-------------------------------------------------------] 00048 //[ Classes ] 00049 //[-------------------------------------------------------] 00050 /** 00051 * @brief 00052 * Modifier base class 00053 */ 00054 class Modifier : public PLCore::Object, public WidgetFunctions { 00055 00056 00057 //[-------------------------------------------------------] 00058 //[ Class definition ] 00059 //[-------------------------------------------------------] 00060 pl_class(PLGUI_RTTI_EXPORT, Modifier, "PLGui", PLCore::Object, "Modifier base class") 00061 pl_class_end 00062 00063 00064 //[-------------------------------------------------------] 00065 //[ Friends ] 00066 //[-------------------------------------------------------] 00067 friend class Widget; 00068 00069 00070 //[-------------------------------------------------------] 00071 //[ Public functions ] 00072 //[-------------------------------------------------------] 00073 public: 00074 /** 00075 * @brief 00076 * Constructor 00077 */ 00078 PLGUI_API Modifier(); 00079 00080 /** 00081 * @brief 00082 * Destructor 00083 */ 00084 PLGUI_API virtual ~Modifier(); 00085 00086 /** 00087 * @brief 00088 * Return the widget to which the modifier belongs 00089 * 00090 * @return 00091 * Widget that contains the modifier 00092 */ 00093 PLGUI_API Widget *GetWidget() const; 00094 00095 /** 00096 * @brief 00097 * Get name of modifier 00098 * 00099 * @return 00100 * Name 00101 */ 00102 PLGUI_API PLCore::String GetName() const; 00103 00104 00105 //[-------------------------------------------------------] 00106 //[ Protected functions ] 00107 //[-------------------------------------------------------] 00108 protected: 00109 /** 00110 * @brief 00111 * Set name of modifier 00112 * 00113 * @param[in] sName 00114 * Name 00115 */ 00116 PLGUI_API void SetName(const PLCore::String &sName); 00117 00118 /** 00119 * @brief 00120 * Attach the modifier to a widget 00121 * 00122 * @param[in] cWidget 00123 * Widget to which the modifier is attached 00124 */ 00125 PLGUI_API void Attach(Widget &cWidget); 00126 00127 /** 00128 * @brief 00129 * Detach the modifier 00130 */ 00131 PLGUI_API void Detach(); 00132 00133 00134 //[-------------------------------------------------------] 00135 //[ Protected virtual Modifier functions ] 00136 //[-------------------------------------------------------] 00137 protected: 00138 /** 00139 * @brief 00140 * Called when the modifier is attached to a widget 00141 * 00142 * @param[in] cWidget 00143 * Widget to which the modifier is attached 00144 */ 00145 virtual void OnAttach(Widget &cWidget); 00146 00147 /** 00148 * @brief 00149 * Called when the modifier is detached from a widget 00150 * 00151 * @param[in] cWidget 00152 * Widget from which the modifier is detached 00153 */ 00154 virtual void OnDetach(Widget &cWidget); 00155 00156 00157 //[-------------------------------------------------------] 00158 //[ Protected virtual WidgetFunctions functions ] 00159 //[-------------------------------------------------------] 00160 protected: 00161 PLGUI_API virtual void OnMessage(const GuiMessage &cMessage); 00162 00163 00164 //[-------------------------------------------------------] 00165 //[ Protected data ] 00166 //[-------------------------------------------------------] 00167 protected: 00168 Widget *m_pWidget; /**< Widget to which the modifier belongs */ 00169 PLCore::String m_sName; /**< Name of modifier */ 00170 00171 00172 }; 00173 00174 00175 //[-------------------------------------------------------] 00176 //[ Namespace ] 00177 //[-------------------------------------------------------] 00178 } // PLGui 00179 00180 00181 #endif // __PLGUI_MODIFIER_H__
|