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_RANGELIST_H
0009 #define SCRIPTING_RANGELIST_H
0010 
0011 #include "core/rangelist.h"
0012 
0013 #include <QObject>
0014 
0015 namespace SubtitleComposer {
0016 namespace Scripting {
0017 class RangeList : public QObject
0018 {
0019     Q_OBJECT
0020 
0021 public slots:
0022     QObject * complement() const;
0023 
0024     bool isEmpty() const;
0025 
0026     int rangesCount() const;
0027     int indexesCount() const;
0028 
0029     int firstIndex() const;
0030     int lastIndex() const;
0031 
0032     QObject * range(int rangeIndex) const;
0033 
0034     bool contains(int index) const;
0035 
0036     void clear();
0037 
0038     void trimToIndex(int index);
0039     void trimToRange(QObject *range);
0040 
0041     QObject * addIndex(int index);
0042     QObject * addRange(QObject *range);
0043 
0044     void shiftIndexesForwards(int fromIndex, int delta, bool fillSplitGap);
0045     void shiftIndexesBackwards(int fromIndex, int delta);
0046 
0047 private:
0048     friend class RangesModule;
0049     friend class Subtitle;
0050 
0051     RangeList(const SubtitleComposer::RangeList &backend, QObject *parent);
0052 
0053     SubtitleComposer::RangeList m_backend;
0054 };
0055 }
0056 }
0057 #endif