File indexing completed on 2024-03-24 17:24:46

0001 /* This file is part of Kairo Timer
0002 
0003    SPDX-FileCopyrightText: 2016 (c) Kevin Ottens <ervin@kde.org>
0004 
0005    SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL
0006 
0007 */
0008 
0009 #ifndef CIRCUITMODEL_H
0010 #define CIRCUITMODEL_H
0011 
0012 #include <initializer_list>
0013 
0014 #include <QVector>
0015 
0016 #include "timermodel.h"
0017 
0018 class CircuitModel
0019 {
0020     Q_GADGET
0021     Q_PROPERTY(QString name READ name)
0022     Q_PROPERTY(bool empty READ isEmpty)
0023     Q_PROPERTY(int size READ size)
0024 public:
0025     CircuitModel();
0026     CircuitModel(const QString &name, std::initializer_list<TimerModel> content);
0027     CircuitModel(const QString &name, const QVector<TimerModel> &content);
0028 
0029     bool operator==(const CircuitModel &other) const;
0030     bool operator!=(const CircuitModel &other) const;
0031 
0032     QString name() const;
0033     bool isEmpty() const;
0034     int size() const;
0035 
0036     Q_INVOKABLE TimerModel at(int index) const;
0037 
0038 private:
0039     QString m_name;
0040     QVector<TimerModel> m_content;
0041 };
0042 
0043 Q_DECLARE_METATYPE(CircuitModel)
0044 
0045 #endif