indexing
	description: "Standard dialog box to specify the properties of a particular print job."
	status: "See notice at end of class."
	date: "$Date$"
	revision: "$Revision$"

class interface
	WEL_PRINT_DIALOG

create 

	make
			-- Make and setup the structure
		ensure -- from WEL_STRUCTURE
			not_shared: not shared

feature -- Access

	copies: INTEGER
			-- Number of copies for the Copies edit control

	dc: WEL_PRINTER_DC
			-- Device context associated to the selected printer
		require
			selected: selected
		ensure
			result_not_void: Result /= void

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

	from_page: INTEGER
			-- Value for the starting page edit control
		ensure
			positive_result: Result >= 0

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

	maximum_page: INTEGER
			-- Maximum value for the range of pages specified
			-- in the From and To page edit controls

	minimum_page: INTEGER
			-- Minimum value for the range of pages specified
			-- in the From and To page edit controls

	to_page: INTEGER
			-- Value for the ending page edit control
		ensure
			positive_result: Result >= 0
	
feature -- Measurement

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

	all_pages_selected: BOOLEAN
			-- Is the "All pages" radio button selected?

	collate_checked: BOOLEAN
			-- Is the "Collate" check box checked?

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

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

	page_numbers_enabled: BOOLEAN
			-- Is the "Page numbers" radio button enabled?

	page_numbers_selected: BOOLEAN
			-- Is the "Page" radio button selected?

	print_setup_enabled: BOOLEAN
			-- Is the Print setup dialog box enabled?

	print_to_file_checked: BOOLEAN
			-- Is the "Print to file" check box checked?

	print_to_file_enabled: BOOLEAN
			-- Is the "Print to file" check box enabled?

	print_to_file_shown: BOOLEAN
			-- Is the "Print to file" check box shown?

	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)

	selection_enabled: BOOLEAN
			-- Is the "Selection" radio button enabled?

	selection_selected: BOOLEAN
			-- Is the "Selection" radio box selected?

	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)

	warning_enabled: BOOLEAN
			-- Is the warning message from being displayed when
			-- there is no default printer enabled?
	
feature -- Status setting

	check_collate
			-- Check the "Collate" check box.
		ensure
			collate_checked: collate_checked

	check_print_to_file
			-- Check the "Print to file" check box.
		ensure
			print_to_file_checked: print_to_file_checked

	disable_page_numbers
			-- Disable the "Page numbers" radio button.
		ensure
			page_numbers_disabled: not page_numbers_enabled

	disable_print_setup
			-- Disable the system to display the Print setup dialog
			-- box rather than the Print dialog box.
		ensure
			print_setup_disabled: not print_setup_enabled

	disable_print_to_file
			-- Disable the "Print to file" check box.
		ensure
			print_to_file_disabled: not print_to_file_enabled

	disable_selection
			-- Disable the "Selection" radio button.
		ensure
			selection_disabled: not selection_enabled

	disable_warning
			-- Disable the warning message from being displayed when
			-- there is no default printer.
		ensure
			warning_disabled: not warning_enabled

	enable_page_numbers
			-- Enable the "Page numbers" radio button.
		ensure
			page_numbers_enabled: page_numbers_enabled

	enable_print_setup
			-- Enable the system to display the Print setup dialog
			-- box rather than the Print dialog box.
		ensure
			print_setup_enabled: print_setup_enabled

	enable_print_to_file
			-- Enable the "Print to file" check box.
		ensure
			print_to_file_enabled: print_to_file_enabled

	enable_selection
			-- Enable the "Selection" radio button.
		ensure
			selection_enabled: selection_enabled

	enable_warning
			-- Enable the warning message from being displayed when
			-- there is no default printer.
		ensure
			warning_enabled: warning_enabled

	hide_print_to_file
			-- Hide the "Print to file" check box.
		ensure
			print_to_file_hidden: not print_to_file_shown

	select_all_pages
			-- Select the "All pages" radio button.
		ensure
			all_pages_selected: all_pages_selected

	select_page_numbers
			-- Select the "Page numbers" radio button.
		ensure
			page_numbers_selected: page_numbers_selected

	select_selection
			-- Select the "Selection" radio button.
		ensure
			selection_selected: selection_selected

	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

	show_print_to_file
			-- Show the "Print to file" check box.
		ensure
			print_to_file_shown: print_to_file_shown

	uncheck_collate
			-- Uncheck the "Collate" check box.
		ensure
			collate_unchecked: not collate_checked

	uncheck_print_to_file
			-- Uncheck the "Print to file" check box.
		ensure
			print_to_file_unchecked: not print_to_file_checked
	
feature -- Element change

	add_flag (a_flags: INTEGER)
			-- Add a_flags to flags.
			-- See class WEL_PD_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_PD_CONSTANTS for a_flags values.
		ensure
			has_not_flag: not has_flag (a_flags)

	set_copies (number: INTEGER)
			-- Set copies with number.
		ensure
			copies_set: copies = number

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

	set_from_page (page: INTEGER)
			-- Set from_page with page.
		ensure
			from_page_set: from_page = page

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

	set_maximum_page (page: INTEGER)
			-- Set maximum_page with page.
		ensure
			maximum_page_set: maximum_page = page

	set_minimum_page (page: INTEGER)
			-- Set minimum_page with page.
		ensure
			minimum_page_set: minimum_page = page

	set_to_page (page: INTEGER)
			-- Set to_page with page.
		ensure
			to_page_set: to_page = page
	
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
	
invariant

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

end -- class WEL_PRINT_DIALOG