/usr/include/Wt/WScrollArea is in libwt-dev 3.3.0-1build1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 | // 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><div></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 //!< Always show a scrollbar
};
/*! \brief Creates a scroll area.
*/
WScrollArea(WContainerWidget *parent = 0);
~WScrollArea();
/*! \brief Sets the widget that is the content of the scroll area.
*
* Setting a new widget will delete the previously set widget.
*/
void setWidget(WWidget *widget);
/*! \brief Removes the widget content.
*/
WWidget *takeWidget();
/*! \brief Returns the widget content.
*/
WWidget *widget() const { return widget_; }
/*! \brief Returns the horizontal scrollbar.
*/
WScrollBar *horizontalScrollBar() const { return horizontalScrollBar_; }
/*! \brief Returns the vertical scrollbar.
*/
WScrollBar *verticalScrollBar() const { return verticalScrollBar_; }
/*! \brief Sets the policy for both scrollbars.
*
* \sa setHorizontalScrollBarPolicy(), setVerticalScrollBarPolicy()
*/
void setScrollBarPolicy(ScrollBarPolicy scrollBarPolicy);
/*! \brief Sets the horizontal scroll bar policy.
*
* \sa setScrollBarPolicy()
*/
void setHorizontalScrollBarPolicy(ScrollBarPolicy scrollBarPolicy);
/*! \brief Sets the vertical scroll bar policy.
*
* \sa setScrollBarPolicy()
*/
void setVerticalScrollBarPolicy(ScrollBarPolicy scrollBarPolicy);
/*! \brief Returns the horizontal scroll bar policy.
*
* \sa setHorizontalScrollBarPolicy()
*/
ScrollBarPolicy horizontalScrollBarPolicy()
{ return horizontalScrollBarPolicy_; }
/*! \brief Returns the vertical scroll bar policy.
*
* \sa setVerticalScrollBarPolicy()
*/
ScrollBarPolicy verticalScrollBarPolicy()
{ return verticalScrollBarPolicy_; }
private:
WWidget *widget_;
bool widgetChanged_;
WScrollBar *horizontalScrollBar_;
WScrollBar *verticalScrollBar_;
bool scrollBarChanged_;
ScrollBarPolicy horizontalScrollBarPolicy_, verticalScrollBarPolicy_;
bool scrollBarPolicyChanged_;
void scrollBarChanged();
friend class WScrollBar;
protected:
virtual void updateDom(DomElement& element, bool all);
virtual DomElementType domElementType() const;
};
}
#endif // WSCROLLAREA
|