Home · All Namespaces · All Classes · Main Classes |
00001 /*************************************************************************** 00002 ** 00003 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). 00004 ** All rights reserved. 00005 ** Contact: Karoliina T. Salminen <karoliina.t.salminen@nokia.com> 00006 ** 00007 ** This file is part of duicontrolpanel. 00008 ** 00009 ** 00010 ** This library is free software; you can redistribute it and/or 00011 ** modify it under the terms of the GNU Lesser General Public 00012 ** License version 2.1 as published by the Free Software Foundation 00013 ** and appearing in the file LICENSE.LGPL included in the packaging 00014 ** of this file. 00015 ** 00016 ****************************************************************************/ 00017 00018 /* -*- Mode: C; indent-tabs-mode: s; c-basic-offset: 4; tab-width: 4 -*- */ 00019 /* vim:set et ai sw=4 ts=4 sts=4: tw=80 cino="(0,W2s,i2s,t0,l1,:0" */ 00020 #ifndef DCPAPPLETDB_H 00021 #define DCPAPPLETDB_H 00022 00023 #include <QObject> 00024 #include <QStringList> 00025 #include <QMap> 00026 #include "dcpapplet.h" 00027 00036 class DcpAppletMetadata; 00037 class DcpAppletObject; 00038 00039 typedef QList<DcpAppletMetadata*> DcpAppletMetadataList; 00040 00041 typedef bool (*checkCategory)(const QString &); 00042 00043 class DcpAppletDbPrivate; 00044 class DcpAppletDb: public QObject 00045 { 00046 Q_OBJECT 00047 public: 00055 static DcpAppletDb *instance ( 00056 const QString &pathName = DcpApplet::DefaultPath, 00057 const QString &nameFilter = "*.desktop"); 00058 00065 static void initEmptyDb (); 00066 00068 bool addPath (const QString &pathName); 00069 00070 /* \brief adds files at specified pathName with specific name filter */ 00071 bool addFiles (const QString &path, const QString &filter); 00072 00074 virtual ~DcpAppletDb(); 00075 00079 DcpAppletMetadataList list() const; 00080 00085 DcpAppletMetadataList listByCategory( 00086 const QString &category); 00087 00088 DcpAppletMetadataList listByCategory ( 00089 const char **category, 00090 int n_categories, 00091 checkCategory checkFunction = 0); 00092 00093 DcpAppletMetadataList listByCategory ( 00094 const QStringList& categories, 00095 checkCategory checkFunction = 0); 00096 00105 DcpAppletMetadataList listMostUsed(); 00106 00108 DcpAppletObject *applet(const QString& name); 00109 00111 DcpAppletMetadata *metadata(const QString& name); 00112 00114 bool addFile(const QString& filename); 00115 00117 void eraseEntry(DcpAppletMetadata *metadata); 00118 00120 QStringList appletNames() const; 00121 00123 bool containsFile(const QString& fileName); 00124 00127 bool containsName(const QString& name); 00128 00131 bool isAppletLoaded (const QString& name); 00132 00135 QList<DcpAppletObject*> loadedApplets () const; 00136 00138 void destroyData (void); 00139 static void destroy (void); 00140 00141 signals: 00142 void appletLoaded (DcpAppletObject *applet); 00143 00144 protected: 00146 DcpAppletDb (const QString &pathName, const QString &nameFilter); 00148 DcpAppletDb (); 00149 00150 private: 00151 DcpAppletDbPrivate *const d_ptr; 00152 Q_DISABLE_COPY(DcpAppletDb); 00153 friend class Ut_DcpAppletDb; 00154 }; 00155 00156 #endif // DCPAPPLETDB_H 00157
Copyright © 2009 Nokia Corporation | Generated on Tue Jul 5 2011 15:01:31 Doxygen 1.7.1 |
Meego control panel |