File indexing completed on 2024-06-16 04:38:25

0001 /*
0002     SPDX-FileCopyrightText: 2007-2009 Sergio Pistone <sergio_pistone@yahoo.com.ar>
0003     SPDX-FileCopyrightText: 2010-2022 Mladen Milinkovic <max@smoothware.net>
0004 
0005     SPDX-License-Identifier: GPL-2.0-or-later
0006 */
0007 
0008 #ifndef SCRIPTING_LIST_H
0009 #define SCRIPTING_LIST_H
0010 
0011 #include <QObjectList>
0012 
0013 namespace SubtitleComposer {
0014 namespace Scripting {
0015 class List : public QObject
0016 {
0017     Q_OBJECT
0018 
0019 public:
0020     List(const char *contentClass, QObject *parent);
0021     List(const QObjectList &backend, const char *contentClass, QObject *parent);
0022 
0023 public slots:
0024     bool isEmpty() const;
0025 
0026     int length() const;
0027     int size() const;
0028     int count() const;
0029 
0030     QObject * at(int index) const;
0031 
0032     void insert(int index, QObject *object);
0033     void append(QObject *object);
0034     void prepend(QObject *object);
0035 
0036     void removeFirst();
0037     void removeLast();
0038     void removeAt(int index);
0039 
0040     void clear();
0041 
0042 private:
0043     const char *m_contentClass;
0044     QObjectList m_backend;
0045 };
0046 }
0047 }
0048 #endif