/* Network-Integrated Multimedia Middleware (NMM)
 * http://www.motama.com/nmm.html
 *
 * Copyright (C) 2006-2007
 * Motama GmbH, Saarbruecken, Germany
 * http://www.motama.com
 *
 * This file is part of NMM. 
 * 
 * NMM is free software; you can redistribute it and/or modify it    
 * under the terms of the GNU General Public License as published by 
 * the Free Software Foundation; only version 2 of the License.      
 * 
 * NMM 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 General Public 
 * License for more details.  
 * 
 * You should have received a copy of the GNU General Public License 
 * along with NMM; if not, write to the Free Software Foundation,    
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
 *
 */

module NMM {
  /** Interface contains methods to check and use seek mechanisms.
   */
  interface ISeekable {
    /** Tests if implementing object supports seeking by percent.
     *   
     * This method can be used to test if the implementing supports
     * seeking by percentage.
     *
     * @return true iff percantage seeking is supported.
     */
    nmm_bool hasPercentSeek() const;

    /** Seeks relative from current positon by percent.
     *
     * This method seeks relative from the current position in
     * percent.
     *
     * @param percent The offset to seek in a Rational from -1 to 1.
     */
    void seekPercent(in Rational percent);

    /** Seeks absolut to the given position in percent.
     *
     * This method seeks absolute to the given position in percent.
     *
     * @param percent The position to seek to in a Rational from 0 to 1.
     */
    void seekPercentTo(in Rational percent);


    /** Tests if implementing object supports seeking by bytes.
     *
     * This method can be used to test if this interface supports
     * seeking by bytes.
     *
     * @return true iff bytewise seeking is supported.
     */
    nmm_bool hasBytesSeek() const;

    /** Seeks relative from current position by bytes.
     *
     * This method seeks relative from the current position in
     * bytes.
     *
     * @param offset The offset to seek.
     */
    void seekBytes(in nmm_int64 offset);

    /** Seeks absolut to the given position in bytes.
     *
     * This method seeks absolute to the given position in percent.
     *
     * @param bytes The position to seek to.
     */
    void seekBytesTo(in nmm_uint64 bytes) instream;


    /** Tests if implementing object supports seeking by time.
     *
     * This method can be used to test if this interface supports
     * seeking by Time.
     *
     * @return true iff seeking by Time is supported.
     */
    nmm_bool hasTimeSeek() const;

    /** Seeks relative from current positon by time.
     *
     * This method seeks relative from the current position in
     * Time.
     *
     * @param interval The Interval to seek.
     */
    void seekTime(in Interval interval);

    /** Seeks absolut to given position in time.
     *
     * This method seeks absolute to the given position in Time.
     *
     * @param time The Time to seek to.
     */
    void seekTimeTo(in Time time);
  };
}
