/usr/include/Wt/WStackedWidget is in libwt-dev 3.3.3+dfsg-4.1.
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 | // 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 WSTACKEDWIDGET_H_
#define WSTACKEDWIDGET_H_
#include <Wt/WContainerWidget>
namespace Wt {
/*! \class WStackedWidget Wt/WStackedWidget Wt/WStackedWidget
* \brief A container widget that stacks its widgets on top of each
* other.
*
* This is a container widget which at all times has only one item
* visible. The widget accomplishes this using setHidden(bool) on the
* children.
*
* Using currentIndex() and setCurrentIndex(int index) you can
* retrieve or set the visible widget.
*
* %WStackedWidget, like WContainerWidget, is by default not inline.
*
* <h3>CSS</h3>
*
* The widget is rendered using an HTML <tt><div></tt> tag and
* does not provide styling. It can be styled using inline or external
* CSS as appropriate.
*
* \sa WMenu
*/
class WT_API WStackedWidget : public WContainerWidget
{
public:
/*! \brief Creates a new stack.
*/
WStackedWidget(WContainerWidget *parent = 0);
virtual void addWidget(WWidget *widget);
/*! \brief Returns the index of the widget that is currently shown.
*
* \sa setCurrentIndex(), currentWidget()
*/
int currentIndex() const;
/*! \brief Returns the widget that is currently shown.
*
* \sa setCurrentWidget(), currentIndex()
*/
WWidget *currentWidget() const;
/*! \brief Insert a widget at a given index
*/
void insertWidget(int index, WWidget *widget);
/*! \brief Changes the current widget.
*
* The widget with index \p index is made visible, while all other
* widgets are hidden.
*
* The change of current widget is done using the animation settings
* specified by setTransitionAnimation().
*
* The default value for current index is 0 (provided thath
*
* \sa currentIndex(), setCurrentWidget()
*/
void setCurrentIndex(int index);
/*! \brief Changes the current widget using a custom animation.
*
* \sa currentIndex(), setCurrentWidget()
*/
void setCurrentIndex(int index, const WAnimation& animation,
bool autoReverse = true);
/*! \brief Changes the current widget.
*
* The widget \p widget, which must have been added before, is
* made visible, while all other widgets are hidden.
*
* \sa currentWidget(), setCurrentIndex()
*/
void setCurrentWidget(WWidget *widget);
/*! \brief Specifies an animation used during transitions.
*
* The animation is used to hide the previously current widget and
* show the next current widget using setCurrentIndex().
*
* The initial value for \p animation is WAnimation(), specifying
* no animation.
*
* When \p autoReverse is set to \c true, then the reverse animation
* is chosen when the new index precedes the current index. This
* only applies to WAnimation::SlideLeft, WAnimation::SlideRight,
* WAnimation::SlideUp or WAnimation::SlideDown transition
* effects.
*
* \sa setCurrentIndex()
*/
void setTransitionAnimation(const WAnimation& animation,
bool autoReverse = false);
protected:
using WWidget::removeChild;
virtual void removeChild(WWidget *child);
virtual DomElement *createDomElement(WApplication *app);
virtual void getDomChanges(std::vector<DomElement *>& result,
WApplication *app);
virtual void render(WFlags<RenderFlag> flags);
private:
WAnimation animation_;
bool autoReverseAnimation_;
int currentIndex_;
bool widgetsAdded_, javaScriptDefined_, loadAnimateJS_;
void defineJavaScript();
void loadAnimateJS();
};
}
#endif // WSTACKEDWIDGET_H_
|