MauiKit File Browsing

openwithmodel.h
1#pragma once
2
3#include <QObject>
4
5#include <MauiKit4/Core/mauilist.h>
6
7/**
8 * @brief A model of services associated to a list of file URLs, that can handle its file content.
9 *
10 * This model is exposed adn used by the OpenWithDialog control.
11 */
12class OpenWithModel : public MauiList
13{
15 Q_DISABLE_COPY(OpenWithModel)
16
17 /**
18 * The list of file URLs. The model will try to look for all the possible services that can handle the given files.
19 */
20 Q_PROPERTY(QStringList urls READ urls WRITE setUrls NOTIFY urlsChanged)
21
22public:
23 explicit OpenWithModel(QObject * parent = nullptr);
24
25 /**
26 * @private
27 */
28 const FMH::MODEL_LIST &items() const final override;
29
30 /**
31 * @private
32 */
33 void componentComplete() override final;
34
35 void setUrls(const QStringList &urls);
36 QStringList urls() const;
37
38public Q_SLOTS:
39 /**
40 * @brief Launch a service at the given index with the URLs provided.
41 * @param index the index position of the service to launch
42 */
43 void openWith(const int &index);
44
45private:
46 void setList();
47
48 FMH::MODEL_LIST m_list;
49 QStringList m_urls;
50
52 void urlsChanged();
53};
54
A model of services associated to a list of file URLs, that can handle its file content.
void openWith(const int &index)
Launch a service at the given index with the URLs provided.
QStringList urls
The list of file URLs.
Q_OBJECTQ_OBJECT
Q_PROPERTY(...)
Q_SIGNALSQ_SIGNALS
Q_SLOTSQ_SLOTS
QObject * parent() const const
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Sat Dec 21 2024 16:58:02 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.