interfaces/bodypartformatter.h
1 /*
2  bodypartformatter.h
3 
4  This file is part of KMail's plugin interface.
5  Copyright (c) 2004 Marc Mutz <mutz@kde.org>,
6  Ingo Kloecker <kloecker@kde.org>
7 
8  KMail is free software; you can redistribute it and/or modify it
9  under the terms of the GNU General Public License as published by
10  the Free Software Foundation; either version 2 of the License, or
11  (at your option) any later version.
12 
13  KMail is distributed in the hope that it will be useful, but
14  WITHOUT ANY WARRANTY; without even the implied warranty of
15  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16  General Public License for more details.
17 
18  You should have received a copy of the GNU General Public License
19  along with this program; if not, write to the Free Software
20  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
21 
22  In addition, as a special exception, the copyright holders give
23  permission to link the code of this program with any edition of
24  the TQt library by Trolltech AS, Norway (or with modified versions
25  of TQt that use the same license as TQt), and distribute linked
26  combinations including the two. You must obey the GNU General
27  Public License in all respects for all of the code used other than
28  TQt. If you modify this file, you may extend this exception to
29  your version of the file, but you are not obligated to do so. If
30  you do not wish to do so, delete this exception statement from
31  your version.
32 */
33 
34 #ifndef __KMAIL_INTERFACE_BODYPARTFORMATTER_H__
35 #define __KMAIL_INTERFACE_BODYPARTFORMATTER_H__
36 
37 namespace KMail {
38  class Callback;
39  class HtmlWriter;
40 
41  namespace Interface {
42 
43  class BodyPart;
44  class BodyPartURLHandler;
45 
46  class BodyPartFormatter {
47  public:
48  virtual ~BodyPartFormatter() {}
49 
56  enum Result { Ok, NeedContent, AsIcon, Failed };
57 
64  virtual Result format( BodyPart * part, KMail::HtmlWriter * writer, Callback &c ) const = 0;
65  };
66 
81  public:
82  virtual ~BodyPartFormatterPlugin() {}
83 
84  virtual const BodyPartFormatter * bodyPartFormatter( int idx ) const = 0;
85  virtual const char * type( int idx ) const = 0;
86  virtual const char * subtype( int idx ) const = 0;
87 
88  virtual const BodyPartURLHandler * urlHandler( int idx ) const = 0;
89  };
90 
91  } // namespace Interface
92 
93 } // namespace KMail
94 
95 #endif // __KMAIL_INTERFACE_BODYPARTFORMATTER_H__
An interface to HTML sinks.
Definition: htmlwriter.h:99
interface for BodyPartFormatter plugins
An interface to body part reader link handlers.
@ Ok
The user rights/ACL have been fetched from the server sucessfully.
Definition: acljobs.h:66
folderdiaquotatab.h
Definition: aboutdata.cpp:40