Diffstat (limited to 'libopie2/opiepim/core/opimstate.h') (more/less context) (show whitespace changes)
-rw-r--r-- | libopie2/opiepim/core/opimstate.h | 31 |
1 files changed, 30 insertions, 1 deletions
diff --git a/libopie2/opiepim/core/opimstate.h b/libopie2/opiepim/core/opimstate.h index cf6af46..78e8cd0 100644 --- a/libopie2/opiepim/core/opimstate.h +++ b/libopie2/opiepim/core/opimstate.h | |||
@@ -1,46 +1,75 @@ | |||
1 | /* | ||
2 | This file is part of the Opie Project | ||
3 | Copyright (C) The Main Author <main-author@whereever.org> | ||
4 | =. Copyright (C) The Opie Team <opie-devel@handhelds.org> | ||
5 | .=l. | ||
6 | .>+-= | ||
7 | _;:, .> :=|. This program is free software; you can | ||
8 | .> <`_, > . <= redistribute it and/or modify it under | ||
9 | :`=1 )Y*s>-.-- : the terms of the GNU Library General Public | ||
10 | .="- .-=="i, .._ License as published by the Free Software | ||
11 | - . .-<_> .<> Foundation; either version 2 of the License, | ||
12 | ._= =} : or (at your option) any later version. | ||
13 | .%`+i> _;_. | ||
14 | .i_,=:_. -<s. This program is distributed in the hope that | ||
15 | + . -:. = it will be useful, but WITHOUT ANY WARRANTY; | ||
16 | : .. .:, . . . without even the implied warranty of | ||
17 | =_ + =;=|` MERCHANTABILITY or FITNESS FOR A | ||
18 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU | ||
19 | ..}^=.= = ; Library General Public License for more | ||
20 | ++= -. .` .: details. | ||
21 | : = ...= . :.=- | ||
22 | -. .:....=;==+<; You should have received a copy of the GNU | ||
23 | -_. . . )=. = Library General Public License along with | ||
24 | -- :-=` this library; see the file COPYING.LIB. | ||
25 | If not, write to the Free Software Foundation, | ||
26 | Inc., 59 Temple Place - Suite 330, | ||
27 | Boston, MA 02111-1307, USA. | ||
28 | */ | ||
1 | #ifndef OPIE_PIM_STATE_H | 29 | #ifndef OPIE_PIM_STATE_H |
2 | #define OPIE_PIM_STATE_H | 30 | #define OPIE_PIM_STATE_H |
3 | 31 | ||
4 | #include <qstring.h> | 32 | #include <qstring.h> |
5 | 33 | ||
34 | namespace Opie { | ||
6 | /** | 35 | /** |
7 | * The State of a Task | 36 | * The State of a Task |
8 | * This class encapsules the state of a todo | 37 | * This class encapsules the state of a todo |
9 | * and it's shared too | 38 | * and it's shared too |
10 | */ | 39 | */ |
11 | /* | 40 | /* |
12 | * in c a simple struct would be enough ;) | 41 | * in c a simple struct would be enough ;) |
13 | * g_new_state(); | 42 | * g_new_state(); |
14 | * g_do_some_thing( state_t* ); | 43 | * g_do_some_thing( state_t* ); |
15 | * ;) | 44 | * ;) |
16 | */ | 45 | */ |
17 | class OPimState { | 46 | class OPimState { |
18 | public: | 47 | public: |
19 | enum State { | 48 | enum State { |
20 | Started = 0, | 49 | Started = 0, |
21 | Postponed, | 50 | Postponed, |
22 | Finished, | 51 | Finished, |
23 | NotStarted, | 52 | NotStarted, |
24 | Undefined | 53 | Undefined |
25 | }; | 54 | }; |
26 | OPimState( int state = Undefined ); | 55 | OPimState( int state = Undefined ); |
27 | OPimState( const OPimState& ); | 56 | OPimState( const OPimState& ); |
28 | ~OPimState(); | 57 | ~OPimState(); |
29 | 58 | ||
30 | bool operator==( const OPimState& ); | 59 | bool operator==( const OPimState& ); |
31 | OPimState &operator=( const OPimState& ); | 60 | OPimState &operator=( const OPimState& ); |
32 | void setState( int state); | 61 | void setState( int state); |
33 | int state()const; | 62 | int state()const; |
34 | private: | 63 | private: |
35 | void deref(); | 64 | void deref(); |
36 | inline void copyInternally(); | 65 | inline void copyInternally(); |
37 | 66 | ||
38 | struct Data; | 67 | struct Data; |
39 | Data* data; | 68 | Data* data; |
40 | 69 | ||
41 | class Private; | 70 | class Private; |
42 | Private *d; | 71 | Private *d; |
43 | }; | 72 | }; |
44 | 73 | ||
45 | 74 | } | |
46 | #endif | 75 | #endif |