1 // IBreak.hh -- Interface of a break.
2 //
3 // Copyright (C) 2001 - 2007, 2011 Rob Caelers <robc@krandor.nl>
4 // All rights reserved.
5 //
6 // This program is free software: you can redistribute it and/or modify
7 // it under the terms of the GNU General Public License as published by
8 // the Free Software Foundation, either version 3 of the License, or
9 // (at your option) any later version.
10 //
11 // This program is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14 // GNU General Public License for more details.
15 //
16 // You should have received a copy of the GNU General Public License
17 // along with this program.  If not, see <http://www.gnu.org/licenses/>.
18 //
19 
20 #ifndef IBREAK_HH
21 #define IBREAK_HH
22 
23 #include "ICore.hh"
24 
25 #include <string.h>
26 
27 namespace workrave {
28 
29   //! Interface to retrieve information about a break.
30   class IBreak
31   {
32   public:
~IBreak()33     virtual ~IBreak() {}
34 
35     //! Returns the name of the break.
36     virtual std::string get_name() const = 0;
37 
38     //! Returns the ID of the break.
39     virtual BreakId get_id() const = 0;
40 
41     //! Is this break currently enabled?
42     virtual bool is_enabled() const = 0;
43 
44     //! Returns the current time state.
45     virtual bool is_running() const = 0;
46 
47     //! Returns the elasped active time.
48     virtual time_t get_elapsed_time() const = 0;
49 
50     //! Returns the elasped idle time.
51     virtual time_t get_elapsed_idle_time() const = 0;
52 
53     //! Returns the auto-reset interval (i.e. break duration)
54     virtual time_t get_auto_reset() const = 0;
55 
56     //! Is the auto-reset enabled?
57     virtual bool is_auto_reset_enabled() const = 0;
58 
59     //! Returns the break limit (i.e. time before break)
60     virtual time_t get_limit() const = 0;
61 
62     //! Is the limit enabled.
63     virtual bool is_limit_enabled() const = 0;
64 
65     //! Is the break window visible.
66     virtual bool is_taking() const = 0;
67   };
68 }
69 
70 #endif // IBREAK_HH
71