// 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 WSCROLLAREA_H_
#define WSCROLLAREA_H_

#include <Wt/WWebWidget>

namespace Wt {

class WScrollBar;

/*! \class WScrollArea Wt/WScrollArea Wt/WScrollArea
 *  \brief A widget that adds scrolling capabilities to its content.
 *
 * Use a WScrollArea to add scrolling capabilities to another widget.
 * When the content is bigger than the WScrollArea, scrollbars are added
 * so that the user can still view the entire content.
 *
 * Use setScrollBarPolicy() to configure if and when the scrollbars may
 * appear.
 *
 * In many cases, it might be easier to use the CSS overflow property
 * on a WContainerWidget (see
 * WContainerWidget::setOverflow()). However, this class will behave
 * better when used inside a layout manager: in that case it will make
 * sure horizontal scrolling works properly, since otherwise the
 * layout manager would overflow rather than scrollbars appear.
 *
 * <h3>CSS</h3>
 *
 * This widget is rendered using a <tt>&lt;div&gt;</tt> with a CSS
 * overflow attribute. When in a layout manager it is positioned
 * absolutely. It can be styled using inline or external CSS as
 * appropriate.
 */
class WT_API WScrollArea : public WWebWidget
{
public:
  /*! brief Policy for showing a scrollbar.
   */
  enum ScrollBarPolicy {
    ScrollBarAsNeeded,	//!< Automatic
    ScrollBarAlwaysOff, //!< Never show a scrollbar
    ScrollBarAlwaysOn   /                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           