diff options
author | toma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2009-11-25 17:56:58 +0000 |
---|---|---|
committer | toma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2009-11-25 17:56:58 +0000 |
commit | bd9e6617827818fd043452c08c606f07b78014a0 (patch) | |
tree | 425bb4c3168f9c02f10150f235d2cb998dcc6108 /kbugbuster/backend/bug.h | |
download | tdesdk-bd9e6617827818fd043452c08c606f07b78014a0.tar.gz tdesdk-bd9e6617827818fd043452c08c606f07b78014a0.zip |
Copy the KDE 3.5 branch to branches/trinity for new KDE 3.5 features.
BUG:215923
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdesdk@1054174 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kbugbuster/backend/bug.h')
-rw-r--r-- | kbugbuster/backend/bug.h | 92 |
1 files changed, 92 insertions, 0 deletions
diff --git a/kbugbuster/backend/bug.h b/kbugbuster/backend/bug.h new file mode 100644 index 00000000..9a5ae8b6 --- /dev/null +++ b/kbugbuster/backend/bug.h @@ -0,0 +1,92 @@ +#ifndef __bug_h__ +#define __bug_h__ + +#include "person.h" + +#include <qvaluelist.h> + +#include <ksharedptr.h> + +class BugImpl; + +class Bug +{ +public: + typedef QValueList<Bug> List; + typedef QValueList<int> BugMergeList; + + enum Severity { SeverityUndefined, Critical, Grave, Major, Crash, Normal, + Minor, Wishlist }; + enum Status { StatusUndefined, Unconfirmed, New, Assigned, Reopened, + Closed }; + + Bug(); + Bug( BugImpl *impl ); + Bug( const Bug &other ); + Bug &operator=( const Bug &rhs ); + ~Bug(); + + static QString severityLabel( Severity s ); + /** + Return string representation of severity. This function is symmetric to + stringToSeverity(). + */ + static QString severityToString( Severity s ); + /** + Return severity code of string representation. This function is symmetric + to severityToString(). + */ + static Severity stringToSeverity( const QString &, bool *ok = 0 ); + + static QValueList<Severity> severities(); + + uint age() const; + void setAge( uint days ); + + QString title() const; + void setTitle( QString title ); + Person submitter() const; + QString number() const; + Severity severity() const; + void setSeverity( Severity severity ); + QString severityAsString() const; + Person developerTODO() const; + + BugMergeList mergedWith() const; + + /** + * Status of a bug. Currently open or closed. + * TODO: Should we add a status 'deleted' here ? + */ + Status status() const; + void setStatus( Status newStatus ); + + static QString statusLabel( Status s ); + /** + Return string representation of status. This function is symmetric to + stringToStatus(). + */ + static QString statusToString( Status s ); + /** + Return status code of string representation. This function is symmetric + to statusToString(). + */ + static Status stringToStatus( const QString &, bool *ok = 0 ); + + bool operator==( const Bug &rhs ); + bool operator<( const Bug &rhs ) const; + + bool isNull() const { return m_impl == 0; } + + static Bug fromNumber( const QString &bugNumber ); + +private: + BugImpl *impl() const { return m_impl; } + + KSharedPtr<BugImpl> m_impl; +}; + +#endif + +/* vim: set sw=4 ts=4 et softtabstop=4: */ + |