1 /* 2 * DQt - D bindings for the Qt Toolkit 3 * 4 * GNU Lesser General Public License Usage 5 * This file may be used under the terms of the GNU Lesser 6 * General Public License version 3 as published by the Free Software 7 * Foundation and appearing in the file LICENSE.LGPL3 included in the 8 * packaging of this file. Please review the following information to 9 * ensure the GNU Lesser General Public License version 3 requirements 10 * will be met: https://www.gnu.org/licenses/lgpl-3.0.html. 11 */ 12 module qt.core.basictimer; 13 extern(C++): 14 15 import qt.config; 16 import qt.core.namespace; 17 import qt.core.object; 18 import qt.core.typeinfo; 19 import qt.helpers; 20 21 22 /// Binding for C++ class [QBasicTimer](https://doc.qt.io/qt-6/qbasictimer.html). 23 @Q_RELOCATABLE_TYPE extern(C++, class) struct /+ Q_CORE_EXPORT +/ QBasicTimer 24 { 25 private: 26 int id; 27 /+ Q_DISABLE_COPY(QBasicTimer) +/ 28 @disable this(this); 29 /+this(ref const(QBasicTimer));+//+ref QBasicTimer operator =(ref const(QBasicTimer));+/ 30 public: 31 @disable this(); 32 /+this()/+ noexcept+/ 33 { 34 this.id = {0}; 35 }+/ 36 pragma(inline, true) ~this() { if (id) stop(); } 37 38 /+ QBasicTimer(QBasicTimer &&other) noexcept 39 : id{qExchange(other.id, 0)} 40 {} +/ 41 42 /+ QT_MOVE_ASSIGNMENT_OPERATOR_IMPL_VIA_MOVE_AND_SWAP(QBasicTimer) +/ 43 44 /+ void swap(QBasicTimer &other) noexcept { qSwap(id, other.id); } +/ 45 46 bool isActive() const/+ noexcept+/ { return id != 0; } 47 int timerId() const/+ noexcept+/ { return id; } 48 49 void start(int msec, QObject obj); 50 void start(int msec, /+ Qt:: +/qt.core.namespace.TimerType timerType, QObject obj); 51 void stop(); 52 mixin(CREATE_CONVENIENCE_WRAPPERS); 53 } 54 /+ Q_DECLARE_TYPEINFO(QBasicTimer, Q_RELOCATABLE_TYPE); 55 56 inline void swap(QBasicTimer &lhs, QBasicTimer &rhs) noexcept { lhs.swap(rhs); } +/ 57