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
|
|
|
|
|
|
|
#ifndef NS_SMILINTERVAL_H_
|
|
|
|
#define NS_SMILINTERVAL_H_
|
|
|
|
|
2010-01-12 20:00:49 +00:00
|
|
|
#include "nsSMILInstanceTime.h"
|
2010-03-01 19:31:50 +00:00
|
|
|
#include "nsTArray.h"
|
2009-01-15 04:38:07 +00:00
|
|
|
|
|
|
|
//----------------------------------------------------------------------
|
|
|
|
// nsSMILInterval class
|
|
|
|
//
|
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
|
2010-01-12 20:00:49 +00:00
|
|
|
// the documentation in nsSMILTimeValue.h
|
2009-01-15 04:38:07 +00:00
|
|
|
|
|
|
|
class nsSMILInterval
|
|
|
|
{
|
|
|
|
public:
|
2010-03-01 19:31:50 +00:00
|
|
|
nsSMILInterval();
|
|
|
|
nsSMILInterval(const nsSMILInterval& aOther);
|
|
|
|
~nsSMILInterval();
|
2011-09-29 06:19:26 +00:00
|
|
|
void Unlink(bool aFiltered = false);
|
2010-01-12 20:00:49 +00:00
|
|
|
|
|
|
|
const nsSMILInstanceTime* 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;
|
|
|
|
}
|
2010-03-01 19:31:50 +00:00
|
|
|
nsSMILInstanceTime* Begin();
|
2010-01-12 20:00:49 +00:00
|
|
|
|
|
|
|
const nsSMILInstanceTime* 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;
|
|
|
|
}
|
2010-03-01 19:31:50 +00:00
|
|
|
nsSMILInstanceTime* End();
|
2010-01-12 20:00:49 +00:00
|
|
|
|
2010-03-01 19:31:50 +00:00
|
|
|
void SetBegin(nsSMILInstanceTime& aBegin);
|
|
|
|
void SetEnd(nsSMILInstanceTime& aEnd);
|
|
|
|
void Set(nsSMILInstanceTime& aBegin, nsSMILInstanceTime& aEnd)
|
2010-01-12 20:00:49 +00:00
|
|
|
{
|
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
|
|
|
|
2015-10-18 05:24:48 +00:00
|
|
|
typedef nsTArray<RefPtr<nsSMILInstanceTime> > InstanceTimeList;
|
2011-06-15 00:16:57 +00:00
|
|
|
|
2010-03-01 19:31:50 +00:00
|
|
|
void AddDependentTime(nsSMILInstanceTime& aTime);
|
|
|
|
void RemoveDependentTime(const nsSMILInstanceTime& 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:
|
2015-10-18 05:24:48 +00:00
|
|
|
RefPtr<nsSMILInstanceTime> mBegin;
|
|
|
|
RefPtr<nsSMILInstanceTime> mEnd;
|
2010-03-01 19:31:50 +00:00
|
|
|
|
2010-05-21 00:18:29 +00:00
|
|
|
// nsSMILInstanceTimes 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
|
2011-10-17 14:59:28 +00:00
|
|
|
// (i.e. nsSMILInstanceTime::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
|
|
|
|
// end point to refer to a different nsSMILInstanceTime object.
|
|
|
|
//
|
2011-10-17 14:59:28 +00:00
|
|
|
// However, if mBegin/EndFixed is true, then BOTH the nsSMILInstanceTime
|
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
|
|
|
};
|
|
|
|
|
|
|
|
#endif // NS_SMILINTERVAL_H_
|