File indexing completed on 2024-05-05 04:47:06

0001 #pragma once
0002 #include <QObject>
0003 
0004 #if (defined Q_OS_LINUX || defined Q_OS_FREEBSD) && !defined Q_OS_ANDROID
0005 class OrgMauiSettingsActionsInterface;
0006 
0007 namespace AppInstance
0008 {
0009 QVector<QPair<QSharedPointer<OrgMauiSettingsActionsInterface>, QStringList> > appInstances(const QString& preferredService);
0010 
0011 bool attachToExistingInstance(const QString &module, const QString& preferredService = QString());
0012 
0013 bool registerService();
0014 }
0015 #endif
0016 
0017 class Server : public QObject
0018 {
0019     Q_OBJECT
0020     Q_CLASSINFO("D-Bus Interface", "org.maui.shelf.Actions")
0021 
0022 public:
0023     explicit Server(QObject *parent = nullptr);
0024     void setQmlObject(QObject  *object);
0025 
0026 public Q_SLOTS:
0027     /**
0028            * Tries to raise/activate the Dolphin window.
0029            */
0030     void activateWindow();
0031 
0032     /** Stores all settings and quits Dolphin. */
0033     void quit();
0034 
0035     void openModule(const QString &module);
0036     /**
0037                 * Determines if a URL is open in any tab.
0038                 * @note Use of QString instead of QUrl is required to be callable via DBus.
0039                 *
0040                 * @param url URL to look for
0041                 * @returns true if url is currently open in a tab, false otherwise.
0042                 */
0043     bool isModuleOpen(const QString &module);
0044 
0045 
0046 private:
0047     QObject* m_qmlObject = nullptr;
0048     QStringList filterFiles(const QStringList &urls);
0049 
0050 };
0051