• Skip to content
  • Skip to link menu
  • KDE API Reference
  • kdepimlibs-4.14.10 API Reference
  • KDE Home
  • Contact Us
 

KCal Library

  • kcal
kresult.h
Go to the documentation of this file.
1/*
2 This file is part of KDE.
3
4 Copyright (c) 2005 Cornelius Schumacher <schumacher@kde.org>
5
6 This library is free software; you can redistribute it and/or
7 modify it under the terms of the GNU Library General Public
8 License as published by the Free Software Foundation; either
9 version 2 of the License, or (at your option) any later version.
10
11 This library is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 Library General Public License for more details.
15
16 You should have received a copy of the GNU Library General Public License
17 along with this library; see the file COPYING.LIB. If not, write to
18 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
19 Boston, MA 02110-1301, USA.
20*/
28#ifndef KRESULT_H
29#define KRESULT_H
30
31#include <QtCore/QString>
32#include "kcal_export.h"
33
34namespace KCal {
35
109class KCAL_DEPRECATED_EXPORT KResult
110{
111 public:
115 enum Type {
116 Ok,
117 InProgress,
118 Error
119 };
120
124 enum ErrorType {
125 NotAnError,
126 Undefined,
127 InvalidUrl,
128 WrongParameter,
129 ConnectionFailed,
130 WriteError,
131 ReadError,
132 ParseError,
133 WrongSchemaRevision
134 };
135
139 KResult();
140
144 KResult( const KResult & );
145
150 explicit KResult( Type type );
151
159 explicit KResult( ErrorType error, const QString &details = QString() );
160
164 ~KResult();
165
171 operator bool() const;
172
176 bool isOk() const;
177
181 bool isInProgress() const;
182
186 bool isError() const;
187
191 ErrorType error() const;
192
198 QString message() const;
199
210 void setDetails( const QString &details );
211
216 QString details() const;
217
222 QString fullMessage() const;
223
230 KResult &chain( const KResult &result );
231
236 bool hasChainedResult() const;
237
241 KResult chainedResult() const;
242
247 QString chainedMessage() const;
248
249 private:
250 //@cond PRIVATE
251 class Private;
252 Private *const d;
253 //@endcond
254};
255
260class KCAL_DEPRECATED_EXPORT KResultOk : public KResult
261{
262 public:
266 KResultOk() : KResult( Ok ), d( 0 ) {}
267
268 private:
269 //@cond PRIVATE
270 class Private;
271 Private *const d;
272 //@endcond
273};
274
279class KCAL_DEPRECATED_EXPORT KResultInProgress : public KResult
280{
281 public:
285 KResultInProgress() : KResult( InProgress ), d( 0 ) {}
286
287 private:
288 //@cond PRIVATE
289 class Private;
290 Private *const d;
291 //@endcond
292};
293
298class KCAL_DEPRECATED_EXPORT KResultError : public KResult
299{
300 public:
304 KResultError() : KResult( Error ), d( 0 ) {}
305
314 explicit KResultError( ErrorType error, const QString &details = QString() )
315 : KResult( error, details ), d( 0 ) {}
316
323 KResultError( const QString &details ) :
324 KResult( Undefined, details ), d( 0 ) {}
325
326 private:
327 //@cond PRIVATE
328 Q_DISABLE_COPY( KResultError )
329 class Private;
330 Private *const d;
331 //@endcond PRIVATE
332};
333
334}
335
336#endif
KCal::KResultError
Convenience class for creating a KResult of type Error.
Definition: kresult.h:299
KCal::KResultError::KResultError
KResultError(ErrorType error, const QString &details=QString())
Create KResult object of type Error with given error type and optionally a detailed error message.
Definition: kresult.h:314
KCal::KResultError::KResultError
KResultError(const QString &details)
Create KResult object of type Error with given detailed error message.
Definition: kresult.h:323
KCal::KResultError::KResultError
KResultError()
Create KResult object of type Error.
Definition: kresult.h:304
KCal::KResultInProgress
Convenience class for creating a KResult of type InProgress.
Definition: kresult.h:280
KCal::KResultInProgress::KResultInProgress
KResultInProgress()
Create KResult object of type InProgress.
Definition: kresult.h:285
KCal::KResultOk
Convenience class for creating a KResult of type Ok.
Definition: kresult.h:261
KCal::KResultOk::KResultOk
KResultOk()
Create KResult object of type Ok.
Definition: kresult.h:266
KCal::KResult
This class represents the result of an operation.
Definition: kresult.h:110
KCal::KResult::Type
Type
The different types of results.
Definition: kresult.h:115
KCal::KResult::Ok
@ Ok
Operation successfully completed.
Definition: kresult.h:116
KCal::KResult::InProgress
@ InProgress
Operation still in-progress.
Definition: kresult.h:117
KCal::KResult::ErrorType
ErrorType
The different types of error conditions.
Definition: kresult.h:124
KCal::KResult::WrongParameter
@ WrongParameter
Invalid parameter.
Definition: kresult.h:128
KCal::KResult::Undefined
@ Undefined
Undefined error.
Definition: kresult.h:126
KCal::KResult::InvalidUrl
@ InvalidUrl
Invalid URL.
Definition: kresult.h:127
KCal::KResult::ParseError
@ ParseError
Parse error.
Definition: kresult.h:132
KCal::KResult::WriteError
@ WriteError
Write error.
Definition: kresult.h:130
KCal::KResult::ConnectionFailed
@ ConnectionFailed
unable to establish a connection
Definition: kresult.h:129
KCal::KResult::NotAnError
@ NotAnError
Not an error.
Definition: kresult.h:125
KCal::KResult::ReadError
@ ReadError
Read error.
Definition: kresult.h:131
This file is part of the KDE documentation.
Documentation copyright © 1996-2022 The KDE developers.
Generated on Thu Jul 21 2022 00:00:00 by doxygen 1.9.5 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

KCal Library

Skip menu "KCal Library"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Related Pages

kdepimlibs-4.14.10 API Reference

Skip menu "kdepimlibs-4.14.10 API Reference"
  • akonadi
  •   contact
  •   kmime
  •   socialutils
  • kabc
  • kalarmcal
  • kblog
  • kcal
  • kcalcore
  • kcalutils
  • kholidays
  • kimap
  • kioslave
  •   imap4
  •   mbox
  •   nntp
  • kldap
  • kmbox
  • kmime
  • kontactinterface
  • kpimidentities
  • kpimtextedit
  • kpimutils
  • kresources
  • ktnef
  • kxmlrpcclient
  • mailtransport
  • microblog
  • qgpgme
  • syndication
  •   atom
  •   rdf
  •   rss2
Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal