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

class interface
	WEL_REBARBANDINFO

create 

	make
			-- Create a band with no informations.

	make_with_id (an_id: INTEGER)
			-- Create a band with an_id as id.

	make_by_pointer (a_pointer: POINTER)
			-- Set item with a_pointer.
			-- Since item is shared, it does not need
			-- to be freed.
			-- Caution: a_pointer must be a pointer
			-- coming from Windows.
			-- (from WEL_ANY)
		ensure -- from WEL_ANY
			item_set: item = a_pointer
			shared: shared

feature -- Access

	background_color: WEL_COLOR_REF
			-- Background color used for the background of the
			-- control
		require
			exists: exists
		ensure
			color_not_void: Result /= void

	child: WEL_WINDOW
			-- Child currently in the rebar.
		require
			exists: exists

	child_minimum_height: INTEGER
			-- Minimum width required by the child.
		require
			exists: exists
		ensure
			positive_result: Result >= 0

	child_minimum_width: INTEGER
			-- Minimum width required by the child.
		require
			exists: exists
		ensure
			positive_result: Result >= 0

	foreground_color: WEL_COLOR_REF
			-- foreground color used for the text of the
			-- control
		require
			exists: exists
		ensure
			color_not_void: Result /= void

	id: INTEGER
			-- id of the band.
		require
			exists: exists

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

	length: INTEGER
			-- Current length of the band.
		require
			exists: exists
		ensure
			positive_result: Result >= 0

	mask: INTEGER
			-- Array of flags that indicate which of the other
			-- structure members contain valid data or which are
			-- to be filled in. This member can be a combination
			-- of the Rbbim_* values.
			-- See class WEL_RBBIM_CONSTANTS.
		require
			exists: exists

	style: INTEGER
			-- Array of flags that specify the band style.
			-- This value can be a combinaison of RBBS_* constants.
			-- See class WEL_RBBS_CONSTANTS.
		require
			exists: exists

	text: STRING
			-- Item text
		require
			exists: exists
	
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)
	
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_background_bitmap (bmp: WEL_BITMAP)
			-- Set background_bitmap with bmp.
		require
			exists: exists
			bitmap_not_void: bmp /= void

	set_background_color (color: WEL_COLOR_REF)
			-- Set background_color as color.
		require
			exists: exists
			color_not_void: color /= void
		ensure
			color_set: background_color.is_equal (color)

	set_child (window: WEL_WINDOW)
			-- Set child as window.
			-- Do not use this features for controls as toolbars
			-- that reposition themself automaticaly at a specific
			-- place. Use set_reposition_child.
		require
			exists: exists
			window_not_void: window /= void
			window_is_inside: window.is_inside
		ensure
			window_set: child.is_equal (window)

	set_child_minimum_height (value: INTEGER)
			-- Set child_minimum_height as value.
		require
			exists: exists
			valid_value: value >= 0
		ensure
			value_set: child_minimum_height = value

	set_child_minimum_width (value: INTEGER)
			-- Set child_minimum_width as value.
		require
			exists: exists
			valid_value: value >= 0
		ensure
			value_set: child_minimum_width = value

	set_foreground_color (color: WEL_COLOR_REF)
			-- Set foreground_color as color.
		require
			exists: exists
			color_not_void: color /= void
		ensure
			color_set: foreground_color.is_equal (color)

	set_id (value: INTEGER)
			-- Set id as value.
		require
			exists: exists
		ensure
			id_set: id = value

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

	set_length (value: INTEGER)
			-- Set length as value.
		require
			exists: exists
			valid_value: value >= 0
		ensure
			length_set: length = value

	set_style (value: INTEGER)
			-- Set cbSize (size of the structure) as value.
		require
			exists: exists
		ensure
			style_set: style = value

	set_text (txt: STRING)
			-- Set text as txt.
		require
			exists: exists
			a_text_not_void: txt /= void
		ensure
			text_set: text.is_equal (txt)

	set_unpositionable_child (window: WEL_WINDOW)
			-- Set child as window.
			-- Use this features for controls as toolbars
			-- that reposition themself automaticaly at a specific
			-- place. Use set_reposition_child.
			-- Do not use for usual controls.
		require
			exists: exists
			window_not_void: window /= void
			window_is_inside: window.is_inside
		ensure
			window_set: child.is_equal (window.parent)
	
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 -- Basic operation

	clear_mask
			-- Clear the current mask.
			-- Call it before to call a set_? feature when you
			-- want to change only one parameter.
		require
			exists: exists
	
invariant

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

end -- class WEL_REBARBANDINFO