/* 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_IWidgetImpl_HPP
#define NMM_IWidgetImpl_HPP

#include "nmm/nmm_prefix.hpp"

#include "nmm/comm/NMMObject.hpp"
#include "IWidget.hpp"

#include "IScrollableImpl.hpp"

#include "visibility.hpp"

namespace NMM
{
  /**
   * Widget interface.
   * Interface for controlling widgets in an OSDManager.
   * The widgets are identified by integers. To get an interface, use the IOSDManager interface.
   */

  class DLLEXPORT IWidgetImpl  : virtual public IScrollableImpl { 
  public:
    IWidgetImpl() { addInterface(new IWidget(*this)); registerEvents(); };

    virtual ~IWidgetImpl() {};

  protected:
    /** Selects next button (adds 1 to buttonid). */

    virtual void selectRight() = 0;
    /** Selects privious button (subs 1 to buttonid). */

    virtual void selectLeft() = 0;
    /** Selects button (in privoius line, subs step to buttonid). */

    virtual void selectUp() = 0;
    /** Selects button (in next line, adds step to buttonid). */

    virtual void selectDown() = 0;
    /** Activates the selected button. */

    virtual void selectPush() = 0;
    /** Get widget ID. */

    virtual nmm_int32 getWidgetID() const = 0;
    /**
     * Set x and y position of the widget in the window.
     * @param x x position
     * @param y x position
     */

    virtual void setPosition(const nmm_uint32& x, const nmm_uint32& y) = 0;
    /**
     * Set width and height of the widget.
     * @param w width
     * @param h height
     */

    virtual void setDimension(const nmm_uint32& w, const nmm_uint32& h) = 0;
    /**
     * Get x and y position of the widget.
     * @param x x position
     * @param y x position
     */

    virtual void getPosition(nmm_uint32& x, nmm_uint32& y) const = 0;
    /**
     * Get width and height of the widget.
     * @param w width
     * @param h height
     */

    virtual void getDimension(nmm_uint32& w, nmm_uint32& h) const = 0;


  private:
    void registerEvents();
  };

}

#include "nmm/nmm_suffix.hpp"

#endif
