File indexing completed on 2024-04-21 05:42:02

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 #ifndef KSVN_JOBVIEW_H
0021 #define KSVN_JOBVIEW_H
0022 
0023 #include "ksvnwidgets/jobviewinterface.h"
0024 
0025 class KsvnJobView : public org::kde::JobViewV2
0026 {
0027     Q_OBJECT
0028 
0029 public:
0030     KsvnJobView(qulonglong id, const QString &service, const QString &path, const QDBusConnection &connection, QObject *parent = nullptr);
0031 
0032     enum jobstate { STOPPED = 0, RUNNING, CANCELD };
0033 
0034     jobstate state() const
0035     {
0036         return m_state;
0037     }
0038     void setState(jobstate aState)
0039     {
0040         m_state = aState;
0041     }
0042     qulonglong id() const
0043     {
0044         return m_id;
0045     }
0046 
0047     unsigned long percent(qulonglong amount) const;
0048 
0049     virtual void setTotal(qlonglong max);
0050     qlonglong max() const
0051     {
0052         return m_max;
0053     }
0054 
0055 protected Q_SLOTS:
0056     virtual void killJob();
0057 
0058 private:
0059     qulonglong m_id;
0060     jobstate m_state;
0061     qlonglong m_max;
0062 };
0063 
0064 #endif