1 /*************************************************************************** 2 docdigest.h - 3 ------------------- 4 begin : Wed Mar 15 2006 5 copyright : (C) 2006 by Klaas Freitag 6 email : freitag@kde.org 7 ***************************************************************************/ 8 9 /*************************************************************************** 10 * * 11 * This program is free software; you can redistribute it and/or modify * 12 * it under the terms of the GNU General Public License as published by * 13 * the Free Software Foundation; either version 2 of the License, or * 14 * (at your option) any later version. * 15 * * 16 ***************************************************************************/ 17 #ifndef DOCDIGEST_H 18 #define DOCDIGEST_H 19 20 #include <kcontacts/addressee.h> 21 #include <QLocale> 22 #include <QList> 23 24 #include "dbids.h" 25 #include "archdoc.h" 26 27 class QString; 28 class QDate; 29 30 typedef QList<ArchDocDigest> ArchDocDigestList; 31 32 class DocDigest 33 { 34 35 public: 36 DocDigest( dbID id, const QString& type, const QString& clientID ); 37 DocDigest(); 38 clientId()39 QString clientId() const { return mClientId; } setClientId(const QString & id)40 void setClientId( const QString& id ) { mClientId = id; } 41 clientAddress()42 QString clientAddress() const { return mClientAddress; } setClientAddress(const QString & address)43 void setClientAddress( const QString& address ) { mClientAddress = address; } 44 45 KContacts::Addressee addressee() const; 46 void setAddressee( const KContacts::Addressee& ); 47 type()48 QString type() const { return mType; } setType(const QString & t)49 void setType( const QString& t ) { mType = t; } 50 51 QString date() const; setDate(const QDate & date)52 void setDate( const QDate& date ) { mDate = date; } 53 QDate rawDate() const; 54 55 QString lastModified() const; setLastModified(const QDateTime & date)56 void setLastModified( const QDateTime& date ) { mLastModified = date; } 57 id()58 QString id() const { return mID.toString(); } setId(dbID id)59 void setId( dbID id ) { mID = id; } 60 ident()61 QString ident() const { return mIdent; } setIdent(const QString & ident)62 void setIdent( const QString& ident ) { mIdent = ident; } 63 whiteboard()64 QString whiteboard() const { return mWhiteboard; } setWhiteboard(const QString & white)65 void setWhiteboard( const QString& white ) { mWhiteboard = white; } 66 setProjectLabel(const QString & prjLabel)67 void setProjectLabel( const QString& prjLabel ) { mProjectLabel = prjLabel; } projectLabel()68 QString projectLabel() const { return mProjectLabel; } 69 70 ArchDocDigestList archDocDigestList(); 71 72 protected: 73 74 dbID mID; 75 QString mType; 76 QString mClientId; 77 QString mIdent; 78 QString mWhiteboard; 79 QString mProjectLabel; 80 QString mClientAddress ; 81 82 QDateTime mLastModified; 83 QDate mDate; 84 QLocale mLocale; 85 86 ArchDocDigestList mArchDocs; 87 bool _archDocLazyLoaded; 88 private: 89 KContacts::Addressee mContact; 90 }; 91 92 typedef QList<DocDigest> DocDigestList; 93 typedef QList<DocDigestList> DocDigestListIterator; 94 95 96 class DocDigestsTimeline 97 { 98 public: 99 DocDigestsTimeline(); 100 DocDigestsTimeline( int, int ); 101 month()102 int month() { return mMonth; } setMonth(int m)103 void setMonth( int m ) { mMonth = m; } year()104 int year() { return mYear; } setYear(int y)105 void setYear( int y ) { mYear = y; } 106 digests()107 DocDigestList digests() { return mDigests; } 108 void setDigestList( const DocDigestList& ); clearDigestList()109 void clearDigestList() { mDigests.clear (); } 110 private: 111 int mMonth, mYear; 112 DocDigestList mDigests; 113 }; 114 115 typedef QList<DocDigestsTimeline> DocDigestsTimelineList; 116 117 #endif 118