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

KUtils

  • sources
  • kde-4.14
  • kdelibs
  • 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 
24 class QTimer;
25 class QEvent;
26 
27 class WidgetBasedPoller : public AbstractSystemPoller
28 {
29  Q_OBJECT
30 
31 public:
32  WidgetBasedPoller(QWidget *parent = 0);
33  virtual ~WidgetBasedPoller();
34 
35  bool isAvailable();
36  bool setUpPoller();
37  void unloadPoller();
38 
39 protected:
40  bool eventFilter(QObject *object, QEvent *event);
41 
42 public 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 
50 private slots:
51  int poll();
52  virtual int getIdleTime() = 0;
53  void detectedActivity();
54  void waitForActivity();
55  void releaseInputLock();
56 
57 private:
58  virtual bool additionalSetUp() = 0;
59 
60 private:
61  QTimer * m_pollTimer;
62  QWidget * m_grabber;
63  QList<int> m_timeouts;
64 };
65 
66 #endif /* WIDGETBASEDPOLLER_H */
WidgetBasedPoller::eventFilter
bool eventFilter(QObject *object, QEvent *event)
Definition: widgetbasedpoller.cpp:77
QEvent
QWidget
WidgetBasedPoller::WidgetBasedPoller
WidgetBasedPoller(QWidget *parent=0)
Definition: widgetbasedpoller.cpp:29
WidgetBasedPoller::unloadPoller
void unloadPoller()
Definition: widgetbasedpoller.cpp:60
WidgetBasedPoller::setUpPoller
bool setUpPoller()
Definition: widgetbasedpoller.cpp:43
abstractsystempoller.h
WidgetBasedPoller::forcePollRequest
int forcePollRequest()
Definition: widgetbasedpoller.cpp:148
WidgetBasedPoller::removeTimeout
void removeTimeout(int nextTimeout)
Definition: widgetbasedpoller.cpp:153
WidgetBasedPoller
Definition: widgetbasedpoller.h:27
WidgetBasedPoller::~WidgetBasedPoller
virtual ~WidgetBasedPoller()
Definition: widgetbasedpoller.cpp:34
QTimer
WidgetBasedPoller::isAvailable
bool isAvailable()
Definition: widgetbasedpoller.cpp:38
QObject
WidgetBasedPoller::timeouts
QList< int > timeouts() const
Definition: widgetbasedpoller.cpp:66
QList< int >
WidgetBasedPoller::stopCatchingIdleEvents
virtual void stopCatchingIdleEvents()
Definition: widgetbasedpoller.cpp:164
WidgetBasedPoller::catchIdleEvent
virtual void catchIdleEvent()
Definition: widgetbasedpoller.cpp:159
AbstractSystemPoller
Definition: abstractsystempoller.h:24
QObject::parent
QObject * parent() const
QWidget::event
virtual bool event(QEvent *event)
WidgetBasedPoller::addTimeout
void addTimeout(int nextTimeout)
Definition: widgetbasedpoller.cpp:71
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:25:27 by doxygen 1.8.7 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 API Reference

Skip menu "kdelibs 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

Search



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