/* 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_IWidgetFactoryImpl_HPP
#define NMM_IWidgetFactoryImpl_HPP

#include "nmm/nmm_prefix.hpp"

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

#include "IWidgetImpl.hpp"
#include "IWidgetCompositeImpl.hpp"
#include "IProgressBarImpl.hpp"
#include "ITextViewImpl.hpp"
#include "ITimeViewImpl.hpp"
#include "IImageViewImpl.hpp"
#include "IRadioButtonsImpl.hpp"
#include "IButtonsImpl.hpp"
#include "IBorderDecoratorImpl.hpp"
#include "IHeaderDecoratorImpl.hpp"
#include "IPlaneDecoratorImpl.hpp"
#include "IScrollDecoratorImpl.hpp"

#include "visibility.hpp"

namespace NMM
{
  /**
   * Widget factory.
   * This interface, which is implemented by the OSD manager, is used
   * for creating widget objects. I wrote a seperate interface for this for the
   * following reasons:
   * - It has a lot of methods only for creating widgets that would inflate IOSDManager
   * - It depends on all the widget interfaces. I don't want IOSDManager to include them all
   */

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

    virtual ~IWidgetFactoryImpl() {};

  protected:
    /**
     * Create a widget composite.
     * Creates a new widget and returns an interface for it.
     * @return an interface for this widget
     */

    virtual IWidgetComposite* createWidgetComposite() = 0;
    /**
     * Create a progress bar.
     * Creates a new widget and returns an interface for it.
     * @return an interface for this widget
     */

    virtual IProgressBar* createProgressBar() = 0;
    /**
     * Create a text view.
     * Creates a new widget and returns an interface for it.
     * @return an interface for this widget
     */

    virtual ITextView* createTextView() = 0;
    /**
     * Create a time view.
     * Creates a new widget and returns an interface for it.
     * @return an interface for this widget
     */

    virtual ITimeView* createTimeView() = 0;
    /**
     * Create an image view.
     * Creates a new widget and returns an interface for it.
     * @return an interface for this widget
     */

    virtual IImageView* createImageView() = 0;
    /**
     * Create radio buttons.
     * Creates a new widget and returns an interface for it.
     * @return an interface for this widget
     */

    virtual IRadioButtons* createRadioButtons() = 0;
    /**
     * Create buttons.
     * Creates a new widget and returns an interface for it.
     * @return an interface for this widget
     */

    virtual IButtons* createButtons() = 0;
    /**
     * Create border decorator.
     * Creates a new widget and returns an interface for it.
     * @param internal the internal widget of the decorator
     * @return an interface for this widget
     */

    virtual IBorderDecorator* createBorderDecorator(const IWidget& internal) = 0;
    /**
     * Create border decorator.
     * Creates a new widget and returns an interface for it.
     * @param internal the internal widget of the decorator
     * @return an interface for this widget
     */

    virtual IHeaderDecorator* createHeaderDecorator(const IWidget& internal) = 0;
    /**
     * Create plane decorator.
     * Creates a new widget and returns an interface for it.
     * @param internal the internal widget of the decorator
     * @return an interface for this widget
     */

    virtual IPlaneDecorator* createPlaneDecorator(const IWidget& internal) = 0;
    /**
     * Create scroll decorator.
     * Creates a new widget and returns an interface for it.
     * @param internal the internal widget of the decorator
     * @return an interface for this widget
     */

    virtual IScrollDecorator* createScrollDecorator(const IWidget& internal) = 0;


  private:
    void registerEvents();
  };

}

#include "nmm/nmm_suffix.hpp"

#endif
