2015-05-03 19:32:37 +00:00
|
|
|
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
|
|
|
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
|
2012-05-21 11:12:37 +00:00
|
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
2009-01-15 04:38:07 +00:00
|
|
|
|
2019-01-25 08:16:09 +00:00
|
|
|
#ifndef mozilla_SMILInterval_h
|
|
|
|
#define mozilla_SMILInterval_h
|
2009-01-15 04:38:07 +00:00
|
|
|
|
2019-01-22 07:28:40 +00:00
|
|
|
#include "mozilla/SMILInstanceTime.h"
|
2010-03-01 19:31:50 +00:00
|
|
|
#include "nsTArray.h"
|
2009-01-15 04:38:07 +00:00
|
|
|
|
2019-01-21 13:08:12 +00:00
|
|
|
namespace mozilla {
|
|
|
|
|
2009-01-15 04:38:07 +00:00
|
|
|
//----------------------------------------------------------------------
|
2019-01-21 13:08:12 +00:00
|
|
|
// SMILInterval class
|
2009-01-15 04:38:07 +00:00
|
|
|
//
|
2010-01-12 20:00:49 +00:00
|
|
|
// A structure consisting of a begin and end time. The begin time must be
|
|
|
|
// resolved (i.e. not indefinite or unresolved).
|
2009-01-15 04:38:07 +00:00
|
|
|
//
|
|
|
|
// For an overview of how this class is related to other SMIL time classes see
|
2019-01-22 07:28:40 +00:00
|
|
|
// the documentation in SMILTimeValue.h
|
2009-01-15 04:38:07 +00:00
|
|
|
|
2019-01-21 13:08:12 +00:00
|
|
|
class SMILInterval {
|
2009-01-15 04:38:07 +00:00
|
|
|
public:
|
2019-01-21 13:08:12 +00:00
|
|
|
SMILInterval();
|
|
|
|
SMILInterval(const SMILInterval& aOther);
|
|
|
|
~SMILInterval();
|
2011-09-29 06:19:26 +00:00
|
|
|
void Unlink(bool aFiltered = false);
|
2010-01-12 20:00:49 +00:00
|
|
|
|
2019-01-22 07:28:40 +00:00
|
|
|
const SMILInstanceTime* Begin() const {
|
2015-02-09 22:34:50 +00:00
|
|
|
MOZ_ASSERT(mBegin && mEnd,
|
|
|
|
"Requesting Begin() on un-initialized instance time");
|
2010-01-12 20:00:49 +00:00
|
|
|
return mBegin;
|
|
|
|
}
|
2019-01-22 07:28:40 +00:00
|
|
|
SMILInstanceTime* Begin();
|
2010-01-12 20:00:49 +00:00
|
|
|
|
2019-01-22 07:28:40 +00:00
|
|
|
const SMILInstanceTime* End() const {
|
2015-02-09 22:34:50 +00:00
|
|
|
MOZ_ASSERT(mBegin && mEnd,
|
|
|
|
"Requesting End() on un-initialized instance time");
|
2010-01-12 20:00:49 +00:00
|
|
|
return mEnd;
|
|
|
|
}
|
2019-01-22 07:28:40 +00:00
|
|
|
SMILInstanceTime* End();
|
2010-01-12 20:00:49 +00:00
|
|
|
|
2019-01-22 07:28:40 +00:00
|
|
|
void SetBegin(SMILInstanceTime& aBegin);
|
|
|
|
void SetEnd(SMILInstanceTime& aEnd);
|
|
|
|
void Set(SMILInstanceTime& aBegin, SMILInstanceTime& aEnd) {
|
2010-03-01 19:31:50 +00:00
|
|
|
SetBegin(aBegin);
|
|
|
|
SetEnd(aEnd);
|
2010-01-12 20:00:49 +00:00
|
|
|
}
|
|
|
|
|
2010-07-03 05:52:50 +00:00
|
|
|
void FixBegin();
|
|
|
|
void FixEnd();
|
2010-03-01 19:31:50 +00:00
|
|
|
|
2019-01-22 07:28:40 +00:00
|
|
|
typedef nsTArray<RefPtr<SMILInstanceTime> > InstanceTimeList;
|
2011-06-15 00:16:57 +00:00
|
|
|
|
2019-01-22 07:28:40 +00:00
|
|
|
void AddDependentTime(SMILInstanceTime& aTime);
|
|
|
|
void RemoveDependentTime(const SMILInstanceTime& aTime);
|
2011-06-15 00:16:57 +00:00
|
|
|
void GetDependentTimes(InstanceTimeList& aTimes);
|
2010-03-01 19:31:50 +00:00
|
|
|
|
2010-07-03 05:52:50 +00:00
|
|
|
// Cue for assessing if this interval can be filtered
|
2011-09-29 06:19:26 +00:00
|
|
|
bool IsDependencyChainLink() const;
|
2010-07-03 05:52:50 +00:00
|
|
|
|
2010-01-12 20:00:49 +00:00
|
|
|
private:
|
2019-01-22 07:28:40 +00:00
|
|
|
RefPtr<SMILInstanceTime> mBegin;
|
|
|
|
RefPtr<SMILInstanceTime> mEnd;
|
2010-03-01 19:31:50 +00:00
|
|
|
|
2019-01-22 07:28:40 +00:00
|
|
|
// SMILInstanceTimes to notify when this interval is changed or deleted.
|
2010-03-01 19:31:50 +00:00
|
|
|
InstanceTimeList mDependentTimes;
|
|
|
|
|
2010-07-03 05:52:50 +00:00
|
|
|
// Indicates if the end points of the interval are fixed or not.
|
|
|
|
//
|
|
|
|
// Note that this is not the same as having an end point whose TIME is fixed
|
2019-01-22 07:28:40 +00:00
|
|
|
// (i.e. SMILInstanceTime::IsFixed() returns true). This is because it is
|
2010-07-03 05:52:50 +00:00
|
|
|
// possible to have an end point with a fixed TIME and yet still update the
|
2019-01-22 07:28:40 +00:00
|
|
|
// end point to refer to a different SMILInstanceTime object.
|
2010-07-03 05:52:50 +00:00
|
|
|
//
|
2019-01-22 07:28:40 +00:00
|
|
|
// However, if mBegin/EndFixed is true, then BOTH the SMILInstanceTime
|
2010-07-03 05:52:50 +00:00
|
|
|
// OBJECT returned for that end point and its TIME value will not change.
|
2011-09-29 06:19:26 +00:00
|
|
|
bool mBeginFixed;
|
|
|
|
bool mEndFixed;
|
2009-01-15 04:38:07 +00:00
|
|
|
};
|
|
|
|
|
2019-01-21 13:08:12 +00:00
|
|
|
} // namespace mozilla
|
|
|
|
|
2019-01-25 08:16:09 +00:00
|
|
|
#endif // mozilla_SMILInterval_h
|