diff options
author | toma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2009-11-25 17:56:58 +0000 |
---|---|---|
committer | toma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2009-11-25 17:56:58 +0000 |
commit | 460c52653ab0dcca6f19a4f492ed2c5e4e963ab0 (patch) | |
tree | 67208f7c145782a7e90b123b982ca78d88cc2c87 /kitchensync/libqopensync/result.h | |
download | tdepim-460c52653ab0dcca6f19a4f492ed2c5e4e963ab0.tar.gz tdepim-460c52653ab0dcca6f19a4f492ed2c5e4e963ab0.zip |
Copy the KDE 3.5 branch to branches/trinity for new KDE 3.5 features.
BUG:215923
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdepim@1054174 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kitchensync/libqopensync/result.h')
-rw-r--r-- | kitchensync/libqopensync/result.h | 126 |
1 files changed, 126 insertions, 0 deletions
diff --git a/kitchensync/libqopensync/result.h b/kitchensync/libqopensync/result.h new file mode 100644 index 000000000..c7cf13d70 --- /dev/null +++ b/kitchensync/libqopensync/result.h @@ -0,0 +1,126 @@ +/* + This file is part of libqopensync. + + Copyright (c) 2005 Tobias Koenig <tokoe@kde.org> + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#ifndef QSYNC_RESULT_H +#define QSYNC_RESULT_H + +#include <qstring.h> + +struct OSyncError; + +namespace QSync { + +class Result +{ + public: + /** + Result types. + */ + enum Type { + NoError, + GenericError, + IOError, + NotSupported, + Timeout, + Disconnected, + FileNotFound, + Exists, + Convert, + Misconfiguration, + Initialization, + Parameter, + Expected, + NoConnection, + Temporary, + Locked, + PluginNotFound + }; + + /** + Constructs a NoError result. + */ + Result(); + + /** + Constructs a result of the given type. + */ + Result( Type type ); + + /** + Construct Result from OpenSync error object. Deletes the OpenSync error + object. + */ + Result( OSyncError **, bool deleteError = true ); + + /** + Destroys the result. + */ + ~Result(); + + /** + Sets the name of the result. + */ + void setName( const QString &name ); + + /** + Returns the name of the result. + */ + QString name() const; + + /** + Sets the message text of the result. + */ + void setMessage( const QString &message ); + + /** + Returns the message text of the result. + */ + QString message() const; + + /** + Sets the type of the result. + */ + void setType( Type type ); + + /** + Returns the type of the result. + */ + Type type() const; + + /** + Reimplemented boolean operator. + */ + operator bool () const; + + /** + Return true, if this Result is an error, return false otherwise. + */ + bool isError() const; + + private: + QString mName; + QString mMessage; + Type mType; +}; + +} + +#endif |