Applets
urlitemlauncher.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef URLITEMLAUNCHER_H
00022 #define URLITEMLAUNCHER_H
00023
00024 #include "core/kickoff_export.h"
00025
00026 #include <QObject>
00027 #include <solid/storageaccess.h>
00028
00029 class QModelIndex;
00030 class KUrl;
00031
00032 namespace Kickoff
00033 {
00034
00041 class UrlItemHandler
00042 {
00043 public:
00044 virtual ~UrlItemHandler() {}
00045 virtual bool openUrl(const KUrl& url) = 0;
00046 };
00047
00056 class KICKOFF_EXPORT UrlItemLauncher : public QObject
00057 {
00058 Q_OBJECT
00059
00060 public:
00061 UrlItemLauncher(QObject *parent = 0);
00062 virtual ~UrlItemLauncher();
00063
00064 enum HandlerType {
00065 ProtocolHandler,
00066 ExtensionHandler
00067 };
00068 static void addGlobalHandler(HandlerType type,
00069 const QString& name,
00070 UrlItemHandler *handler);
00071
00072 public Q_SLOTS:
00074 bool openItem(const QModelIndex& index);
00076 bool openUrl(const QString& url);
00077
00078 private Q_SLOTS:
00079 void onSetupDone(Solid::ErrorType error, QVariant errorData, const QString &udi);
00080
00081 private:
00082 class Private;
00083 Private * const d;
00084 };
00085
00086 }
00087
00088 #endif // URLITEMLAUNCHER_H
00089