/* 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_IButtons_HPP
#define NMM_IButtons_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 "IImageView.hpp"

#include "visibility.hpp"

namespace NMM
{
  /**
   * Buttons widget interface.
   */

  class DLLEXPORT IButtons : virtual public IImageView { 
  public:
    IButtons() : NMM::Interface(IButtons::IButtons_type, "NMM") { };

    IButtons(NMM::NMMObject& parent) : NMM::Interface (parent, IButtons::IButtons_type, "NMM") { };

    virtual ~IButtons() {};

    static const char* IButtons_type;

    virtual  string getInterfaceType() const { return IButtons_type; }

    NMM::Interface* copy() const { return new IButtons(*this); }
    static void used(); 
    static const char* addButton_event;
    static const char* getButtonLabel_event;
    static const char* getSelectedButtonLabel_event;
    static const char* getButtonState_event;
    static const char* deleteButton_event;
    static const char* deleteAllButtons_event;
    static const char* selectButton_event;
    static const char* setStep_event;
    static const char* deselectButton_event;
    static const char* activateButton_event;
    static const char* deactivateButton_event;
    static const char* deactivateAllButtons_event;
    /**
     * Add button.
     * @param id identifier for this button
     * @param label button label
     * @param x x position of the upper left corner of the button
     * @param y y position of the upper left corner
     * @param inactive_id bitmap identifier for using if inactive button should be drawn
     * @param active_id bitmap identifier for using if active button should be drawn
     * @param select_id bitmap identifier for using if selected button should be drawn
     */

    virtual void addButton(const nmm_int32& buttonid, const string& label, const nmm_int32& x, const nmm_int32& y, const string& inactive_id, const string& active_id, const string& select_id)
      throw(const NMM::SerializedException&);
    /**
     * Get label of a button.
     * @param button_id button identifier
     * @return label of the button with button_id
     */

    virtual string getButtonLabel(const nmm_int32& button_id)
      throw(const NMM::SerializedException&);
    /**
     * Get label of selected button.
     * @return label of the selected button
     */

    virtual string getSelectedButtonLabel()
      throw(const NMM::SerializedException&);
    /**
     * Get burron state.
     * @param button_id button identifier
     * @return true, if button is active, false otherwise
     */

    virtual nmm_bool getButtonState(const nmm_int32& button_id)
      throw(const NMM::SerializedException&);
    /**
     * Delete button.
     * @param button_id button identifier
     */

    virtual void deleteButton(const nmm_int32& button_id)
      throw(const NMM::SerializedException&);
    /** Delete all buttons. */

    virtual void deleteAllButtons()
      throw(const NMM::SerializedException&);
    /**
     * Selects the given button.
     * @param buttonid id of button that should be selected
     * @return id of selected button
     */

    virtual nmm_int32 selectButton(const nmm_int32& buttonid)
      throw(const NMM::SerializedException&);
    /**
     * Set number of buttons per line.
     * Set number of buttons to get into next line (important for selectUp() and selectDown() calls).
     * @param value number of buttons to skip
     */

    virtual void setStep(const nmm_uint32& value)
      throw(const NMM::SerializedException&);
    /** Deselect selected button. */

    virtual void deselectButton()
      throw(const NMM::SerializedException&);
    /**
     * Activate a button.
     * @param button_id button identifier
     */

    virtual void activateButton(const nmm_int32& button_id)
      throw(const NMM::SerializedException&);
    /**
     * Deactivate a button.
     * @param button_id button identifier
     */

    virtual void deactivateButton(const nmm_int32& button_id)
      throw(const NMM::SerializedException&);
    /**
     * Deactivate all buttons.
     */

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


  };

  typedef auto_ptr<IButtons> IButtons_var;




}

#include "nmm/nmm_suffix.hpp"

#endif
