File indexing completed on 2024-03-24 05:45:15
0001 /*************************************************************************** 0002 * Copyright (C) 2005-2009 by Rajko Albrecht * 0003 * ral@alwins-world.de * 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 KDESVN_PART_H 0022 #define KDESVN_PART_H 0023 0024 #include "kdesvn-config.h" 0025 0026 #include <kparts/browserextension.h> 0027 #include <kparts/readonlypart.h> 0028 #include <kparts/readwritepart.h> 0029 #include <kparts/statusbarextension.h> 0030 0031 #include <KAboutData> 0032 0033 class kdesvnView; 0034 class KdesvnBrowserExtension; 0035 class KAboutApplicationDialog; 0036 0037 /** 0038 * This is a "Part". It that does all the real work in a KPart 0039 * application. 0040 * 0041 * @short Main Part 0042 * @author Rajko Albrecht <ral@alwins-world.de> 0043 * @version 0.1 0044 */ 0045 class kdesvnpart : public KParts::ReadOnlyPart 0046 { 0047 Q_OBJECT 0048 public: 0049 /** 0050 * Default constructor 0051 */ 0052 kdesvnpart(QWidget *parentWidget, QObject *parent, const QVariantList &args = QVariantList()); 0053 0054 kdesvnpart(QWidget *parentWidget, QObject *parent, bool ownapp, const QVariantList &args = QVariantList()); 0055 0056 /** 0057 * Destructor 0058 */ 0059 ~kdesvnpart() override; 0060 bool closeUrl() override; 0061 0062 Q_SIGNALS: 0063 void refreshTree(); 0064 void settingsChanged(); 0065 0066 public slots: 0067 virtual void slotDispPopup(const QString &, QWidget **target); 0068 virtual void slotFileProperties(); 0069 bool openUrl(const QUrl &) override; 0070 virtual void slotSshAdd(); 0071 virtual void showDbStatus(); 0072 0073 protected: 0074 /** 0075 * This must be implemented by each part 0076 */ 0077 bool openFile() override; 0078 virtual void setupActions(); 0079 KAboutApplicationDialog *m_aboutDlg; 0080 0081 void init(QWidget *parentWidget, bool full); 0082 0083 protected slots: 0084 virtual void slotLogFollowNodes(bool); 0085 virtual void slotDisplayIgnored(bool); 0086 virtual void slotDisplayUnkown(bool); 0087 void slotUrlChanged(const QUrl &); 0088 void showAboutApplication(); 0089 void appHelpActivated(); 0090 virtual void slotShowSettings(); 0091 0092 private: 0093 kdesvnView *m_view; 0094 KdesvnBrowserExtension *m_browserExt; 0095 0096 protected slots: 0097 void slotSettingsChanged(const QString &); 0098 0099 protected slots: 0100 virtual void slotHideUnchanged(bool); 0101 virtual void slotEnableNetwork(bool); 0102 }; 0103 0104 class KCmdLineArgs; 0105 0106 class KdesvnBrowserExtension : public KParts::BrowserExtension 0107 { 0108 Q_OBJECT 0109 public: 0110 explicit KdesvnBrowserExtension(kdesvnpart *); 0111 ~KdesvnBrowserExtension() override; 0112 0113 public slots: 0114 void properties(); 0115 }; 0116 0117 #endif // _KDESVNPART_H_