File indexing completed on 2024-12-22 04:40:14

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 #include "scripting_range.h"
0009 
0010 using namespace SubtitleComposer;
0011 
0012 /// RANGE IMPLEMENTATION
0013 /// ====================
0014 
0015 Scripting::Range::Range(const SubtitleComposer::Range &range, QObject *parent) :
0016     QObject(parent),
0017     m_backend(range)
0018 {}
0019 
0020 int
0021 Scripting::Range::start() const
0022 {
0023     return m_backend.start();
0024 }
0025 
0026 int
0027 Scripting::Range::end() const
0028 {
0029     return m_backend.end();
0030 }
0031 
0032 int
0033 Scripting::Range::length() const
0034 {
0035     return m_backend.length();
0036 }
0037 
0038 bool
0039 Scripting::Range::contains(int index) const
0040 {
0041     return m_backend.contains(index);
0042 }
0043 
0044 bool
0045 Scripting::Range::contains(const QObject *object) const
0046 {
0047     if(const Scripting::Range * range = qobject_cast<const Scripting::Range *>(object))
0048         return m_backend.contains(range->m_backend);
0049     else
0050         return false;
0051 }
0052 
0053