/usr/include/Wt/WValidationStatus 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 | // 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 WVALIDATIONSTATUS_H_
#define WVALIDATIONSTATUS_H_
#include <Wt/WCompositeWidget>
#include <Wt/WValidator>
namespace Wt {
class WFormWidget;
/*! \class WValidationStatus Wt/WValidationStatus Wt/WValidationStatus
* \brief A widget that keeps track of the validation status of a form widget.
*
* <i>Since %Wt 2.1.3, all standard validators provide client-side
* validation and this is reflected in the form widget using the style
* class "Wt-invalid" when the validator returns not
* WValidator::Valid. Therefore, it is unlikely you will need this
* class anymore.</i>
*
* Use a %WValidationStatus widget to act to changes in validation of a
* WFormWidget. The widget may show visual feed-back of the validation
* state of the input.
*
* Visual feed-back may be given by showing an invalidStateWidget when
* input is invalid, an invalidEmptyStateWidget when the input is
* invalid because mandatory and empty, or a validStateWidget when
* input is valid. All of these widgets may be 0, indicating that no
* widget will be shown for the corresponding state.
*
* When validation state changes from invalid to valid, or from valid
* to invalid, the widget emits the validated signal. This may be used
* to for example enable or disable a button.
*
* \deprecated Since %Wt 3.1.1, validation is handled directly on WFormWidget
* subclasses.
*/
class WT_API WValidationStatus : public WCompositeWidget
{
public:
/*! \brief Construct a WValidationStatus widget for another widget.
*
* Constructs a validation status widget for the given field.
*
* The validation stateWidgets (if not \c 0) will be managed by this
* widget, and shown and hidden to reflect the current validation
* state.
*/
WValidationStatus(WFormWidget *field,
WWidget *validStateWidget = 0,
WWidget *invalidStateWidget = 0,
WWidget *invalidEmptyStateWidget = 0,
WContainerWidget *parent = 0);
/*! \brief Is the field currently considered valid?
*/
bool valid() const { return state_ == WValidator::Valid; }
/*! \brief Signal emitted when the validation state changed.
*
* The new state of the validation (valid or invalid) is given
* as argument. This signal gets emitted when the state changes
* from WValidator::Valid to WValidator::Invalid, or from
* WValidator::Invalid to WValidator::Valid.
*/
Signal<bool>& validated() { return validated_; }
private:
Signal<bool> validated_;
WContainerWidget *impl_;
WFormWidget *field_;
WWidget *validStateWidget_;
WWidget *invalidStateWidget_;
WWidget *invalidEmptyStateWidget_;
WValidator::State state_;
void inputChanged();
};
}
#endif // WVALIDATION_WIDGET_H_
|