/* 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_ITVManagerImpl_HPP
#define NMM_ITVManagerImpl_HPP

#include "nmm/nmm_prefix.hpp"

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

#include "nmm/multimedia/INodeImpl.hpp"
#include "nmm/multimedia/IUsageNotifyImpl.hpp"

#include "visibility.hpp"

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

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

    virtual ~ITVManagerImpl() {};

  protected:

    virtual Result setChannel(const nmm_uint32& channel) = 0;

    virtual Result channelUp() = 0;

    virtual Result channelDown() = 0;

    virtual INode* getTVCard() = 0;

    virtual Result startGraph() = 0;

    virtual void setUsageNotify(const IUsageNotify* u) = 0;

    virtual void releaseGraph() = 0;


  private:
    void registerEvents();
  };
  /**
   * This interface is used by the TVManager to notify applications about certain Events 
   */

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

    virtual ~ITVManagerEventsImpl() {};

  protected:
    /**
     *Indicates on channel-switch that the next channel is not available on the current TVCard and the source will be switched
     */

    virtual Result switchingSource() = 0;
    /**
     *Indicates that the application couldn't request the source exclusive and is only slave
     */

    virtual Result sharedSource() = 0;
    /**
     *Indocates, that the next channel is unavailable and therefore left out while channel-hopping
     */

    virtual Result skippingChannel() = 0;


  private:
    void registerEvents();
  };

}

#include "nmm/nmm_suffix.hpp"

#endif
