![]() |
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 00020 #ifndef EVENTTYPESTORE_H_ 00021 #define EVENTTYPESTORE_H_ 00022 00023 #include <QString> 00024 #include <QMap> 00025 #include <QSet> 00026 #include <QSettings> 00027 #include <QSharedPointer> 00028 #include <QStringList> 00029 #include <QFileSystemWatcher> 00030 00031 00042 class EventTypeStore : public QObject 00043 { 00044 Q_OBJECT 00045 00046 public: 00054 explicit EventTypeStore(const QString &eventTypesPath, uint maxStoredEventTypes = 100); 00055 00061 bool eventTypeExists(const QString &eventType) const; 00062 00069 QList<QString> allKeys(const QString &eventType) const; 00070 00081 bool contains(const QString &eventType, const QString &key) const; 00082 00092 QString value(const QString &eventType, const QString &key) const; 00093 00094 private slots: 00098 void updateEventTypeFileList(); 00099 00106 void updateEventTypeFile(const QString &path); 00107 00108 signals: 00113 void eventTypeModified(const QString &eventType); 00114 00119 void eventTypeUninstalled(const QString &eventType); 00120 00121 private: 00123 static const QString FILE_EXTENSION; 00124 00126 static const uint FILE_MAX_SIZE; 00127 00129 QString eventTypesPath; 00130 00132 uint maxStoredEventTypes; 00133 00135 mutable QMap<QString, QSharedPointer<QSettings> > eventTypesMap; 00136 00138 mutable QStringList eventTypeUsage; 00139 00141 void loadSettings(const QString &eventType); 00142 00144 void eventTypeAccessed(const QString &eventType); 00145 00147 QFileSystemWatcher eventTypePathWatcher; 00148 00150 QSet<QString> eventTypeFiles; 00151 }; 00152 00153 #endif /* EVENTTYPESTORE_H_ */
Copyright © 2011 Nokia Corporation | Generated on Tue Aug 30 2011 16:38:12 Doxygen 1.7.1 |
MeeGo Touch |