Diffstat (limited to 'libopie2/opiepim/core/opimrecord.h') (more/less context) (ignore whitespace changes)
-rw-r--r-- | libopie2/opiepim/core/opimrecord.h | 66 |
1 files changed, 36 insertions, 30 deletions
diff --git a/libopie2/opiepim/core/opimrecord.h b/libopie2/opiepim/core/opimrecord.h index 63a3a98..4981a41 100644 --- a/libopie2/opiepim/core/opimrecord.h +++ b/libopie2/opiepim/core/opimrecord.h @@ -26,14 +26,12 @@ Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#ifndef OPIE_PIM_RECORD_H -#define OPIE_PIM_RECORD_H -#include <qdatastream.h> -#include <qmap.h> -#include <qstring.h> -#include <qstringlist.h> +#ifndef OPIMRECORD_H +#define OPIMRECORD_H +/* OPIE */ +#include <opie2/opimxrefmanager.h> /* * we need to get customMap which is private... */ @@ -41,22 +39,28 @@ #include <qpe/palmtoprecord.h> #undef private -#include <opie2/opimxrefmanager.h> +/* QT */ +#include <qdatastream.h> +#include <qmap.h> +#include <qstring.h> +#include <qstringlist.h> -namespace Opie { +namespace Opie +{ /** * This is the base class for * all PIM Records * */ -class OPimRecord : public Qtopia::Record { -public: +class OPimRecord : public Qtopia::Record +{ + public: /** * c'tor * uid of 0 isEmpty * uid of 1 will be assigned a new one */ - OPimRecord(int uid = 0); + OPimRecord( int uid = 0 ); ~OPimRecord(); /** @@ -72,7 +76,7 @@ public: /** * category names resolved */ - QStringList categoryNames( const QString& appname )const; + QStringList categoryNames( const QString& appname ) const; /** * set category names they will be resolved @@ -89,53 +93,55 @@ public: * if a Record isEmpty * it's empty if it's 0 */ - virtual bool isEmpty()const; + virtual bool isEmpty() const; /** * toRichText summary */ - virtual QString toRichText()const = 0; + virtual QString toRichText() const = 0; /** * a small one line summary */ - virtual QString toShortText()const = 0; + virtual QString toShortText() const = 0; /** * the name of the Record */ - virtual QString type()const = 0; + virtual QString type() const = 0; /** * matches the Records the regular expression? */ virtual bool match( const QString ®exp ) const - {setLastHitField( -1 ); - return Qtopia::Record::match(QRegExp(regexp));}; + { + setLastHitField( -1 ); + return Qtopia::Record::match( QRegExp( regexp ) ); + }; /** * if implemented this function returns which item has been * last hit by the match() function. * or -1 if not implemented or no hit has occured */ - int lastHitField()const; + int lastHitField() const; /** * converts the internal structure to a map */ - virtual QMap<int, QString> toMap()const = 0; + virtual QMap<int, QString> toMap() const = 0; // virtual fromMap( const <int, QString>& map ) = 0; // Should be added in the future (eilers) /** * key value representation of extra items */ - QMap<QString, QString> toExtraMap()const; + QMap<QString, QString> toExtraMap() const; void setExtraMap( const QMap<QString, QString>& ); /** * the name for a recordField */ - virtual QString recordField(int)const = 0; + virtual QString recordField( int ) const = 0; /** * returns a reference of the @@ -161,24 +167,24 @@ public: * saves the OPimRecord * to and from a DataStream */ - virtual bool loadFromStream(QDataStream& ); - virtual bool saveToStream( QDataStream& stream )const; + virtual bool loadFromStream( QDataStream& ); + virtual bool saveToStream( QDataStream& stream ) const; -protected: + protected: // need to be const cause it is called from const methods mutable int m_lastHit; - void setLastHitField( int lastHit )const; + void setLastHitField( int lastHit ) const; Qtopia::UidGen &uidGen(); -// QString crossToString()const; + // QString crossToString()const; -private: + private: class OPimRecordPrivate; OPimRecordPrivate *d; OPimXRefManager m_xrefman; static Qtopia::UidGen m_uidGen; -private: - void flush( const OPimXRefPartner&, QDataStream& stream )const; + private: + void flush( const OPimXRefPartner&, QDataStream& stream ) const; OPimXRefPartner partner( QDataStream& ); }; |