Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

Task Class Reference

The Task class holds the data of a todo entry. More...

#include </home/clem/local/src/opie/library/backend/task.h>

Inheritance diagram for Task:

Inheritance graph
[legend]
Collaboration diagram for Task:

Collaboration graph
[legend]
List of all members.

Public Types

enum  PriorityValue {
  VeryHigh = 1, High, Normal, Low,
  VeryLow
}

Public Member Functions

 Task ()
 Task (const QMap< int, QString > &fromMap)
 ~Task ()
QMap< int, QStringtoMap () const
void setPriority (int priority)
int priority () const
void setDescription (const QString &description)
const QStringdescription () const
void setDueDate (const QDate &date)
void clearDueDate ()
void setDueDate (const QDate &date, bool hasDue)
void setHasDueDate (bool b)
const QDatedueDate () const
bool hasDueDate () const
void setCompleted (bool b)
bool isCompleted () const
void save (QString &buf) const
bool match (const QRegExp &r) const

Static Public Member Functions

static void writeVCalendar (const QString &filename, const QValueList< Task > &tasks)
static void writeVCalendar (const QString &filename, const Task &task)
static QValueList< TaskreadVCalendar (const QString &filename)

Private Member Functions

Qtopia::UidGenuidGen ()

Private Attributes

bool mDue
QDate mDueDate
bool mCompleted
int mPriority
QString mDesc
TaskPrivate * d
int recordId
int recordInfo

Static Private Attributes

static Qtopia::UidGen sUidGen

Detailed Description

The Task class holds the data of a todo entry.

This data includes the priority of the task, a description, an optional due date, and whether the task is completed or not.

Definition at line 30 of file task.h.


Member Enumeration Documentation

enum Task::PriorityValue
 

Enumeration values:
VeryHigh 
High 
Normal 
Low 
VeryLow 

Definition at line 43 of file task.h.


Constructor & Destructor Documentation

Task::Task  ) 
 

Creates a new, empty task.

Definition at line 50 of file task.cpp.

Task::Task const QMap< int, QString > &  m  ) 
 

For internal use only.

Creates a new task. The properties of the task are set from m.

Definition at line 139 of file task.cpp.

References QMap< Key, T >::begin(), Qtopia::Completed, Qtopia::Date, QMap< Key, T >::end(), TimeConversion::fromString(), Qtopia::HasDate, Qtopia::Record::idsFromString(), mDue, mDueDate, Qtopia::Priority, Qtopia::Record::setCategories(), setCompleted(), setDescription(), setPriority(), Qtopia::Record::setUid(), Qtopia::TaskCategory, Qtopia::TaskDescription, Qtopia::TaskRid, Qtopia::TaskRinfo, Qtopia::TaskUid, and TRUE.

Task::~Task  ) 
 

Destroys a task.

Definition at line 162 of file task.cpp.


Member Function Documentation

void Task::clearDueDate  )  [inline]
 

Clears the due date of the task.

Definition at line 91 of file task.h.

References FALSE, and setHasDueDate().

const QString & Task::description  )  const [inline]
 

Returns the description of the task.

Definition at line 54 of file task.h.

Referenced by createVObject(), and toMap().

const QDate & Task::dueDate  )  const [inline]
 

Returns the due date of the task.

Definition at line 64 of file task.h.

Referenced by createVObject(), and toMap().

bool Task::hasDueDate  )  const [inline]
 

Returns TRUE if there is a due date set for the task. Otherwise returns FALSE.

Definition at line 65 of file task.h.

Referenced by createVObject(), and toMap().

bool Task::isCompleted  )  const [inline]
 

Returns TRUE if the task is completed. Otherwise returns FALSE.

Definition at line 68 of file task.h.

Referenced by createVObject(), and toMap().

bool Task::match const QRegExp regexp  )  const [virtual]
 

Returns TRUE if the task matches the regular expressions regexp. Otherwise returns FALSE.

Reimplemented from Qtopia::Record.

Definition at line 239 of file task.cpp.

References QString::find(), mDesc, mDue, mDueDate, mPriority, QString::number(), and QDate::toString().

int Task::priority  )  const [inline]
 

Returns the priority of the task.

Definition at line 46 of file task.h.

Referenced by createVObject(), and toMap().

QValueList< Task > Task::readVCalendar const QString filename  )  [static]
 

Returns the set of tasks read as VCards from the file filename.

Definition at line 382 of file task.cpp.

References QValueList< T >::append(), name, o, parseVObject(), t, QString::utf8(), VCCalProp, and VCTodoProp.

void Task::save QString buf  )  const
 

For internal use only.

Appends the task information to buf.

Definition at line 193 of file task.cpp.

References Qtopia::Record::categories(), Qtopia::Record::customToXml(), QDate::day(), Qtopia::escapeString(), Qtopia::Record::idsToString(), mCompleted, mDesc, mDue, mDueDate, QDate::month(), mPriority, QString::number(), Qtopia::Record::uid(), and QDate::year().

void Task::setCompleted bool  b  )  [inline]
 

If b is TRUE marks the task as completed. Otherwise marks the task as uncompleted.

Definition at line 67 of file task.h.

Referenced by parseVObject(), and Task().

void Task::setDescription const QString description  )  [inline]
 

Sets the description of the task to description.

Definition at line 52 of file task.h.

References Qtopia::simplifyMultiLineSpace().

Referenced by parseVObject(), and Task().

void Task::setDueDate const QDate date,
bool  hasDue
[inline]
 

For internal use only.

If hasDue is TRUE sets the due date of the task to date. Otherwise clears the due date of the task.

Definition at line 61 of file task.h.

void Task::setDueDate const QDate date  )  [inline]
 

Sets the due date of the task to date.

Definition at line 90 of file task.h.

References QDate::isValid().

Referenced by parseVObject().

void Task::setHasDueDate bool  b  )  [inline]
 

For internal use only.

Just don't ask. I really can't justify the function.

Definition at line 62 of file task.h.

Referenced by clearDueDate().

void Task::setPriority int  priority  )  [inline]
 

Sets the priority of the task to priority.

Definition at line 45 of file task.h.

Referenced by parseVObject(), and Task().

QMap< int, QString > Task::toMap  )  const
 

For internal use only.

Returns the task as a map of field ids to property values.

Definition at line 170 of file task.cpp.

References Qtopia::Record::categories(), Qtopia::Completed, Qtopia::Date, description(), dueDate(), Qtopia::HasDate, hasDueDate(), Qtopia::Record::idsToString(), QMap< Key, T >::insert(), isCompleted(), QString::number(), priority(), Qtopia::Priority, Qtopia::TaskCategory, Qtopia::TaskDescription, Qtopia::TaskUid, TimeConversion::toString(), and Qtopia::Record::uid().

Qtopia::UidGen& Task::uidGen  )  [inline, private, virtual]
 

Implements Qtopia::Record.

Definition at line 74 of file task.h.

void Task::writeVCalendar const QString filename,
const Task task
[static]
 

Writes task as a VCard to the file filename.

Definition at line 364 of file task.cpp.

References createVObject(), QFileDirect::directHandle(), f, IO_WriteOnly, QFile::open(), qWarning(), QString::utf8(), and writeVObject().

void Task::writeVCalendar const QString filename,
const QValueList< Task > &  tasks
[static]
 

Writes the list of tasks as a set of VCards to the file filename.

Definition at line 343 of file task.cpp.

References QValueList< T >::begin(), createVObject(), QFileDirect::directHandle(), QValueList< T >::end(), f, IO_WriteOnly, QFile::open(), qWarning(), QString::utf8(), and writeVObject().


Member Data Documentation

TaskPrivate* Task::d [private]
 

Reimplemented from Qtopia::Record.

Definition at line 82 of file task.h.

bool Task::mCompleted [private]
 

Definition at line 79 of file task.h.

Referenced by save().

QString Task::mDesc [private]
 

Definition at line 81 of file task.h.

Referenced by match(), and save().

bool Task::mDue [private]
 

Definition at line 77 of file task.h.

Referenced by match(), save(), and Task().

QDate Task::mDueDate [private]
 

Definition at line 78 of file task.h.

Referenced by match(), save(), and Task().

int Task::mPriority [private]
 

Definition at line 80 of file task.h.

Referenced by match(), and save().

int Task::recordId [private]
 

Definition at line 84 of file task.h.

int Task::recordInfo [private]
 

Definition at line 85 of file task.h.

UidGen Task::sUidGen [static, private]
 


The documentation for this class was generated from the following files:
Generated on Sat Nov 5 17:53:13 2005 for OPIE by  doxygen 1.4.2