indexing
	description: "Browse for folder dialog."
	status: "See notice at end of class."
	date: "$Date$"
	revision: "$Revision$"

class interface
	WEL_CHOOSE_FOLDER_DIALOG

create 

	make
			-- Initialize structure

feature -- Initialization

	make
			-- Initialize structure
	
feature -- Access

	flags: INTEGER
			-- Dialog box creation flags
			-- Can be a combination of values defined in
			-- class WEL_BIF_CONSTANTS.

	folder_name: STRING
			-- Selected folder name
			-- Empty if no folder was selected.

	has_flag (a_flags: INTEGER): BOOLEAN
			-- Is a_flags set in flags?
			-- See class WEL_BIF_CONSTANTS for a_flags values.

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

	starting_folder: STRING
			-- Initial folder name

	title: STRING
			-- Dialog title
	
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)

	selected: BOOLEAN
			-- Has the user selected something (file, color, etc.)?
			-- If True, the Ok button has been chosen. If False,
			-- the Cancel button has been chosen.
			-- (from WEL_STANDARD_DIALOG)

	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_item (an_item: POINTER)
			-- Set item with an_item
			-- (from WEL_ANY)
		ensure -- from WEL_ANY
			item_set: item = an_item
	
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

	activate (a_parent: WEL_COMPOSITE_WINDOW)
			-- Activate the dialog box (modal mode) with
			-- a_parent as owner.
		require -- from WEL_STANDARD_DIALOG
			a_parent_not_void: a_parent /= void
			a_parent_exists: a_parent.exists

	structure_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 -- Element Change

	add_flag (a_flags: INTEGER)
			-- Add a_flags to flags.
			-- See class WEL_BIF_CONSTANTS for a_flags values.
		ensure
			has_flag: has_flag (a_flags)

	remove_flag (a_flags: INTEGER)
			-- Remove a_flags from flags.
			-- See class WEL_BIF_CONSTANTS for a_flags values.
		ensure
			has_not_flag: not has_flag (a_flags)

	set_default_title
			-- Set title with default title ("Please choose a folder")

	set_flags (a_flags: INTEGER)
			-- Set flags with a_flags.
			-- See class WEL_BIF_CONSTANTS for a_flags values.
		ensure
			flags_set: flags = a_flags

	set_starting_folder (a_folder_name: STRING)
			-- Set the initial folder name
		require
			valid_folder_name: a_folder_name /= void and then not a_folder_name.is_empty
		ensure
			starting_folder_set: starting_folder.is_equal (a_folder_name)

	set_title (a_title: STRING)
			-- Set title with a_title
		require
			a_title_not_void: a_title /= void
		ensure
			title_set: title.is_equal (a_title)
	
invariant

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

end -- class WEL_CHOOSE_FOLDER_DIALOG