PixelLightAPI
.
|
00001 /*********************************************************\ 00002 * File: ModTimeout.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_MODTIMEOUT_H__ 00024 #define __PLGUI_MODTIMEOUT_H__ 00025 #pragma once 00026 00027 00028 //[-------------------------------------------------------] 00029 //[ Includes ] 00030 //[-------------------------------------------------------] 00031 #include "PLGui/Modifiers/Modifier.h" 00032 00033 00034 //[-------------------------------------------------------] 00035 //[ Namespace ] 00036 //[-------------------------------------------------------] 00037 namespace PLGui { 00038 00039 00040 //[-------------------------------------------------------] 00041 //[ Forward declarations ] 00042 //[-------------------------------------------------------] 00043 class Timer; 00044 00045 00046 //[-------------------------------------------------------] 00047 //[ Classes ] 00048 //[-------------------------------------------------------] 00049 /** 00050 * @brief 00051 * Modifier that closes the widget after a specific time 00052 */ 00053 class ModTimeout : public Modifier { 00054 00055 00056 //[-------------------------------------------------------] 00057 //[ Class definition ] 00058 //[-------------------------------------------------------] 00059 pl_class(PLGUI_RTTI_EXPORT, ModTimeout, "PLGui", PLGui::Modifier, "Modifier that closes the widget after a specific time") 00060 // Attributes 00061 pl_attribute(Timeout, PLCore::uint64, 1000, ReadWrite, DirectValue, "Timeout in milliseconds", "") 00062 // Constructors 00063 pl_constructor_0(DefaultConstructor, "Default constructor", "") 00064 // Slots 00065 pl_slot_0(OnTimer, "Timer callback", "") 00066 pl_class_end 00067 00068 00069 //[-------------------------------------------------------] 00070 //[ Public functions ] 00071 //[-------------------------------------------------------] 00072 public: 00073 /** 00074 * @brief 00075 * Constructor 00076 */ 00077 PLGUI_API ModTimeout(); 00078 00079 /** 00080 * @brief 00081 * Destructor 00082 */ 00083 PLGUI_API virtual ~ModTimeout(); 00084 00085 00086 //[-------------------------------------------------------] 00087 //[ Protected virtual Modifier functions ] 00088 //[-------------------------------------------------------] 00089 protected: 00090 virtual void OnAttach(Widget &cWidget) override; 00091 virtual void OnDetach(Widget &cWidget) override; 00092 00093 00094 //[-------------------------------------------------------] 00095 //[ Protected virtual WidgetFunctions functions ] 00096 //[-------------------------------------------------------] 00097 protected: 00098 virtual void OnShow() override; 00099 00100 00101 //[-------------------------------------------------------] 00102 //[ Protected functions ] 00103 //[-------------------------------------------------------] 00104 protected: 00105 /** 00106 * @brief 00107 * Called when the timer has fired 00108 */ 00109 void OnTimer(); 00110 00111 00112 //[-------------------------------------------------------] 00113 //[ Protected data ] 00114 //[-------------------------------------------------------] 00115 protected: 00116 Timer *m_pTimer; /**< Timer */ 00117 00118 00119 }; 00120 00121 00122 //[-------------------------------------------------------] 00123 //[ Namespace ] 00124 //[-------------------------------------------------------] 00125 } // PLGui 00126 00127 00128 #endif // __PLGUI_MODTIMEOUT_H__
|