![]() |
Home · All Namespaces · All Classes |
00001 /**************************************************************************** 00002 ** 00003 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). 00004 ** All rights reserved. 00005 ** Contact: Nokia Corporation (directui@nokia.com) 00006 ** 00007 ** This file is part of systemui. 00008 ** 00009 ** If you have questions regarding the use of this file, please contact 00010 ** Nokia at directui@nokia.com. 00011 ** 00012 ** This library is free software; you can redistribute it and/or 00013 ** modify it under the terms of the GNU Lesser General Public 00014 ** License version 2.1 as published by the Free Software Foundation 00015 ** and appearing in the file LICENSE.LGPL included in the packaging 00016 ** of this file. 00017 ** 00018 ****************************************************************************/ 00019 #ifndef XEVENTLISTENER_H 00020 #define XEVENTLISTENER_H 00021 00022 #include <QHash> 00023 #include <QObject> 00024 #include <QAbstractEventDispatcher> 00025 #include <X11/Xlib.h> 00026 00030 class XEventListenerFilterInterface 00031 { 00032 public: 00033 XEventListenerFilterInterface() {} 00034 virtual ~XEventListenerFilterInterface() {} 00035 00036 virtual bool xEventFilter(const XEvent &event) = 0; 00037 }; 00038 00049 class XEventListener : public QObject 00050 { 00051 protected: 00052 XEventListener(); 00053 00054 public: 00055 ~XEventListener(); 00057 static void registerEventFilter(XEventListenerFilterInterface *filter, long eventMask); 00059 static void unregisterEventFilter(XEventListenerFilterInterface *filter); 00060 00065 static bool xEventFilter(void *message); 00066 00067 private: 00069 static void setupEventMasks(); 00070 00072 static void setupListener(); 00073 00074 static QHash<XEventListenerFilterInterface *, long> filterList; 00075 static QAbstractEventDispatcher::EventFilter previousEventFilter; 00076 00077 #ifdef UNIT_TEST 00078 friend class Ut_XEventListener; 00079 #endif 00080 }; 00081 00082 #endif
Copyright © 2011 Nokia Corporation | Generated on Tue Aug 30 2011 16:38:12 Doxygen 1.7.1 |
MeeGo Touch |