1
// GUI.hh --- The WorkRave GUI
3
// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2007, 2008, 2009, 2010 Rob Caelers & Raymond Penners
4
// All rights reserved.
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.
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.
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/>.
23
#include "preinclude.h"
26
#include "ICoreEventListener.hh"
36
using namespace workrave;
46
public ICoreEventListener
49
GUI(int argc, char **argv);
52
static GUI *get_instance();
58
// IGUIFactory methods
59
virtual void set_break_response(IBreakResponse *rep);
60
virtual void create_prelude_window(BreakId break_id);
61
virtual void create_break_window(BreakId break_id, BreakHint break_hint);
62
virtual void hide_break_window();
63
virtual void show_break_window();
64
virtual void refresh_break_window();
65
virtual void set_break_progress(int value, int max_value);
66
virtual void set_prelude_stage(PreludeStage stage);
67
virtual void set_prelude_progress_text(PreludeProgressText text);
70
void core_event_notify(CoreEvent event);
71
void core_event_operation_mode_changed(const OperationMode m);
73
SoundPlayer *get_sound_player() const;
75
static gboolean static_on_timer(gpointer data);
77
enum BlockMode { BLOCK_MODE_NONE = 0, BLOCK_MODE_INPUT, BLOCK_MODE_ALL };
85
void init_sound_player();
87
void collect_garbage();
88
IBreakWindow *new_break_window(BreakId break_id, bool ignorable);
91
static const std::string CFG_KEY_GUI_BLOCK_MODE;
92
BlockMode get_block_mode();
93
void set_block_mode(BlockMode mode);
98
//! The one and only instance
101
//! The Configurator.
102
IConfigurator *configurator;
104
//! The Core controller
108
SoundPlayer *sound_player;
110
//! Interface to the break window.
111
IBreakWindow *break_window;
113
//! Interface to the prelude windows.
114
PreludeWindow *prelude_window;
117
MainWindow *main_window;
119
//! Reponse interface for breaks
120
IBreakResponse *response;
122
//! Destroy break window on next heartbeat?
123
bool break_window_destroy;
125
//! Destroy prelude window on next heartbeat?
126
bool prelude_window_destroy;
128
//! Current active break.
129
BreakId active_break_id;
131
//! The number of command line arguments.
134
//! The command line arguments.
138
std::string progress_text;
142
int progress_max_value;
146
//! Returns the only instance of GUI
153
//! Returns the sound player
155
GUI::get_sound_player() const