7#ifndef ACTIVITIES_RESOURCEINSTANCE_H
8#define ACTIVITIES_RESOURCEINSTANCE_H
13#include "kactivities_export.h"
17class ResourceInstancePrivate;
43 Q_PROPERTY(QUrl uri READ uri WRITE setUri)
44 Q_PROPERTY(QString mimetype READ mimetype WRITE setMimetype)
45 Q_PROPERTY(QString title READ title WRITE setTitle)
46 Q_PROPERTY(quintptr winId READ winId)
64 explicit ResourceInstance(quintptr wid,
const QString &application, QObject *parent =
nullptr);
90 const QString &mimetype = QString(),
91 const QString &title = QString(),
92 const QString &application = QString(),
93 QObject *parent =
nullptr);
185 static void notifyAccessed(
const QUrl &uri,
const QString &application = QString());
188 const QScopedPointer<ResourceInstancePrivate> d;
This class is used to notify the system that a file, web page or some other resource has been accesse...
Definition resourceinstance.h:40
ResourceInstance(quintptr wid, const QString &application, QObject *parent=nullptr)
Creates a new resource instance.
void notifyFocusedIn()
Call this method to notify the system that the resource has the focus in your application.
void setUri(const QUrl &newUri)
This is a convenience method that sets the new URI.
~ResourceInstance() override
Destroys the ResourceInstance and notifies the system that the resource has been closed.
void setTitle(const QString &title)
Sets the title for this resource.
static void notifyAccessed(const QUrl &uri, const QString &application=QString())
If there's no way to tell for how long an application is keeping the resource open,...
ResourceInstance(quintptr wid, QObject *parent=nullptr)
Creates a new resource instance.
ResourceInstance(quintptr wid, QUrl resourceUri, const QString &mimetype=QString(), const QString &title=QString(), const QString &application=QString(), QObject *parent=nullptr)
Creates a new resource instance and automatically notifies the system that it was opened.
void notifyFocusedOut()
Call this method to notify the system that the resource lost the focus in your application.
void requestsFocus()
Emitted when the system wants to show the resource represented by this ResourceInstance.
void notifyModified()
Call this method to notify the system that you modified (the contents of) the resource.
void setMimetype(const QString &mimetype)
Sets the mimetype for this resource.
Namespace for everything in libkactivities.
Definition consumer.h:20