/* 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_DECOSCROLL_HPP_
#define _NMM_DECOSCROLL_HPP_ _NMM_DECOSCROLL_HPP_

#include "nmm/nmm_prefix.hpp"

#include "Decorator.hpp"

#include "nmm/plugins/video/osd/manager/interfaces/IScrollDecoratorImpl.hpp"

namespace NMM {
  /*****************************************************************************************/
  /* ScrollDecorator   									   */
  /*****************************************************************************************/
  class ScrollDecorator : virtual public Decorator,
                          virtual public IScrollDecoratorImpl {
  protected:
    unsigned int barwidth;
    unsigned int backgroundcolor;
    unsigned int bordercolor;
    unsigned int barcolor;
    unsigned int barbordercolor1;
    unsigned int barbordercolor2;
    
    void drawFilledBox( unsigned int* frame, unsigned int stride,
                        unsigned int xs, unsigned int ys,
                        unsigned int width, unsigned int height,
			unsigned int color );
    
    void drawBox( unsigned int* frame, unsigned int stride,
                  unsigned int xs, unsigned int ys,
                  unsigned int width, unsigned int height,
                  unsigned int color1, unsigned int color2 );
    
    void drawScrollBar( workspace_t* ws );
    
  public:
    ScrollDecorator();
    
    /** IScrollDecorator interface. */
    virtual void setBarWidth( const nmm_uint32& bw );
    virtual void setBackgroundColor( const nmm_uint32& bcolor );
    virtual void setBorderColor( const nmm_uint32& bcolor );
    virtual void setBarColor( const nmm_uint32& bcolor );
    virtual void setBarBorderColors( const nmm_uint32& bcolor1, const nmm_uint32& bcolor2 );
    
    /** Draws Widget with Scrollbar. */
    virtual void draw( workspace_t* ws );
    
  }; // ScrollDecorator
} // NMM

#include "nmm/nmm_suffix.hpp"

#endif //_NMM_DECOSCROLL_HPP_
