Fix FreeBSD build.
[haiku.git] / headers / os / mail / MailContainer.h
blob318e8517326295e0d435737845a30a5d34881cda
1 #ifndef ZOIDBERG_MAIL_CONTAINER_H
2 #define ZOIDBERG_MAIL_CONTAINER_H
3 /* Container - message part container class
4 **
5 ** Copyright 2001 Dr. Zoidberg Enterprises. All rights reserved.
6 */
9 #include <List.h>
11 #include <MailComponent.h>
13 class BPositionIO;
15 class BMailContainer : public BMailComponent {
16 public:
17 BMailContainer (uint32 defaultCharSet = B_MAIL_NULL_CONVERSION) :
18 BMailComponent (defaultCharSet) {};
20 virtual status_t AddComponent(BMailComponent *component) = 0;
21 virtual status_t RemoveComponent(BMailComponent *component) = 0;
22 virtual status_t RemoveComponent(int32 index) = 0;
24 virtual BMailComponent *GetComponent(int32 index, bool parse_now = false) = 0;
25 virtual int32 CountComponents() const = 0;
27 private:
28 virtual void _ReservedContainer1();
29 virtual void _ReservedContainer2();
30 virtual void _ReservedContainer3();
31 virtual void _ReservedContainer4();
34 class BMIMEMultipartMailContainer : public BMailContainer {
35 public:
36 BMIMEMultipartMailContainer(
37 const char *boundary = NULL,
38 const char *this_is_an_MIME_message_text = NULL,
39 uint32 defaultCharSet = B_MAIL_NULL_CONVERSION);
40 BMIMEMultipartMailContainer(BMIMEMultipartMailContainer &copy);
41 virtual ~BMIMEMultipartMailContainer();
43 void SetBoundary(const char *boundary);
44 void SetThisIsAnMIMEMessageText(const char *text);
46 // MailContainer
47 virtual status_t AddComponent(BMailComponent *component);
48 virtual status_t RemoveComponent(BMailComponent *component);
49 virtual status_t RemoveComponent(int32 index);
51 virtual BMailComponent *GetComponent(int32 index, bool parse_now = false);
52 virtual int32 CountComponents() const;
54 // MailComponent
55 virtual status_t GetDecodedData(BPositionIO *data);
56 virtual status_t SetDecodedData(BPositionIO *data);
58 virtual status_t SetToRFC822(BPositionIO *data, size_t length, bool parse_now = false);
59 virtual status_t RenderToRFC822(BPositionIO *render_to);
61 private:
62 virtual void _ReservedMultipart1();
63 virtual void _ReservedMultipart2();
64 virtual void _ReservedMultipart3();
66 const char *_boundary;
67 const char *_MIME_message_warning;
69 BPositionIO *_io_data;
71 BList _components_in_raw;
72 BList _components_in_code;
75 uint32 _reserved[5];
78 #endif /* ZOIDBERG_MAIL_CONTAINER_H */