Qtopia library API Documentation

task.h

00001 /**********************************************************************
00002 ** Copyright (C) 2000-2002 Trolltech AS.  All rights reserved.
00003 **
00004 ** This file is part of the Qtopia Environment.
00005 **
00006 ** This file may be distributed and/or modified under the terms of the
00007 ** GNU General Public License version 2 as published by the Free Software
00008 ** Foundation and appearing in the file LICENSE.GPL included in the
00009 ** packaging of this file.
00010 **
00011 ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
00012 ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
00013 **
00014 ** See http://www.trolltech.com/gpl/ for GPL licensing information.
00015 **
00016 ** Contact info@trolltech.com if any conditions of this licensing are
00017 ** not clear to you.
00018 **
00019 **********************************************************************/
00020 #ifndef __TASK_H__
00021 #define __TASK_H__
00022 
00023 #include <qtopia/private/palmtoprecord.h>
00024 #include <qtopia/stringutil.h>
00025 
00026 #include <qvaluelist.h>
00027 #include <qdatetime.h>
00028 
00029 class TaskPrivate;
00030 class QPC_EXPORT Task : public Qtopia::Record
00031 {
00032 public:
00033     Task();
00034     Task( const QMap<int, QString> &fromMap );
00035     ~Task();
00036 
00037     QMap<int, QString> toMap() const;
00038 
00039     static void writeVCalendar( const QString &filename, const QValueList<Task> &tasks);
00040     static void writeVCalendar( const QString &filename, const Task &task);
00041     static QValueList<Task> readVCalendar( const QString &filename );
00042 
00043     enum PriorityValue { VeryHigh=1, High, Normal, Low, VeryLow };
00044 
00045     void setPriority( int priority ) { mPriority = priority; }
00046     int priority() const { return mPriority; }
00047 
00048 //     void setCategory( const QString& category )
00049 //     { mCategory = category.stripWhiteSpace(); }
00050 //     const QString &category() const { return mCategory; }
00051 
00052     void setDescription( const QString& description )
00053     { mDesc = Qtopia::simplifyMultiLineSpace(description); }
00054     const QString &description() const { return mDesc; }
00055 
00056     // Use THESE functions
00057     void setDueDate( const QDate &date);
00058     void clearDueDate();
00059    
00060     // Instead of these functions.
00061     void setDueDate( const QDate& date, bool hasDue ) { mDueDate = date; mDue = hasDue; }
00062     void setHasDueDate( bool b ) { mDue = b; }
00063 
00064     const QDate &dueDate() const { return mDueDate; }
00065     bool hasDueDate() const { return mDue; }
00066     
00067     void setCompleted( bool b ) { mCompleted = b; }
00068     bool isCompleted() const { return mCompleted; }
00069 
00070     void save( QString& buf ) const;
00071     bool match( const QRegExp &r ) const;
00072 
00073 private:
00074     Qtopia::UidGen &uidGen() { return sUidGen; }
00075     static Qtopia::UidGen sUidGen;
00076 
00077     bool mDue;
00078     QDate mDueDate;
00079     bool mCompleted;
00080     int mPriority;
00081     QString mDesc;
00082     TaskPrivate *d;
00083     // ADDITION
00084     int recordId;
00085     int recordInfo;
00086     //
00087 };
00088 
00089 // MUST be inline.  (forwards compatability).
00090 inline void Task::setDueDate( const QDate &date) { setDueDate(date, date.isValid()); }
00091 inline void Task::clearDueDate() { setHasDueDate( FALSE ); }
00092 #endif
KDE Logo
This file is part of the documentation for OPIE Version 1.5.5.
Documentation copyright © 1997-2003 the KDE developers. 2003 OPIE developers
Generated on Tue Feb 10 20:24:08 2004 by doxygen 1.3.5 written by Dimitri van Heesch, © 1997-2001