indexing description: "Objects that represent an EV_TITLED_WINDOW.% %The original version of this class was generated by EiffelBuild." date: "$Date$" revision: "$Revision$" class WEB_BROWSER_WIDGET inherit WEB_BROWSER_WIDGET_IMP TEXT_OBSERVER undefine copy, is_equal, default_create redefine on_text_fully_loaded end SHARED_OBJECTS undefine copy, default_create, is_equal end create make feature -- Creation make is -- Make do default_create end feature {NONE} -- Initialization user_initialization is -- called by `initialize'. -- Any custom user initialization that -- could not be performed in `initialize', -- (due to regeneration of implementation class) -- can be added here. do -- Browser create browser_winform_container browser_winform_container.extend (Internal_browser) browser_container.extend (browser_winform_container) end feature -- Commands load_url (a_url: STRING) is -- Load `a_url' local l_ptr: SYSTEM_OBJECT do Internal_browser.navigate (a_url, $l_ptr, $l_ptr, $l_ptr, $l_ptr) end refresh is -- Reload the HTML based upon changes made to `document'. If there is no -- document then simply refresh the loaded url. do if document /= Void then shared_document_manager.save_document load_url (generated_document) else Internal_browser.refresh end end feature -- Status Setting set_document (a_doc: DOCUMENT) is -- Set `document' require doc_not_void: a_doc /= Void local l_util: UTILITY_FUNCTIONS l_name: STRING do document := a_doc create l_util l_name := document.name l_name.replace_substring_all ("\", "/") if l_util.file_type (l_name).is_equal ("xml") or l_util.file_type (l_name).is_equal ("html") then load_url (generated_document) end ensure is_set: document = a_doc end feature {NONE} -- Implementation browser_winform_container: EV_WINFORM_CONTAINER -- Vision 2 Winforms container internal_browser: AX_WEB_BROWSER is -- Web browser control once create Result.make end document: DOCUMENT -- Document generated_document: STRING is -- Generated `document' content local l_generator: HTML_GENERATOR l_util: UTILITY_FUNCTIONS do create Result.make_empty if document.is_persisted then create l_generator create l_util l_generator.generate_file (document, create {DIRECTORY}.make (l_util.temporary_html_location (document.name, False))) Result.append (l_generator.last_generated_file.name.string) Result.replace_substring_all ("\", "/") end ensure has_result: Result /= Void end on_text_fully_loaded is -- Update `Current' when the text has been completely loaded. -- Observer must be registered as "edition_observer" for this feature to be called. local l_consts: SHARED_OBJECTS do create l_consts if l_consts.shared_document_manager.current_document /= Void then set_document (l_consts.shared_document_manager.current_document) end end end -- class WEB_BROWSER_WIDGET