KockpitValidator Class Reference

Class for validation. More...

#include <kockpitvalidator.h>

Public Member Functions

 KockpitValidator (QObject *parent=0)
 Constructor.
virtual ~KockpitValidator ()
 Destructor.
Q_INVOKABLE void appendValidationObj (const QString &item, const QString &errmsg, int errcode)
 Append Validation Object.
void computeErrState (QStringList *result=NULL)
 Compute Error State.
void clear ()
 Clear Error List.
validationResult getErrState () const
 Getter.

Private Attributes

QList< KockpitValidationObjvallist
 List of validated items.
validationResult errstate
 Main errorstate - one defective entry in vallist indicates a negative error state.

Friends

std::ostream & operator<< (std::ostream &output, const KockpitValidator &validator)
 Output.

Detailed Description

Class for validation.

This class handles all actions in association with validation.


Constructor & Destructor Documentation

KockpitValidator::KockpitValidator ( QObject *  parent = 0  ) 

Constructor.

The validation result is set to VALIDATION_FAILED.

See also:
validationResult
virtual KockpitValidator::~KockpitValidator (  )  [inline, virtual]

Destructor.


Member Function Documentation

void KockpitValidator::appendValidationObj ( const QString &  item,
const QString &  errmsg,
int  errcode 
)

Append Validation Object.

Calling this function a new validation result will be added to list. This function is callable in a javascript file.

Parameters:
item Item which was validated.
errmsg Error message.
errcode Error code.
void KockpitValidator::clear (  ) 

Clear Error List.

This function resets vallist.

void KockpitValidator::computeErrState ( QStringList *  result = NULL  ) 

Compute Error State.

This function iterates over vallist and determines the error state. If errors occured it is possible to add them to a QStringList which is hand over as a parameter.

Parameters:
result Result Error Messages.
validationResult KockpitValidator::getErrState (  )  const

Getter.

Get the current error state.

Returns:
validationResult Error state.

Friends And Related Function Documentation

std::ostream& operator<< ( std::ostream &  output,
const KockpitValidator validator 
) [friend]

Output.

This function is only needed to give out the KockpitValidator on STDOUT.

Parameters:
output Reference to stdout.
validator Reference to an KockpitValidator object.

Field Documentation

Main errorstate - one defective entry in vallist indicates a negative error state.

List of validated items.


The documentation for this class was generated from the following files:
Generated on Wed Mar 24 09:58:14 2010 for kockpit by  doxygen 1.6.3