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