// This may look like C code, but it's really -*- C++ -*-
/*
 * Copyright (C) 2008 Emweb bvba, Kessel-Lo, Belgium.
 *
 * See the LICENSE file for terms of use.
 */
#ifndef WBRUSH_H_
#define WBRUSH_H_

#include <Wt/WColor>

namespace Wt {

/*! \class WBrush Wt/WBrush Wt/WBrush
 *  \brief A value class that defines the style for filling a path
 *
 * A brush defines the properties of how areas (the interior of
 * shapes) are filled. A brush is defined using a color and a fill
 * type (currently only solid fills are supported).
 *
 * \sa WPainter::setBrush(), WPen
 *
 * \ingroup painting
 */
class WT_API WBrush
{
public:
  /*! \brief Creates a brush.
   *
   * Creates a brush with a \link Wt::NoBrush NoBrush\endlink fill style.
   */
  WBrush();

  /*! \brief Creates a black brush with given style.
   *
   * Creates a black brush with the indicated \p style.
   */
  WBrush(BrushStyle style);

  /*! \brief Creates a solid brush of a given color.
   *
   * Creates a solid brush with the indicated \p color.
   */
  WBrush(const WColor& color);

  /*! \brief Creates a solid brush with a particular standard color.
   *
   * Creates a solid brush with the indicated \p color.
   */
  WBrush(GlobalColor color);

#ifdef WT_TARGET_JAVA
  /*! \brief Clone method.
   *
   * Clones this brush.
   */
  WBrush clone() const;
#endif

  /*! \brief Comparison operator.
   *
   * Returns \c true if the brushes are exactly the same.
   */
  bool operator==(const WBrush& other) const;

  /*! \brief Comparison operator.
   *
   * Returns \c true if the brushes are different.
   */
  bool operator!=(const WBrush& other) const;

  /*! \brief Sets the brush style.
   *
   * \sa style()
   */
  void setStyle(BrushStyle style);

  /*! \brief Returns the fill style.
   *
   * \sa setStyle(BrushStyle)
   */
  BrushStyle style() const { return style_; }

  /*! \brief Sets the brush color.
   *
   * \sa color()
   */
  void setColor(const WColor& color);

  /*! \brief Returns the brush color.
   *
   * \sa color()
   */
  const WColor& color() const { return color_; }

private:
  BrushStyle style_;
  WColor      color_;
};

}

#endif // WBRUSH_H_
