Warning, file /maui/mauikit-filebrowsing/src/code/openwithmodel.h was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).
0001 #pragma once 0002 0003 #include <QObject> 0004 0005 #if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) 0006 #include <MauiKit3/Core/mauilist.h> 0007 #else 0008 #include <MauiKit4/Core/mauilist.h> 0009 #endif 0010 0011 /** 0012 * @brief A model of services associated to a list of file URLs, that can handle its file content. 0013 * 0014 * This model is exposed adn used by the OpenWithDialog control. 0015 */ 0016 class OpenWithModel : public MauiList 0017 { 0018 Q_OBJECT 0019 Q_DISABLE_COPY(OpenWithModel) 0020 0021 /** 0022 * The list of file URLs. The model will try to look for all the possible services that can handle the given files. 0023 */ 0024 Q_PROPERTY(QStringList urls READ urls WRITE setUrls NOTIFY urlsChanged) 0025 0026 public: 0027 explicit OpenWithModel(QObject * parent = nullptr); 0028 0029 /** 0030 * @private 0031 */ 0032 const FMH::MODEL_LIST &items() const final override; 0033 0034 /** 0035 * @private 0036 */ 0037 void componentComplete() override final; 0038 0039 void setUrls(const QStringList &urls); 0040 QStringList urls() const; 0041 0042 public Q_SLOTS: 0043 /** 0044 * @brief Launch a service at the given index with the URLs provided. 0045 * @param index the index position of the service to launch 0046 */ 0047 void openWith(const int &index); 0048 0049 private: 0050 void setList(); 0051 0052 FMH::MODEL_LIST m_list; 0053 QStringList m_urls; 0054 0055 Q_SIGNALS: 0056 void urlsChanged(); 0057 }; 0058