domain::Field Struct Reference

Represents a field to be used by a TaskType. More...

#include <tasktype.h>

Collaboration diagram for domain::Field:
Collaboration graph
[legend]

List of all members.

Public Types

enum  Nature {
  Numerical,
  Textual
}

Public Member Functions

bool isValid (const QVariant &value) const
bool isNull () const
bool isValid () const

Public Attributes

Nature nature
QString id
QString name

Detailed Description

Represents a field to be used by a TaskType.

A field is represented by an id (which is used to refer to a field), a name and a nature. The nature indicates what kind of value can be associated with a field.

Note:
The actual value is stored in Task objects.
See also:
Task::field(), TaskType::fields(), TaskType::fieldById().

Definition at line 26 of file tasktype.h.


Member Enumeration Documentation

Defines the different possible natures for Field objects. If new values are added to this enumeration, don't forget to update isValid(const QVariant&) const.

Enumerator:
Numerical 

Allows everything that can be represented as a number. ie "123" is allowed but "foo" is not.

Textual 

Allows everything that can be represented as a string.

Definition at line 33 of file tasktype.h.


Member Function Documentation

bool domain::Field::isNull (  )  const

Indicates whether this is an existing field. A field exists when it has an id set.

See also:
isValid()

Definition at line 215 of file tasktype.cpp.

bool domain::Field::isValid (  )  const

Indicates whether this is a valid field. A field is valid when it has both an id and a name.

See also:
isNull()

Definition at line 220 of file tasktype.cpp.

bool domain::Field::isValid ( const QVariant &  value  )  const

Indicates whether the given value is valid for this field.

Returns:
True if value can be converted to a datatype of this fields nature.

Definition at line 202 of file tasktype.cpp.


Member Data Documentation

The id of this field.

See also:
Task::field(), TaskType::fieldById().

Definition at line 57 of file tasktype.h.

The name of this field. Is used to show a field to the user.

Definition at line 62 of file tasktype.h.

The Nature of this field.

Definition at line 50 of file tasktype.h.


The documentation for this struct was generated from the following files:
 All Classes Namespaces Functions Variables Enumerations Enumerator
Generated on Thu May 27 14:20:18 2010 for MopTaskManager by  doxygen 1.6.3