2 kopeteidletimer.h - Kopete Idle Timer
4 Copyright (c) 2002 by Hendrik vom Lehn <hvl@linux-4-ever.de>
5 Copyright (c) 2003 by Olivier Goffart <ogoffart@kde.org>
6 Copyright (c) 2008 by Roman Jarosz <kedgedev@centrum.cz>
7 Kopete (c) 2002-2008 by the Kopete developers <kopete-devel@kde.org>
9 *************************************************************************
11 * This library is free software; you can redistribute it and/or *
12 * modify it under the terms of the GNU Lesser General Public *
13 * License as published by the Free Software Foundation; either *
14 * version 2 of the License, or (at your option) any later version. *
16 *************************************************************************
18 #ifndef KOPETEIDLETIMER_H
19 #define KOPETEIDLETIMER_H
21 #include <QtCore/QObject>
23 #include "kopete_export.h"
29 * IdleTimer handles global idle time and allows to register idle timeout notifications
31 * IdleTimer is a singleton, you may uses it with @ref IdleTimer::self()
33 class KOPETE_EXPORT IdleTimer
: public QObject
39 * Get the only instance of IdleTimer
40 * @return IdleTimer single instance
42 static IdleTimer
*self();
47 * @brief Time in seconds the user has been idle
53 * @brief Register new timeout notification
54 * \param idleSeconds the idle notification time period
55 * \param receiver the object that receives the timeout notification.
56 * \param memberActive the slot that is called when user has changed its state from idle to active.
57 * \param memberIdle the slot that is called when user was idle for @param idleSeconds seconds.
59 void registerTimeout( int idleSeconds
, QObject
* receiver
,
60 const char * memberActive
, const char * memberIdle
);
63 * removes all registered timeout notifications for this object
65 void unregisterTimeout( QObject
*receiver
);
68 void updateIdleTime();
73 static IdleTimer
*instance
;