kitchensync

result.h
00001 /*
00002     This file is part of libqopensync.
00003 
00004     Copyright (c) 2005 Tobias Koenig <tokoe@kde.org>
00005 
00006     This library is free software; you can redistribute it and/or
00007     modify it under the terms of the GNU Library General Public
00008     License as published by the Free Software Foundation; either
00009     version 2 of the License, or (at your option) any later version.
00010 
00011     This library is distributed in the hope that it will be useful,
00012     but WITHOUT ANY WARRANTY; without even the implied warranty of
00013     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00014     Library General Public License for more details.
00015 
00016     You should have received a copy of the GNU Library General Public License
00017     along with this library; see the file COPYING.LIB.  If not, write to
00018     the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
00019     Boston, MA 02110-1301, USA.
00020 */
00021 
00022 #ifndef TQSYNC_RESULT_H
00023 #define TQSYNC_RESULT_H
00024 
00025 #include <tqstring.h>
00026 
00027 struct OSyncError;
00028 
00029 namespace QSync {
00030 
00031 class Result
00032 {
00033   public:
00037     enum Type {
00038       NoError,
00039       GenericError,
00040       IOError,
00041       NotSupported,
00042       Timeout,
00043       Disconnected,
00044       FileNotFound,
00045       Exists,
00046       Convert,
00047       Misconfiguration,
00048       Initialization,
00049       Parameter,
00050       Expected,
00051       NoConnection,
00052       Temporary,
00053       Locked,
00054       PluginNotFound
00055     };
00056 
00060     Result();
00061 
00065     Result( Type type );
00066 
00071     Result( OSyncError **, bool deleteError = true );
00072 
00076     ~Result();
00077 
00081     void setName( const TQString &name );
00082 
00086     TQString name() const;
00087 
00091     void setMessage( const TQString &message );
00092 
00096     TQString message() const;
00097 
00101     void setType( Type type );
00102 
00106     Type type() const;
00107 
00111     operator bool () const;
00112 
00116     bool isError() const;
00117 
00118   private:
00119     TQString mName;
00120     TQString mMessage;
00121     Type mType;
00122 };
00123 
00124 }
00125 
00126 #endif