1 /* 2 * Copyright (c) 2024 Huawei Device Co., Ltd. 3 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * you may not use this file except in compliance with the License. 5 * You may obtain a copy of the License at 6 * 7 * http://www.apache.org/licenses/LICENSE-2.0 8 * 9 * Unless required by applicable law or agreed to in writing, software 10 * distributed under the License is distributed on an "AS IS" BASIS, 11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 * See the License for the specific language governing permissions and 13 * limitations under the License. 14 */ 15 16 #ifndef META_INTERFACE_ITICKABLE_H 17 #define META_INTERFACE_ITICKABLE_H 18 19 #include <meta/base/interface_macros.h> 20 #include <meta/base/time_span.h> 21 22 META_BEGIN_NAMESPACE() 23 24 REGISTER_INTERFACE(ITickable, "4ff70521-002a-4f64-8b42-20a82a11947d") 25 26 /** 27 * @brief The ITickable interface can be implemented by startable objects who want notifcation 28 * from the startable object controller of a UI hierarchy during runtime. 29 */ 30 class ITickable : public CORE_NS::IInterface { 31 META_INTERFACE(CORE_NS::IInterface, ITickable) 32 public: 33 /** 34 * @brief Called by a startable object controller. 35 * @param sinceLastTick Time since previous call. 36 */ 37 virtual void Tick(const TimeSpan& time, const TimeSpan& sinceLastTick) = 0; 38 }; 39 40 META_END_NAMESPACE() 41 42 #endif // META_INTERFACE_ITICKABLE_H 43