• Skip to content
  • Skip to link menu
  • KDE API Reference
  • kdelibs-4.14.38 API Reference
  • KDE Home
  • Contact Us
 

KUtils

  • kutils
  • kidletime
widgetbasedpoller.h
Go to the documentation of this file.
1/* This file is part of the KDE libraries
2 Copyright (C) 2009 Dario Freddi <drf at kde.org>
3
4 This library is free software; you can redistribute it and/or
5 modify it under the terms of the GNU Library General Public
6 License version 2 as published by the Free Software Foundation.
7
8 This library is distributed in the hope that it will be useful,
9 but WITHOUT ANY WARRANTY; without even the implied warranty of
10 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 Library General Public License for more details.
12
13 You should have received a copy of the GNU Library General Public License
14 along with this library; see the file COPYING.LIB. If not, write to
15 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
16 Boston, MA 02110-1301, USA.
17*/
18
19#ifndef WIDGETBASEDPOLLER_H
20#define WIDGETBASEDPOLLER_H
21
22#include "abstractsystempoller.h"
23
24class QTimer;
25class QEvent;
26
27class WidgetBasedPoller : public AbstractSystemPoller
28{
29 Q_OBJECT
30
31public:
32 WidgetBasedPoller(QWidget *parent = 0);
33 virtual ~WidgetBasedPoller();
34
35 bool isAvailable();
36 bool setUpPoller();
37 void unloadPoller();
38
39protected:
40 bool eventFilter(QObject *object, QEvent *event);
41
42public slots:
43 void addTimeout(int nextTimeout);
44 void removeTimeout(int nextTimeout);
45 QList<int> timeouts() const;
46 int forcePollRequest();
47 virtual void catchIdleEvent();
48 virtual void stopCatchingIdleEvents();
49
50private slots:
51 int poll();
52 virtual int getIdleTime() = 0;
53 void detectedActivity();
54 void waitForActivity();
55 void releaseInputLock();
56
57private:
58 virtual bool additionalSetUp() = 0;
59
60private:
61 QTimer * m_pollTimer;
62 QWidget * m_grabber;
63 QList<int> m_timeouts;
64};
65
66#endif /* WIDGETBASEDPOLLER_H */
abstractsystempoller.h
AbstractSystemPoller
Definition: abstractsystempoller.h:25
QList
QObject
QWidget
WidgetBasedPoller
Definition: widgetbasedpoller.h:28
WidgetBasedPoller::removeTimeout
void removeTimeout(int nextTimeout)
Definition: widgetbasedpoller.cpp:153
WidgetBasedPoller::isAvailable
bool isAvailable()
Definition: widgetbasedpoller.cpp:38
WidgetBasedPoller::addTimeout
void addTimeout(int nextTimeout)
Definition: widgetbasedpoller.cpp:71
WidgetBasedPoller::~WidgetBasedPoller
virtual ~WidgetBasedPoller()
Definition: widgetbasedpoller.cpp:34
WidgetBasedPoller::catchIdleEvent
virtual void catchIdleEvent()
Definition: widgetbasedpoller.cpp:159
WidgetBasedPoller::forcePollRequest
int forcePollRequest()
Definition: widgetbasedpoller.cpp:148
WidgetBasedPoller::timeouts
QList< int > timeouts() const
Definition: widgetbasedpoller.cpp:66
WidgetBasedPoller::stopCatchingIdleEvents
virtual void stopCatchingIdleEvents()
Definition: widgetbasedpoller.cpp:164
WidgetBasedPoller::unloadPoller
void unloadPoller()
Definition: widgetbasedpoller.cpp:60
WidgetBasedPoller::setUpPoller
bool setUpPoller()
Definition: widgetbasedpoller.cpp:43
WidgetBasedPoller::eventFilter
bool eventFilter(QObject *object, QEvent *event)
Definition: widgetbasedpoller.cpp:77
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Mon Feb 20 2023 00:00:00 by doxygen 1.9.6 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

KUtils

Skip menu "KUtils"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Related Pages

kdelibs-4.14.38 API Reference

Skip menu "kdelibs-4.14.38 API Reference"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDEWebKit
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • kio
  • KIOSlave
  • KJS
  •   KJS-API
  •   WTF
  • kjsembed
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUnitConversion
  • KUtils
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver
Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal