libkcal

exceptions.h
1 /*
2  This file is part of libkcal.
3 
4  Copyright (c) 2001-2003 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 */
21 
22 #ifndef KCAL_EXCEPTIONS_H
23 #define KCAL_EXCEPTIONS_H
24 //
25 // Exception classes of libkcal.
26 //
27 // We don't use actual C++ exceptions right now. These classes are currently
28 // returned by an error function, but we can build upon them, if we start
29 // to use C++ exceptions.
30 
31 #include <tqstring.h>
32 
33 namespace KCal {
34 
39 class Exception
40 {
41  public:
45  Exception( const TQString &message = TQString() );
46  virtual ~Exception();
47 
51  virtual TQString message();
52 
53  protected:
54  TQString mMessage;
55 
56  private:
57  class Private;
58  Private *d;
59 };
60 
64 class ErrorFormat : public Exception
65 {
66  public:
81  UserCancel
82  };
83 
87  ErrorFormat( ErrorCodeFormat code, const TQString &message = TQString() );
88 
92  TQString message();
97 
98  private:
99  ErrorCodeFormat mCode;
100 
101  class Private;
102  Private *d;
103 };
104 
105 }
106 
107 #endif
Calendar format related error class.
Definition: exceptions.h:65
ErrorFormat(ErrorCodeFormat code, const TQString &message=TQString())
Create format error exception.
Definition: exceptions.cpp:48
ErrorCodeFormat
The different types of Calendar format errors.
Definition: exceptions.h:70
@ Restriction
Restriction violation.
Definition: exceptions.h:79
@ NoCalendar
No calendar component found.
Definition: exceptions.h:75
@ LoadError
Load error.
Definition: exceptions.h:71
@ CalVersion1
vCalendar v1.0 detected
Definition: exceptions.h:76
@ ParseErrorIcal
Parse error in libical.
Definition: exceptions.h:73
@ NoWritableFound
No writable resource is available.
Definition: exceptions.h:80
@ ParseErrorKcal
Parse error in libkcal.
Definition: exceptions.h:74
@ CalVersion2
iCalendar v2.0 detected
Definition: exceptions.h:77
@ SaveError
Save error.
Definition: exceptions.h:72
@ CalVersionUnknown
Unknown calendar format detected.
Definition: exceptions.h:78
@ UserCancel
User canceled the operation.
Definition: exceptions.h:81
TQString message()
Return format error message.
Definition: exceptions.cpp:54
ErrorCodeFormat errorCode()
Return format error code.
Definition: exceptions.cpp:101
KOrganizer exceptions base class.
Definition: exceptions.h:40
Exception(const TQString &message=TQString())
Construct exception with descriptive message message.
Definition: exceptions.cpp:29
virtual TQString message()
Return descriptive message of exception.
Definition: exceptions.cpp:38
Namespace KCal is for global classes, objects and/or functions in libkcal.
Definition: alarm.h:38