Code

moving trunk for module inkscape
[inkscape.git] / src / debug / event.h
1 /*
2  * Inkscape::Debug::Event - event for debug tracing
3  *
4  * Authors:
5  *   MenTaLguY <mental@rydia.net>
6  *
7  * Copyright (C) 2005 MenTaLguY
8  *
9  * Released under GNU GPL, read the file 'COPYING' for more information
10  */
12 #ifndef SEEN_INKSCAPE_DEBUG_EVENT_H
13 #define SEEN_INKSCAPE_DEBUG_EVENT_H
15 #include <utility>
16 #include "util/shared-c-string-ptr.h"
18 namespace Inkscape {
20 namespace Debug {
22 class Event {
23 public:
24     virtual ~Event() {}
26     enum Category {
27         CORE=0,
28         XML,
29         SPOBJECT,
30         DOCUMENT,
31         REFCOUNT,
32         EXTENSION,
33         OTHER
34     };
35     enum { N_CATEGORIES=OTHER+1 };
37     struct PropertyPair {
38     public:
39         PropertyPair() {}
40         PropertyPair(Util::SharedCStringPtr n, Util::SharedCStringPtr v)
41         : name(n), value(v) {}
42         PropertyPair(char const *n, Util::SharedCStringPtr v)
43         : name(Util::SharedCStringPtr::copy(n)), value(v) {}
44         PropertyPair(Util::SharedCStringPtr n, char const *v)
45         : name(n), value(Util::SharedCStringPtr::copy(v)) {}
46         PropertyPair(char const *n, char const *v)
47         : name(Util::SharedCStringPtr::copy(n)),
48           value(Util::SharedCStringPtr::copy(v)) {}
50         Util::SharedCStringPtr name;
51         Util::SharedCStringPtr value;
52     };
54     static Category category() { return OTHER; }
56     virtual Util::SharedCStringPtr name() const=0;
57     virtual unsigned propertyCount() const=0;
58     virtual PropertyPair property(unsigned property) const=0;
59 };
61 }
63 }
65 #endif
66 /*
67   Local Variables:
68   mode:c++
69   c-file-style:"stroustrup"
70   c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
71   indent-tabs-mode:nil
72   fill-column:99
73   End:
74 */
75 // vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 :