2015-05-03 22:32:37 +03: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 15:12:37 +04: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 07:38:07 +03:00
|
|
|
|
|
|
|
#ifndef NS_SMILINTERVAL_H_
|
|
|
|
#define NS_SMILINTERVAL_H_
|
|
|
|
|
2010-01-12 23:00:49 +03:00
|
|
|
#include "nsSMILInstanceTime.h"
|
2010-03-01 22:31:50 +03:00
|
|
|
#include "nsTArray.h"
|
2009-01-15 07:38:07 +03:00
|
|
|
|
|
|
|
//----------------------------------------------------------------------
|
|
|
|
// nsSMILInterval class
|
|
|
|
//
|
2010-01-12 23:00:49 +03: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 07:38:07 +03:00
|
|
|
//
|
|
|
|
// For an overview of how this class is related to other SMIL time classes see
|
2010-01-12 23:00:49 +03:00
|
|
|
// the documentation in nsSMILTimeValue.h
|
2009-01-15 07:38:07 +03:00
|
|
|
|
|
|
|
class nsSMILInterval
|
|
|
|
{
|
|
|
|
public:
|
2010-03-01 22:31:50 +03:00
|
|
|
nsSMILInterval();
|
|
|
|
nsSMILInterval(const nsSMILInterval& aOther);
|
|
|
|
~nsSMILInterval();
|
2011-09-29 10:19:26 +04:00
|
|
|
void Unlink(bool aFiltered = false);
|
2010-01-12 23:00:49 +03:00
|
|
|
|
|
|
|
const nsSMILInstanceTime* Begin() const
|
|
|
|
{
|
2015-02-10 01:34:50 +03:00
|
|
|
MOZ_ASSERT(mBegin && mEnd,
|
|
|
|
"Requesting Begin() on un-initialized instance time");
|
2010-01-12 23:00:49 +03:00
|
|
|
return mBegin;
|
|
|
|
}
|
2010-03-01 22:31:50 +03:00
|
|
|
nsSMILInstanceTime* Begin();
|
2010-01-12 23:00:49 +03:00
|
|
|
|
|
|
|
const nsSMILInstanceTime* End() const
|
|
|
|
{
|
2015-02-10 01:34:50 +03:00
|
|
|
MOZ_ASSERT(mBegin && mEnd,
|
|
|
|
"Requesting End() on un-initialized instance time");
|
2010-01-12 23:00:49 +03:00
|
|
|
return mEnd;
|
|
|
|
}
|
2010-03-01 22:31:50 +03:00
|
|
|
nsSMILInstanceTime* End();
|
2010-01-12 23:00:49 +03:00
|
|
|
|
2010-03-01 22:31:50 +03:00
|
|
|
void SetBegin(nsSMILInstanceTime& aBegin);
|
|
|
|
void SetEnd(nsSMILInstanceTime& aEnd);
|
|
|
|
void Set(nsSMILInstanceTime& aBegin, nsSMILInstanceTime& aEnd)
|
2010-01-12 23:00:49 +03:00
|
|
|
{
|
2010-03-01 22:31:50 +03:00
|
|
|
SetBegin(aBegin);
|
|
|
|
SetEnd(aEnd);
|
2010-01-12 23:00:49 +03:00
|
|
|
}
|
|
|
|
|
2010-07-03 09:52:50 +04:00
|
|
|
void FixBegin();
|
|
|
|
void FixEnd();
|
2010-03-01 22:31:50 +03:00
|
|
|
|
2011-06-15 04:16:57 +04:00
|
|
|
typedef nsTArray<nsRefPtr<nsSMILInstanceTime> > InstanceTimeList;
|
|
|
|
|
2010-03-01 22:31:50 +03:00
|
|
|
void AddDependentTime(nsSMILInstanceTime& aTime);
|
|
|
|
void RemoveDependentTime(const nsSMILInstanceTime& aTime);
|
2011-06-15 04:16:57 +04:00
|
|
|
void GetDependentTimes(InstanceTimeList& aTimes);
|
2010-03-01 22:31:50 +03:00
|
|
|
|
2010-07-03 09:52:50 +04:00
|
|
|
// Cue for assessing if this interval can be filtered
|
2011-09-29 10:19:26 +04:00
|
|
|
bool IsDependencyChainLink() const;
|
2010-07-03 09:52:50 +04:00
|
|
|
|
2010-01-12 23:00:49 +03:00
|
|
|
private:
|
|
|
|
nsRefPtr<nsSMILInstanceTime> mBegin;
|
|
|
|
nsRefPtr<nsSMILInstanceTime> mEnd;
|
2010-03-01 22:31:50 +03:00
|
|
|
|
2010-05-21 04:18:29 +04:00
|
|
|
// nsSMILInstanceTimes to notify when this interval is changed or deleted.
|
2010-03-01 22:31:50 +03:00
|
|
|
InstanceTimeList mDependentTimes;
|
|
|
|
|
2010-07-03 09:52:50 +04: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 18:59:28 +04:00
|
|
|
// (i.e. nsSMILInstanceTime::IsFixed() returns true). This is because it is
|
2010-07-03 09:52:50 +04: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 18:59:28 +04:00
|
|
|
// However, if mBegin/EndFixed is true, then BOTH the nsSMILInstanceTime
|
2010-07-03 09:52:50 +04:00
|
|
|
// OBJECT returned for that end point and its TIME value will not change.
|
2011-09-29 10:19:26 +04:00
|
|
|
bool mBeginFixed;
|
|
|
|
bool mEndFixed;
|
2009-01-15 07:38:07 +03:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // NS_SMILINTERVAL_H_
|