/* 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_IWindow_HPP
#define NMM_IWindow_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 "IWidget.hpp"

#include "visibility.hpp"

namespace NMM
{

  class IWidget;
  /**
   * 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 IWindow : virtual public NMM::Interface { 
  public:
    IWindow() : NMM::Interface(IWindow::IWindow_type, "NMM") { };

    IWindow(NMM::NMMObject& parent) : NMM::Interface (parent, IWindow::IWindow_type, "NMM") { };

    virtual ~IWindow() {};

    static const char* IWindow_type;

    virtual  string getInterfaceType() const { return IWindow_type; }

    NMM::Interface* copy() const { return new IWindow(*this); }
    static void used(); 
    static const char* getWindowID_event;
    static const char* setPosition_event;
    static const char* getPosition_event;
    static const char* setDimension_event;
    static const char* getDimension_event;
    static const char* update_event;
    static const char* getVisible_event;
    static const char* setVisible_event;
    static const char* setScaleFactor_event;
    static const char* setContent_event;
    static const char* getContent_event;
    /** Get window ID. */

    virtual nmm_int32 getWindowID() const
      throw(const NMM::SerializedException&);
    /**
     * 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)
      throw(const NMM::SerializedException&);
    /**
     * 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
      throw(const NMM::SerializedException&);
    /** Set width and height of the window. */

    virtual void setDimension(const nmm_uint32& w, const nmm_uint32& h)
      throw(const NMM::SerializedException&);
    /** Get width and height of the window. */

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

    virtual void update()
      throw(const NMM::SerializedException&);
    /**
     * Check if window is visible
     * @return true if window is visible
     */

    virtual nmm_bool getVisible() const
      throw(const NMM::SerializedException&);
    /**
     * Set window visibility
     * @param show true to make window visible
     */

    virtual void setVisible(const nmm_bool& value)
      throw(const NMM::SerializedException&);
    /**
     * Set window scale factor.
     */

    virtual void setScaleFactor(const nmm_double& x, const nmm_double& y)
      throw(const NMM::SerializedException&);
    /**
     * Set content.
     * Set the widget that this window contains.
     */

    virtual void setContent(const IWidget& value)
      throw(const NMM::SerializedException&);
    /**
     * Get content.
     * Get the widget that this window contains.
     */

    virtual IWidget* getContent() const
      throw(const NMM::SerializedException&);


  };

  typedef auto_ptr<IWindow> IWindow_var;




}

#include "nmm/nmm_suffix.hpp"

#endif
