1 #ifndef ZOIDBERG_MAIL_CONTAINER_H
2 #define ZOIDBERG_MAIL_CONTAINER_H
3 /* Container - message part container class
5 ** Copyright 2001 Dr. Zoidberg Enterprises. All rights reserved.
11 #include <MailComponent.h>
15 class BMailContainer
: public BMailComponent
{
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;
28 virtual void _ReservedContainer1();
29 virtual void _ReservedContainer2();
30 virtual void _ReservedContainer3();
31 virtual void _ReservedContainer4();
34 class BMIMEMultipartMailContainer
: public BMailContainer
{
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
©
);
41 virtual ~BMIMEMultipartMailContainer();
43 void SetBoundary(const char *boundary
);
44 void SetThisIsAnMIMEMessageText(const char *text
);
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;
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
);
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
;
78 #endif /* ZOIDBERG_MAIL_CONTAINER_H */