File indexing completed on 2024-10-06 12:22:18

0001 /*
0002     This file is part of the KDE libraries
0003     SPDX-FileCopyrightText: 2016 Kai Uwe Broulik <kde@privat.broulik.de>
0004 
0005     SPDX-License-Identifier: LGPL-2.0-or-later
0006 */
0007 
0008 #ifndef OPENFILEMANAGERWINDOWJOB_P_H
0009 #define OPENFILEMANAGERWINDOWJOB_P_H
0010 
0011 #include <KJob>
0012 
0013 namespace KIO
0014 {
0015 class OpenFileManagerWindowJob;
0016 
0017 class AbstractOpenFileManagerWindowStrategy
0018 {
0019 public:
0020     explicit AbstractOpenFileManagerWindowStrategy(OpenFileManagerWindowJob *job)
0021         : m_job(job)
0022     {
0023     }
0024 
0025     virtual ~AbstractOpenFileManagerWindowStrategy()
0026     {
0027     }
0028     virtual void start(const QList<QUrl> &urls, const QByteArray &asn) = 0;
0029 
0030     void emitResultProxy(int error = KJob::NoError)
0031     {
0032         m_job->setError(error);
0033         m_job->emitResult();
0034     }
0035 
0036 protected:
0037     OpenFileManagerWindowJob *m_job;
0038 };
0039 
0040 class OpenFileManagerWindowDBusStrategy : public AbstractOpenFileManagerWindowStrategy
0041 {
0042 public:
0043     explicit OpenFileManagerWindowDBusStrategy(OpenFileManagerWindowJob *job)
0044         : AbstractOpenFileManagerWindowStrategy(job)
0045     {
0046     }
0047     void start(const QList<QUrl> &urls, const QByteArray &asn) override;
0048 };
0049 
0050 class OpenFileManagerWindowKRunStrategy : public AbstractOpenFileManagerWindowStrategy
0051 {
0052 public:
0053     explicit OpenFileManagerWindowKRunStrategy(OpenFileManagerWindowJob *job)
0054         : AbstractOpenFileManagerWindowStrategy(job)
0055     {
0056     }
0057     void start(const QList<QUrl> &urls, const QByteArray &asn) override;
0058 };
0059 
0060 }
0061 
0062 #endif // OPENFILEMANAGERWINDOWJOB_P_H