indexing
	description: "Contains the input filename used by `start_doc' in WEL_PRINTER_DC."
	status: "See notice at end of class."
	date: "$Date$"
	revision: "$Revision$"

class interface
	WEL_DOC_INFO

create 

	make (a_document_name: STRING)
			-- Make doc info structure with document_name,
		ensure
			document_name_set: document_name.is_equal (a_document_name)

feature -- Access

	document_name: STRING
			-- Name of the document
		ensure
			result_not_void: Result /= void

	item: POINTER
			-- Generic Windows handle or structure pointer.
			-- Can be a HWND, HICON, RECT *, WNDCLASS *, etc...
			-- (from WEL_ANY)

	output: STRING
			-- Name of the output file
		require
			default_output_not_set: not default_output_set
		ensure
			result_not_void: Result /= void
	
feature -- Measurement

	structure_size: INTEGER
			-- Size to allocate (in bytes)
		ensure -- from WEL_STRUCTURE
			positive_result: Result > 0
	
feature -- Status report

	default_output_set: BOOLEAN
			-- Is the default output set?

	exists: BOOLEAN
			-- Does the item exist?
			-- (from WEL_ANY)
		ensure -- from WEL_ANY
			Result = (item /= default_pointer)

	shared: BOOLEAN
			-- Is item shared by another object?
			-- If False (by default), item will
			-- be destroyed by destroy_item.
			-- If True, item will not be destroyed.
			-- (from WEL_ANY)
	
feature -- Status setting

	set_shared
			-- Set shared to True.
			-- (from WEL_ANY)
		ensure -- from WEL_ANY
			shared: shared

	set_unshared
			-- Set shared to False.
			-- (from WEL_ANY)
		ensure -- from WEL_ANY
			unshared: not shared
	
feature -- Element change

	set_default_output
			-- Set the output to the default system value.
		ensure
			default_output_set: default_output_set

	set_document_name (a_document_name: STRING)
			-- Set document_name with a_document_name.
		require
			a_document_name_not_void: a_document_name /= void
		ensure
			document_name_set: document_name.is_equal (a_document_name)

	set_item (an_item: POINTER)
			-- Set item with an_item
			-- (from WEL_ANY)
		ensure -- from WEL_ANY
			item_set: item = an_item

	set_output (an_output: STRING)
			-- Set output with an_output.
		require
			an_output_not_void: an_output /= void
		ensure
			output_set: output.is_equal (an_output)
	
feature -- Removal

	dispose
			-- Destroy the inner structure of Current.
			--
			-- This function should be called by the GC when the
			-- object is collected or by the user if Current is
			-- no more usefull.
			-- (from WEL_ANY)
	
feature -- Conversion

	to_integer: INTEGER
			-- Converts item to an integer.
			-- (from WEL_ANY)
		ensure -- from WEL_ANY
			Result = cwel_pointer_to_integer (item)
	
feature -- Basic operations

	initialize
			-- Fill Current with zeros.
			-- (from WEL_STRUCTURE)
		require -- from WEL_STRUCTURE
			exists: exists

	initialize_with_character (a_character: CHARACTER)
			-- Fill current with a_character.
			-- (from WEL_STRUCTURE)
		require -- from WEL_STRUCTURE
			exists: exists

	memory_copy (source_pointer: POINTER; length: INTEGER)
			-- Copy length bytes from source_pointer to item.
			-- (from WEL_STRUCTURE)
		require -- from WEL_STRUCTURE
			length_small_enough: length <= structure_size
			length_large_enough: length > 0
			exists: exists
	
feature -- Implementation

	str_document_name: WEL_STRING
			-- C string to save the document name

	str_output: WEL_STRING
			-- C string to save the output
	
invariant

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

end -- class WEL_DOC_INFO