~ubuntu-branches/ubuntu/quantal/smb4k/quantal

« back to all changes in this revision

Viewing changes to core/smb4ksynchronizationinfo.h

  • Committer: Package Import Robot
  • Author(s): Fathi Boudra
  • Date: 2012-05-19 18:54:34 UTC
  • mfrom: (1.1.20)
  • Revision ID: package-import@ubuntu.com-20120519185434-duffny2n87214n1n
Tags: 1.0.1-1
* New upstream release.
* Update debian/compat: bump to 9.
* Update debian/control:
  - bump debhelper to 9.
  - bump kdelibs5-dev build dependency to 4:4.4.0.
  - bump Standards-Version to 3.9.3 (no changes needed).
  - Replace smbfs dependency by cifs-utils. (Closes: #638162)
* Update debian/copyright:
  - update upstream URL.
  - update upstream e-mail.
* Update debian/smb4k.lintian-overrides file.
* Update debian/watch file.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/***************************************************************************
2
 
    smb4ksynchronizationinfo  -  This is a container that holds
3
 
    information about progress of the synchronization
4
 
                             -------------------
5
 
    begin                : So Mai 20 2007
6
 
    copyright            : (C) 2007 by Alexander Reinholdt
7
 
    email                : dustpuppy@users.berlios.de
8
 
 ***************************************************************************/
9
 
 
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.                                   *
15
 
 *                                                                         *
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.                              *
20
 
 *                                                                         *
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,   *
24
 
 *   MA  02111-1307 USA                                                    *
25
 
 ***************************************************************************/
26
 
 
27
 
#ifndef SMB4KSYNCHRONIZATIONINFO_H
28
 
#define SMB4KSYNCHRONIZATIONINFO_H
29
 
 
30
 
// Qt includes
31
 
#include <QString>
32
 
 
33
 
// KDE includes
34
 
#include <kdemacros.h>
35
 
 
36
 
class KDE_EXPORT Smb4KSynchronizationInfo
37
 
{
38
 
  public:
39
 
    /**
40
 
     * The constructor. It takes no arguments and you should use the
41
 
     * setXYZ() functions to set the necessary values.
42
 
     */
43
 
    Smb4KSynchronizationInfo();
44
 
 
45
 
    /**
46
 
     * The destructor.
47
 
     */
48
 
    ~Smb4KSynchronizationInfo();
49
 
 
50
 
    /**
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
53
 
     *
54
 
     * @param text        The text
55
 
     */
56
 
    void setText( const QString &text );
57
 
 
58
 
    /**
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.
61
 
     *
62
 
     * @returns the name of the file that is currently processed or an empty
63
 
     * string
64
 
     */
65
 
    const QString &text () const { return m_text; }
66
 
 
67
 
    /**
68
 
     * Set the progress of the file that's currently processed.
69
 
     *
70
 
     * @param percent     The progress in percent
71
 
     */
72
 
    void setCurrentProgress( int percent );
73
 
 
74
 
    /**
75
 
     * Return the progress of the current file transfer. If no
76
 
     * information is available, -1 is returned.
77
 
     *
78
 
     * @returns the progress of the current file transfer or -1.
79
 
     */
80
 
    int currentProgress() const { return m_current_progress; }
81
 
 
82
 
    /**
83
 
     * Set the total progress of synchronization process.
84
 
     *
85
 
     * @param percent     The progress in percent
86
 
     */
87
 
    void setTotalProgress( int percent );
88
 
 
89
 
    /**
90
 
     * Return the total progress of synchronization process. If no
91
 
     * information is available, -1 is returned.
92
 
     *
93
 
     * @returns the total progress of the synchronization or -1.
94
 
     */
95
 
    int totalProgress() const { return m_total_progress; }
96
 
 
97
 
    /**
98
 
     * Set the total number of files that have been considered for the
99
 
     * synchronization.
100
 
     *
101
 
     * @param total       The total number of files
102
 
     */
103
 
    void setTotalFileNumber( int total );
104
 
 
105
 
    /**
106
 
     * Return the total number of files that were considered for synchronization.
107
 
     * If no information is available, -1 is returned.
108
 
     *
109
 
     * @returns the total number of files or -1.
110
 
     */
111
 
    int totalFileNumber() const { return m_total_files; }
112
 
 
113
 
    /**
114
 
     * Set the number of files that have already been processed during the
115
 
     * synchronization.
116
 
     *
117
 
     * @param processed   The number of files that have been processed
118
 
     */
119
 
    void setProcessedFileNumber( int processed );
120
 
 
121
 
    /**
122
 
     * Return the number of files that have already been processed during the
123
 
     * synchronization. If no information is available, -1 is returned.
124
 
     *
125
 
     * @returns the number of processed files or -1.
126
 
     */
127
 
    int processedFileNumber() const { return m_processed_files; }
128
 
 
129
 
    /**
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.
132
 
     *
133
 
     * @param rate        The rate string (e.g. 100 kB/s)
134
 
     */
135
 
    void setTransferRate( const QString &rate );
136
 
 
137
 
    /**
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
141
 
     * available.
142
 
     *
143
 
     * @returns The rate or an empty string.
144
 
     */
145
 
    const QString &transferRate() const { return m_rate; }
146
 
 
147
 
  private:
148
 
    /**
149
 
     * The text
150
 
     */
151
 
    QString m_text;
152
 
 
153
 
    /**
154
 
     * The individual progress
155
 
     */
156
 
    int m_current_progress;
157
 
 
158
 
    /**
159
 
     * The total progress
160
 
     */
161
 
    int m_total_progress;
162
 
 
163
 
    /**
164
 
     * The total file number
165
 
     */
166
 
    int m_total_files;
167
 
 
168
 
    /**
169
 
     * The number of processed files
170
 
     */
171
 
    int m_processed_files;
172
 
 
173
 
    /**
174
 
     * The rate string
175
 
     */
176
 
    QString m_rate;
177
 
};
178
 
 
179
 
#endif