7#if !defined(OWL_VALIDATE_H)
11#if defined(BI_HAS_PRAGMA_ONCE)
77 virtual bool IsValidInput(LPTSTR input,
bool suppressFill);
78 virtual bool IsValid(LPCTSTR input);
80 virtual int Adjust(
tstring& text,
int& begPos,
int& endPos,
int amount);
87 bool HasOption(
int option);
88 void SetOption(
int option);
89 void UnsetOption(
int option);
155 int Adjust(
tstring& text,
int& begPos,
int& endPos,
int amount);
168 void Init(
bool autoFill);
171 void ToGroupEnd(
uint termCh,
uint& i);
172 bool SkipToComma(
uint termCh,
uint& i);
237 int Adjust(
tstring& text,
int& begPos,
int& endPos,
int amount);
279 virtual bool Lookup(LPCTSTR str);
303 int Adjust(
tstring& text,
int& begPos,
int& endPos,
int amount);
Definition of a bit set and a character set.
Derived from TBitSet, TCharSet sets and clears bytes for a group of characters.
A streamable class, TFilterValidator checks an input field as the user types into it.
void SetValidChars(const TCharSet &vc)
Sets the valid character set for the validator.
TFilterValidator(const TCharSet &validChars)
Let the compiler know that the following template instances will be defined elsewhere.
void Error(TWindow *owner)
Error overrides TValidator's virtual function and displays a message box indicating that the text str...
bool IsValid(LPCTSTR str)
IsValid overrides TValidator's virtuals and returns true if all characters in str are in the set of a...
const TCharSet & GetValidChars()
Returns the valid character set for the validator.
bool IsValidInput(TCHAR *str, bool suppressFill)
IsValidInput overrides TValidator's virtual function and checks each character in the string str to e...
A streamable class, TLookupValidator compares the string typed by a user with a list of acceptable va...
TLookupValidator()
Constructs a TLookupValidator object.
bool IsValid(LPCTSTR str)
IsValid overrides TValidator's virtual function and calls Lookup to find the string str in the list o...
virtual bool Lookup(LPCTSTR str)
Searches for the string str in the list of valid entries and returns true if it finds str; otherwise,...
TPXPictureValidator objects compare user input with a picture of a data format to determine the valid...
int Adjust(tstring &text, int &begPos, int &endPos, int amount)
Adjusts the 'value' of the text, given a cursor position and an amount.
virtual TPicResult Picture(TCHAR *input, bool autoFill=false)
Checks the validity of the input according to the format specified by the picture string,...
void SetPic(const tstring &pic)
Sets the picture mask for the validator.
const tstring & GetPic() const
Returns the picture mask used by the validator.
TPXPictureValidator(LPCTSTR pic, bool autoFill=false)
Constructs a picture validator object by first calling the constructor inherited from TValidator and ...
bool IsValid(LPCTSTR str)
IsValid overrides TValidator's virtual function and compares the string passed in str with the format...
void Error(TWindow *owner)
Overrides TValidator's virtual function and displays a message box that indicates an error in the pic...
bool IsValidInput(TCHAR *str, bool suppressFill)
IsValidInput overrides TValidator's virtual function and checks the string passed in str against the ...
void SetMax(TExtent maxValue)
Sets the maximum number the validator can accept.
bool IsValid(LPCTSTR str)
We first validate the range, because of the asynchronous manner in which SetMin and SetMax could be c...
auto GetRange() const -> TRange
Returns the given the minimum and maximum number the validator can accept.
auto GetMax() const -> TExtent
Returns the maximum number the validator can accept.
void Error(TWindow *owner)
Overrides TValidator's virtual function and displays a message box indicating that the entered value ...
int Adjust(tstring &text, int &begPos, int &endPos, int amount)
We first validate the range, because of the asynchronous manner in which SetMin and SetMax could be c...
TRangeValidator(TExtent minValue, TExtent maxValue)
Constructs a range validator object using minValue and maxValue as the range of possible values.
void SetRange(const TRange &range)
Sets the minimum and maximum number the validator can accept.
uint Transfer(TCHAR *str, void *buffer, TTransferDirection direction)
Incorporates the three types, tdSizeData, tdGetData, and tdSetData, that a range validator can handle...
void SetMin(TExtent minValue)
Sets the minimum number the validator can accept.
auto GetMin() const -> TExtent
Returns the minimum number the validator can accept.
Classes that inherit from TStreamableBase are known as streamable classes (their objects can be writt...
Derived from TLookupValidator, TStringLookupValidator is a streamable class.
void Error(TWindow *owner)
Overrides TValidator's virtual function and displays a message box indicating that the typed string d...
int Adjust(tstring &text, int &begPos, int &endPos, int amount)
Adjusts the 'value' of the text, given a cursor position and an amount.
TStringLookupValidator(TSortedStringArray *strings)
Constructs a string-lookup object by first calling the constructor inherited from TLookupValidator an...
bool Lookup(LPCTSTR str)
Overrides TLookupValidator's virtual function.
void NewStringList(TSortedStringArray *strings)
Sets the list of valid input string for the string-lookup validator.
const TSortedStringArray * GetStrings() const
Returns the set of valid strings used by the validator.
void SetStrings(TSortedStringArray *strings)
Sets the valid strings used by the validator.
A streamable class, TValidator defines an abstract data validation object.
void UnsetOption(int option)
Unsets the bits specified in the Options data member.
uint16 Options
A bitmap member used to control options for various descendants of TValidator.
virtual uint Transfer(TCHAR *text, void *buffer, TTransferDirection direction)
Allows a validator to set and read the values of its associated edit control.
bool Valid(LPCTSTR str, TWindow *owner=0)
Returns true if IsValid returns true.
bool HasOption(int option)
Gets the Options bits. Returns true if a specified option is set.
virtual bool IsValidInput(TCHAR *input, bool suppressFill)
Checks current input against validator.
virtual void Error(TWindow *owner)
Error is an abstract function called by Valid when it detects that the user has entered invalid infor...
bool Valid(const tstring &str, TWindow *owner=0)
virtual bool IsValid(LPCTSTR input)
Checks input against validator for completeness. Never modifies input.
TValidator()
Constructs an abstract validator object and sets Options fields to 0.
virtual int Adjust(tstring &text, int &begPos, int &endPos, int amount)
Adjusts the 'value' of the text, given a cursor position and an amount.
void SetOption(int option)
Sets the bits for the Options data member.
TWindow, derived from TEventHandler and TStreamableBase, provides window-specific behavior and encaps...
A nested class, TXValidator describes an exception that results from an invalid validator object.
void Throw()
Creates an instance of TXValidator and throws it.
TXValidator(uint resId=IDS_VALIDATORSYNTAX)
Constructs a TXValidator object, setting the resource ID to IDS_VALIDATORSYNTAX string resource.
static void Raise()
Creates an instance of TXValidator and throws it.
TXValidator * Clone()
Copies the exception so it can be rethrown at a safer time.
Definition of container classes used and made available by OWL.
#define DECLARE_STREAMABLE_OWL(cls, ver)
#define DECLARE_STREAMABLE_INLINES(cls)
TXOwl(const tstring &msg, uint resId=0)
An OWL exception with a given message for displaying and an unsigned Id that can be used for identifi...
TValidatorOptions
Bit-register flags used with TValidator::SetOption and UnsetOption.
TPicResult
Validation result type.
@ voReserved
Reserved for future use.
@ voTransfer
Option to perform conversion & transfer.
@ voOnAppend
Option to only validate input on appending.
@ voFill
Option to fill in chars on IsValidInput checks.
TTransferDirection
The TTransferDirection enum describes the constants that the transfer function uses to determine how ...
Object Windows Library (OWLNext Core).
TSortedObjectArray< tstring > TSortedStringArray
Definition of container classes used and made available by OWL.
Base window class TWindow definition, including HWND encapsulation.