/* 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_IWindowImpl_HPP
#define NMM_IWindowImpl_HPP

#include "nmm/nmm_prefix.hpp"

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

#include "IWidgetImpl.hpp"

#include "visibility.hpp"

namespace NMM
{
  /**
   * Window interface.
   * A window is a container for a widget in an OSDManager.
   * This interface can be retrieved through an IWidget or IOSDManager interface.
   */

  class DLLEXPORT IWindowImpl  : public virtual NMM::NMMObject { 
  public:
    IWindowImpl() { addInterface(new IWindow(*this)); registerEvents(); };

    virtual ~IWindowImpl() {};

  protected:
    /** Get window ID. */

    virtual nmm_int32 getWindowID() const = 0;
    /**
     * Set position of the window.
     * @param x x position of the upper left corner
     * @param y y position of the upper left corner
     */

    virtual void setPosition(const nmm_uint32& x, const nmm_uint32& y) = 0;
    /**
     * Get x and y position of the window.
     * @param x x position of the upper left corner
     * @param y y position of the upper left corner
     */

    virtual void getPosition(nmm_uint32& x, nmm_uint32& y) const = 0;
    /** Set width and height of the window. */

    virtual void setDimension(const nmm_uint32& w, const nmm_uint32& h) = 0;
    /** Get width and height of the window. */

    virtual void getDimension(nmm_uint32& w, nmm_uint32& h) const = 0;
    /**
     * Redraw the window with help of the widget.
     * Sets updateflag to true.
     */

    virtual void update() = 0;
    /**
     * Check if window is visible
     * @return true if window is visible
     */

    virtual nmm_bool getVisible() const = 0;
    /**
     * Set window visibility
     * @param show true to make window visible
     */

    virtual void setVisible(const nmm_bool& value) = 0;
    /**
     * Set window scale factor.
     */

    virtual void setScaleFactor(const nmm_double& x, const nmm_double& y) = 0;
    /**
     * Set content.
     * Set the widget that this window contains.
     */

    virtual void setContent(const IWidget& value) = 0;
    /**
     * Get content.
     * Get the widget that this window contains.
     */

    virtual IWidget* getContent() const = 0;


  private:
    void registerEvents();
  };

}

#include "nmm/nmm_suffix.hpp"

#endif
