indexing
	description: "Abstraction for objects that have a text label."
	status: "See notice at end of class"
	keywords: "text, label, font, name, property"
	date: "$Date$"
	revision: "$Revision$"

deferred class interface
	EV_TEXTABLE

feature -- Access

	alignment: EV_TEXT_ALIGNMENT
			-- Current text positioning.
		require
			not_destroyed: not is_destroyed
		ensure
			alignment_not_void: Result /= void

	data: ANY
			-- Arbitrary user data may be stored here.
			-- (from EV_ANY)

	text: STRING
			-- Text displayed in textable.
		require
			not_destroyed: not is_destroyed
		ensure
			bridge_ok: equal (Result, implementation.text)
			not_void_implies_cloned: Result /= void implies Result /= implementation.text
	
feature -- Status setting

	align_text_center
			-- Display text centered.
		require
			not_destroyed: not is_destroyed
		ensure
			alignment_set: alignment.is_center_aligned

	align_text_left
			-- Display text left aligned.
		require
			not_destroyed: not is_destroyed
		ensure
			alignment_set: alignment.is_left_aligned

	align_text_right
			-- Display text right aligned.
		require
			not_destroyed: not is_destroyed
		ensure
			alignment_set: alignment.is_right_aligned
	
feature -- Element change

	remove_text
			-- Make text Void.
		require
			not_destroyed: not is_destroyed
		ensure
			text_removed: text = void

	set_data (some_data: like data)
			-- Assign some_data to data.
			-- (from EV_ANY)
		require -- from EV_ANY
			not_destroyed: not is_destroyed
		ensure -- from EV_ANY
			data_assigned: data = some_data

	set_text (a_text: STRING)
			-- Assign a_text to text.
		require
			not_destroyed: not is_destroyed
			a_text_not_void: a_text /= void
			a_text_not_empty: not a_text.is_empty
		ensure
			text_cloned: text.is_equal (a_text) and then text /= a_text
	
feature -- Duplication

	copy (other: like Current)
			-- Update current object using fields of object attached
			-- to other, so as to yield equal objects.
			-- (from EV_ANY)
		require -- from ANY
			other_not_void: other /= void
			type_identity: same_type (other)
		ensure -- from ANY
			is_equal: is_equal (other)
	
feature -- Command

	destroy
			-- Destroy underlying native toolkit object.
			-- Render Current unusable.
			-- (from EV_ANY)
		ensure -- from EV_ANY
			is_destroyed: is_destroyed
	
feature -- Status Report

	is_destroyed: BOOLEAN
			-- Is Current no longer usable?
			-- (from EV_ANY)
		ensure -- from EV_ANY
			bridge_ok: Result = implementation.is_destroyed
	
invariant

	text_not_void_implies_text_not_empty: is_usable and text /= void implies text.count > 0
		-- from ANY
	reflexive_equality: standard_is_equal (Current)
	reflexive_conformance: conforms_to (Current)
		-- from EV_ANY
	is_initialized: is_initialized
	is_coupled: implementation /= void and then implementation.interface = Current
	default_create_called: default_create_called

end -- class EV_TEXTABLE