KIO
kfilemetadataprovider_p.h
Go to the documentation of this file.
00001 /***************************************************************************** 00002 * Copyright (C) 2010 by Peter Penz <peter.penz@gmx.at> * 00003 * * 00004 * This library is free software; you can redistribute it and/or * 00005 * modify it under the terms of the GNU Library General Public * 00006 * License as published by the Free Software Foundation; either * 00007 * version 2 of the License, or (at your option) any later version. * 00008 * * 00009 * This library is distributed in the hope that it will be useful, * 00010 * but WITHOUT ANY WARRANTY; without even the implied warranty of * 00011 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * 00012 * Library General Public License for more details. * 00013 * * 00014 * You should have received a copy of the GNU Library General Public License * 00015 * along with this library; see the file COPYING.LIB. If not, write to * 00016 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * 00017 * Boston, MA 02110-1301, USA. * 00018 *****************************************************************************/ 00019 00020 #ifndef KFILEMETADATAMODEL_H 00021 #define KFILEMETADATAMODEL_H 00022 00023 #include <kurl.h> 00024 00025 #include <QtCore/QHash> 00026 #include <QtCore/QObject> 00027 #include <QtCore/QString> 00028 00029 #include <config-kio.h> 00030 #ifndef KIO_NO_NEPOMUK 00031 #define DISABLE_NEPOMUK_LEGACY 00032 #include <variant.h> 00033 #endif 00034 00035 class KFileItemList; 00036 class KProcess; 00037 class KUrl; 00038 class QWidget; 00039 00050 class KFileMetaDataProvider : public QObject 00051 { 00052 Q_OBJECT 00053 00054 public: 00055 explicit KFileMetaDataProvider(QObject* parent = 0); 00056 virtual ~KFileMetaDataProvider(); 00057 00067 void setItems(const KFileItemList& items); 00068 KFileItemList items() const; 00069 00075 void setReadOnly(bool readOnly); 00076 bool isReadOnly() const; 00077 00083 virtual QString label(const KUrl& metaDataUri) const; 00084 00096 virtual QString group(const KUrl& metaDataUri) const; 00097 00098 #ifndef KIO_NO_NEPOMUK 00099 00105 virtual QHash<KUrl, Nepomuk::Variant> data() const; 00106 00114 virtual QWidget* createValueWidget(const KUrl& metaDataUri, 00115 const Nepomuk::Variant& value, 00116 QWidget* parent) const; 00117 #endif 00118 00119 Q_SIGNALS: 00124 void loadingFinished(); 00125 00126 void urlActivated(const KUrl& url); 00127 00128 void dataChangeStarted(); 00129 void dataChangeFinished(); 00130 00131 private: 00132 class Private; 00133 Private* const d; 00134 00135 Q_PRIVATE_SLOT(d, void slotLoadingFinished()) 00136 Q_PRIVATE_SLOT(d, void slotRatingChanged(unsigned int rating)) 00137 Q_PRIVATE_SLOT(d, void slotTagsChanged(const QList<Nepomuk::Tag>& tags)) 00138 Q_PRIVATE_SLOT(d, void slotCommentChanged(const QString& comment)) 00139 Q_PRIVATE_SLOT(d, void slotTagClicked(const Nepomuk::Tag& tag)) 00140 Q_PRIVATE_SLOT(d, void slotLinkActivated(const QString&)) 00141 00142 friend class KLoadMetaDataThread; // invokes KMetaDataObject::loadData() 00143 }; 00144 00145 #endif
KDE 4.7 API Reference