/* 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_ITVManager_HPP
#define NMM_ITVManager_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 "nmm/multimedia/INode.hpp"
#include "nmm/multimedia/IUsageNotify.hpp"

#include "visibility.hpp"

namespace NMM
{
  /**
   * Interface to control TVManager 
   */

  class DLLEXPORT ITVManager : virtual public NMM::Interface { 
  public:
    ITVManager() : NMM::Interface(ITVManager::ITVManager_type, "NMM") { };

    ITVManager(NMM::NMMObject& parent) : NMM::Interface (parent, ITVManager::ITVManager_type, "NMM") { };

    virtual ~ITVManager() {};

    static const char* ITVManager_type;

    virtual  string getInterfaceType() const { return ITVManager_type; }

    NMM::Interface* copy() const { return new ITVManager(*this); }
    static void used(); 
    static const char* setChannel_event;
    static const char* channelUp_event;
    static const char* channelDown_event;
    static const char* getTVCard_event;
    static const char* startGraph_event;
    static const char* setUsageNotify_event;
    static const char* releaseGraph_event;

    virtual Result setChannel(const nmm_uint32& channel)
      throw(const NMM::SerializedException&);

    virtual Result channelUp()
      throw(const NMM::SerializedException&);

    virtual Result channelDown()
      throw(const NMM::SerializedException&);

    virtual INode* getTVCard()
      throw(const NMM::SerializedException&);

    virtual Result startGraph()
      throw(const NMM::SerializedException&);

    virtual void setUsageNotify(const IUsageNotify* u)
      throw(const NMM::SerializedException&);

    virtual void releaseGraph()
      throw(const NMM::SerializedException&);


  };

  typedef auto_ptr<ITVManager> ITVManager_var;


  /**
   * This interface is used by the TVManager to notify applications about certain Events 
   */

  class DLLEXPORT ITVManagerEvents : virtual public NMM::Interface { 
  public:
    ITVManagerEvents() : NMM::Interface(ITVManagerEvents::ITVManagerEvents_type, "NMM") { };

    ITVManagerEvents(NMM::NMMObject& parent) : NMM::Interface (parent, ITVManagerEvents::ITVManagerEvents_type, "NMM") { };

    virtual ~ITVManagerEvents() {};

    static const char* ITVManagerEvents_type;

    virtual  string getInterfaceType() const { return ITVManagerEvents_type; }

    NMM::Interface* copy() const { return new ITVManagerEvents(*this); }
    static void used(); 
    static const char* switchingSource_event;
    static const char* sharedSource_event;
    static const char* skippingChannel_event;
    /**
     *Indicates on channel-switch that the next channel is not available on the current TVCard and the source will be switched
     */

    virtual Result switchingSource()
      throw(const NMM::SerializedException&);
    /**
     *Indicates that the application couldn't request the source exclusive and is only slave
     */

    virtual Result sharedSource()
      throw(const NMM::SerializedException&);
    /**
     *Indocates, that the next channel is unavailable and therefore left out while channel-hopping
     */

    virtual Result skippingChannel()
      throw(const NMM::SerializedException&);


  };

  typedef auto_ptr<ITVManagerEvents> ITVManagerEvents_var;




}

#include "nmm/nmm_suffix.hpp"

#endif
