summaryrefslogtreecommitdiff
path: root/libopie/pim/opimstate.h
blob: cf6af4625bdf23df2ad37e93fb043f26923ebdd7 (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
#ifndef OPIE_PIM_STATE_H
#define OPIE_PIM_STATE_H

#include <qstring.h>

/**
 * The State of a Task
 * This class encapsules the state of a todo
 * and it's shared too
 */
/*
 * in c a simple struct would be enough ;)
 * g_new_state();
 * g_do_some_thing( state_t*  );
 * ;)
 */
class OPimState {
public:
    enum State {
        Started = 0,
        Postponed,
        Finished,
        NotStarted,
        Undefined
    };
    OPimState( int state = Undefined );
    OPimState( const OPimState& );
    ~OPimState();

    bool operator==( const OPimState& );
    OPimState &operator=( const OPimState& );
    void setState( int state);
    int state()const;
private:
    void deref();
    inline void copyInternally();

    struct Data;
    Data* data;

    class Private;
    Private *d;
};


#endif