1
/***************************************************************************
2
smb4ksynchronizationinfo - This is a container that holds
3
information about progress of the synchronization
6
copyright : (C) 2007 by Alexander Reinholdt
7
email : dustpuppy@users.berlios.de
8
***************************************************************************/
10
/***************************************************************************
11
* This program is free software; you can redistribute it and/or modify *
12
* it under the terms of the GNU General Public License as published by *
13
* the Free Software Foundation; either version 2 of the License, or *
14
* (at your option) any later version. *
16
* This program is distributed in the hope that it will be useful, but *
17
* WITHOUT ANY WARRANTY; without even the implied warranty of *
18
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
19
* General Public License for more details. *
21
* You should have received a copy of the GNU General Public License *
22
* along with this program; if not, write to the *
23
* Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, *
25
***************************************************************************/
27
#ifndef SMB4KSYNCHRONIZATIONINFO_H
28
#define SMB4KSYNCHRONIZATIONINFO_H
34
#include <kdemacros.h>
36
class KDE_EXPORT Smb4KSynchronizationInfo
40
* The constructor. It takes no arguments and you should use the
41
* setXYZ() functions to set the necessary values.
43
Smb4KSynchronizationInfo();
48
~Smb4KSynchronizationInfo();
51
* Set the text that's provided in rsync's output. This may either be a
52
* file name or some information about the progress
54
* @param text The text
56
void setText( const QString &text );
59
* Return the name of the file that is currently processed. This may
60
* be empty if no information about the file name is available.
62
* @returns the name of the file that is currently processed or an empty
65
const QString &text () const { return m_text; }
68
* Set the progress of the file that's currently processed.
70
* @param percent The progress in percent
72
void setCurrentProgress( int percent );
75
* Return the progress of the current file transfer. If no
76
* information is available, -1 is returned.
78
* @returns the progress of the current file transfer or -1.
80
int currentProgress() const { return m_current_progress; }
83
* Set the total progress of synchronization process.
85
* @param percent The progress in percent
87
void setTotalProgress( int percent );
90
* Return the total progress of synchronization process. If no
91
* information is available, -1 is returned.
93
* @returns the total progress of the synchronization or -1.
95
int totalProgress() const { return m_total_progress; }
98
* Set the total number of files that have been considered for the
101
* @param total The total number of files
103
void setTotalFileNumber( int total );
106
* Return the total number of files that were considered for synchronization.
107
* If no information is available, -1 is returned.
109
* @returns the total number of files or -1.
111
int totalFileNumber() const { return m_total_files; }
114
* Set the number of files that have already been processed during the
117
* @param processed The number of files that have been processed
119
void setProcessedFileNumber( int processed );
122
* Return the number of files that have already been processed during the
123
* synchronization. If no information is available, -1 is returned.
125
* @returns the number of processed files or -1.
127
int processedFileNumber() const { return m_processed_files; }
130
* Set the transfer rate. This should be a string that already contains
131
* all information, i.e. the string should look like this: 100 kB/s.
133
* @param rate The rate string (e.g. 100 kB/s)
135
void setTransferRate( const QString &rate );
138
* Return the transfer rate. This is a string that already contains all
139
* information, so that you can just put it into your widget without any
140
* modification. It may also be empty if no information about the rate is
143
* @returns The rate or an empty string.
145
const QString &transferRate() const { return m_rate; }
154
* The individual progress
156
int m_current_progress;
161
int m_total_progress;
164
* The total file number
169
* The number of processed files
171
int m_processed_files;