File indexing completed on 2024-04-28 05:41:50
0001 /*************************************************************************** 0002 * Copyright (C) 2005-2009 by Rajko Albrecht ral@alwins-world.de * 0003 * https://kde.org/applications/development/org.kde.kdesvn * 0004 * * 0005 * This program is free software; you can redistribute it and/or modify * 0006 * it under the terms of the GNU General Public License as published by * 0007 * the Free Software Foundation; either version 2 of the License, or * 0008 * (at your option) any later version. * 0009 * * 0010 * This program is distributed in the hope that it will be useful, * 0011 * but WITHOUT ANY WARRANTY; without even the implied warranty of * 0012 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 0013 * GNU General Public License for more details. * 0014 * * 0015 * You should have received a copy of the GNU General Public License * 0016 * along with this program; if not, write to the * 0017 * Free Software Foundation, Inc., * 0018 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * 0019 ***************************************************************************/ 0020 0021 #ifndef kdesvnd_H 0022 #define kdesvnd_H 0023 0024 #include "ksvnwidgets/jobviewserverinterface.h" 0025 0026 #include <KDEDModule> 0027 #include <QDBusVariant> 0028 #include <QString> 0029 #include <QStringList> 0030 #include <QUrl> 0031 0032 class KdesvndListener; 0033 class KsvnJobView; 0034 0035 class kdesvnd : public KDEDModule 0036 { 0037 Q_OBJECT 0038 Q_CLASSINFO("D-Bus Interface", "org.kde.kdesvnd") 0039 0040 public: 0041 kdesvnd(QObject *parent, const QList<QVariant> &); 0042 ~kdesvnd() override; 0043 0044 protected: 0045 bool isWorkingCopy(const QUrl &url) const; 0046 bool isRepository(const QUrl &url) const; 0047 static QString cleanUrl(const QUrl &url); 0048 KdesvndListener *m_Listener; 0049 QStringList getActionMenu(const QList<QUrl> &list, bool toplevel) const; 0050 0051 org::kde::JobViewServer m_uiserver; 0052 0053 QHash<qulonglong, KsvnJobView *> progressJobView; 0054 0055 public: 0056 //! get a subversion login 0057 /*! 0058 * \param realm the realm 0059 * \param user default username 0060 * \return a stringlist containing username-password-saveit as "true" or "false" or empty list if cancel hit. 0061 */ 0062 QStringList get_login(const QString &realm, const QString &user) const; 0063 //! get a saved subversion login 0064 /*! 0065 * \param realm the realm 0066 * \param user default username 0067 * \return a stringlist containing username-password 0068 */ 0069 QStringList get_saved_login(const QString &realm, const QString &user) const; 0070 0071 // return: -1 don't accept 0 accept temporary 1 accept always 0072 // hostname, fingerprint, validFrom, validUntil, issuerDName, realm, 0073 int get_sslaccept(const QString &hostname, 0074 const QString &fingerprint, 0075 const QString &validFrom, 0076 const QString &validUntil, 0077 const QString &issuerDName, 0078 const QString &realm) const; 0079 0080 // returns cert file or empty string 0081 QString get_sslclientcertfile() const; 0082 // return a logmessage at pos 0, null-size list if cancel hit 0083 QStringList get_logmsg() const; 0084 0085 // return pw loaded from wallet if existent 0086 QString load_sslclientcertpw(const QString &realm) const; 0087 // return pw at pos 0, maysafe at pos 1, null-size if cancel hit. 0088 QStringList get_sslclientcertpw(const QString &) const; 0089 QStringList getActionMenu(const QStringList &urlList) const; 0090 QStringList getTopLevelActionMenu(const QStringList &urlList) const; 0091 QStringList getSingleActionMenu(const QString &) const; 0092 0093 bool canceldKioOperation(qulonglong kioid); 0094 void maxTransferKioOperation(qulonglong kioid, qulonglong maxtransfer); 0095 void registerKioFeedback(qulonglong kioid); 0096 void titleKioOperation(qulonglong kioid, const QString &title, const QString &label); 0097 void transferredKioOperation(qulonglong kioid, qulonglong transferred); 0098 void unRegisterKioFeedback(qulonglong kioid); 0099 void notifyKioOperation(const QString &text); 0100 void errorKioOperation(const QString &text); 0101 //! set status from KIO 0102 /*! 0103 * \param kioid the kio makes an action 0104 * \param status the status to set: 0 - stopped (terminated) 1 - running 2 - canceld (terminated) 0105 * \param message a message to print when not running 0106 */ 0107 void setKioStatus(qulonglong kioid, int status, const QString &message); 0108 }; 0109 #endif