PixelLightAPI
.
|
00001 /*********************************************************\ 00002 * File: TabBarButton.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_TABBARBUTTON_H__ 00024 #define __PLGUI_TABBARBUTTON_H__ 00025 #pragma once 00026 00027 00028 //[-------------------------------------------------------] 00029 //[ Includes ] 00030 //[-------------------------------------------------------] 00031 #include "PLGui/Widgets/Base/AbstractButton.h" 00032 00033 00034 //[-------------------------------------------------------] 00035 //[ Namespace ] 00036 //[-------------------------------------------------------] 00037 namespace PLGui { 00038 00039 00040 //[-------------------------------------------------------] 00041 //[ Classes ] 00042 //[-------------------------------------------------------] 00043 /** 00044 * @brief 00045 * Tab bar button 00046 */ 00047 class TabBarButton : public AbstractButton { 00048 00049 00050 //[-------------------------------------------------------] 00051 //[ Class definition ] 00052 //[-------------------------------------------------------] 00053 pl_class(PLGUI_RTTI_EXPORT, TabBarButton, "PLGui", PLGui::AbstractButton, "Tab bar button") 00054 pl_constructor_0(DefaultConstructor, "Default constructor", "") 00055 pl_class_end 00056 00057 00058 //[-------------------------------------------------------] 00059 //[ Friends ] 00060 //[-------------------------------------------------------] 00061 friend class TabBar; 00062 friend class TabBarEntry; 00063 00064 00065 //[-------------------------------------------------------] 00066 //[ Public functions ] 00067 //[-------------------------------------------------------] 00068 public: 00069 /** 00070 * @brief 00071 * Constructor 00072 * 00073 * @param[in] pParent 00074 * Pointer to parent widget 00075 */ 00076 PLGUI_API TabBarButton(Widget *pParent = nullptr); 00077 00078 /** 00079 * @brief 00080 * Destructor 00081 */ 00082 PLGUI_API virtual ~TabBarButton(); 00083 00084 /** 00085 * @brief 00086 * Get TabBar 00087 * 00088 * @return 00089 * TabBar 00090 */ 00091 PLGUI_API TabBar *GetTabBar() const; 00092 00093 /** 00094 * @brief 00095 * Get TabBarEntry 00096 * 00097 * @return 00098 * TabBarEntry 00099 */ 00100 PLGUI_API TabBarEntry *GetTabBarEntry() const; 00101 00102 /** 00103 * @brief 00104 * Get tab-bar function 00105 * 00106 * @return 00107 * Function 00108 */ 00109 PLGUI_API ETabBarFunction GetFunction() const; 00110 00111 00112 //[-------------------------------------------------------] 00113 //[ Protected functions ] 00114 //[-------------------------------------------------------] 00115 protected: 00116 /** 00117 * @brief 00118 * Set TabBar 00119 * 00120 * @param[in] pTabBar 00121 * TabBar 00122 */ 00123 PLGUI_API void SetTabBar(TabBar *pTabBar); 00124 00125 /** 00126 * @brief 00127 * Set TabBarEntry 00128 * 00129 * @param[in] pEntry 00130 * TabBarEntry 00131 */ 00132 PLGUI_API void SetTabBarEntry(TabBarEntry *pEntry); 00133 00134 /** 00135 * @brief 00136 * Set tab-bar function 00137 * 00138 * @param[in] nFunction 00139 * Function 00140 */ 00141 PLGUI_API void SetFunction(ETabBarFunction nFunction); 00142 00143 00144 //[-------------------------------------------------------] 00145 //[ Protected virtual Widget functions ] 00146 //[-------------------------------------------------------] 00147 protected: 00148 virtual void OnMouseEnter(); 00149 virtual void OnMouseLeave(); 00150 00151 00152 //[-------------------------------------------------------] 00153 //[ Private virtual AbstractButton functions ] 00154 //[-------------------------------------------------------] 00155 private: 00156 virtual void OnButtonClicked(); 00157 00158 00159 //[-------------------------------------------------------] 00160 //[ Protected data ] 00161 //[-------------------------------------------------------] 00162 protected: 00163 // Internal data (only to be set from TabBar itself!) 00164 TabBar *m_pTabBar; /**< TabBar to which the entry belongs */ 00165 TabBarEntry *m_pTabBarEntry; /**< TabBarEntry to which the entry belongs */ 00166 ETabBarFunction m_nFunction; /**< TabBar function */ 00167 00168 00169 }; 00170 00171 00172 //[-------------------------------------------------------] 00173 //[ Namespace ] 00174 //[-------------------------------------------------------] 00175 } // PLGui 00176 00177 00178 #endif // __PLGUI_TABBARBUTTON_H__
|