#ifndef __SMIL_H__ #define __SMIL_H__ /** * Phoebe DOM Implementation. * * This is a C++ approximation of the W3C DOM model, which follows * fairly closely the specifications in the various .idl files, copies of * which are provided for reference. Most important is this one: * * http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407/idl-definitions.html * * Authors: * Bob Jamison * * Copyright (C) 2005 Bob Jamison * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "dom.h" #include "views.h" #include "events.h" #include namespace org { namespace w3c { namespace dom { namespace smil { //Local definitions typedef dom::DOMString DOMString; typedef dom::Element Element; typedef dom::NodeList NodeList; typedef dom::Document Document; //forward declarations class ElementExclusiveTimeContainer; class ElementLayout; class ElementParallelTimeContainer; class ElementSequentialTimeContainer; class ElementSyncBehavior; class ElementTargetAttributes; class ElementTest; class ElementTime; class ElementTimeContainer; class ElementTimeControl; class ElementTimeManipulation; class SMILAnimateColorElement; class SMILAnimateElement; class SMILAnimateMotionElement; class SMILAnimation; class SMILDocument; class SMILElement; class SMILLayoutElement; class SMILMediaElement; class SMILRefElement; class SMILRegionElement; class SMILRegionInterface; class SMILRootLayoutElement; class SMILSetElement; class SMILSwitchElement; class SMILTopLayoutElement; class Time; class TimeEvent; class TimeList; /*######################################################################### ########################################################################### ## D A T A T Y P E S ########################################################################### #########################################################################*/ /*######################################################################### ## ElementLayout #########################################################################*/ /** * */ class ElementLayout { public: /** * */ virtual DOMString getTitle() { return title; } /** * */ virtual void setTitle(const DOMString &val) throw(dom::DOMException) { title = val; } /** * */ virtual DOMString getBackgroundColor() { return backgroundColor; } /** * */ virtual void setBackgroundColor(const DOMString &val) throw(dom::DOMException) { backgroundColor = val; } /** * */ virtual long getHeight() { return height; } /** * */ virtual void setHeight(long val) throw(dom::DOMException) { height = val; } /** * */ virtual long getWidth() { return width; } /** * */ virtual void setWidth(long val) throw(dom::DOMException) { width = val; } //################## //# Non-API methods //################## /** * */ ElementLayout() {} /** * */ ElementLayout(const ElementLayout &other) { title = other.title; backgroundColor = other.backgroundColor; height = other.height; width = other.width; } /** * */ virtual ~ElementLayout() {} protected: DOMString title; DOMString backgroundColor; long height; long width; }; /*######################################################################### ## SMILRegionInterface #########################################################################*/ /** * */ class SMILRegionInterface { public: /** * */ virtual SMILRegionElement *getRegion() { return regionElement; } /** * */ virtual void setRegion(const SMILRegionElement *val) { regionElement = (SMILRegionElement *)val; } //################## //# Non-API methods //################## /** * */ SMILRegionInterface() { regionElement = NULL; } /** * */ SMILRegionInterface(const SMILRegionInterface &other) { regionElement = other.regionElement; } /** * */ virtual ~SMILRegionInterface() {} protected: SMILRegionElement *regionElement; }; /*######################################################################### ## Time #########################################################################*/ /** * */ class Time { public: /** * */ virtual bool getResolved() { return resolved; } /** * */ virtual double getResolvedOffset() { return resolvedOffset; } typedef enum { SMIL_TIME_INDEFINITE = 0, SMIL_TIME_OFFSET = 1, SMIL_TIME_SYNC_BASED = 2, SMIL_TIME_EVENT_BASED = 3, SMIL_TIME_WALLCLOCK = 4, SMIL_TIME_MEDIA_MARKER = 5 } TimeTypes; /** * */ virtual unsigned short getTimeType() { return timeType; } /** * */ virtual double getOffset() { return offset; } /** * */ virtual void setOffset(double val) throw (dom::DOMException) { offset = val; } /** * */ virtual Element *getBaseElement() { return baseElement; } /** * */ virtual void setBaseElement(const Element *val) throw (dom::DOMException) { baseElement = (Element *)val; } /** * */ virtual bool getBaseBegin() { return baseBegin; } /** * */ virtual void setBaseBegin(bool val) throw (dom::DOMException) { baseBegin = val; } /** * */ virtual DOMString getEvent() { return eventStr; } /** * */ virtual void setEvent(const DOMString &val) throw (dom::DOMException) { eventStr = val; } /** * */ virtual DOMString getMarker() { return marker; } /** * */ virtual void setMarker(const DOMString &val) throw (dom::DOMException) { marker = val; } //################## //# Non-API methods //################## /** * */ Time() { resolved = false; resolvedOffset = 0.0; timeType = SMIL_TIME_INDEFINITE; offset = 0.0; baseElement = NULL; baseBegin = false; eventStr = ""; marker = ""; } /** * */ Time(const Time &other) { resolved = other.resolved; resolvedOffset = other.resolvedOffset; timeType = other.timeType; offset = other.offset; baseElement = other.baseElement; baseBegin = other.baseBegin; eventStr = other.eventStr; marker = other.marker; } /** * */ virtual ~Time() {} protected: bool resolved; double resolvedOffset; unsigned short timeType; double offset; Element * baseElement; bool baseBegin; DOMString eventStr; DOMString marker; }; /*######################################################################### ## TimeList #########################################################################*/ /** * */ class TimeList { public: /** * */ virtual Time item(unsigned long index) { if (index >=items.size()) { Time tim; return tim; } return items[index]; } /** * */ virtual unsigned long getLength() { return items.size(); } //################## //# Non-API methods //################## /** * */ TimeList() {} /** * */ TimeList(const TimeList &other) { items = other.items; } /** * */ virtual ~TimeList() {} protected: std::vector