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:
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