/* * Copyright (C) 2007-2008 Esmertec AG. * Copyright (C) 2007-2008 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.android.mms.dom.smil; import java.util.ArrayList; import org.w3c.dom.DOMException; import org.w3c.dom.smil.ElementTime; import org.w3c.dom.smil.SMILElement; import org.w3c.dom.smil.Time; import org.w3c.dom.smil.TimeList; import android.util.Log; public abstract class ElementTimeImpl implements ElementTime { private static final String TAG = "ElementTimeImpl"; private static final String FILL_REMOVE_ATTRIBUTE = "remove"; private static final String FILL_FREEZE_ATTRIBUTE = "freeze"; private static final String FILL_HOLD_ATTRIBUTE = "hold"; private static final String FILL_TRANSITION_ATTRIBUTE = "transition"; private static final String FILL_AUTO_ATTRIBUTE = "auto"; private static final String FILL_ATTRIBUTE_NAME = "fill"; private static final String FILLDEFAULT_ATTRIBUTE_NAME = "fillDefault"; final SMILElement mSmilElement; /* * Internal Interface */ ElementTimeImpl(SMILElement element) { mSmilElement = element; } // Default implementation. Override if required. int getBeginConstraints() { return TimeImpl.ALLOW_ALL; } // Default implementation. Override if required int getEndConstraints() { return TimeImpl.ALLOW_ALL; } /** * To get the parent node on the ElementTime tree. It is in opposition to getTimeChildren. * @return the parent ElementTime. Returns null if there is no parent. */ abstract ElementTime getParentElementTime(); /* * ElementTime Interface */ public TimeList getBegin() { String[] beginTimeStringList = mSmilElement.getAttribute("begin").split(";"); // TODO: Check other constraints on parsed values, e.g., "single, non-negative offset values ArrayList