summaryrefslogtreecommitdiffstats
path: root/kbugbuster/backend/bugdetails.h
blob: 171847a7497a2c269aa4122b9d1f2310c43e36e4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
#ifndef __bugdetails_h__
#define __bugdetails_h__

#include "person.h"
#include "bugdetailspart.h"
#include "bugdetailsimpl.h"

#include <tqvaluelist.h>

#include <ksharedptr.h>

class BugDetailsImpl;

class BugDetails
{
public:
    typedef TQValueList<BugDetails> List;
    struct Attachment {
        TQByteArray contents;
        TQString filename;
    };

    BugDetails();
    BugDetails( BugDetailsImpl *impl );
    BugDetails( const BugDetails &other );
    BugDetails &operator=( const BugDetails &rhs );
    ~BugDetails();

    TQString version() const;
    TQString source() const;
    TQString compiler() const;
    TQString os() const;
    BugDetailsPart::List parts() const;
    void addAttachmentDetails( const TQValueList<BugDetailsImpl::AttachmentDetails>& attch );
    TQValueList<BugDetailsImpl::AttachmentDetails> attachmentDetails() const;
    TQValueList<BugDetails::Attachment> extractAttachments() const;
    static TQValueList<BugDetails::Attachment> extractAttachments( const TQString& text );

    TQDateTime submissionDate() const;
    int age() const;

    bool operator==( const BugDetails &rhs );

    bool isNull() const { return m_impl == 0; }

private:
    BugDetailsImpl *impl() const { return m_impl; }

    KSharedPtr<BugDetailsImpl> m_impl;
};

#endif

/* vim: set sw=4 ts=4 et softtabstop=4: */