/* 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.
 *
 */

#ifndef NMM_ISPUDecoder_HPP
#define NMM_ISPUDecoder_HPP

#include "nmm/nmm_prefix.hpp"

#include "nmm/comm/Interface.hpp"
#include "nmm/comm/messaging/Event.hpp"
#include "nmm/comm/messaging/IllegalStateException.hpp"
#include <memory>


#include "visibility.hpp"

namespace NMM
{
  /**
   * Subtitle Picture Unit (SPU) decoder.
   * Interface that defines the events that control a SPU decoder. These events
   * are sent for example by the DVD reader.
   */

  class DLLEXPORT ISPUDecoder : virtual public NMM::Interface { 
  public:
    ISPUDecoder() : NMM::Interface(ISPUDecoder::ISPUDecoder_type, "NMM") { };

    ISPUDecoder(NMM::NMMObject& parent) : NMM::Interface (parent, ISPUDecoder::ISPUDecoder_type, "NMM") { };

    virtual ~ISPUDecoder() {};

    static const char* ISPUDecoder_type;

    virtual  string getInterfaceType() const { return ISPUDecoder_type; }

    NMM::Interface* copy() const { return new ISPUDecoder(*this); }
    static void used(); 
    static const char* setPaletteItem_event;
    static NMM::Event* create_setPaletteItem(const nmm_int32& index, const nmm_int32& color_y, const nmm_int32& color_u, const nmm_int32& color_v, const nmm_int32& alpha);
    static const char* initColorScheme_event;
    static NMM::Event* create_initColorScheme(const nmm_int32& scheme_nr, const nmm_int32& selection, const nmm_int32& activation);
    static const char* setDVDSelectedButton_event;
    static NMM::Event* create_setDVDSelectedButton(const nmm_int32& button);
    static const char* setDVDButtonCount_event;
    static NMM::Event* create_setDVDButtonCount(const nmm_int32& buttons);
    static const char* setDVDButtonCoords_event;
    static NMM::Event* create_setDVDButtonCoords(const nmm_int32& start_x, const nmm_int32& start_y, const nmm_int32& end_x, const nmm_int32& end_y);
    static const char* setDVDButtonScheme_event;
    static NMM::Event* create_setDVDButtonScheme(const nmm_int32& scheme);
  /* instream (protected) and non-instream (public) */        /**
     * Instream event to set colorpalette item.
     * Assigns an RGBA color value to a color palette index.
     * @param index color palette index
     * @param color_y Y color value
     * @param color_u U color value
     * @param color_v V color value
     * @param alpha alpha value
     */

    virtual Result setPaletteItem(const nmm_int32& index, const nmm_int32& color_y, const nmm_int32& color_u, const nmm_int32& color_v, const nmm_int32& alpha) /* in-stream */ 
      throw(const NMM::SerializedException&);
        /**
     * Instream event to init color sheme.
     * Initialize the colors of a color scheme. Assigns the colors (palette entries) for the
     * selection and activation state of a button that has this scheme.
     * @param scheme_nr index of color scheme
     * @param selection palette index of selection color
     * @param activation color palette index of activation color
     */

    virtual Result initColorScheme(const nmm_int32& scheme_nr, const nmm_int32& selection, const nmm_int32& activation) /* in-stream */ 
      throw(const NMM::SerializedException&);
        /**
     * Instream event to set selected button.
     * Sent by the DVD reader if a new menu button was selected.
     * @param button the button number
     */

    virtual Result setDVDSelectedButton(const nmm_int32& button) /* in-stream */ 
      throw(const NMM::SerializedException&);
        /**
     * Instream event to set the number of buttons.
     * Sent by the DVD reader to inform the SPU decoder about the number of buttons.
     * @param buttons number of buttons
     */

    virtual Result setDVDButtonCount(const nmm_int32& buttons) /* in-stream */ 
      throw(const NMM::SerializedException&);
        /**
     * Instream event to set button coordinates.
     * Sent by the DVD reader to set the coordinates of the current button.
     * @param start_x left X coordinate of button
     * @param start_y upper Y coordinate of button
     * @param end_x right X coordinate of button
     * @param end_y lower Y coordinate of button
     */

    virtual Result setDVDButtonCoords(const nmm_int32& start_x, const nmm_int32& start_y, const nmm_int32& end_x, const nmm_int32& end_y) /* in-stream */ 
      throw(const NMM::SerializedException&);
        /**
     * Instream event to set button color scheme.
     * Sent by the DVD reader to set the color scheme of the current button.
     * @param scheme color scheme index
     */

    virtual Result setDVDButtonScheme(const nmm_int32& scheme) /* in-stream */ 
      throw(const NMM::SerializedException&);


  };

  typedef auto_ptr<ISPUDecoder> ISPUDecoder_var;




}

#include "nmm/nmm_suffix.hpp"

#endif
