/* 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_IButtonsImpl_HPP
#define NMM_IButtonsImpl_HPP

#include "nmm/nmm_prefix.hpp"

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

#include "IImageViewImpl.hpp"

#include "visibility.hpp"

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

  class DLLEXPORT IButtonsImpl  : virtual public IImageViewImpl { 
  public:
    IButtonsImpl() { addInterface(new IButtons(*this)); registerEvents(); };

    virtual ~IButtonsImpl() {};

  protected:
    /**
     * 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) = 0;
    /**
     * 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) = 0;
    /**
     * Get label of selected button.
     * @return label of the selected button
     */

    virtual string getSelectedButtonLabel() = 0;
    /**
     * 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) = 0;
    /**
     * Delete button.
     * @param button_id button identifier
     */

    virtual void deleteButton(const nmm_int32& button_id) = 0;
    /** Delete all buttons. */

    virtual void deleteAllButtons() = 0;
    /**
     * 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) = 0;
    /**
     * 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) = 0;
    /** Deselect selected button. */

    virtual void deselectButton() = 0;
    /**
     * Activate a button.
     * @param button_id button identifier
     */

    virtual void activateButton(const nmm_int32& button_id) = 0;
    /**
     * Deactivate a button.
     * @param button_id button identifier
     */

    virtual void deactivateButton(const nmm_int32& button_id) = 0;
    /**
     * Deactivate all buttons.
     */

    virtual void deactivateAllButtons() = 0;


  private:
    void registerEvents();
  };

}

#include "nmm/nmm_suffix.hpp"

#endif
