indexing
	description: "All resources"
	author: ""
	date: "$Date$"
	revision: "$Revision$"

deferred class interface
	EMAIL_RESOURCE

feature -- Access

	header (h: STRING): HEADER
			-- Retrieve the content of the header 'h'

	headers: HASH_TABLE [HEADER, STRING]
			-- All information concerning each headers
	
feature -- Status report

	can_be_received: BOOLEAN
			-- Can resource be received?

	can_be_sent: BOOLEAN
			-- Can resource be sent?

	can_receive: BOOLEAN
			-- Can resource receive?

	can_send: BOOLEAN
			-- Can resource send?

	error: BOOLEAN
			-- Is there an error?

	is_header_valid: BOOLEAN
			-- Is the email resource's header valid?

	is_initiated: BOOLEAN
			-- Has the connection has been initiated?

	transfer_error: TRANSFER_ERROR
			-- Transfer error handling
	
feature -- Status setting

	disable_initiated
			-- Unset is_initiated.

	disable_transfer_error
			-- Disable transfer error.

	enable_initiated
			-- Set is_initiated.

	enable_transfer_error
			-- Enable transfer error.

	set_transfer_error_message (s: STRING)
			-- Set transfer error message to 's'.
	
feature -- Basic operations

	transfer (resource: EMAIL_RESOURCE)
			-- Transfer the Current email resource to 'resource'.
		require
			resource_exists: resource /= void
			is_valid_transfer: (resource.can_be_sent and can_send) or (resource.can_receive and can_be_received)
			connection_is_initiated: (can_be_sent and resource.is_initiated) or (is_initiated and resource.can_be_received)
	
feature -- Constants for SMTP Protocol

	Ack_begin_connection: INTEGER is 220
			-- (from EMAIL_CONSTANTS)

	Ack_end_connection: INTEGER is 221
			-- (from EMAIL_CONSTANTS)

	Data: STRING is "DATA"
			-- (from EMAIL_CONSTANTS)

	Data_code: INTEGER is 354
			-- (from EMAIL_CONSTANTS)

	Ehlo: STRING is "EHLO "
			-- (from EMAIL_CONSTANTS)

	Helo: STRING is "HELO "
			-- (from EMAIL_CONSTANTS)

	Mail_bcc: STRING is "RCPT BCC:"
			-- (from EMAIL_CONSTANTS)

	Mail_cc: STRING is "RCPT CC:"
			-- (from EMAIL_CONSTANTS)

	Mail_from: STRING is "MAIL FROM: "
			-- (from EMAIL_CONSTANTS)

	Mail_reply_to: STRING is "RCPT REPLY TO:"
			-- (from EMAIL_CONSTANTS)

	Mail_to: STRING is "RCPT TO: "
			-- (from EMAIL_CONSTANTS)

	No_valid_recipient: INTEGER is 554
			-- (from EMAIL_CONSTANTS)

	Ok: INTEGER is 250
			-- (from EMAIL_CONSTANTS)

	Quit: STRING is "QUIT"
			-- (from EMAIL_CONSTANTS)

	Remote_error: INTEGER is 550
			-- (from EMAIL_CONSTANTS)

	Size_error: INTEGER is 500
			-- (from EMAIL_CONSTANTS)

	Struct_error: INTEGER is 552
			-- (from EMAIL_CONSTANTS)
	
feature -- Constants for email headers (Authorized keys for the Hashtables)

	default_headers: ARRAY [STRING]
			-- (from EMAIL_CONSTANTS)

	H_bcc: STRING is "Bcc"
			-- (from EMAIL_CONSTANTS)

	H_cc: STRING is "Cc"
			-- (from EMAIL_CONSTANTS)

	H_from: STRING is "From"
			-- (from EMAIL_CONSTANTS)

	H_reply_to: STRING is "Reply-to"
			-- (from EMAIL_CONSTANTS)

	H_subject: STRING is "Subject"
			-- (from EMAIL_CONSTANTS)

	H_to: STRING is "To"
			-- (from EMAIL_CONSTANTS)
	
invariant

		-- from ANY
	reflexive_equality: standard_is_equal (Current)
	reflexive_conformance: conforms_to (Current)

end -- class EMAIL_RESOURCE