indexing
	description: "Contains information about a tool in a tooltip control."
	status: "See notice at end of class."
	date: "$Date$"
	revision: "$Revision$"

class interface
	WEL_TOOL_INFO

create 

	make
			-- Make a tool info structure.

feature -- Access

	flags: INTEGER
			-- A set of bit flags. See class WEL_TTF_CONSTANTS
			-- for values.

	id: INTEGER
			-- Application-defined identifier of the tool

	instance: WEL_INSTANCE
			-- Instance that contains the string resource for the
			-- tool. If text specifies the identifier of a string
			-- resource, this information is used.
		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)

	rect: WEL_RECT
			-- Coordinates of the bounding rectangle of the tool
		ensure
			result_not_void: Result /= void

	text: STRING
			-- Text for the tool
		require
			text_id_not_set: not text_id_set
		ensure
			result_not_void: Result /= void

	text_id: INTEGER
			-- String resource identifier for the text
		require
			text_id_set: text_id_set

	window: WEL_WINDOW
			-- Window that contains the tool
	
feature -- Measurement

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

	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)

	text_call_back_set: BOOLEAN
			-- Is text equal to Lpstr_textcallback?

	text_id_set: BOOLEAN
			-- Is text equal to a resource string identifer?
	
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_flags (a_flags: INTEGER)
			-- Set flags with a_flags.
		ensure
			flags_set: flags = a_flags

	set_id (an_id: INTEGER)
			-- Set id with an_id.
		ensure
			id_set: id = an_id

	set_id_with_window (a_window: WEL_WINDOW)
			-- Set id with a_window.
		ensure
			id_set: id = cwel_pointer_to_integer (a_window.item)

	set_instance (an_instance: WEL_INSTANCE)
			-- Set instance with an_instance.
		require
			an_instance_not_void: an_instance /= void
		ensure
			instance_set: instance.item = an_instance.item

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

	set_rect (a_rect: WEL_RECT)
			-- Set rect with a_rect.
		require
			a_rect_not_void: a_rect /= void
		ensure
			rect_set: rect.is_equal (a_rect)

	set_text (a_text: STRING)
			-- Set text with a_text.
		require
			a_text_not_void: a_text /= void
		ensure
			text_set: text.is_equal (a_text)

	set_text_call_back
			-- Set text with Lpstr_textcallback.
		ensure
			text_call_back_set: text_call_back_set

	set_text_id (an_id: INTEGER)
			-- Set text with a string resource identifier an_id.
		ensure
			text_id_set: text_id = an_id

	set_window (a_window: WEL_WINDOW)
			-- Set window with a_window.
		require
			a_window_not_void: a_window /= void
			a_window_exists: a_window.exists
		ensure
			window_set: window = a_window
	
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
	
invariant

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

end -- class WEL_TOOL_INFO