/* 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_ITVGuidePlugin_HPP
#define NMM_ITVGuidePlugin_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
{
  /**
   * Interface for controlling EPG-Plugins
   */

  class DLLEXPORT ITVGuidePlugin : virtual public NMM::Interface { 
  public:
  enum State { 
    CONSTRUCTED = 1 , 
    INITIALIZED = 2 , 
    STARTED = 16  };

    ITVGuidePlugin() : NMM::Interface(ITVGuidePlugin::ITVGuidePlugin_type, "NMM") { };

    ITVGuidePlugin(NMM::NMMObject& parent) : NMM::Interface (parent, ITVGuidePlugin::ITVGuidePlugin_type, "NMM") { };

    virtual ~ITVGuidePlugin() {};

    static const char* ITVGuidePlugin_type;

    virtual  string getInterfaceType() const { return ITVGuidePlugin_type; }

    NMM::Interface* copy() const { return new ITVGuidePlugin(*this); }
    static void used(); 
    static const char* getName_event;
    static const char* start_event;
    static const char* stop_event;
    static const char* init_event;
    static const char* deinit_event;
    static const char* getState_event;
    static const char* setPriority_event;
    static const char* getPriority_event;
    static const char* enable_event;
    static const char* disable_event;
    static const char* getEnabled_event;
    /**
     * returns the name of the plugin
     */

    virtual string getName()
      throw(const NMM::SerializedException&);
    /**
     * Starts an update
     */

    virtual Result start()
      throw(const NMM::SerializedException&);
    /**
     * stops the update
     */

    virtual Result stop()
      throw(const NMM::SerializedException&);
    /**
     * initializes the plugin
     */

    virtual Result init()
      throw(const NMM::SerializedException&);
    /**
     * deinitializes the plugin
     */

    virtual Result deinit()
      throw(const NMM::SerializedException&);
    /**
     * get the current State of the plugin
     *@return plugin-state
     */

    virtual ITVGuidePlugin::State getState()
      throw(const NMM::SerializedException&);
    /**
     * set the priority of an TVGuide-plugin
     */

    virtual void setPriority(const nmm_uint32& priority)
      throw(const NMM::SerializedException&);
    /**
     * get the priority of an TVGuide-plugin
     */

    virtual nmm_uint32 getPriority()
      throw(const NMM::SerializedException&);
    /**
     * enables a TVGuide-Plugin. Indicates, that it should be startet by the TVGuide
     */

    virtual Result enable()
      throw(const NMM::SerializedException&);
    /**
     * disables a TVGuide-plugin. This plugin will not be startetd by TVGuide
     */

    virtual Result disable()
      throw(const NMM::SerializedException&);
    /**
     * returns, if the TVGuide-plugin is enabled
     */

    virtual nmm_bool getEnabled()
      throw(const NMM::SerializedException&);


  };

  typedef auto_ptr<ITVGuidePlugin> ITVGuidePlugin_var;

  DLLEXPORT NMM::OValueStream& operator<<(NMM::OValueStream& ov, const ITVGuidePlugin::State& t);
  DLLEXPORT NMM::IValueStream& operator>>(NMM::IValueStream& iv, ITVGuidePlugin::State& t);



}

#include "nmm/nmm_suffix.hpp"

#endif
