From a065e04d529da1d847b5062a12c46d916408bf32 Mon Sep 17 00:00:00 2001 From: Peter Bengtsson Date: Tue, 8 Dec 2020 21:46:22 -0500 Subject: update based on https://github.com/mdn/yari/issues/2028 --- .../tech/accessibility/at-apis/gecko/index.html | 5 - .../accessibility/at-apis/gecko/roles/index.html | 496 ----------- .../gecko/roles/role_accel_label/index.html | 30 - .../at-apis/gecko/roles/role_alert/index.html | 38 - .../at-apis/gecko/roles/role_animation/index.html | 30 - .../at-apis/gecko/roles/role_app_root/index.html | 26 - .../gecko/roles/role_application/index.html | 34 - .../at-apis/gecko/roles/role_arrow/index.html | 30 - .../gecko/roles/role_autocomplete/index.html | 30 - .../at-apis/gecko/roles/role_border/index.html | 23 - .../gecko/roles/role_buttondropdown/index.html | 28 - .../gecko/roles/role_buttondropdowngrid/index.html | 30 - .../at-apis/gecko/roles/role_buttonmenu/index.html | 29 - .../at-apis/gecko/roles/role_calendar/index.html | 24 - .../at-apis/gecko/roles/role_canvas/index.html | 28 - .../at-apis/gecko/roles/role_caption/index.html | 27 - .../at-apis/gecko/roles/role_caret/index.html | 23 - .../at-apis/gecko/roles/role_cell/index.html | 39 - .../at-apis/gecko/roles/role_character/index.html | 23 - .../at-apis/gecko/roles/role_chart/index.html | 29 - .../gecko/roles/role_check_menu_item/index.html | 32 - .../gecko/roles/role_checkbutton/index.html | 34 - .../gecko/roles/role_chrome_window/index.html | 30 - .../at-apis/gecko/roles/role_clock/index.html | 28 - .../gecko/roles/role_color_chooser/index.html | 30 - .../gecko/roles/role_columnheader/index.html | 32 - .../at-apis/gecko/roles/role_combobox/index.html | 34 - .../gecko/roles/role_combobox_list/index.html | 27 - .../gecko/roles/role_combobox_option/index.html | 28 - .../at-apis/gecko/roles/role_cursor/index.html | 23 - .../gecko/roles/role_date_editor/index.html | 30 - .../gecko/roles/role_desktop_frame/index.html | 30 - .../gecko/roles/role_desktop_icon/index.html | 30 - .../at-apis/gecko/roles/role_diagram/index.html | 28 - .../at-apis/gecko/roles/role_dial/index.html | 29 - .../at-apis/gecko/roles/role_dialog/index.html | 35 - .../gecko/roles/role_directory_pane/index.html | 30 - .../at-apis/gecko/roles/role_document/index.html | 35 - .../gecko/roles/role_document_frame/index.html | 27 - .../at-apis/gecko/roles/role_droplist/index.html | 28 - .../at-apis/gecko/roles/role_editbar/index.html | 29 - .../at-apis/gecko/roles/role_entry/index.html | 29 - .../at-apis/gecko/roles/role_equation/index.html | 30 - .../gecko/roles/role_file_chooser/index.html | 30 - .../gecko/roles/role_font_chooser/index.html | 30 - .../at-apis/gecko/roles/role_footer/index.html | 27 - .../at-apis/gecko/roles/role_form/index.html | 28 - .../at-apis/gecko/roles/role_glass_pane/index.html | 27 - .../at-apis/gecko/roles/role_graphic/index.html | 43 - .../at-apis/gecko/roles/role_grip/index.html | 23 - .../at-apis/gecko/roles/role_grouping/index.html | 40 - .../at-apis/gecko/roles/role_header/index.html | 29 - .../at-apis/gecko/roles/role_heading/index.html | 32 - .../gecko/roles/role_helpballoon/index.html | 34 - .../gecko/roles/role_hotkeyfield/index.html | 28 - .../gecko/roles/role_html_container/index.html | 27 - .../at-apis/gecko/roles/role_icon/index.html | 29 - .../at-apis/gecko/roles/role_image_map/index.html | 26 - .../at-apis/gecko/roles/role_ime/index.html | 25 - .../at-apis/gecko/roles/role_indicator/index.html | 29 - .../gecko/roles/role_internal_frame/index.html | 39 - .../at-apis/gecko/roles/role_ipaddress/index.html | 28 - .../at-apis/gecko/roles/role_label/index.html | 31 - .../gecko/roles/role_layered_pane/index.html | 27 - .../at-apis/gecko/roles/role_link/index.html | 36 - .../at-apis/gecko/roles/role_list/index.html | 41 - .../at-apis/gecko/roles/role_listbox/index.html | 29 - .../at-apis/gecko/roles/role_listitem/index.html | 51 -- .../at-apis/gecko/roles/role_menubar/index.html | 35 - .../at-apis/gecko/roles/role_menuitem/index.html | 35 - .../at-apis/gecko/roles/role_menupopup/index.html | 37 - .../at-apis/gecko/roles/role_nothing/index.html | 30 - .../at-apis/gecko/roles/role_option/index.html | 27 - .../gecko/roles/role_option_pane/index.html | 27 - .../at-apis/gecko/roles/role_outline/index.html | 33 - .../gecko/roles/role_outlineitem/index.html | 36 - .../at-apis/gecko/roles/role_page/index.html | 27 - .../at-apis/gecko/roles/role_pagetab/index.html | 31 - .../gecko/roles/role_pagetablist/index.html | 33 - .../at-apis/gecko/roles/role_pane/index.html | 38 - .../at-apis/gecko/roles/role_paragraph/index.html | 27 - .../gecko/roles/role_parent_menuitem/index.html | 27 - .../gecko/roles/role_password_text/index.html | 28 - .../at-apis/gecko/roles/role_popup_menu/index.html | 25 - .../gecko/roles/role_progressbar/index.html | 33 - .../gecko/roles/role_propertypage/index.html | 39 - .../at-apis/gecko/roles/role_pushbutton/index.html | 33 - .../gecko/roles/role_radio_menu_item/index.html | 28 - .../gecko/roles/role_radiobutton/index.html | 32 - .../gecko/roles/role_redundant_object/index.html | 26 - .../gecko/roles/role_rich_option/index.html | 28 - .../at-apis/gecko/roles/role_root_pane/index.html | 26 - .../at-apis/gecko/roles/role_row/index.html | 34 - .../at-apis/gecko/roles/role_ruler/index.html | 27 - .../gecko/roles/role_scroll_pane/index.html | 26 - .../at-apis/gecko/roles/role_scrollbar/index.html | 22 - .../at-apis/gecko/roles/role_section/index.html | 30 - .../at-apis/gecko/roles/role_separator/index.html | 34 - .../at-apis/gecko/roles/role_slider/index.html | 32 - .../at-apis/gecko/roles/role_sound/index.html | 23 - .../at-apis/gecko/roles/role_spinbutton/index.html | 32 - .../at-apis/gecko/roles/role_split_pane/index.html | 26 - .../at-apis/gecko/roles/role_statusbar/index.html | 27 - .../at-apis/gecko/roles/role_table/index.html | 27 - .../roles/role_table_column_header/index.html | 25 - .../gecko/roles/role_table_row_header/index.html | 25 - .../gecko/roles/role_tear_off_menu_item/index.html | 26 - .../at-apis/gecko/roles/role_terminal/index.html | 26 - .../at-apis/gecko/roles/role_text_leaf/index.html | 28 - .../at-apis/gecko/roles/role_titlebar/index.html | 22 - .../gecko/roles/role_toggle_button/index.html | 27 - .../at-apis/gecko/roles/role_toolbar/index.html | 32 - .../at-apis/gecko/roles/role_tooltip/index.html | 37 - .../at-apis/gecko/roles/role_tree_table/index.html | 29 - .../at-apis/gecko/roles/role_viewport/index.html | 27 - .../at-apis/gecko/roles/role_whitespace/index.html | 30 - .../at-apis/gecko/roles/role_window/index.html | 23 - .../mozilla/tech/accessibility/at-apis/index.html | 5 - files/ja/mozilla/tech/accessibility/index.html | 28 - files/ja/mozilla/tech/index.html | 15 - .../index.html | 281 ------ .../xpcom/fun_with_xbl_and_xpconnect/index.html | 88 -- .../mozilla/tech/xpcom/generating_guids/index.html | 79 -- .../mozilla/tech/xpcom/generic_factory/index.html | 136 --- .../index.html | 190 ---- files/ja/mozilla/tech/xpcom/guide/index.html | 16 - .../guide/mozilla_internal_string_guide/index.html | 834 ------------------ .../xpcom/guide/xpcom_hashtable_guide/index.html | 297 ------- files/ja/mozilla/tech/xpcom/index.html | 114 --- .../index.html | 67 -- .../introduction_to_xpcom_for_the_dom/index.html | 319 ------- .../components.classes/index.html | 109 --- .../components.classesbyid/index.html | 20 - .../components.constructor/index.html | 109 --- .../components.exception/index.html | 26 - .../language_bindings/components.id/index.html | 23 - .../components.interfaces/index.html | 37 - .../components.lastresult/index.html | 57 -- .../components.manager/index.html | 11 - .../components.results/index.html | 40 - .../components.returncode/index.html | 28 - .../language_bindings/components.stack/index.html | 11 - .../components.utils.evalinsandbox/index.html | 34 - .../components.utils.forcegc/index.html | 20 - .../components.utils.getweakreference/index.html | 45 - .../components.utils.import/index.html | 118 --- .../components.utils.reporterror/index.html | 40 - .../language_bindings/components.utils/index.html | 46 - .../language_bindings/components_object/index.html | 108 --- .../tech/xpcom/language_bindings/index.html | 25 - .../javaxpcom/development/index.html | 24 - .../index.html | 156 ---- .../javaxpcom/examples/index.html | 13 - .../xpcom/language_bindings/javaxpcom/index.html | 73 -- .../javaxpcom/other_resources/index.html | 15 - .../xpcom/language_bindings/plxpcom/index.html | 17 - .../xpcom/language_bindings/pyxpcom/index.html | 62 -- .../xpcom/language_bindings/rbxpcom/index.html | 16 - .../tech/xpcom/reference/components/index.html | 18 - .../components/nscategorymanager/index.html | 30 - .../components/nsdirectoryservice/index.html | 71 -- .../reference/components/nslocalfile/index.html | 41 - .../components/nsobserverservice/index.html | 30 - .../components/nsscriptableinputstream/index.html | 66 -- .../tech/xpcom/reference/glue_classes/index.html | 16 - .../reference/glue_classes/nscomptr/index.html | 27 - files/ja/mozilla/tech/xpcom/reference/index.html | 21 - .../tech/xpcom/reference/ns_ensure_true/index.html | 49 -- .../imgiloader/index.html | 27 - .../reference/xpcom_interface_reference/index.html | 15 - .../mozijssubscriptloader/index.html | 80 -- .../moziregistry/index.html | 89 -- .../mozistoragestatementparams/index.html | 25 - .../nsiaccessible/index.html | 484 ---------- .../nsiaccessibleprovider/index.html | 49 -- .../nsiannotationobserver/index.html | 128 --- .../nsiasyncinputstream/index.html | 96 -- .../nsiconsoleservice/index.html | 51 -- .../nsicontentprefobserver/index.html | 79 -- .../nsicontentprefservice/index.html | 203 ----- .../nsicryptohash/index.html | 265 ------ .../nsidomfile/index.html | 108 --- .../nsidomfileexception/index.html | 57 -- .../nsidomfilelist/index.html | 80 -- .../nsidomhtmlmediaelement/index.html | 39 - .../nsidomofflineresourcelist/index.html | 184 ---- .../nsidomsimplegestureevent/index.html | 61 -- .../nsidownload/index.html | 135 --- .../nsidownloadmanager/index.html | 424 --------- .../nsidownloadmanagerui/index.html | 111 --- .../nsidownloadprogresslistener/index.html | 295 ------- .../nsidragservice/index.html | 227 ----- .../nsieffectivetldservice/index.html | 173 ---- .../nsienumerator/index.html | 40 - .../xpcom_interface_reference/nsifeed/index.html | 125 --- .../nsifeedcontainer/index.html | 101 --- .../nsifeedelementbase/index.html | 46 - .../nsifeedentry/index.html | 68 -- .../nsifeedgenerator/index.html | 51 -- .../nsifeedperson/index.html | 53 -- .../nsifeedprocessor/index.html | 116 --- .../nsifeedprogresslistener/index.html | 102 --- .../nsifeedresult/index.html | 105 --- .../nsifeedresultlistener/index.html | 50 -- .../nsifeedtextconstruct/index.html | 94 -- .../nsihttpactivitydistributor/index.html | 68 -- .../nsihttpactivityobserver/index.html | 172 ---- .../nsihttpchannel/index.html | 569 ------------ .../nsiidleservice/index.html | 135 --- .../nsiinputstream/index.html | 65 -- .../nsiioservice/index.html | 456 ---------- .../xpcom_interface_reference/nsijscid/index.html | 24 - .../xpcom_interface_reference/nsijson/index.html | 165 ---- .../nsilogininfo/index.html | 147 ---- .../nsiloginmanager/index.html | 306 ------- .../nsiobserver/index.html | 65 -- .../nsiobserverservice/index.html | 186 ---- .../nsioutputstream/index.html | 60 -- .../nsiparentalcontrolsservice/index.html | 172 ---- .../nsiparserutils/index.html | 205 ----- .../nsipassword/index.html | 12 - .../nsipasswordmanager/index.html | 16 - .../nsiplacesview/index.html | 128 --- .../nsiprefbranch/index.html | 494 ----------- .../nsiscriptableunescapehtml/index.html | 104 --- .../nsiscriptableunicodeconverter/index.html | 142 --- .../nsisessionstore/index.html | 419 --------- .../nsisupports_proxies/index.html | 89 -- .../nsitaggingservice/index.html | 180 ---- .../xpcom_interface_reference/nsithread/index.html | 119 --- .../nsithreadeventfilter/index.html | 61 -- .../nsithreadinternal/index.html | 82 -- .../nsithreadmanager/index.html | 112 --- .../nsithreadobserver/index.html | 125 --- .../nsithreadpool/index.html | 78 -- .../nsiwebprogresslistener/index.html | 392 --------- .../nsiwindowmediator/index.html | 60 -- .../nsixmlhttprequest/index.html | 84 -- .../nsizipentry/index.html | 60 -- .../nsizipreader/index.html | 185 ---- .../nsizipwriter/index.html | 496 ----------- .../xpcom_interface_reference_group/index.html | 976 --------------------- .../xpcom/setting_http_request_headers/index.html | 273 ------ files/ja/mozilla/tech/xpcom/storage/index.html | 378 -------- .../tech/xpcom/the_thread_manager/index.html | 130 --- .../frequently_asked_questions/index.html | 91 -- .../getting_started_guide/index.html | 294 ------- .../mozilla/tech/xpcom/using_nscomptr/index.html | 24 - .../using_nscomptr/reference_manual/index.html | 523 ----------- .../status,_recent_changes,_and_plans/index.html | 36 - .../mozilla/tech/xpcom/weak_reference/index.html | 153 ---- .../mozilla/tech/xpcom/wrappedjsobject/index.html | 104 --- files/ja/mozilla/tech/xpcom/xpcom_abi/index.html | 54 -- .../xpcom/xpcom_ownership_guidelines/index.html | 37 - files/ja/mozilla/tech/xpcom/xptcall_faq/index.html | 76 -- .../xpidl/generating_xpt_on_windows/index.html | 13 - files/ja/mozilla/tech/xpidl/index.html | 560 ------------ files/ja/mozilla/tech/xpidl/xpidl/index.html | 57 -- files/ja/mozilla/tech/xslt_2.0/index.html | 35 - 259 files changed, 22541 deletions(-) delete mode 100644 files/ja/mozilla/tech/accessibility/at-apis/gecko/index.html delete mode 100644 files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/index.html delete mode 100644 files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_accel_label/index.html delete mode 100644 files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_alert/index.html delete mode 100644 files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_animation/index.html delete mode 100644 files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_app_root/index.html delete mode 100644 files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_application/index.html delete mode 100644 files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_arrow/index.html delete mode 100644 files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_autocomplete/index.html delete mode 100644 files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_border/index.html delete mode 100644 files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_buttondropdown/index.html delete mode 100644 files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_buttondropdowngrid/index.html delete mode 100644 files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_buttonmenu/index.html delete mode 100644 files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_calendar/index.html delete mode 100644 files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_canvas/index.html delete mode 100644 files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_caption/index.html delete mode 100644 files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_caret/index.html delete mode 100644 files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_cell/index.html delete mode 100644 files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_character/index.html delete mode 100644 files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_chart/index.html delete mode 100644 files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_check_menu_item/index.html delete mode 100644 files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_checkbutton/index.html delete mode 100644 files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_chrome_window/index.html delete mode 100644 files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_clock/index.html delete mode 100644 files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_color_chooser/index.html delete mode 100644 files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_columnheader/index.html delete mode 100644 files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_combobox/index.html delete mode 100644 files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_combobox_list/index.html delete mode 100644 files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_combobox_option/index.html delete mode 100644 files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_cursor/index.html delete mode 100644 files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_date_editor/index.html delete mode 100644 files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_desktop_frame/index.html delete mode 100644 files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_desktop_icon/index.html delete mode 100644 files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_diagram/index.html delete mode 100644 files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_dial/index.html delete mode 100644 files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_dialog/index.html delete mode 100644 files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_directory_pane/index.html delete mode 100644 files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_document/index.html delete mode 100644 files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_document_frame/index.html delete mode 100644 files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_droplist/index.html delete mode 100644 files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_editbar/index.html delete mode 100644 files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_entry/index.html delete mode 100644 files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_equation/index.html delete mode 100644 files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_file_chooser/index.html delete mode 100644 files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_font_chooser/index.html delete mode 100644 files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_footer/index.html delete mode 100644 files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_form/index.html delete mode 100644 files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_glass_pane/index.html delete mode 100644 files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_graphic/index.html delete mode 100644 files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_grip/index.html delete mode 100644 files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_grouping/index.html delete mode 100644 files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_header/index.html delete mode 100644 files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_heading/index.html delete mode 100644 files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_helpballoon/index.html delete mode 100644 files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_hotkeyfield/index.html delete mode 100644 files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_html_container/index.html delete mode 100644 files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_icon/index.html delete mode 100644 files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_image_map/index.html delete mode 100644 files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_ime/index.html delete mode 100644 files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_indicator/index.html delete mode 100644 files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_internal_frame/index.html delete mode 100644 files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_ipaddress/index.html delete mode 100644 files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_label/index.html delete mode 100644 files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_layered_pane/index.html delete mode 100644 files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_link/index.html delete mode 100644 files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_list/index.html delete mode 100644 files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_listbox/index.html delete mode 100644 files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_listitem/index.html delete mode 100644 files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_menubar/index.html delete mode 100644 files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_menuitem/index.html delete mode 100644 files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_menupopup/index.html delete mode 100644 files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_nothing/index.html delete mode 100644 files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_option/index.html delete mode 100644 files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_option_pane/index.html delete mode 100644 files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_outline/index.html delete mode 100644 files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_outlineitem/index.html delete mode 100644 files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_page/index.html delete mode 100644 files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_pagetab/index.html delete mode 100644 files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_pagetablist/index.html delete mode 100644 files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_pane/index.html delete mode 100644 files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_paragraph/index.html delete mode 100644 files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_parent_menuitem/index.html delete mode 100644 files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_password_text/index.html delete mode 100644 files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_popup_menu/index.html delete mode 100644 files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_progressbar/index.html delete mode 100644 files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_propertypage/index.html delete mode 100644 files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_pushbutton/index.html delete mode 100644 files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_radio_menu_item/index.html delete mode 100644 files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_radiobutton/index.html delete mode 100644 files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_redundant_object/index.html delete mode 100644 files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_rich_option/index.html delete mode 100644 files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_root_pane/index.html delete mode 100644 files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_row/index.html delete mode 100644 files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_ruler/index.html delete mode 100644 files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_scroll_pane/index.html delete mode 100644 files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_scrollbar/index.html delete mode 100644 files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_section/index.html delete mode 100644 files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_separator/index.html delete mode 100644 files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_slider/index.html delete mode 100644 files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_sound/index.html delete mode 100644 files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_spinbutton/index.html delete mode 100644 files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_split_pane/index.html delete mode 100644 files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_statusbar/index.html delete mode 100644 files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_table/index.html delete mode 100644 files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_table_column_header/index.html delete mode 100644 files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_table_row_header/index.html delete mode 100644 files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_tear_off_menu_item/index.html delete mode 100644 files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_terminal/index.html delete mode 100644 files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_text_leaf/index.html delete mode 100644 files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_titlebar/index.html delete mode 100644 files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_toggle_button/index.html delete mode 100644 files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_toolbar/index.html delete mode 100644 files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_tooltip/index.html delete mode 100644 files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_tree_table/index.html delete mode 100644 files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_viewport/index.html delete mode 100644 files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_whitespace/index.html delete mode 100644 files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_window/index.html delete mode 100644 files/ja/mozilla/tech/accessibility/at-apis/index.html delete mode 100644 files/ja/mozilla/tech/accessibility/index.html delete mode 100644 files/ja/mozilla/tech/index.html delete mode 100644 files/ja/mozilla/tech/xpcom/accessing_the_windows_registry_using_xpcom/index.html delete mode 100644 files/ja/mozilla/tech/xpcom/fun_with_xbl_and_xpconnect/index.html delete mode 100644 files/ja/mozilla/tech/xpcom/generating_guids/index.html delete mode 100644 files/ja/mozilla/tech/xpcom/generic_factory/index.html delete mode 100644 files/ja/mozilla/tech/xpcom/guide/how_to_build_an_xpcom_component_in_javascript/index.html delete mode 100644 files/ja/mozilla/tech/xpcom/guide/index.html delete mode 100644 files/ja/mozilla/tech/xpcom/guide/mozilla_internal_string_guide/index.html delete mode 100644 files/ja/mozilla/tech/xpcom/guide/xpcom_hashtable_guide/index.html delete mode 100644 files/ja/mozilla/tech/xpcom/index.html delete mode 100644 files/ja/mozilla/tech/xpcom/interfacing_with_the_xpcom_cycle_collector/index.html delete mode 100644 files/ja/mozilla/tech/xpcom/introduction_to_xpcom_for_the_dom/index.html delete mode 100644 files/ja/mozilla/tech/xpcom/language_bindings/components.classes/index.html delete mode 100644 files/ja/mozilla/tech/xpcom/language_bindings/components.classesbyid/index.html delete mode 100644 files/ja/mozilla/tech/xpcom/language_bindings/components.constructor/index.html delete mode 100644 files/ja/mozilla/tech/xpcom/language_bindings/components.exception/index.html delete mode 100644 files/ja/mozilla/tech/xpcom/language_bindings/components.id/index.html delete mode 100644 files/ja/mozilla/tech/xpcom/language_bindings/components.interfaces/index.html delete mode 100644 files/ja/mozilla/tech/xpcom/language_bindings/components.lastresult/index.html delete mode 100644 files/ja/mozilla/tech/xpcom/language_bindings/components.manager/index.html delete mode 100644 files/ja/mozilla/tech/xpcom/language_bindings/components.results/index.html delete mode 100644 files/ja/mozilla/tech/xpcom/language_bindings/components.returncode/index.html delete mode 100644 files/ja/mozilla/tech/xpcom/language_bindings/components.stack/index.html delete mode 100644 files/ja/mozilla/tech/xpcom/language_bindings/components.utils.evalinsandbox/index.html delete mode 100644 files/ja/mozilla/tech/xpcom/language_bindings/components.utils.forcegc/index.html delete mode 100644 files/ja/mozilla/tech/xpcom/language_bindings/components.utils.getweakreference/index.html delete mode 100644 files/ja/mozilla/tech/xpcom/language_bindings/components.utils.import/index.html delete mode 100644 files/ja/mozilla/tech/xpcom/language_bindings/components.utils.reporterror/index.html delete mode 100644 files/ja/mozilla/tech/xpcom/language_bindings/components.utils/index.html delete mode 100644 files/ja/mozilla/tech/xpcom/language_bindings/components_object/index.html delete mode 100644 files/ja/mozilla/tech/xpcom/language_bindings/index.html delete mode 100644 files/ja/mozilla/tech/xpcom/language_bindings/javaxpcom/development/index.html delete mode 100644 files/ja/mozilla/tech/xpcom/language_bindings/javaxpcom/embedding_mozilla_in_a_java_application_using_javaxpcom/index.html delete mode 100644 files/ja/mozilla/tech/xpcom/language_bindings/javaxpcom/examples/index.html delete mode 100644 files/ja/mozilla/tech/xpcom/language_bindings/javaxpcom/index.html delete mode 100644 files/ja/mozilla/tech/xpcom/language_bindings/javaxpcom/other_resources/index.html delete mode 100644 files/ja/mozilla/tech/xpcom/language_bindings/plxpcom/index.html delete mode 100644 files/ja/mozilla/tech/xpcom/language_bindings/pyxpcom/index.html delete mode 100644 files/ja/mozilla/tech/xpcom/language_bindings/rbxpcom/index.html delete mode 100644 files/ja/mozilla/tech/xpcom/reference/components/index.html delete mode 100644 files/ja/mozilla/tech/xpcom/reference/components/nscategorymanager/index.html delete mode 100644 files/ja/mozilla/tech/xpcom/reference/components/nsdirectoryservice/index.html delete mode 100644 files/ja/mozilla/tech/xpcom/reference/components/nslocalfile/index.html delete mode 100644 files/ja/mozilla/tech/xpcom/reference/components/nsobserverservice/index.html delete mode 100644 files/ja/mozilla/tech/xpcom/reference/components/nsscriptableinputstream/index.html delete mode 100644 files/ja/mozilla/tech/xpcom/reference/glue_classes/index.html delete mode 100644 files/ja/mozilla/tech/xpcom/reference/glue_classes/nscomptr/index.html delete mode 100644 files/ja/mozilla/tech/xpcom/reference/index.html delete mode 100644 files/ja/mozilla/tech/xpcom/reference/ns_ensure_true/index.html delete mode 100644 files/ja/mozilla/tech/xpcom/reference/xpcom_interface_reference/imgiloader/index.html delete mode 100644 files/ja/mozilla/tech/xpcom/reference/xpcom_interface_reference/index.html delete mode 100644 files/ja/mozilla/tech/xpcom/reference/xpcom_interface_reference/mozijssubscriptloader/index.html delete mode 100644 files/ja/mozilla/tech/xpcom/reference/xpcom_interface_reference/moziregistry/index.html delete mode 100644 files/ja/mozilla/tech/xpcom/reference/xpcom_interface_reference/mozistoragestatementparams/index.html delete mode 100644 files/ja/mozilla/tech/xpcom/reference/xpcom_interface_reference/nsiaccessible/index.html delete mode 100644 files/ja/mozilla/tech/xpcom/reference/xpcom_interface_reference/nsiaccessibleprovider/index.html delete mode 100644 files/ja/mozilla/tech/xpcom/reference/xpcom_interface_reference/nsiannotationobserver/index.html delete mode 100644 files/ja/mozilla/tech/xpcom/reference/xpcom_interface_reference/nsiasyncinputstream/index.html delete mode 100644 files/ja/mozilla/tech/xpcom/reference/xpcom_interface_reference/nsiconsoleservice/index.html delete mode 100644 files/ja/mozilla/tech/xpcom/reference/xpcom_interface_reference/nsicontentprefobserver/index.html delete mode 100644 files/ja/mozilla/tech/xpcom/reference/xpcom_interface_reference/nsicontentprefservice/index.html delete mode 100644 files/ja/mozilla/tech/xpcom/reference/xpcom_interface_reference/nsicryptohash/index.html delete mode 100644 files/ja/mozilla/tech/xpcom/reference/xpcom_interface_reference/nsidomfile/index.html delete mode 100644 files/ja/mozilla/tech/xpcom/reference/xpcom_interface_reference/nsidomfileexception/index.html delete mode 100644 files/ja/mozilla/tech/xpcom/reference/xpcom_interface_reference/nsidomfilelist/index.html delete mode 100644 files/ja/mozilla/tech/xpcom/reference/xpcom_interface_reference/nsidomhtmlmediaelement/index.html delete mode 100644 files/ja/mozilla/tech/xpcom/reference/xpcom_interface_reference/nsidomofflineresourcelist/index.html delete mode 100644 files/ja/mozilla/tech/xpcom/reference/xpcom_interface_reference/nsidomsimplegestureevent/index.html delete mode 100644 files/ja/mozilla/tech/xpcom/reference/xpcom_interface_reference/nsidownload/index.html delete mode 100644 files/ja/mozilla/tech/xpcom/reference/xpcom_interface_reference/nsidownloadmanager/index.html delete mode 100644 files/ja/mozilla/tech/xpcom/reference/xpcom_interface_reference/nsidownloadmanagerui/index.html delete mode 100644 files/ja/mozilla/tech/xpcom/reference/xpcom_interface_reference/nsidownloadprogresslistener/index.html delete mode 100644 files/ja/mozilla/tech/xpcom/reference/xpcom_interface_reference/nsidragservice/index.html delete mode 100644 files/ja/mozilla/tech/xpcom/reference/xpcom_interface_reference/nsieffectivetldservice/index.html delete mode 100644 files/ja/mozilla/tech/xpcom/reference/xpcom_interface_reference/nsienumerator/index.html delete mode 100644 files/ja/mozilla/tech/xpcom/reference/xpcom_interface_reference/nsifeed/index.html delete mode 100644 files/ja/mozilla/tech/xpcom/reference/xpcom_interface_reference/nsifeedcontainer/index.html delete mode 100644 files/ja/mozilla/tech/xpcom/reference/xpcom_interface_reference/nsifeedelementbase/index.html delete mode 100644 files/ja/mozilla/tech/xpcom/reference/xpcom_interface_reference/nsifeedentry/index.html delete mode 100644 files/ja/mozilla/tech/xpcom/reference/xpcom_interface_reference/nsifeedgenerator/index.html delete mode 100644 files/ja/mozilla/tech/xpcom/reference/xpcom_interface_reference/nsifeedperson/index.html delete mode 100644 files/ja/mozilla/tech/xpcom/reference/xpcom_interface_reference/nsifeedprocessor/index.html delete mode 100644 files/ja/mozilla/tech/xpcom/reference/xpcom_interface_reference/nsifeedprogresslistener/index.html delete mode 100644 files/ja/mozilla/tech/xpcom/reference/xpcom_interface_reference/nsifeedresult/index.html delete mode 100644 files/ja/mozilla/tech/xpcom/reference/xpcom_interface_reference/nsifeedresultlistener/index.html delete mode 100644 files/ja/mozilla/tech/xpcom/reference/xpcom_interface_reference/nsifeedtextconstruct/index.html delete mode 100644 files/ja/mozilla/tech/xpcom/reference/xpcom_interface_reference/nsihttpactivitydistributor/index.html delete mode 100644 files/ja/mozilla/tech/xpcom/reference/xpcom_interface_reference/nsihttpactivityobserver/index.html delete mode 100644 files/ja/mozilla/tech/xpcom/reference/xpcom_interface_reference/nsihttpchannel/index.html delete mode 100644 files/ja/mozilla/tech/xpcom/reference/xpcom_interface_reference/nsiidleservice/index.html delete mode 100644 files/ja/mozilla/tech/xpcom/reference/xpcom_interface_reference/nsiinputstream/index.html delete mode 100644 files/ja/mozilla/tech/xpcom/reference/xpcom_interface_reference/nsiioservice/index.html delete mode 100644 files/ja/mozilla/tech/xpcom/reference/xpcom_interface_reference/nsijscid/index.html delete mode 100644 files/ja/mozilla/tech/xpcom/reference/xpcom_interface_reference/nsijson/index.html delete mode 100644 files/ja/mozilla/tech/xpcom/reference/xpcom_interface_reference/nsilogininfo/index.html delete mode 100644 files/ja/mozilla/tech/xpcom/reference/xpcom_interface_reference/nsiloginmanager/index.html delete mode 100644 files/ja/mozilla/tech/xpcom/reference/xpcom_interface_reference/nsiobserver/index.html delete mode 100644 files/ja/mozilla/tech/xpcom/reference/xpcom_interface_reference/nsiobserverservice/index.html delete mode 100644 files/ja/mozilla/tech/xpcom/reference/xpcom_interface_reference/nsioutputstream/index.html delete mode 100644 files/ja/mozilla/tech/xpcom/reference/xpcom_interface_reference/nsiparentalcontrolsservice/index.html delete mode 100644 files/ja/mozilla/tech/xpcom/reference/xpcom_interface_reference/nsiparserutils/index.html delete mode 100644 files/ja/mozilla/tech/xpcom/reference/xpcom_interface_reference/nsipassword/index.html delete mode 100644 files/ja/mozilla/tech/xpcom/reference/xpcom_interface_reference/nsipasswordmanager/index.html delete mode 100644 files/ja/mozilla/tech/xpcom/reference/xpcom_interface_reference/nsiplacesview/index.html delete mode 100644 files/ja/mozilla/tech/xpcom/reference/xpcom_interface_reference/nsiprefbranch/index.html delete mode 100644 files/ja/mozilla/tech/xpcom/reference/xpcom_interface_reference/nsiscriptableunescapehtml/index.html delete mode 100644 files/ja/mozilla/tech/xpcom/reference/xpcom_interface_reference/nsiscriptableunicodeconverter/index.html delete mode 100644 files/ja/mozilla/tech/xpcom/reference/xpcom_interface_reference/nsisessionstore/index.html delete mode 100644 files/ja/mozilla/tech/xpcom/reference/xpcom_interface_reference/nsisupports_proxies/index.html delete mode 100644 files/ja/mozilla/tech/xpcom/reference/xpcom_interface_reference/nsitaggingservice/index.html delete mode 100644 files/ja/mozilla/tech/xpcom/reference/xpcom_interface_reference/nsithread/index.html delete mode 100644 files/ja/mozilla/tech/xpcom/reference/xpcom_interface_reference/nsithreadeventfilter/index.html delete mode 100644 files/ja/mozilla/tech/xpcom/reference/xpcom_interface_reference/nsithreadinternal/index.html delete mode 100644 files/ja/mozilla/tech/xpcom/reference/xpcom_interface_reference/nsithreadmanager/index.html delete mode 100644 files/ja/mozilla/tech/xpcom/reference/xpcom_interface_reference/nsithreadobserver/index.html delete mode 100644 files/ja/mozilla/tech/xpcom/reference/xpcom_interface_reference/nsithreadpool/index.html delete mode 100644 files/ja/mozilla/tech/xpcom/reference/xpcom_interface_reference/nsiwebprogresslistener/index.html delete mode 100644 files/ja/mozilla/tech/xpcom/reference/xpcom_interface_reference/nsiwindowmediator/index.html delete mode 100644 files/ja/mozilla/tech/xpcom/reference/xpcom_interface_reference/nsixmlhttprequest/index.html delete mode 100644 files/ja/mozilla/tech/xpcom/reference/xpcom_interface_reference/nsizipentry/index.html delete mode 100644 files/ja/mozilla/tech/xpcom/reference/xpcom_interface_reference/nsizipreader/index.html delete mode 100644 files/ja/mozilla/tech/xpcom/reference/xpcom_interface_reference/nsizipwriter/index.html delete mode 100644 files/ja/mozilla/tech/xpcom/reference/xpcom_interface_reference_group/index.html delete mode 100644 files/ja/mozilla/tech/xpcom/setting_http_request_headers/index.html delete mode 100644 files/ja/mozilla/tech/xpcom/storage/index.html delete mode 100644 files/ja/mozilla/tech/xpcom/the_thread_manager/index.html delete mode 100644 files/ja/mozilla/tech/xpcom/using_nscomptr/frequently_asked_questions/index.html delete mode 100644 files/ja/mozilla/tech/xpcom/using_nscomptr/getting_started_guide/index.html delete mode 100644 files/ja/mozilla/tech/xpcom/using_nscomptr/index.html delete mode 100644 files/ja/mozilla/tech/xpcom/using_nscomptr/reference_manual/index.html delete mode 100644 files/ja/mozilla/tech/xpcom/using_nscomptr/status,_recent_changes,_and_plans/index.html delete mode 100644 files/ja/mozilla/tech/xpcom/weak_reference/index.html delete mode 100644 files/ja/mozilla/tech/xpcom/wrappedjsobject/index.html delete mode 100644 files/ja/mozilla/tech/xpcom/xpcom_abi/index.html delete mode 100644 files/ja/mozilla/tech/xpcom/xpcom_ownership_guidelines/index.html delete mode 100644 files/ja/mozilla/tech/xpcom/xptcall_faq/index.html delete mode 100644 files/ja/mozilla/tech/xpidl/generating_xpt_on_windows/index.html delete mode 100644 files/ja/mozilla/tech/xpidl/index.html delete mode 100644 files/ja/mozilla/tech/xpidl/xpidl/index.html delete mode 100644 files/ja/mozilla/tech/xslt_2.0/index.html (limited to 'files/ja/mozilla/tech') diff --git a/files/ja/mozilla/tech/accessibility/at-apis/gecko/index.html b/files/ja/mozilla/tech/accessibility/at-apis/gecko/index.html deleted file mode 100644 index 709114d7ea..0000000000 --- a/files/ja/mozilla/tech/accessibility/at-apis/gecko/index.html +++ /dev/null @@ -1,5 +0,0 @@ ---- -title: Gecko -slug: Mozilla/Tech/Accessibility/AT-APIs/Gecko ---- -This page was auto-generated because a user created a sub-page to this page. diff --git a/files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/index.html b/files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/index.html deleted file mode 100644 index 582be09b29..0000000000 --- a/files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/index.html +++ /dev/null @@ -1,496 +0,0 @@ ---- -title: Gecko Roles -slug: Mozilla/Tech/Accessibility/AT-APIs/Gecko/Roles -tags: - - AT_APIs - - Accessibility - - Reference -translation_of: Mozilla/Tech/Accessibility/AT-APIs/Gecko/Roles ---- -

« AT APIs Support ページ

-

以下のリストは Gecko で使用されるアクセシブル role です。Role 定数 は nsIAccessibleRole インタフェースで定義されています。

-
-
- ROLE_NOTHING
-
- accessible アイテムが、明確に定義された role を持っていない場合に使用されます。
-
- ROLE_TITLEBAR
-
- ウィンドウのタイトルバーまたはキャプションバーを表します。これは MSAA のみで使用されるため、MS Windows によって自動的にサポートされます。
-
- ROLE_MENUBAR
-
- ユーザによって選択された (ウィンドウのタイトルバーのすぐ下に位置するか、Mac OS X では画面最上部) メニューバーを表します。
-
- ROLE_SCROLLBAR
-
- 垂直または水平スクロールバーを表します。クライアント領域の一部か、コントロール内で使用されます。
-
- ROLE_GRIP
-
- 特別なマウスポインタを表します。ウィンドウなどのユーザインタフェース要素をユーザに操作させます。例えば、ユーザがウィンドウ右下隅のサイズ変更グリップをクリックし、そのサイズを変更するためにドラッグします。
-
- ROLE_SOUND
-
- システムサウンドを表します。様々なシステムイベントに関連付けられます。
-
- ROLE_CURSOR
-
- システムのマウスポインタを表します。
-
- ROLE_CARET
-
- システムのキャレットを表します。
-
- ROLE_ALERT
-
- ユーザに注意を促す alert または condition を表します。支援技術は一般的に、この role を広告するコンテナの全スクリーン上のコンテンツを読むことによって、role に反応します。警告ダイアログなどで使用してください。
-
- ROLE_WINDOW
-
- ウィンドウ枠を表します。タイトルバーやクライアント、ウィンドウに含まれる他のオブジェクトなどの子オブジェクトを含みます。この role は MS Windows によって自動的にサポートされます。
-
- ROLE_INTERNAL_FRAME
-
- サブドキュメントです。
-
- ROLE_MENUPOPUP
-
- メニューを表します。実行する操作をユーザに選択させるための、オプションの一覧を提供します。
-
- ROLE_MENUITEM
-
- メニュー項目を表します。実行するコマンドやオプションをユーザに選択させるための、メニュー内のエントリです。
-
- ROLE_TOOLTIP
-
- 役立つヒントを提供するツールチップを表します。一般的にマウスカーソルの位置に表示されます。
-
- ROLE_APPLICATION
-
- アプリケーションのメインウィンドウを表します。
-
- ROLE_DOCUMENT
-
- ドキュメントウィンドウを表します。ドキュメントウィンドウは常にアプリケーションウィンドウ内に含まれます。
-
- ROLE_PANE
-
- フレームウィンドウやドキュメントウィンドウ内のペインを表します。ユーザは他のペインと現在のペインのコンテンツ内の間を移動できますが、異なるペイン内の項目間は移動できません。このように、ペインはフレームウィンドウやドキュメントより下位、個々のコントロールよりも上位のグループレベルを表します。
-
- ROLE_CHART
-
- データの提供に使用されるグラフィカルな画像を表します。
-
- ROLE_DIALOG
-
- ダイアログボックスまたはメッセージボックスを表します。
-
- ROLE_BORDER
-
- ウィンドウの境界線を表します。
-
- ROLE_GROUPING
-
- その他のオブジェクトを論理的にグループ化します。
-
- ROLE_SEPARATOR
-
- separator メニュー項目やウィンドウ内のペインを分割するバーなど、空間を二つの領域に視覚的に分割するために使用されます。
-
- ROLE_TOOLBAR
-
- ツールバーを表します。よく使用される機能への簡単なアクセスを提供するコントロール (プッシュボタンやトグルボタン) のグループです。
-
- ROLE_STATUSBAR
-
- ステータスバーを表します。現在の操作やアプリケーションの状態、選択したオブジェクトについての情報を表示する、ウィンドウ下部の領域です。ステータスバーには異なる種類の情報を表示する複数のフィールドがあります。
-
- ROLE_TABLE
-
- セルの行と列を含むテーブルを表します。また、任意で行ヘッダと列ヘッダが含まれます。
-
- ROLE_COLUMNHEADER
-
- 列ヘッダを表します。テーブルの列のための視覚的なラベルを提供します。
-
- ROLE_ROWHEADER
-
- 行ヘッダを表します。テーブルの行のための視覚的なラベルを提供します。
-
- ROLE_COLUMN
-
- テーブル内のセルの列を表します。
-
- ROLE_ROW
-
- テーブル内のセルの行を表します。
-
- ROLE_CELL
-
- テーブル内のセルを表します。
-
- ROLE_LINK
-
- 何かへのリンクを表します。このオブジェクトはテキストやグラフィックで表現されますが、ボタンのように動作します。
-
- ROLE_HELPBALLOON
-
- ツールチップやヘルプバルーンのフォーム内のヘルプトピックを表示します。
-
- ROLE_CHARACTER
-
- Microsoft Office アシスタントなどのアニメのようなグラフィックオブジェクトを表します。アプリケーションのヘルプをユーザに提供するために表示されます。
-
- ROLE_LIST
-
- リストボックスを表します。ユーザは一個以上の項目を選択できます。
-
- ROLE_LISTITEM
-
- リスト内の項目を表します。
-
- ROLE_OUTLINE
-
- ツリービューコントロールなどのアウトライン構造またはツリー構造を表します。階層的なリストを表示し、ユーザは下層の展開と折り畳みができます。
-
- ROLE_OUTLINEITEM
-
- アウトライン構造やツリー構造内の項目を表します。
-
- ROLE_PAGETAB
-
- ページタブを表します。これはページタブリストの子要素です。
-
- ROLE_PROPERTYPAGE
-
- プロパティシートを表します。
-
- ROLE_INDICATOR
-
- 現在の項目を指し示すポインタ画像などのインジケータを表します。
-
- ROLE_GRAPHIC
-
- 画像を表します。
-
- ROLE_STATICTEXT
-
- 他のコントロールのためのラベルやダイアログボックス内の説明など、読み取り専用テキストを表します。静的テキストは変更や選択ができません。
-
- ROLE_TEXT_LEAF
-
- 選択可能なテキストを表します。編集したり読み取り専用にできます。
-
- ROLE_PUSHBUTTON
-
- プッシュボタンコントロールを表します。
-
- ROLE_CHECKBUTTON
-
- チェックボックスコントロールを表します。
-
- ROLE_RADIOBUTTON
-
- オプションボタンを表します。ラジオボタンとも呼ばれています。これは排他的なグループの一つです。すべてのオブジェクトは、この属性を持つ一つの親要素を共有しており、一つの排他的なグループの一部と仮定されます。
-
- ROLE_COMBOBOX
-
- コンボボックスを表します。予め選択されたセットを提供するリストボックスに関連付けられた編集コントロールです。
-
- ROLE_DROPLIST
-
- カレンダーコントロールを表します。
-
- ROLE_PROGRESSBAR
-
- 進捗バーを表します。ユーザに作業中の操作の現在の達成度を表示します。
-
- ROLE_DIAL
-
- ユーザに値を設定させるダイアルまたはノブを表します。
-
- ROLE_HOTKEYFIELD
-
- ホットキーフィールドを表します。ユーザに連続したキーストロークや、その組み合わせを入力させます。
-
- ROLE_SLIDER
-
- スライダを表します。ユーザに最小値と最大値の間に与えられた値を設定させます。
-
- ROLE_SPINBUTTON
-
- スピンボックスを表します。ユーザに表示された値を増減させるコントロールです。これはスピンボックスに関連付けられた別の "仲間" コントロール内に表示されます。
-
- ROLE_DIAGRAM
-
- ダイアグラムデータに使用される、グラフィカルな画像を表します。
-
- ROLE_ANIMATION
-
- アニメーションコントロールを表します。連続したビットマップフレームを表示するコントロールなど、時間毎に変わるコンテンツを含みます。
-
- ROLE_EQUATION
-
- 数式を表します。これは MATHML によって使用されます。
-
- ROLE_BUTTONDROPDOWN
-
- 項目のリストをドロップダウン表示するボタンを表します。
-
- ROLE_BUTTONMENU
-
- メニューをドロップダウン表示するボタンを表します。
-
- ROLE_BUTTONDROPDOWNGRID
-
- グリッドをドロップダウン表示するボタンを表します。
-
- ROLE_WHITESPACE
-
- オブジェクト間の空白を表します。
-
- ROLE_PAGETABLIST
-
- ページタブコントロールのコンテナを表します。
-
- ROLE_CLOCK
-
- 時刻を表示するコントロールを表します。
-
- ROLE_SPLITBUTTON
-
- ツールバー上のボタンを表します。ドロップダウンリストアイコンがボタンのすぐ隣にあります。
-
- ROLE_IPADDRESS
-
- IP (Internet Protocol) アドレスを入力するための編集コントロールを表します。編集コントロールは入力部分が IP アドレスの数値ごとに区切られています。
-
- ROLE_ACCEL_LABEL
-
- アクセラレータを持つラベルコントロールを表します。
-
- ROLE_ARROW
-
- 主要な 4 方向の矢印のうちの一つを表します。
-
- ROLE_CANVAS
-
- イベントの発生とトラップに使用されるコントロールを表します。
-
- ROLE_CHECK_MENU_ITEM
-
- チェックボックス付きのメニュー項目を表します。
-
- ROLE_COLOR_CHOOSER
-
- ユーザに色を選択させる特別なダイアログを表します。
-
- ROLE_DATE_EDITOR
-
- ユーザに日付を編集させるためのコントロールを表します。
-
- ROLE_DESKTOP_ICON
-
- ROLE_DESKTOP_PANE 内のアイコン化された内部フレーム。
-
- ROLE_DESKTOP_FRAME
-
- デスクトップペイン。内部フレームと、そのアイコン化されたバージョンをサポートするペイン。
-
- ROLE_DIRECTORY_PANE
-
- ディレクトリペイン。ユーザがディレクトリの内容を選択したり操作するためのペイン。ファイルの選択に使用されます。
-
- ROLE_FILE_CHOOSER
-
- ファイル選択ダイアログ。ディレクトリ内のファイルを表示してユーザにファイルを選択させたり、異なるディレクトリや特定のファイル名を閲覧させるための特別なダイアログ。ディレクトリの内容を表示するためにディレクトリペインを使用します。
-
- ROLE_FONT_CHOOSER
-
- フォント選択ダイアログ。フォント選択ダイアログは、ユーザに様々な属性のフォントを選択させるコンポーネントです。
-
- ROLE_CHROME_WINDOW
-
- フレーム role です。タイトルバー、境界線、メニューバーなどを持つトップレベルのウィンドウ。アプリケーションの最初のウィンドウとしてよく使用されます。
-
- ROLE_GLASS_PANE
-
- ガラスペイン。すべてのペインより前面に描かれることが保証されたペイン。
-
- ROLE_HTML_CONTAINER
-
- HTML のためのドキュメントコンテナ。このコンテナの子要素は document の内容を提供します。
-
- ROLE_ICON
-
- 小さな固定サイズの画像。一般的にはコンポーネントの飾りに使用されます。
-
- ROLE_LABEL
-
- インターフェースのアイコンまたは短い文字列を提供します。
-
- ROLE_LAYERED_PANE
-
- 階層化ペイン。子要素をスタック順の外観を提供しているレイヤー内に描画する特別なペイン。通常は、ウィンドウ内のほとんどの視覚的なコンポ―テントとメニューバーを保持するペインです。
-
- ROLE_OPTION_PANE
-
- ダイアログの内側で最初に使用される特別なペイン。
-
- ROLE_PASSWORD_TEXT
-
- パスワードなど、テキストの内容がユーザに分からないように表示されるテキストオブジェクトです。
-
- ROLE_POPUP_MENU
-
- ユーザに選択肢の一覧を提供する一時的なウィンドウ。ユーザが一覧から一つを選択すると隠されます。
-
- ROLE_RADIO_MENU_ITEM
-
- メニュー項目のラジオボタンです。
-
- ROLE_ROOT_PANE
-
- ルートペインです。ガラスペインや階層化ペインを子要素に持つ特別なペイン。この子要素にはスクロールバーやビューポートを含むことができます。
-
- ROLE_SCROLL_PANE
-
- スクロールペインです。大量の情報をユーザが順次表示できるオブジェクト。
-
- ROLE_SPLIT_PANE
-
- 分割ペインです。同時に 2 つのパネルを提供する特別なパネル。2 つのパネルの間は、ユーザがその大きさを変更することができる仕切りになっています。
-
- ROLE_TABLE_COLUMN_HEADER
-
- テーブルの列のためのヘッダです。
-
- ROLE_TABLE_ROW_HEADER
-
- テーブルの行のためのヘッダです。
-
- ROLE_TEAR_OFF_MENU_ITEM
-
- 着脱可能なメニュー項目です。
-
- ROLE_TERMINAL
-
- アクセシブルターミナルを表します。
-
- ROLE_TEXT_CONTAINER
-
- 論理的なテキスト実体を構成するオブジェクトのコレクションです。
-
- ROLE_TOGGLE_BUTTON
-
- 切り替えボタンです。チェックを入れたり外したりできる特別な押しボタン。現在の状態を示すインジケータは提供しません。
-
- ROLE_TREE_TABLE
-
- 複数行のデータ表示を展開したり折り畳んだりできるコントロールを表します。複数列のデータも表示できます。
-
- ROLE_VIEWPORT
-
- ビューポートです。通常はスクロールペイン内で使用されるオブジェクト。ユーザが見ることができるデータ全体の一部分を提供します。ユーザがスクロールバーを操作してビューポートに表示する部分を変更できます。
-
- ROLE_HEADER
-
- ドキュメントページのヘッダです。
-
- ROLE_FOOTER
-
- ドキュメントページのフッタです。
-
- ROLE_PARAGRAPH
-
- テキストの段落です。
-
- ROLE_RULER
-
- ワープロなどで使用される定規です。
-
- ROLE_AUTOCOMPLETE
-
- エントリウィジェットに挿入する項目を含むダイアログあるいはリストを持つテキストエントリ。つまり、テキストエントリを補完する語のリストです。
-
- ROLE_EDITBAR
-
- ツールバー内の編集可能なテキストオブジェクト。
-
- ROLE_ENTRY
-
- ユーザによって入力または変更されるテキスト内容のコントロール。
-
- ROLE_CAPTION
-
- 他のオブジェクトを説明するキャプションです。
-
- ROLE_DOCUMENT_FRAME
-
- ドキュメント内容の表示領域を含む視覚的なフレームまたはコンテナです。ドキュメントフレームは他のドキュメント実体内に発生します。この場合、2 番目のドキュメントは包含する実体内に埋め込まれます。大抵の HTML フレームは ROLE_DOCUMENT_FRAME です。このオブジェクトや単体の子孫は Document インタフェースを実装します。
-
- ROLE_HEADING
-
- 見出しです。
-
- ROLE_PAGE
-
- ドキュメント内容のページを表すオブジェクト。ユーザがページを基準にしてアクセスするドキュメント内で使用されます。
-
- ROLE_SECTION
-
- ドキュメント内容のコンテナです。
-
- ROLE_REDUNDANT_OBJECT
-
- アクセシブルな階層内の他のオブジェクトと重複するオブジェクト。支援技術 (AT)は、この role を持つオブジェクトを無視します。
-
- ROLE_FORM
-
- フォームコントロールのコンテナです。
-
- ROLE_IME
-
- キーボード上に無い文字を入力するために使用されるオブジェクト。例えば、英語キーボードで中国語を入力する場合など。
-
- ROLE_APP_ROOT
-
- ???
-
- ROLE_PARENT_MENUITEM
-
- メニュー項目を表します。これはユーザが選択して別のメニューを表示できるメニュー内のエントリです。
-
- ROLE_CALENDAR
-
- ユーザに日付を選択させるカレンダーです。
-
- ROLE_COMBOBOX_LIST
-
- コンボボックスによって表示される項目のリストです。
-
- ROLE_COMBOBOX_OPTION
-
- コンボボックスによって表示されるリストの項目です。
-
- ROLE_IMAGE_MAP
-
- イメージマップです。子リンクを表す領域を持ちます。
-
- ROLE_OPTION
-
- リストボックス内のオプションです。
-
- ROLE_RICH_OPTION
-
- リストボックス内のリッチオプションです。他のウィジェットを子要素として持つことができます。
-
- ROLE_LISTBOX
-
- オプションのリストです。
-
-
-

編注: ROLE_ のテンプレートを使用してアクセシブル role への参照を取得してください。ROLE_MENUITEM のように表示されます。

-
diff --git a/files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_accel_label/index.html b/files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_accel_label/index.html deleted file mode 100644 index de5747c491..0000000000 --- a/files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_accel_label/index.html +++ /dev/null @@ -1,30 +0,0 @@ ---- -title: ROLE_ACCEL_LABEL -slug: Mozilla/Tech/Accessibility/AT-APIs/Gecko/Roles/ROLE_ACCEL_LABEL -tags: - - AT_APIs - - Accessibility - - Reference - - Référence(2) -translation_of: Mozilla/Tech/Accessibility/AT-APIs/Gecko/Roles/ROLE_ACCEL_LABEL ---- -

« Gecko Roles ページ

- -

アクセラレータを持つラベルコントロールを表します。

- -

マッピング

- - - -

使用

- -

使用されていません。

- -

diff --git a/files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_alert/index.html b/files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_alert/index.html deleted file mode 100644 index d03c56080c..0000000000 --- a/files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_alert/index.html +++ /dev/null @@ -1,38 +0,0 @@ ---- -title: ROLE_ALERT -slug: Mozilla/Tech/Accessibility/AT-APIs/Gecko/Roles/ROLE_ALERT -tags: - - AT_APIs - - Accessibility - - Reference -translation_of: Mozilla/Tech/Accessibility/AT-APIs/Gecko/Roles/ROLE_ALERT ---- -

« Gecko Roles ページ

- -

ユーザに通知されるべき警告または条件を表します。支援技術は、一般的に、このロールの内容を告げるコンテナの画面上のコンテンツ全体を読み上げることにより、ロールに応答します。警告ダイアログ等で使用してください。

- -

別名

- - - -

イベント

- - - -

使用する要素

- - - -

diff --git a/files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_animation/index.html b/files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_animation/index.html deleted file mode 100644 index 81d333e72b..0000000000 --- a/files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_animation/index.html +++ /dev/null @@ -1,30 +0,0 @@ ---- -title: ROLE_ANIMATION -slug: Mozilla/Tech/Accessibility/AT-APIs/Gecko/Roles/ROLE_ANIMATION -tags: - - AT_APIs - - Accessibility - - Reference - - Référence(2) -translation_of: Mozilla/Tech/Accessibility/AT-APIs/Gecko/Roles/ROLE_ANIMATION ---- -

« Gecko Roles ページ

- -

例えばビットマップの一連のフレームを表示するコントロールといった、時間の経過とともに変化するコンテンツを含むアニメーションコントロールを表します。

- -

マッピング

- - - -

使用

- -

使用されていません。

- -

diff --git a/files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_app_root/index.html b/files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_app_root/index.html deleted file mode 100644 index cbe8078631..0000000000 --- a/files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_app_root/index.html +++ /dev/null @@ -1,26 +0,0 @@ ---- -title: ROLE_APP_ROOT -slug: Mozilla/Tech/Accessibility/AT-APIs/Gecko/Roles/ROLE_APP_ROOT -tags: - - AT_APIs - - Accessibility - - Reference - - Référence(2) -translation_of: Mozilla/Tech/Accessibility/AT-APIs/Gecko/Roles/ROLE_APP_ROOT ---- -

« Gecko Roles ページ

- -

欧米のキーボード上での漢字の入力のような、キーボードにない文字の入力を可能にするために使用されるオブジェクト。

- -

マッピング

- - - -

使用

- -

使用されていません

diff --git a/files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_application/index.html b/files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_application/index.html deleted file mode 100644 index 4d430e70c9..0000000000 --- a/files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_application/index.html +++ /dev/null @@ -1,34 +0,0 @@ ---- -title: ROLE_APPLICATION -slug: Mozilla/Tech/Accessibility/AT-APIs/Gecko/Roles/ROLE_APPLICATION -tags: - - AT_APIs - - Accessibility - - Reference -translation_of: Mozilla/Tech/Accessibility/AT-APIs/Gecko/Roles/ROLE_APPLICATION ---- -

« Gecko Roles ページ

-

アプリケーションのメインウィンドウを表します。ROLE_APP_ROOT も参照してください。

-

インターフェイス

- -

別名

- -

使用する要素

- -

diff --git a/files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_arrow/index.html b/files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_arrow/index.html deleted file mode 100644 index 6ec87b9cf3..0000000000 --- a/files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_arrow/index.html +++ /dev/null @@ -1,30 +0,0 @@ ---- -title: ROLE_ARROW -slug: Mozilla/Tech/Accessibility/AT-APIs/Gecko/Roles/ROLE_ARROW -tags: - - AT_APIs - - Accessibility - - Reference - - Référence(2) -translation_of: Mozilla/Tech/Accessibility/AT-APIs/Gecko/Roles/ROLE_ARROW ---- -

« Gecko Roles ページ

- -

東西南北方向のいずれかの矢印を表します。

- -

マッピング

- - - -

使用

- -

使用されていません。

- -

diff --git a/files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_autocomplete/index.html b/files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_autocomplete/index.html deleted file mode 100644 index 149af27745..0000000000 --- a/files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_autocomplete/index.html +++ /dev/null @@ -1,30 +0,0 @@ ---- -title: ROLE AUTOCOMPLETE -slug: Mozilla/Tech/Accessibility/AT-APIs/Gecko/Roles/ROLE_AUTOCOMPLETE -tags: - - AT_APIs - - Accessibility -translation_of: Mozilla/Tech/Accessibility/AT-APIs/Gecko/Roles/ROLE_AUTOCOMPLETE ---- -

 

- -

« Gecko Roles ページ

- -

説明

- -

例えば、テキスト入力の完了に対する単語のリストといった、入力ウィジェットに挿入するためのダイアログまたはアイテムを含むリストを持つテキスト入力。

- -

マッピング

- - - -

使用

- - diff --git a/files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_border/index.html b/files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_border/index.html deleted file mode 100644 index 78104f570c..0000000000 --- a/files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_border/index.html +++ /dev/null @@ -1,23 +0,0 @@ ---- -title: ROLE_BORDER -slug: Mozilla/Tech/Accessibility/AT-APIs/Gecko/Roles/ROLE_BORDER -tags: - - AT_APIs - - Accessibility - - Reference -translation_of: Mozilla/Tech/Accessibility/AT-APIs/Gecko/Roles/ROLE_BORDER ---- -

« Gecko Roles ページ

-

ウィンドウの境界線を表します。

-

別名

- -

使用する要素

-

サポートされていません。

-

diff --git a/files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_buttondropdown/index.html b/files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_buttondropdown/index.html deleted file mode 100644 index 13b259f499..0000000000 --- a/files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_buttondropdown/index.html +++ /dev/null @@ -1,28 +0,0 @@ ---- -title: ROLE_BUTTONDROPDOWN -slug: Mozilla/Tech/Accessibility/AT-APIs/Gecko/Roles/ROLE_BUTTONDROPDOWN -tags: - - AT_APIs - - Accessibility -translation_of: Mozilla/Tech/Accessibility/AT-APIs/Gecko/Roles/ROLE_BUTTONDROPDOWN ---- -

« Gecko Roles ページ

- -

アイテムのリストをドロップダウンするボタンを表します。

- -

マッピング

- - - -

使用

- -

使用されていません。

- -

diff --git a/files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_buttondropdowngrid/index.html b/files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_buttondropdowngrid/index.html deleted file mode 100644 index 2439c01b9c..0000000000 --- a/files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_buttondropdowngrid/index.html +++ /dev/null @@ -1,30 +0,0 @@ ---- -title: ROLE_BUTTONDROPDOWNGRID -slug: Mozilla/Tech/Accessibility/AT-APIs/Gecko/Roles/ROLE_BUTTONDROPDOWNGRID -tags: - - AT_APIs - - Accessibility - - Reference -translation_of: Mozilla/Tech/Accessibility/AT-APIs/Gecko/Roles/ROLE_BUTTONDROPDOWNGRID ---- -

« Gecko Roles ページ

- -

グリッドをドロップダウンするボタンを表します。

- -

マッピング

- - - -

使用

- - - -

diff --git a/files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_buttonmenu/index.html b/files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_buttonmenu/index.html deleted file mode 100644 index 675612d4bd..0000000000 --- a/files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_buttonmenu/index.html +++ /dev/null @@ -1,29 +0,0 @@ ---- -title: ROLE_BUTTONMENU -slug: Mozilla/Tech/Accessibility/AT-APIs/Gecko/Roles/ROLE_BUTTONMENU -tags: - - AT_APIs - - Accessibility - - Reference -translation_of: Mozilla/Tech/Accessibility/AT-APIs/Gecko/Roles/ROLE_BUTTONMENU ---- -

« Gecko Roles ページ

- -

メニューをドロップダウンするボタンを表します。

- -

マッピング

- - - -

使用

- -

使用されていません。

- -

diff --git a/files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_calendar/index.html b/files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_calendar/index.html deleted file mode 100644 index 771b5bdf20..0000000000 --- a/files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_calendar/index.html +++ /dev/null @@ -1,24 +0,0 @@ ---- -title: ROLE_CALENDAR -slug: Mozilla/Tech/Accessibility/AT-APIs/Gecko/Roles/ROLE_CALENDAR -tags: - - AT_APIs - - Accessibility - - NeedsContent - - Reference -translation_of: Mozilla/Tech/Accessibility/AT-APIs/Gecko/Roles/ROLE_CALENDAR ---- -

« Gecko Roles ページ

- -

ユーザーが日付を選択できるカレンダー。

- -

マッピング

- - - -

使用

diff --git a/files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_canvas/index.html b/files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_canvas/index.html deleted file mode 100644 index cde08e0b55..0000000000 --- a/files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_canvas/index.html +++ /dev/null @@ -1,28 +0,0 @@ ---- -title: ROLE_CANVAS -slug: Mozilla/Tech/Accessibility/AT-APIs/Gecko/Roles/ROLE_CANVAS -tags: - - AT_APIs - - Accessibility - - Reference -translation_of: Mozilla/Tech/Accessibility/AT-APIs/Gecko/Roles/ROLE_CANVAS ---- -

« Gecko Roles ページ

- -

イベントに引き込むことができ、イベントをトラップするために使用されるコントロールを表します。

- -

マッピング

- - - -

使用

- - diff --git a/files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_caption/index.html b/files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_caption/index.html deleted file mode 100644 index 627d1d8a0c..0000000000 --- a/files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_caption/index.html +++ /dev/null @@ -1,27 +0,0 @@ ---- -title: ROLE CAPTION -slug: Mozilla/Tech/Accessibility/AT-APIs/Gecko/Roles/ROLE_CAPTION -tags: - - AT_APIs - - Accessibility -translation_of: Mozilla/Tech/Accessibility/AT-APIs/Gecko/Roles/ROLE_CAPTION ---- -

 

- -

« Gecko Roles ページ

- -

説明

- -

別のオブジェクトを説明するキャプション。

- -

マッピング

- - - -

使用

diff --git a/files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_caret/index.html b/files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_caret/index.html deleted file mode 100644 index abda30d55e..0000000000 --- a/files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_caret/index.html +++ /dev/null @@ -1,23 +0,0 @@ ---- -title: ROLE_CARET -slug: Mozilla/Tech/Accessibility/AT-APIs/Gecko/Roles/ROLE_CARET -tags: - - AT_APIs - - Accessibility - - Reference -translation_of: Mozilla/Tech/Accessibility/AT-APIs/Gecko/Roles/ROLE_CARET ---- -

« Gecko Roles ページ

-

システムのキャレットを表します。このロールは、キャレットのためにサポートされています。

-

別名

- -

使用する要素

-

サポートされていません。

-

diff --git a/files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_cell/index.html b/files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_cell/index.html deleted file mode 100644 index 14305ce7cc..0000000000 --- a/files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_cell/index.html +++ /dev/null @@ -1,39 +0,0 @@ ---- -title: ROLE_CELL -slug: Mozilla/Tech/Accessibility/AT-APIs/Gecko/Roles/ROLE_CELL -tags: - - AT_APIs - - Accessibility - - Reference -translation_of: Mozilla/Tech/Accessibility/AT-APIs/Gecko/Roles/ROLE_CELL ---- -

« Gecko Roles ページ

-

テーブル内のセルを表します。ROLE_TABLE も参照してください。

-

インターフェイス

- -

別名

- -

使用する要素

- -

diff --git a/files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_character/index.html b/files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_character/index.html deleted file mode 100644 index 8b3b43cbff..0000000000 --- a/files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_character/index.html +++ /dev/null @@ -1,23 +0,0 @@ ---- -title: ROLE_CHARACTER -slug: Mozilla/Tech/Accessibility/AT-APIs/Gecko/Roles/ROLE_CHARACTER -tags: - - AT_APIs - - Accessibility - - Reference -translation_of: Mozilla/Tech/Accessibility/AT-APIs/Gecko/Roles/ROLE_CHARACTER ---- -

« Gecko Roles ページ

-

Microsoft Office Assistant などの、マンガのようなグラフィックオブジェクトを表します。これは、アプリケーションの使い方をユーザに提供するために表示されます。

-

別名

- -

使用する要素

-

使用されていません。

-

diff --git a/files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_chart/index.html b/files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_chart/index.html deleted file mode 100644 index 76a2356d83..0000000000 --- a/files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_chart/index.html +++ /dev/null @@ -1,29 +0,0 @@ ---- -title: ROLE_CHART -slug: Mozilla/Tech/Accessibility/AT-APIs/Gecko/Roles/ROLE_CHART -tags: - - AT_APIs - - Accessibility - - Reference -translation_of: Mozilla/Tech/Accessibility/AT-APIs/Gecko/Roles/ROLE_CHART ---- -

« Gecko Roles ページ

- -

データを示すためのグラフィカルな画像を表します。

-

インターフェイス

- -

別名

- -

使用する要素

-

使用されていません。

-

diff --git a/files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_check_menu_item/index.html b/files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_check_menu_item/index.html deleted file mode 100644 index 2485251344..0000000000 --- a/files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_check_menu_item/index.html +++ /dev/null @@ -1,32 +0,0 @@ ---- -title: ROLE_CHECK_MENU_ITEM -slug: Mozilla/Tech/Accessibility/AT-APIs/Gecko/Roles/ROLE_CHECK_MENU_ITEM -tags: - - AT_APIs - - Accessibility - - Reference -translation_of: Mozilla/Tech/Accessibility/AT-APIs/Gecko/Roles/ROLE_CHECK_MENU_ITEM ---- -

« Gecko Roles ページ

- -

チェックボックスでメニュー項目を表します。

- -

マッピング

- - - -

使用

- - - -

diff --git a/files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_checkbutton/index.html b/files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_checkbutton/index.html deleted file mode 100644 index 7d553a0444..0000000000 --- a/files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_checkbutton/index.html +++ /dev/null @@ -1,34 +0,0 @@ ---- -title: ROLE_CHECKBUTTON -slug: Mozilla/Tech/Accessibility/AT-APIs/Gecko/Roles/ROLE_CHECKBUTTON -tags: - - AT_APIs - - Accessibility - - Reference - - Référence(2) -translation_of: Mozilla/Tech/Accessibility/AT-APIs/Gecko/Roles/ROLE_CHECKBUTTON ---- -

« Gecko Roles ページ

- -

チェックボックスコントロールを表します。

- -

マッピング

- - - -

使用

- - - -

diff --git a/files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_chrome_window/index.html b/files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_chrome_window/index.html deleted file mode 100644 index 05d299d5ae..0000000000 --- a/files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_chrome_window/index.html +++ /dev/null @@ -1,30 +0,0 @@ ---- -title: ROLE_CHROME_WINDOW -slug: Mozilla/Tech/Accessibility/AT-APIs/Gecko/Roles/ROLE_CHROME_WINDOW -tags: - - AT_APIs - - Accessibility - - Reference -translation_of: Mozilla/Tech/Accessibility/AT-APIs/Gecko/Roles/ROLE_CHROME_WINDOW ---- -

« Gecko Roles ページ

- -

フレームの役割。タイトルバー、ボーダー、メニューバーなどを持つトップレベルウィンドウ。 これは、多くの場合、アプリケーションのための主要なウィンドウとして使用されます。

- -

マッピング

- - - -

使用

- -

使用されていません。

- -

diff --git a/files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_clock/index.html b/files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_clock/index.html deleted file mode 100644 index 09eb1efa8e..0000000000 --- a/files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_clock/index.html +++ /dev/null @@ -1,28 +0,0 @@ ---- -title: ROLE_CLOCK -slug: Mozilla/Tech/Accessibility/AT-APIs/Gecko/Roles/ROLE_CLOCK -tags: - - AT_APIs - - Accessibility - - Reference -translation_of: Mozilla/Tech/Accessibility/AT-APIs/Gecko/Roles/ROLE_CLOCK ---- -

« Gecko Roles ページ

- -

時刻を表示するコントロールを表します。

- -

マッピング

- - - -

使用

- -

使用されていません。

- -

diff --git a/files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_color_chooser/index.html b/files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_color_chooser/index.html deleted file mode 100644 index 3b464f2e24..0000000000 --- a/files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_color_chooser/index.html +++ /dev/null @@ -1,30 +0,0 @@ ---- -title: ROLE_COLOR_CHOOSER -slug: Mozilla/Tech/Accessibility/AT-APIs/Gecko/Roles/ROLE_COLOR_CHOOSER -tags: - - AT_APIs - - Accessibility - - Reference -translation_of: Mozilla/Tech/Accessibility/AT-APIs/Gecko/Roles/ROLE_COLOR_CHOOSER ---- -

« Gecko Roles ページ

- -

ユーザが色を選択できるようにする特殊なダイアログを表します。

- -

マッピング

- - - -

使用

- -

使用されていません。

- -

diff --git a/files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_columnheader/index.html b/files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_columnheader/index.html deleted file mode 100644 index e6ccce5729..0000000000 --- a/files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_columnheader/index.html +++ /dev/null @@ -1,32 +0,0 @@ ---- -title: ROLE_COLUMNHEADER -slug: Mozilla/Tech/Accessibility/AT-APIs/Gecko/Roles/ROLE_COLUMNHEADER -tags: - - AT_APIs - - Accessibility - - Reference -translation_of: Mozilla/Tech/Accessibility/AT-APIs/Gecko/Roles/ROLE_COLUMNHEADER ---- -

« Gecko Roles ページ

-

列ヘッダを表します。テーブルの列のための視覚的なラベルを提供します。ROLE_TABLE も参照してください。

-

インターフェイス

- -

別名

- -

使用する要素

- -

diff --git a/files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_combobox/index.html b/files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_combobox/index.html deleted file mode 100644 index 2a7da343b0..0000000000 --- a/files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_combobox/index.html +++ /dev/null @@ -1,34 +0,0 @@ ---- -title: ROLE_COMBOBOX -slug: Mozilla/Tech/Accessibility/AT-APIs/Gecko/Roles/ROLE_COMBOBOX -tags: - - AT_APIs - - Accessibility - - Reference - - Référence(2) -translation_of: Mozilla/Tech/Accessibility/AT-APIs/Gecko/Roles/ROLE_COMBOBOX ---- -

« Gecko Roles ページ

- -

コンボボックスを表します。事前に定義された選択肢のセットを提供し、関連リストボックスとエディットコントロール。

- -

マッピング

- - - -

使用

- - - -

diff --git a/files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_combobox_list/index.html b/files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_combobox_list/index.html deleted file mode 100644 index 7072b0a8f7..0000000000 --- a/files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_combobox_list/index.html +++ /dev/null @@ -1,27 +0,0 @@ ---- -title: ROLE_COMBOBOX_LIST -slug: Mozilla/Tech/Accessibility/AT-APIs/Gecko/Roles/ROLE_COMBOBOX_LIST -tags: - - AT_APIs - - Accessibility - - Reference -translation_of: Mozilla/Tech/Accessibility/AT-APIs/Gecko/Roles/ROLE_COMBOBOX_LIST ---- -

« Gecko Roles ページ

- -

コンボボックスを使用して提示された項目のリスト。

- -

マッピング

- - - -

使用

- - diff --git a/files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_combobox_option/index.html b/files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_combobox_option/index.html deleted file mode 100644 index ce0a67942a..0000000000 --- a/files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_combobox_option/index.html +++ /dev/null @@ -1,28 +0,0 @@ ---- -title: ROLE_COMBOBOX_OPTION -slug: Mozilla/Tech/Accessibility/AT-APIs/Gecko/Roles/ROLE_COMBOBOX_OPTION -tags: - - AT_APIs - - Accessibility - - Reference -translation_of: Mozilla/Tech/Accessibility/AT-APIs/Gecko/Roles/ROLE_COMBOBOX_OPTION ---- -

« Gecko Roles ページ

- -

コンボボックスで示されているリストの項目。

- -

マッピング

- - - -

使用

- - diff --git a/files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_cursor/index.html b/files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_cursor/index.html deleted file mode 100644 index 1fbeb203e4..0000000000 --- a/files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_cursor/index.html +++ /dev/null @@ -1,23 +0,0 @@ ---- -title: ROLE_CURSOR -slug: Mozilla/Tech/Accessibility/AT-APIs/Gecko/Roles/ROLE_CURSOR -tags: - - AT_APIs - - Accessibility - - Reference -translation_of: Mozilla/Tech/Accessibility/AT-APIs/Gecko/Roles/ROLE_CURSOR ---- -

« Gecko Roles ページ

-

システムのマウスポインタを表します。

-

別名

- -

使用する要素

-

サポートされていません。

-

diff --git a/files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_date_editor/index.html b/files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_date_editor/index.html deleted file mode 100644 index 075b5f4066..0000000000 --- a/files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_date_editor/index.html +++ /dev/null @@ -1,30 +0,0 @@ ---- -title: ROLE_DATE_EDITOR -slug: Mozilla/Tech/Accessibility/AT-APIs/Gecko/Roles/ROLE_DATE_EDITOR -tags: - - AT_APIs - - Accessibility - - Reference -translation_of: Mozilla/Tech/Accessibility/AT-APIs/Gecko/Roles/ROLE_DATE_EDITOR ---- -

« Gecko Roles ページ

- -

その目的は、ユーザーが日付を編集することを可能にすることであるコントロールを表します。

- -

マッピング

- - - -

使用

- -

使用されていません。

- -

diff --git a/files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_desktop_frame/index.html b/files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_desktop_frame/index.html deleted file mode 100644 index 9c057e1a24..0000000000 --- a/files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_desktop_frame/index.html +++ /dev/null @@ -1,30 +0,0 @@ ---- -title: ROLE_DESKTOP_FRAME -slug: Mozilla/Tech/Accessibility/AT-APIs/Gecko/Roles/ROLE_DESKTOP_FRAME -tags: - - AT_APIs - - Accessibility - - Reference -translation_of: Mozilla/Tech/Accessibility/AT-APIs/Gecko/Roles/ROLE_DESKTOP_FRAME ---- -

« Gecko Roles ページ

- -

デスクトップ区画。内部フレームとそれらの内部フレームのアイコン化をサポートする区画。

- -

マッピング

- - - -

使用

- -

使用されていません。

- -

diff --git a/files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_desktop_icon/index.html b/files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_desktop_icon/index.html deleted file mode 100644 index af46f177e6..0000000000 --- a/files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_desktop_icon/index.html +++ /dev/null @@ -1,30 +0,0 @@ ---- -title: ROLE_DESKTOP_ICON -slug: Mozilla/Tech/Accessibility/AT-APIs/Gecko/Roles/ROLE_DESKTOP_ICON -tags: - - AT_APIs - - Accessibility - - Reference -translation_of: Mozilla/Tech/Accessibility/AT-APIs/Gecko/Roles/ROLE_DESKTOP_ICON ---- -

« Gecko Roles ページ

- -

ROLE_DESKTOP_PANEにおけるアイコン化された内部フレーム。ROLE_INTERNAL_FRAMEを参照してください。

- -

マッピング

- - - -

使用

- -

使用されていません。

- -

diff --git a/files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_diagram/index.html b/files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_diagram/index.html deleted file mode 100644 index a0fbf37deb..0000000000 --- a/files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_diagram/index.html +++ /dev/null @@ -1,28 +0,0 @@ ---- -title: ROLE_DIAGRAM -slug: Mozilla/Tech/Accessibility/AT-APIs/Gecko/Roles/ROLE_DIAGRAM -tags: - - AT_APIs - - Accessibility - - Reference -translation_of: Mozilla/Tech/Accessibility/AT-APIs/Gecko/Roles/ROLE_DIAGRAM ---- -

« Gecko Roles ページ

- -

データを図式化するために使用されるグラフィックイメージを表します。

- -

マッピング

- - - -

使用

- -

使用されていません。

- -

diff --git a/files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_dial/index.html b/files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_dial/index.html deleted file mode 100644 index 862da2fb26..0000000000 --- a/files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_dial/index.html +++ /dev/null @@ -1,29 +0,0 @@ ---- -title: ROLE_DIAL -slug: Mozilla/Tech/Accessibility/AT-APIs/Gecko/Roles/ROLE_DIAL -tags: - - AT_APIs - - Accessibility - - Reference -translation_of: Mozilla/Tech/Accessibility/AT-APIs/Gecko/Roles/ROLE_DIAL ---- -

« Gecko Roles ページ

- -

その目的は、ユーザーが値を設定できるようにすることであるダイヤルまたはノブを表します。

- -

マッピング

- - - -

使用

- -

使用されていません。

- -

diff --git a/files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_dialog/index.html b/files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_dialog/index.html deleted file mode 100644 index f1d9ad5dfb..0000000000 --- a/files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_dialog/index.html +++ /dev/null @@ -1,35 +0,0 @@ ---- -title: ROLE_DIALOG -slug: Mozilla/Tech/Accessibility/AT-APIs/Gecko/Roles/ROLE_DIALOG -tags: - - AT_APIs - - Accessibility - - Reference -translation_of: Mozilla/Tech/Accessibility/AT-APIs/Gecko/Roles/ROLE_DIALOG ---- -

« Gecko Roles ページ

-

ダイアログボックスまたはメッセージボックスを表します。

-

インターフェイス

- -

別名

- -

使用する要素

- -

diff --git a/files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_directory_pane/index.html b/files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_directory_pane/index.html deleted file mode 100644 index 6c5b3c4e34..0000000000 --- a/files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_directory_pane/index.html +++ /dev/null @@ -1,30 +0,0 @@ ---- -title: ROLE_DIRECTORY_PANE -slug: Mozilla/Tech/Accessibility/AT-APIs/Gecko/Roles/ROLE_DIRECTORY_PANE -tags: - - AT_APIs - - Accessibility - - Reference -translation_of: Mozilla/Tech/Accessibility/AT-APIs/Gecko/Roles/ROLE_DIRECTORY_PANE ---- -

« Gecko Roles ページ

- -

ディレクトリペイン。ユーザーがディレクトリの内容をナビゲートしたり、選択できる区画。ファイルチューザによって使用されてもよいです。また、ROLE_FILE_CHOOSERを参照してください。

- -

マッピング

- - - -

使用

- -

使用されていません。

- -

diff --git a/files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_document/index.html b/files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_document/index.html deleted file mode 100644 index d2824c63ec..0000000000 --- a/files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_document/index.html +++ /dev/null @@ -1,35 +0,0 @@ ---- -title: ROLE_DOCUMENT -slug: Mozilla/Tech/Accessibility/AT-APIs/Gecko/Roles/ROLE_DOCUMENT -tags: - - AT_APIs - - Accessibility - - Reference -translation_of: Mozilla/Tech/Accessibility/AT-APIs/Gecko/Roles/ROLE_DOCUMENT ---- -

« Gecko Roles ページ

-

ドキュメントウィンドウを表します。ドキュメントウィンドウは、常にアプリケーションウィンドウ内に含まれます。

-

インターフェイス

- -

別名

- -

使用する要素

- -

diff --git a/files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_document_frame/index.html b/files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_document_frame/index.html deleted file mode 100644 index a5220cf4d5..0000000000 --- a/files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_document_frame/index.html +++ /dev/null @@ -1,27 +0,0 @@ ---- -title: ROLE DOCUMENT FRAME -slug: Mozilla/Tech/Accessibility/AT-APIs/Gecko/Roles/ROLE_DOCUMENT_FRAME -tags: - - AT_APIs - - Accessibility -translation_of: Mozilla/Tech/Accessibility/AT-APIs/Gecko/Roles/ROLE_DOCUMENT_FRAME ---- -

« Gecko Roles ページ

- -

説明

- -

文書内容のビューが含まれている視覚フレームまたはコンテナ。ドキュメントのフレームが別の文書インスタンス内で発生するかもしれません。その場合、2番目の文書が、含んでいるインスタンスに埋め込まれていると言えます。HTML フレームは、多くの場合、ROLE_DOCUMENT_FRAME です。このオブジェクト、またはシングルトン子孫のいずれかは、Document インターフェイスを実装する必要があります。

- -

マッピング

- - - -

使用

- -

使用されていません。

diff --git a/files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_droplist/index.html b/files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_droplist/index.html deleted file mode 100644 index a240f3e9f0..0000000000 --- a/files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_droplist/index.html +++ /dev/null @@ -1,28 +0,0 @@ ---- -title: ROLE_DROPLIST -slug: Mozilla/Tech/Accessibility/AT-APIs/Gecko/Roles/ROLE_DROPLIST -tags: - - AT_APIs - - Accessibility -translation_of: Mozilla/Tech/Accessibility/AT-APIs/Gecko/Roles/ROLE_DROPLIST ---- -

« Gecko Roles ページ

- -

説明

- -

カレンダーコントロールを表します。

- -

マッピング

- - - -

使用

- -

diff --git a/files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_editbar/index.html b/files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_editbar/index.html deleted file mode 100644 index 2a48b7574d..0000000000 --- a/files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_editbar/index.html +++ /dev/null @@ -1,29 +0,0 @@ ---- -title: ROLE EDITBAR -slug: Mozilla/Tech/Accessibility/AT-APIs/Gecko/Roles/ROLE_EDITBAR -tags: - - AT_APIs - - Accessibility -translation_of: Mozilla/Tech/Accessibility/AT-APIs/Gecko/Roles/ROLE_EDITBAR ---- -

 

- -

« Gecko Roles ページ

- -

説明

- -

ツールバーの編集可能なテキストオブジェクト。

- -

マッピング

- - - -

使用

- -

使用されていません。

diff --git a/files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_entry/index.html b/files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_entry/index.html deleted file mode 100644 index 2314b07eda..0000000000 --- a/files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_entry/index.html +++ /dev/null @@ -1,29 +0,0 @@ ---- -title: ROLE ENTRY -slug: Mozilla/Tech/Accessibility/AT-APIs/Gecko/Roles/ROLE_ENTRY -tags: - - AT_APIs - - Accessibility -translation_of: Mozilla/Tech/Accessibility/AT-APIs/Gecko/Roles/ROLE_ENTRY ---- -

« Gecko Roles ページ

- -

説明

- -

テキストコンテンツが、ユーザーによって入力されるか、修正されるコントロール。

- -

マッピング

- - - -

使用

- - diff --git a/files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_equation/index.html b/files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_equation/index.html deleted file mode 100644 index d070df3529..0000000000 --- a/files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_equation/index.html +++ /dev/null @@ -1,30 +0,0 @@ ---- -title: ROLE_EQUATION -slug: Mozilla/Tech/Accessibility/AT-APIs/Gecko/Roles/ROLE_EQUATION -tags: - - AT_APIs - - Accessibility - - Reference -translation_of: Mozilla/Tech/Accessibility/AT-APIs/Gecko/Roles/ROLE_EQUATION ---- -

« Gecko Roles ページ

- -

説明

- -

数式を表します。

- -

マッピング

- - - -

使用

- -

使用されていません。

- -

diff --git a/files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_file_chooser/index.html b/files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_file_chooser/index.html deleted file mode 100644 index d2be2acdb3..0000000000 --- a/files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_file_chooser/index.html +++ /dev/null @@ -1,30 +0,0 @@ ---- -title: ROLE_FILE_CHOOSER -slug: Mozilla/Tech/Accessibility/AT-APIs/Gecko/Roles/ROLE_FILE_CHOOSER -tags: - - AT_APIs - - Accessibility - - Reference -translation_of: Mozilla/Tech/Accessibility/AT-APIs/Gecko/Roles/ROLE_FILE_CHOOSER ---- -

« Gecko Roles ページ

- -

ファイル選択。ディレクトリ内のファイルを表示し、ユーザーがファイルを選択できるようにする特殊なダイアログが、別のディレクトリをブラウズしたり、ファイル名を指定します。ディレクトリの内容を表示するには、ディレクトリ·ペインを使用してもよいです。また、ROLE_DIRECTORY_PANEを参照してください

- -

マッピング

- - - -

使用

- -

使用されていません。

- -

diff --git a/files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_font_chooser/index.html b/files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_font_chooser/index.html deleted file mode 100644 index 8fd3d7e13e..0000000000 --- a/files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_font_chooser/index.html +++ /dev/null @@ -1,30 +0,0 @@ ---- -title: ROLE_FONT_CHOOSER -slug: Mozilla/Tech/Accessibility/AT-APIs/Gecko/Roles/ROLE_FONT_CHOOSER -tags: - - AT_APIs - - Accessibility - - Reference -translation_of: Mozilla/Tech/Accessibility/AT-APIs/Gecko/Roles/ROLE_FONT_CHOOSER ---- -

« Gecko Roles ページ

- -

フォント選択ダイアログ。フォント選択ダイアログは、ユーザーがフォントのための各種属性を選択できるようにするコンポーネントです。

- -

マッピング

- - - -

使用

- -

使用されていません。

- -

diff --git a/files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_footer/index.html b/files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_footer/index.html deleted file mode 100644 index bbbf07c9bf..0000000000 --- a/files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_footer/index.html +++ /dev/null @@ -1,27 +0,0 @@ ---- -title: ROLE FOOTER -slug: Mozilla/Tech/Accessibility/AT-APIs/Gecko/Roles/ROLE_FOOTER -tags: - - AT_APIs - - Accessibility -translation_of: Mozilla/Tech/Accessibility/AT-APIs/Gecko/Roles/ROLE_FOOTER ---- -

« Gecko Roles ページ

- -

説明

- -

文書ページのフッター。また、ROLE_HEADERを参照してください。

- -

マッピング

- - - -

使用

- -

使用されていません。

diff --git a/files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_form/index.html b/files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_form/index.html deleted file mode 100644 index 90dd8ef6a1..0000000000 --- a/files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_form/index.html +++ /dev/null @@ -1,28 +0,0 @@ ---- -title: ROLE FORM -slug: Mozilla/Tech/Accessibility/AT-APIs/Gecko/Roles/ROLE_FORM -tags: - - AT_APIs - - Accessibility -translation_of: Mozilla/Tech/Accessibility/AT-APIs/Gecko/Roles/ROLE_FORM ---- -

« Gecko Roles ページ

- -

説明

- -

フォームコントロールのコンテナ。

- -

マッピング

- - - -

使用

- - diff --git a/files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_glass_pane/index.html b/files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_glass_pane/index.html deleted file mode 100644 index 197450c892..0000000000 --- a/files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_glass_pane/index.html +++ /dev/null @@ -1,27 +0,0 @@ ---- -title: ROLE GLASS PANE -slug: Mozilla/Tech/Accessibility/AT-APIs/Gecko/Roles/ROLE_GLASS_PANE -tags: - - AT_APIs - - Accessibility -translation_of: Mozilla/Tech/Accessibility/AT-APIs/Gecko/Roles/ROLE_GLASS_PANE ---- -

« Gecko Roles ページ

- -

説明

- -

窓ガラス。その下のすべてのペインの一番上に描画することが保証されたペイン。また、ROLE_ROOT_PANEを参照してください。

- -

マッピング

- - - -

使用

- -

使用されていません。

diff --git a/files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_graphic/index.html b/files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_graphic/index.html deleted file mode 100644 index 827e84c62f..0000000000 --- a/files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_graphic/index.html +++ /dev/null @@ -1,43 +0,0 @@ ---- -title: ROLE_GRAPHIC -slug: Mozilla/Tech/Accessibility/AT-APIs/Gecko/Roles/ROLE_GRAPHIC -tags: - - AT_APIs - - Accessibility - - Gecko - - Reference -translation_of: Mozilla/Tech/Accessibility/AT-APIs/Gecko/Roles/ROLE_GRAPHIC ---- -

« Gecko Roles ページ

- -

画像を表します。

- -

インターフェイス

- - - -

マッピング

- - - -

使用

- - - -

diff --git a/files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_grip/index.html b/files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_grip/index.html deleted file mode 100644 index d13b094295..0000000000 --- a/files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_grip/index.html +++ /dev/null @@ -1,23 +0,0 @@ ---- -title: ROLE_GRIP -slug: Mozilla/Tech/Accessibility/AT-APIs/Gecko/Roles/ROLE_GRIP -tags: - - AT_APIs - - Accessibility - - Reference -translation_of: Mozilla/Tech/Accessibility/AT-APIs/Gecko/Roles/ROLE_GRIP ---- -

« Gecko Roles ページ

-

特別なマウスポインタを表します。ユーザにウィンドウなどのユーザインターフェイス要素を操作させます。例えば、ユーザがウィンドウ右下隅のサイズ変更グリップをクリックし、ドラッグしてそのサイズを変更します。

-

別名

- -

使用する要素

-

サポートされていません。

-

diff --git a/files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_grouping/index.html b/files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_grouping/index.html deleted file mode 100644 index 2a6c263623..0000000000 --- a/files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_grouping/index.html +++ /dev/null @@ -1,40 +0,0 @@ ---- -title: ROLE_GROUPING -slug: Mozilla/Tech/Accessibility/AT-APIs/Gecko/Roles/ROLE_GROUPING -tags: - - AT_APIs - - Accessibility - - Reference -translation_of: Mozilla/Tech/Accessibility/AT-APIs/Gecko/Roles/ROLE_GROUPING ---- -

« Gecko Roles ページ

- -

他のオブジェクトを論理的にグループ化します。グループ化オブジェクトとそれに含まれるオブジェクトの間に必ずしも親子関係があるとは限りません。

- -

インターフェイス

- - - -

別名

- - - -

使用する要素

- - - -

diff --git a/files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_header/index.html b/files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_header/index.html deleted file mode 100644 index 52272ac9de..0000000000 --- a/files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_header/index.html +++ /dev/null @@ -1,29 +0,0 @@ ---- -title: ROLE HEADER -slug: Mozilla/Tech/Accessibility/AT-APIs/Gecko/Roles/ROLE_HEADER -tags: - - AT_APIs - - Accessibility -translation_of: Mozilla/Tech/Accessibility/AT-APIs/Gecko/Roles/ROLE_HEADER ---- -

 

- -

« Gecko Roles ページ

- -

説明

- -

ドキュメントページのヘッダ。ROLE_FOOTERも参照してください。

- -

マッピング

- - - -

使用

- -

使用されていません。

diff --git a/files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_heading/index.html b/files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_heading/index.html deleted file mode 100644 index bd2477520e..0000000000 --- a/files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_heading/index.html +++ /dev/null @@ -1,32 +0,0 @@ ---- -title: ROLE HEADING -slug: Mozilla/Tech/Accessibility/AT-APIs/Gecko/Roles/ROLE_HEADING -tags: - - AT_APIs - - Accessibility -translation_of: Mozilla/Tech/Accessibility/AT-APIs/Gecko/Roles/ROLE_HEADING ---- -

 

- -

« Gecko Roles ページ

- -

説明

- -

見出し

- -

マッピング

- - - -

使用

- - diff --git a/files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_helpballoon/index.html b/files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_helpballoon/index.html deleted file mode 100644 index f5d70d03c3..0000000000 --- a/files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_helpballoon/index.html +++ /dev/null @@ -1,34 +0,0 @@ ---- -title: ROLE_HELPBALLOON -slug: Mozilla/Tech/Accessibility/AT-APIs/Gecko/Roles/ROLE_HELPBALLOON -tags: - - AT_APIs - - Accessibility - - NeedsContent - - Reference -translation_of: Mozilla/Tech/Accessibility/AT-APIs/Gecko/Roles/ROLE_HELPBALLOON ---- -

« Gecko Roles ページ

- -

ツールチップやヘルプバルーンの形のヘルプトピックを表示します。

- -

子要素

- -

インターフェイス

- -

別名

- - - -

使用する要素

- -

使用されていません。

- -

diff --git a/files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_hotkeyfield/index.html b/files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_hotkeyfield/index.html deleted file mode 100644 index 434cdb6e3e..0000000000 --- a/files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_hotkeyfield/index.html +++ /dev/null @@ -1,28 +0,0 @@ ---- -title: ROLE_HOTKEYFIELD -slug: Mozilla/Tech/Accessibility/AT-APIs/Gecko/Roles/ROLE_HOTKEYFIELD -tags: - - AT_APIs - - Accessibility - - Reference -translation_of: Mozilla/Tech/Accessibility/AT-APIs/Gecko/Roles/ROLE_HOTKEYFIELD ---- -

« Gecko Roles ページ

- -

ユーザーがキーストロークの組み合わせまたはシーケンスを入力することを可能にするホットキーフィールドを表します。

- -

マッピング

- - - -

使用

- -

使用されていません。

- -

diff --git a/files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_html_container/index.html b/files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_html_container/index.html deleted file mode 100644 index eccf6ca840..0000000000 --- a/files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_html_container/index.html +++ /dev/null @@ -1,27 +0,0 @@ ---- -title: ROLE HTML CONTAINER -slug: Mozilla/Tech/Accessibility/AT-APIs/Gecko/Roles/ROLE_HTML_CONTAINER -tags: - - AT_APIs - - Accessibility -translation_of: Mozilla/Tech/Accessibility/AT-APIs/Gecko/Roles/ROLE_HTML_CONTAINER ---- -

« Gecko Roles ページ

- -

説明

- -

子供が文書内容を表す、HTML のための AA ドキュメントコンテナ。

- -

マッピング

- - - -

使用

- -

使われない。

diff --git a/files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_icon/index.html b/files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_icon/index.html deleted file mode 100644 index 4dc8a12668..0000000000 --- a/files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_icon/index.html +++ /dev/null @@ -1,29 +0,0 @@ ---- -title: ROLE ICON -slug: Mozilla/Tech/Accessibility/AT-APIs/Gecko/Roles/ROLE_ICON -tags: - - AT_APIs - - Accessibility -translation_of: Mozilla/Tech/Accessibility/AT-APIs/Gecko/Roles/ROLE_ICON ---- -

 

- -

« Gecko Roles ページ

- -

説明

- -

固定サイズの小型イメージ、通常はコンポーネントを装飾するために使用されます。

- -

マッピング

- - - -

使用

- -

使用されていません。

diff --git a/files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_image_map/index.html b/files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_image_map/index.html deleted file mode 100644 index 620eb25232..0000000000 --- a/files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_image_map/index.html +++ /dev/null @@ -1,26 +0,0 @@ ---- -title: ROLE_IMAGE_MAP -slug: Mozilla/Tech/Accessibility/AT-APIs/Gecko/Roles/ROLE_IMAGE_MAP -tags: - - AT_APIs - - Accessibility - - NeedsContent - - Reference -translation_of: Mozilla/Tech/Accessibility/AT-APIs/Gecko/Roles/ROLE_IMAGE_MAP ---- -

« Gecko Roles ページ

- -

イメージマップ。その領域を表す子リンクを持っています。

- -

マッピング

- - - -

使用

- -

?

diff --git a/files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_ime/index.html b/files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_ime/index.html deleted file mode 100644 index 1e95f51a4e..0000000000 --- a/files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_ime/index.html +++ /dev/null @@ -1,25 +0,0 @@ ---- -title: ROLE_IME -slug: Mozilla/Tech/Accessibility/AT-APIs/Gecko/Roles/ROLE_IME -tags: - - AT_APIs - - Accessibility - - Reference -translation_of: Mozilla/Tech/Accessibility/AT-APIs/Gecko/Roles/ROLE_IME ---- -

« Gecko Roles ページ

- -

欧米のキーボード上の漢字の入力等、キーボードにない文字の入力を可能にするために使用されるオブジェクト。

- -

マッピング

- - - -

使用

- -

使用されていません。

diff --git a/files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_indicator/index.html b/files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_indicator/index.html deleted file mode 100644 index 1cb2b70d67..0000000000 --- a/files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_indicator/index.html +++ /dev/null @@ -1,29 +0,0 @@ ---- -title: ROLE_INDICATOR -slug: Mozilla/Tech/Accessibility/AT-APIs/Gecko/Roles/ROLE_INDICATOR -tags: - - AT_APIs - - Accessibility - - Reference -translation_of: Mozilla/Tech/Accessibility/AT-APIs/Gecko/Roles/ROLE_INDICATOR ---- -

« Gecko Roles ページ

- -

このような現在のアイテムを指し示すポインタのグラフィックなどの指標を表します。

- -

マッピング

- - - -

使用

- -

使用されていません。

- -

diff --git a/files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_internal_frame/index.html b/files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_internal_frame/index.html deleted file mode 100644 index e6141d9ad4..0000000000 --- a/files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_internal_frame/index.html +++ /dev/null @@ -1,39 +0,0 @@ ---- -title: ROLE_INTERNAL_FRAME -slug: Mozilla/Tech/Accessibility/AT-APIs/Gecko/Roles/ROLE_INTERNAL_FRAME -tags: - - AT_APIs - - Accessibility - - Reference -translation_of: Mozilla/Tech/Accessibility/AT-APIs/Gecko/Roles/ROLE_INTERNAL_FRAME ---- -

« Gecko Roles ページ

- -

フレーム内のサブドキュメントです。

- -

インターフェイス

- - - -

別名

- - - -

使用する要素

- - - -

diff --git a/files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_ipaddress/index.html b/files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_ipaddress/index.html deleted file mode 100644 index 63257fde23..0000000000 --- a/files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_ipaddress/index.html +++ /dev/null @@ -1,28 +0,0 @@ ---- -title: ROLE_IPADDRESS -slug: Mozilla/Tech/Accessibility/AT-APIs/Gecko/Roles/ROLE_IPADDRESS -tags: - - AT_APIs - - Accessibility - - Reference -translation_of: Mozilla/Tech/Accessibility/AT-APIs/Gecko/Roles/ROLE_IPADDRESS ---- -

« Gecko Roles ページ

- -

インターネットプロトコル(IP)アドレスのために設計された編集コントロールを表します。編集コントロールは、IPアドレスの各オクテットのための一つのセクションに分割されています。

- -

マッピング

- - - -

使用

- -

使用されていません。

- -

diff --git a/files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_label/index.html b/files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_label/index.html deleted file mode 100644 index 8b31fb3737..0000000000 --- a/files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_label/index.html +++ /dev/null @@ -1,31 +0,0 @@ ---- -title: ROLE LABEL -slug: Mozilla/Tech/Accessibility/AT-APIs/Gecko/Roles/ROLE_LABEL -tags: - - AT_APIs - - Accessibility -translation_of: Mozilla/Tech/Accessibility/AT-APIs/Gecko/Roles/ROLE_LABEL ---- -

« Gecko Roles ページ

- -

説明

- -

インターフェイスの中のアイコンまたは短い文字列を提示します。

- -

マッピング

- - - -

使用

- - diff --git a/files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_layered_pane/index.html b/files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_layered_pane/index.html deleted file mode 100644 index 72e9d3ecc3..0000000000 --- a/files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_layered_pane/index.html +++ /dev/null @@ -1,27 +0,0 @@ ---- -title: ROLE LAYERED PANE -slug: Mozilla/Tech/Accessibility/AT-APIs/Gecko/Roles/ROLE_LAYERED_PANE -tags: - - AT_APIs - - Accessibility -translation_of: Mozilla/Tech/Accessibility/AT-APIs/Gecko/Roles/ROLE_LAYERED_PANE ---- -

« Gecko Roles ページ

- -

説明

- -

階層化ペイン。その子を層(レイヤー)に描画できる特殊なペインで、重なり順を提供します。これは、通常、ウィンドウ内のビジュアルコンポーネントのほとんどが含まれているペインだけでなく、メニューバーを保持するペインです。ROLE_GLASS_PANEROLE_ROOT_PANE も参照してください。

- -

マッピング

- - - -

使用

- -

使用されていません

diff --git a/files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_link/index.html b/files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_link/index.html deleted file mode 100644 index 4432a25159..0000000000 --- a/files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_link/index.html +++ /dev/null @@ -1,36 +0,0 @@ ---- -title: ROLE_LINK -slug: Mozilla/Tech/Accessibility/AT-APIs/Gecko/Roles/ROLE_LINK -tags: - - AT_APIs - - Accessibility - - Reference -translation_of: Mozilla/Tech/Accessibility/AT-APIs/Gecko/Roles/ROLE_LINK ---- -

« Gecko Roles ページ

-

何かへのリンクを表します。このオブジェクトはテキストやグラフィックで表現されますが、ボタンのように動作します。

-

インターフェイス

- -

別名

- -

使用する要素

- -

diff --git a/files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_list/index.html b/files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_list/index.html deleted file mode 100644 index 261cda9e1e..0000000000 --- a/files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_list/index.html +++ /dev/null @@ -1,41 +0,0 @@ ---- -title: ROLE_LIST -slug: Mozilla/Tech/Accessibility/AT-APIs/Gecko/Roles/ROLE_LIST -tags: - - AT_APIs - - Accessibility - - Reference -translation_of: Mozilla/Tech/Accessibility/AT-APIs/Gecko/Roles/ROLE_LIST ---- -

« Gecko Roles ページ

-

次のいずれかを表します:

-
    -
  1. ユーザが 1 個以上の項目を選択できるリストボックス。
  2. -
  3. 文書内の構造化されたリスト。これらは常に STATE_READONLY のマークが付いています。
  4. -
-

ROLE_LISTITEM もご覧ください。

-

子要素

-

インターフェイス

- -

別名

- -

使用する要素

- -

diff --git a/files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_listbox/index.html b/files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_listbox/index.html deleted file mode 100644 index 4aef332022..0000000000 --- a/files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_listbox/index.html +++ /dev/null @@ -1,29 +0,0 @@ ---- -title: ROLE LISTBOX -slug: Mozilla/Tech/Accessibility/AT-APIs/Gecko/Roles/ROLE_LISTBOX -tags: - - AT_APIs - - Accessibility -translation_of: Mozilla/Tech/Accessibility/AT-APIs/Gecko/Roles/ROLE_LISTBOX ---- -

« Gecko Roles ページ

- -

説明

- -

オプションのリスト

- -

マッピング

- - - -

使用

- - diff --git a/files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_listitem/index.html b/files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_listitem/index.html deleted file mode 100644 index a4c8e5bc98..0000000000 --- a/files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_listitem/index.html +++ /dev/null @@ -1,51 +0,0 @@ ---- -title: ROLE_LISTITEM -slug: Mozilla/Tech/Accessibility/AT-APIs/Gecko/Roles/ROLE_LISTITEM -tags: - - AT_APIs - - Accessibility - - Reference -translation_of: Mozilla/Tech/Accessibility/AT-APIs/Gecko/Roles/ROLE_LISTITEM ---- -

« Gecko Roles ページ

- -

説明

- -

リスト内の項目を表します。ROLE_LIST もご覧ください。

- -

インターフェイス

- - - -

状態

- - - -

別名

- - - -

使用する要素

- - - -

diff --git a/files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_menubar/index.html b/files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_menubar/index.html deleted file mode 100644 index 4f02f8cf0c..0000000000 --- a/files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_menubar/index.html +++ /dev/null @@ -1,35 +0,0 @@ ---- -title: ROLE_MENUBAR -slug: Mozilla/Tech/Accessibility/AT-APIs/Gecko/Roles/ROLE_MENUBAR -tags: - - AT_APIs - - Accessibility - - Reference -translation_of: Mozilla/Tech/Accessibility/AT-APIs/Gecko/Roles/ROLE_MENUBAR ---- -

« Gecko Roles ページ

-

ユーザにより選択されたメニューの (ウィンドウのタイトルバー下に配置された) メニューバーを表します。

-

インターフェイス

- -

イベント

- -

別名

- -

使用する要素

- -

diff --git a/files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_menuitem/index.html b/files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_menuitem/index.html deleted file mode 100644 index 455ca5e29a..0000000000 --- a/files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_menuitem/index.html +++ /dev/null @@ -1,35 +0,0 @@ ---- -title: ROLE_MENUITEM -slug: Mozilla/Tech/Accessibility/AT-APIs/Gecko/Roles/ROLE_MENUITEM -tags: - - AT_APIs - - Accessibility - - Reference -translation_of: Mozilla/Tech/Accessibility/AT-APIs/Gecko/Roles/ROLE_MENUITEM ---- -

« Gecko Roles ページ

- -

メニュー項目を表します。実行するコマンドやオプションをユーザに選択させるための、メニュー内のエントリです。

-

インターフェイス

- - -

子要素

-

子はありません。

-

別名

- -

使用する要素

- -

diff --git a/files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_menupopup/index.html b/files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_menupopup/index.html deleted file mode 100644 index 0a580711c8..0000000000 --- a/files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_menupopup/index.html +++ /dev/null @@ -1,37 +0,0 @@ ---- -title: ROLE_MENUPOPUP -slug: Mozilla/Tech/Accessibility/AT-APIs/Gecko/Roles/ROLE_MENUPOPUP -tags: - - AT_APIs - - Accessibility - - Reference -translation_of: Mozilla/Tech/Accessibility/AT-APIs/Gecko/Roles/ROLE_MENUPOPUP ---- -

« Gecko Roles ページ

-

メニューを表します。実行する操作をユーザに選択させるための、オプションの一覧を提供します。

-

インターフェイス

- -

イベント

- -

別名

- -

使用する要素

- -

diff --git a/files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_nothing/index.html b/files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_nothing/index.html deleted file mode 100644 index 0c05a6fb07..0000000000 --- a/files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_nothing/index.html +++ /dev/null @@ -1,30 +0,0 @@ ---- -title: ROLE_NOTHING -slug: Mozilla/Tech/Accessibility/AT-APIs/Gecko/Roles/ROLE_NOTHING -tags: - - AT_APIs - - Accessibility - - Reference -translation_of: Mozilla/Tech/Accessibility/AT-APIs/Gecko/Roles/ROLE_NOTHING ---- -

« Gecko Roles ページ

- -

アクセシブルが、明確に定義されたロールを持っていない場合に使用されます。

- -

インターフェイス

- -

アクセシブルは、任意の インターフェイス を実装できます。

- -

別名

- - - -

diff --git a/files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_option/index.html b/files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_option/index.html deleted file mode 100644 index 3e67ec16fe..0000000000 --- a/files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_option/index.html +++ /dev/null @@ -1,27 +0,0 @@ ---- -title: ROLE_OPTION -slug: Mozilla/Tech/Accessibility/AT-APIs/Gecko/Roles/ROLE_OPTION -tags: - - AT_APIs - - Accessibility - - Reference -translation_of: Mozilla/Tech/Accessibility/AT-APIs/Gecko/Roles/ROLE_OPTION ---- -

« Gecko Roles ページ

- -

リストボックス内のオプション。

- -

マッピング

- - - -

使用

- - diff --git a/files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_option_pane/index.html b/files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_option_pane/index.html deleted file mode 100644 index 21ca6a487a..0000000000 --- a/files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_option_pane/index.html +++ /dev/null @@ -1,27 +0,0 @@ ---- -title: ROLE OPTION PANE -slug: Mozilla/Tech/Accessibility/AT-APIs/Gecko/Roles/ROLE_OPTION_PANE -tags: - - AT_APIs - - Accessibility -translation_of: Mozilla/Tech/Accessibility/AT-APIs/Gecko/Roles/ROLE_OPTION_PANE ---- -

« Gecko Roles ページ

- -

説明

- -

その主な用途がダイアログ内にある特殊なペイン。

- -

マッピング

- - - -

使用

- -

使用されていません

diff --git a/files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_outline/index.html b/files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_outline/index.html deleted file mode 100644 index c8ef12e7a5..0000000000 --- a/files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_outline/index.html +++ /dev/null @@ -1,33 +0,0 @@ ---- -title: ROLE_OUTLINE -slug: Mozilla/Tech/Accessibility/AT-APIs/Gecko/Roles/ROLE_OUTLINE -tags: - - AT_APIs - - Accessibility - - Reference -translation_of: Mozilla/Tech/Accessibility/AT-APIs/Gecko/Roles/ROLE_OUTLINE ---- -

« Gecko Roles ページ

-

ツリービューコントロールなどのアウトライン構造またはツリー構造を表します。階層的なリストを表示し、ユーザは下層の展開と折り畳みができます。

-

インターフェイス

- -

別名

- -

使用する要素

- -

diff --git a/files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_outlineitem/index.html b/files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_outlineitem/index.html deleted file mode 100644 index 183d743baf..0000000000 --- a/files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_outlineitem/index.html +++ /dev/null @@ -1,36 +0,0 @@ ---- -title: ROLE_OUTLINEITEM -slug: Mozilla/Tech/Accessibility/AT-APIs/Gecko/Roles/ROLE_OUTLINEITEM -tags: - - AT_APIs - - Accessibility - - NeedsContent - - Reference -translation_of: Mozilla/Tech/Accessibility/AT-APIs/Gecko/Roles/ROLE_OUTLINEITEM ---- -

« Gecko Roles ページ

-

アウトライン構造またはツリー構造内の項目を表します。

-

インターフェイス

- -

別名

- -

使用する要素

- -

diff --git a/files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_page/index.html b/files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_page/index.html deleted file mode 100644 index 9bdae12420..0000000000 --- a/files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_page/index.html +++ /dev/null @@ -1,27 +0,0 @@ ---- -title: ROLE PAGE -slug: Mozilla/Tech/Accessibility/AT-APIs/Gecko/Roles/ROLE_PAGE -tags: - - AT_APIs - - Accessibility -translation_of: Mozilla/Tech/Accessibility/AT-APIs/Gecko/Roles/ROLE_PAGE ---- -

« Gecko Roles ページ

- -

説明

- -

ドキュメント内容のページを表すオブジェクト。これは、ページ単位でユーザーによってアクセスされたドキュメントで使用されています。

- -

マッピング

- - - -

使用

- -

使用されていません。

diff --git a/files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_pagetab/index.html b/files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_pagetab/index.html deleted file mode 100644 index b0a45223c8..0000000000 --- a/files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_pagetab/index.html +++ /dev/null @@ -1,31 +0,0 @@ ---- -title: ROLE_PAGETAB -slug: Mozilla/Tech/Accessibility/AT-APIs/Gecko/Roles/ROLE_PAGETAB -tags: - - AT_APIs - - Accessibility - - Reference -translation_of: Mozilla/Tech/Accessibility/AT-APIs/Gecko/Roles/ROLE_PAGETAB ---- -

« Gecko Roles ページ

-

ページタブを表します。これはページタブリストの子要素です。ROLE_PAGETABLIST も参照してください。

-

インターフェイス

- -

別名

- -

使用する要素

- -

diff --git a/files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_pagetablist/index.html b/files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_pagetablist/index.html deleted file mode 100644 index 97ef09b02a..0000000000 --- a/files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_pagetablist/index.html +++ /dev/null @@ -1,33 +0,0 @@ ---- -title: ROLE_PAGETABLIST -slug: Mozilla/Tech/Accessibility/AT-APIs/Gecko/Roles/ROLE_PAGETABLIST -tags: - - AT_APIs - - Accessibility - - Reference -translation_of: Mozilla/Tech/Accessibility/AT-APIs/Gecko/Roles/ROLE_PAGETABLIST ---- -

« Gecko Roles ページ

- -

ページタブコントロールのコンテナを表します。ROLE_PAGETABを参照してください。

- -

マッピング

- - - -

使用

- - - -

diff --git a/files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_pane/index.html b/files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_pane/index.html deleted file mode 100644 index 9289ffde50..0000000000 --- a/files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_pane/index.html +++ /dev/null @@ -1,38 +0,0 @@ ---- -title: ROLE_PANE -slug: Mozilla/Tech/Accessibility/AT-APIs/Gecko/Roles/ROLE_PANE -tags: - - AT_APIs - - Accessibility - - Reference -translation_of: Mozilla/Tech/Accessibility/AT-APIs/Gecko/Roles/ROLE_PANE ---- -

« Gecko Roles ページ

-

フレームウィンドウやドキュメントウィンドウ内のペインを表します。ユーザは他のペイン間および現在のペインのコンテンツ内の間を移動できますが、異なるペイン内の項目間は移動できません。このように、ペインはフレームウィンドウやドキュメントより下位、個々のコントロールよりも上位のグループレベルを表します。

-

インターフェイス

- -

別名

- -

使用する要素

- -

特徴

- -

diff --git a/files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_paragraph/index.html b/files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_paragraph/index.html deleted file mode 100644 index a7f4443dc4..0000000000 --- a/files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_paragraph/index.html +++ /dev/null @@ -1,27 +0,0 @@ ---- -title: ROLE PARAGRAPH -slug: Mozilla/Tech/Accessibility/AT-APIs/Gecko/Roles/ROLE_PARAGRAPH -tags: - - AT_APIs - - Accessibility -translation_of: Mozilla/Tech/Accessibility/AT-APIs/Gecko/Roles/ROLE_PARAGRAPH ---- -

« Gecko Roles ページ

- -

説明

- -

テキストの段落。

- -

マッピング

- - - -

使用

- -

使用されていません。

diff --git a/files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_parent_menuitem/index.html b/files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_parent_menuitem/index.html deleted file mode 100644 index f79f65b850..0000000000 --- a/files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_parent_menuitem/index.html +++ /dev/null @@ -1,27 +0,0 @@ ---- -title: ROLE_PARENT_MENUITEM -slug: Mozilla/Tech/Accessibility/AT-APIs/Gecko/Roles/ROLE_PARENT_MENUITEM -tags: - - AT_APIs - - Accessibility - - Reference -translation_of: Mozilla/Tech/Accessibility/AT-APIs/Gecko/Roles/ROLE_PARENT_MENUITEM ---- -

« Gecko Roles ページ

- -

ユーザーが別のメニューを表示するように選択することができ、メニュー内の項目であるメニュー項目を表します。

- -

マッピング

- - - -

使用

- - diff --git a/files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_password_text/index.html b/files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_password_text/index.html deleted file mode 100644 index ab51e83aae..0000000000 --- a/files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_password_text/index.html +++ /dev/null @@ -1,28 +0,0 @@ ---- -title: ROLE PASSWORD TEXT -slug: Mozilla/Tech/Accessibility/AT-APIs/Gecko/Roles/ROLE_PASSWORD_TEXT -tags: - - AT_APIs - - Accessibility -translation_of: Mozilla/Tech/Accessibility/AT-APIs/Gecko/Roles/ROLE_PASSWORD_TEXT ---- -

« Gecko Roles ページ

- -

説明

- -

パスワード、またはテキストコンテンツがユーザーに視覚的に示されていない他の場所に使用するテキストオブジェクトです。

- -

マッピング

- - - -

使用

- - diff --git a/files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_popup_menu/index.html b/files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_popup_menu/index.html deleted file mode 100644 index e2c8897daf..0000000000 --- a/files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_popup_menu/index.html +++ /dev/null @@ -1,25 +0,0 @@ ---- -title: ROLE_POPUP_MENU -slug: Mozilla/Tech/Accessibility/AT-APIs/Gecko/Roles/ROLE_POPUP_MENU -tags: - - AT_APIs - - Accessibility - - Reference -translation_of: Mozilla/Tech/Accessibility/AT-APIs/Gecko/Roles/ROLE_POPUP_MENU ---- -

« Gecko Roles ページ

- -

ユーザーはこれらの選択肢のいずれかを選択するとき、通常、ユーザーに選択肢のリストを提供するために使用され、一時的なウィンドウが非表示になります。

- -

マッピング

- - - -

使用

- -

使用されていません。

diff --git a/files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_progressbar/index.html b/files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_progressbar/index.html deleted file mode 100644 index 37ff081c99..0000000000 --- a/files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_progressbar/index.html +++ /dev/null @@ -1,33 +0,0 @@ ---- -title: ROLE_PROGRESSBAR -slug: Mozilla/Tech/Accessibility/AT-APIs/Gecko/Roles/ROLE_PROGRESSBAR -tags: - - AT_APIs - - Accessibility - - Reference -translation_of: Mozilla/Tech/Accessibility/AT-APIs/Gecko/Roles/ROLE_PROGRESSBAR ---- -

« Gecko Roles ページ

- -

動的にユーザーが進行中の操作の完了率を示すプログレスバーを表します。

- -

マッピング

- - - -

使用

- - - -

diff --git a/files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_propertypage/index.html b/files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_propertypage/index.html deleted file mode 100644 index a9d719e7c8..0000000000 --- a/files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_propertypage/index.html +++ /dev/null @@ -1,39 +0,0 @@ ---- -title: ROLE_PROPERTYPAGE -slug: Mozilla/Tech/Accessibility/AT-APIs/Gecko/Roles/ROLE_PROPERTYPAGE -tags: - - AT_APIs - - Accessibility - - Reference -translation_of: Mozilla/Tech/Accessibility/AT-APIs/Gecko/Roles/ROLE_PROPERTYPAGE ---- -

« Gecko Roles ページ

- -

プロパティシートを表します。

- -

インターフェイス

- - - -

マッピング

- - - -

使用

- - - -

diff --git a/files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_pushbutton/index.html b/files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_pushbutton/index.html deleted file mode 100644 index a0b0ecc486..0000000000 --- a/files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_pushbutton/index.html +++ /dev/null @@ -1,33 +0,0 @@ ---- -title: ROLE_PUSHBUTTON -slug: Mozilla/Tech/Accessibility/AT-APIs/Gecko/Roles/ROLE_PUSHBUTTON -tags: - - AT_APIs - - Accessibility - - Reference - - Référence(2) -translation_of: Mozilla/Tech/Accessibility/AT-APIs/Gecko/Roles/ROLE_PUSHBUTTON ---- -

« Gecko Roles ページ

- -

プッシュボタンコントロールを表します。

- -

マッピング

- - - -

使用

- - - -

diff --git a/files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_radio_menu_item/index.html b/files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_radio_menu_item/index.html deleted file mode 100644 index 4ba76918dd..0000000000 --- a/files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_radio_menu_item/index.html +++ /dev/null @@ -1,28 +0,0 @@ ---- -title: ROLE_RADIO_MENU_ITEM -slug: Mozilla/Tech/Accessibility/AT-APIs/Gecko/Roles/ROLE_RADIO_MENU_ITEM -tags: - - AT_APIs - - Accessibility - - Reference -translation_of: Mozilla/Tech/Accessibility/AT-APIs/Gecko/Roles/ROLE_RADIO_MENU_ITEM ---- -

« Gecko Roles ページ

- -

メニュー項目であるラジオボタンを表します。

- -

マッピング

- - - -

使用

- - diff --git a/files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_radiobutton/index.html b/files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_radiobutton/index.html deleted file mode 100644 index 4d48e00c69..0000000000 --- a/files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_radiobutton/index.html +++ /dev/null @@ -1,32 +0,0 @@ ---- -title: ROLE_RADIOBUTTON -slug: Mozilla/Tech/Accessibility/AT-APIs/Gecko/Roles/ROLE_RADIOBUTTON -tags: - - AT_APIs - - Accessibility -translation_of: Mozilla/Tech/Accessibility/AT-APIs/Gecko/Roles/ROLE_RADIOBUTTON ---- -

« Gecko Roles ページ

- -

ラジオボタンとも呼ばれるオプションボタンを表します。これは、相互に排他的なオプションのグループの1つです。この属性を持つ単一の親を共有するすべてのオブジェクトは、単一の相互排他的なグループの一部であると仮定されます。

- -

マッピング

- - - -

使用

- - - -

diff --git a/files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_redundant_object/index.html b/files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_redundant_object/index.html deleted file mode 100644 index efbc9084c5..0000000000 --- a/files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_redundant_object/index.html +++ /dev/null @@ -1,26 +0,0 @@ ---- -title: ROLE REDUNDANT OBJECT -slug: Mozilla/Tech/Accessibility/AT-APIs/Gecko/Roles/ROLE_REDUNDANT_OBJECT -tags: - - AT_APIs - - Accessibility -translation_of: Mozilla/Tech/Accessibility/AT-APIs/Gecko/Roles/ROLE_REDUNDANT_OBJECT ---- -

« Gecko Roles ページ

- -

説明

- -

アクセシブルな階層内で他のオブジェクトと重複しているオブジェクトです。AT は、典型的には、このロールを持つオブジェクトを無視します。

- -

マッピング

- - - -

使用

- -

使用されていません。

diff --git a/files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_rich_option/index.html b/files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_rich_option/index.html deleted file mode 100644 index 9d1206aafc..0000000000 --- a/files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_rich_option/index.html +++ /dev/null @@ -1,28 +0,0 @@ ---- -title: ROLE RICH OPTION -slug: Mozilla/Tech/Accessibility/AT-APIs/Gecko/Roles/ROLE_RICH_OPTION -tags: - - AT_APIs - - Accessibility -translation_of: Mozilla/Tech/Accessibility/AT-APIs/Gecko/Roles/ROLE_RICH_OPTION ---- -

« Gecko Roles ページ

- -

説明

- -

リストボックス内の豊富なオプション。それは子供として他のウィジェットを持つことができます。

- -

マッピング

- - - -

使用

- - diff --git a/files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_root_pane/index.html b/files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_root_pane/index.html deleted file mode 100644 index 35f5b9ca40..0000000000 --- a/files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_root_pane/index.html +++ /dev/null @@ -1,26 +0,0 @@ ---- -title: ROLE_ROOT_PANE -slug: Mozilla/Tech/Accessibility/AT-APIs/Gecko/Roles/ROLE_ROOT_PANE -tags: - - AT_APIs - - Accessibility - - Reference -translation_of: Mozilla/Tech/Accessibility/AT-APIs/Gecko/Roles/ROLE_ROOT_PANE ---- -

« Gecko Roles ページ

- -

ルート区画。ガラス区画と階層化区画を子として持つ特殊な区画。ROLE_GLASS_PANEROLE_LAYERED_PANEを参照してください。

- -

マッピング

- - - -

使用

- -

使用されていません。

diff --git a/files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_row/index.html b/files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_row/index.html deleted file mode 100644 index 537ae5a89b..0000000000 --- a/files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_row/index.html +++ /dev/null @@ -1,34 +0,0 @@ ---- -title: ROLE_ROW -slug: Mozilla/Tech/Accessibility/AT-APIs/Gecko/Roles/ROLE_ROW -tags: - - AT_APIs - - Accessibility - - Reference -translation_of: Mozilla/Tech/Accessibility/AT-APIs/Gecko/Roles/ROLE_ROW ---- -

« Gecko Roles ページ

-

テーブル内のセルの行を表します。ROLE_TABLE も参照してください。

-

インターフェイス

- -

別名

- -

使用する要素

- -

diff --git a/files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_ruler/index.html b/files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_ruler/index.html deleted file mode 100644 index ef0ae65d70..0000000000 --- a/files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_ruler/index.html +++ /dev/null @@ -1,27 +0,0 @@ ---- -title: ROLE RULER -slug: Mozilla/Tech/Accessibility/AT-APIs/Gecko/Roles/ROLE_RULER -tags: - - AT_APIs - - Accessibility -translation_of: Mozilla/Tech/Accessibility/AT-APIs/Gecko/Roles/ROLE_RULER ---- -

« Gecko Roles ページ

- -

説明

- -

ワードプロセッサで使用されるような定規。

- -

マッピング

- - - -

使用

- -

使用されていません。

diff --git a/files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_scroll_pane/index.html b/files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_scroll_pane/index.html deleted file mode 100644 index 30de644a96..0000000000 --- a/files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_scroll_pane/index.html +++ /dev/null @@ -1,26 +0,0 @@ ---- -title: ROLE_SCROLL_PANE -slug: Mozilla/Tech/Accessibility/AT-APIs/Gecko/Roles/ROLE_SCROLL_PANE -tags: - - AT_APIs - - Accessibility - - Reference -translation_of: Mozilla/Tech/Accessibility/AT-APIs/Gecko/Roles/ROLE_SCROLL_PANE ---- -

« Gecko Roles ページ

- -

スクロールペイン、これは、ユーザーが大量の情報を少しずつ表示できるようにするオブジェクトです。その子は、スクロールバーとビューポートを含めることができます。ROLE_VIEW_PORTを参照してください。

- -

マッピング

- - - -

使用

- -

使用されていません。

diff --git a/files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_scrollbar/index.html b/files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_scrollbar/index.html deleted file mode 100644 index 22af0adf33..0000000000 --- a/files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_scrollbar/index.html +++ /dev/null @@ -1,22 +0,0 @@ ---- -title: ROLE_SCROLLBAR -slug: Mozilla/Tech/Accessibility/AT-APIs/Gecko/Roles/ROLE_SCROLLBAR -tags: - - AT_APIs - - Accessibility - - Reference -translation_of: Mozilla/Tech/Accessibility/AT-APIs/Gecko/Roles/ROLE_SCROLLBAR ---- -

« Gecko Roles ページ

-

垂直または水平スクロールバーを表します。クライアント領域の一部か、コントロール内で使用されます。

-

別名

- -

使用する要素

-

サポートされていません。

-

diff --git a/files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_section/index.html b/files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_section/index.html deleted file mode 100644 index 0c08471fd0..0000000000 --- a/files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_section/index.html +++ /dev/null @@ -1,30 +0,0 @@ ---- -title: ROLE SECTION -slug: Mozilla/Tech/Accessibility/AT-APIs/Gecko/Roles/ROLE_SECTION -tags: - - AT_APIs - - Accessibility -translation_of: Mozilla/Tech/Accessibility/AT-APIs/Gecko/Roles/ROLE_SECTION ---- -

« Gecko Roles ページ

- -

説明

- -

文書コンテンツのコンテナ。

- -

マッピング

- - - -

使用

- - diff --git a/files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_separator/index.html b/files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_separator/index.html deleted file mode 100644 index ef277767b6..0000000000 --- a/files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_separator/index.html +++ /dev/null @@ -1,34 +0,0 @@ ---- -title: ROLE_SEPARATOR -slug: Mozilla/Tech/Accessibility/AT-APIs/Gecko/Roles/ROLE_SEPARATOR -tags: - - AT_APIs - - Accessibility - - Reference -translation_of: Mozilla/Tech/Accessibility/AT-APIs/Gecko/Roles/ROLE_SEPARATOR ---- -

« Gecko Roles ページ

-

セパレータメニュー項目やウィンドウ内のペインを分割するバーなど、空間を二つの領域に視覚的に分割するために使用されます。

-

子要素

-

子はありません。

-

インターフェイス

- -

別名

- -

使用する要素

- -

diff --git a/files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_slider/index.html b/files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_slider/index.html deleted file mode 100644 index db831c8a29..0000000000 --- a/files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_slider/index.html +++ /dev/null @@ -1,32 +0,0 @@ ---- -title: ROLE_SLIDER -slug: Mozilla/Tech/Accessibility/AT-APIs/Gecko/Roles/ROLE_SLIDER -tags: - - AT_APIs - - Accessibility - - Reference - - Référence(2) -translation_of: Mozilla/Tech/Accessibility/AT-APIs/Gecko/Roles/ROLE_SLIDER ---- -

« Gecko Roles ページ

- -

ユーザーが最小値と最大値の間の指定された単位で設定を調整することを可能にするスライダーを表します。

- -

マッピング

- - - -

使用

- - - -

diff --git a/files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_sound/index.html b/files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_sound/index.html deleted file mode 100644 index 9fd7001061..0000000000 --- a/files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_sound/index.html +++ /dev/null @@ -1,23 +0,0 @@ ---- -title: ROLE_SOUND -slug: Mozilla/Tech/Accessibility/AT-APIs/Gecko/Roles/ROLE_SOUND -tags: - - AT_APIs - - Accessibility - - Reference -translation_of: Mozilla/Tech/Accessibility/AT-APIs/Gecko/Roles/ROLE_SOUND ---- -

« Gecko Roles ページ

-

システムサウンドを表します。様々なシステムイベントに関連付けられます。

-

別名

- -

使用する要素

-

サポートされていません。

-

diff --git a/files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_spinbutton/index.html b/files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_spinbutton/index.html deleted file mode 100644 index b50d439b1a..0000000000 --- a/files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_spinbutton/index.html +++ /dev/null @@ -1,32 +0,0 @@ ---- -title: ROLE_SPINBUTTON -slug: Mozilla/Tech/Accessibility/AT-APIs/Gecko/Roles/ROLE_SPINBUTTON -tags: - - AT_APIs - - Accessibility - - Reference -translation_of: Mozilla/Tech/Accessibility/AT-APIs/Gecko/Roles/ROLE_SPINBUTTON ---- -

« Gecko Roles ページ

- -

ユーザーがスピンボックスに関連付けられた別の"buddy"コントロールに表示される値をインクリメントまたはデクリメントすることができます制御であるスピンボックスを表します。

- -

マッピング

- - - -

使用

- - - -

diff --git a/files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_split_pane/index.html b/files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_split_pane/index.html deleted file mode 100644 index 690141f20b..0000000000 --- a/files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_split_pane/index.html +++ /dev/null @@ -1,26 +0,0 @@ ---- -title: ROLE_SPLIT_PANE -slug: Mozilla/Tech/Accessibility/AT-APIs/Gecko/Roles/ROLE_SPLIT_PANE -tags: - - AT_APIs - - Accessibility - - Reference -translation_of: Mozilla/Tech/Accessibility/AT-APIs/Gecko/Roles/ROLE_SPLIT_PANE ---- -

« Gecko Roles ページ

- -

同時に2つのパネルを表示する特殊なパネルで分割ペイン。二つのパネルの間に、ユーザは1つのパネルが大きく、他方のパネルを小さくするために操作することができる分周器です。

- -

マッピング

- - - -

使用

- -

使用されていません。

diff --git a/files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_statusbar/index.html b/files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_statusbar/index.html deleted file mode 100644 index 2eb49709db..0000000000 --- a/files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_statusbar/index.html +++ /dev/null @@ -1,27 +0,0 @@ ---- -title: ROLE_STATUSBAR -slug: Mozilla/Tech/Accessibility/AT-APIs/Gecko/Roles/ROLE_STATUSBAR -tags: - - AT_APIs - - Accessibility - - NeedsUpdate - - Reference -translation_of: Mozilla/Tech/Accessibility/AT-APIs/Gecko/Roles/ROLE_STATUSBAR ---- -

« Gecko Roles ページ

-

ステータスバーを表します。現在の操作やアプリケーションの状態、選択したオブジェクトについての情報を表示する、ウィンドウ下部の領域です。ステータスバーには異なる種類の情報を表示する複数のフィールドがあります。

-

別名

- -

使用する要素

- -

diff --git a/files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_table/index.html b/files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_table/index.html deleted file mode 100644 index 71e8f18a6b..0000000000 --- a/files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_table/index.html +++ /dev/null @@ -1,27 +0,0 @@ ---- -title: ROLE_TABLE -slug: Mozilla/Tech/Accessibility/AT-APIs/Gecko/Roles/ROLE_TABLE -tags: - - AT_APIs - - Accessibility - - Reference -translation_of: Mozilla/Tech/Accessibility/AT-APIs/Gecko/Roles/ROLE_TABLE ---- -

« Gecko Roles ページ

-

セルの行と列を含むテーブルを表します。また、任意で行ヘッダと列ヘッダが含まれます。次のロールも参照してください: ROLE_COLUMNHEADER, ROLE_ROWHEADER, ROLE_COLUMN, ROLE_ROW, ROLE_CELL

-

別名

- -

使用する要素

- -

diff --git a/files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_table_column_header/index.html b/files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_table_column_header/index.html deleted file mode 100644 index dbf9e12353..0000000000 --- a/files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_table_column_header/index.html +++ /dev/null @@ -1,25 +0,0 @@ ---- -title: ROLE_TABLE_COLUMN_HEADER -slug: Mozilla/Tech/Accessibility/AT-APIs/Gecko/Roles/ROLE_TABLE_COLUMN_HEADER -tags: - - AT_APIs - - Accessibility - - Reference -translation_of: Mozilla/Tech/Accessibility/AT-APIs/Gecko/Roles/ROLE_TABLE_COLUMN_HEADER ---- -

« Gecko Roles ページ

- -

テーブルの列のヘッダー。このロールはROLE_COLUMNHEADERのデュープであるに見えます。

- -

マッピング

- - - -

使用

- -

使用されていません。

diff --git a/files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_table_row_header/index.html b/files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_table_row_header/index.html deleted file mode 100644 index 1f6ea525d8..0000000000 --- a/files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_table_row_header/index.html +++ /dev/null @@ -1,25 +0,0 @@ ---- -title: ROLE_TABLE_ROW_HEADER -slug: Mozilla/Tech/Accessibility/AT-APIs/Gecko/Roles/ROLE_TABLE_ROW_HEADER -tags: - - AT_APIs - - Accessibility - - Reference -translation_of: Mozilla/Tech/Accessibility/AT-APIs/Gecko/Roles/ROLE_TABLE_ROW_HEADER ---- -

« Gecko Roles ページ

- -

表の行のヘッダー。このロールはROLE_ROWHEADERのデュープであるに見えます。

- -

マッピング

- - - -

使用

- -

使用されていません。

diff --git a/files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_tear_off_menu_item/index.html b/files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_tear_off_menu_item/index.html deleted file mode 100644 index 311f7da062..0000000000 --- a/files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_tear_off_menu_item/index.html +++ /dev/null @@ -1,26 +0,0 @@ ---- -title: ROLE_TEAR_OFF_MENU_ITEM -slug: Mozilla/Tech/Accessibility/AT-APIs/Gecko/Roles/ROLE_TEAR_OFF_MENU_ITEM -tags: - - AT_APIs - - Accessibility - - Reference -translation_of: Mozilla/Tech/Accessibility/AT-APIs/Gecko/Roles/ROLE_TEAR_OFF_MENU_ITEM ---- -

« Gecko Roles ページ

- -

そのメニューをはがすと再接続するために使用されるメニュー項目。

- -

マッピング

- - - -

使用

- -

使用されていません。

diff --git a/files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_terminal/index.html b/files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_terminal/index.html deleted file mode 100644 index a46f45ff18..0000000000 --- a/files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_terminal/index.html +++ /dev/null @@ -1,26 +0,0 @@ ---- -title: ROLE_TERMINAL -slug: Mozilla/Tech/Accessibility/AT-APIs/Gecko/Roles/ROLE_TERMINAL -tags: - - AT_APIs - - Accessibility - - Reference -translation_of: Mozilla/Tech/Accessibility/AT-APIs/Gecko/Roles/ROLE_TERMINAL ---- -

« Gecko Roles ページ

- -

アクセス可能な端末を表します。

- -

マッピング

- - - -

使用

- -

使用されていません。

diff --git a/files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_text_leaf/index.html b/files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_text_leaf/index.html deleted file mode 100644 index 3bcb001036..0000000000 --- a/files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_text_leaf/index.html +++ /dev/null @@ -1,28 +0,0 @@ ---- -title: ROLE_TEXT_LEAF -slug: Mozilla/Tech/Accessibility/AT-APIs/Gecko/Roles/ROLE_TEXT_LEAF -tags: - - AT_APIs - - Accessibility - - Reference -translation_of: Mozilla/Tech/Accessibility/AT-APIs/Gecko/Roles/ROLE_TEXT_LEAF ---- -

« Gecko Roles ページ

- -

編集を可能にするか、読み取り専用に指定された選択可能なテキストを表します。

- -

マッピング

- - - -

使用

- -

使用されていません。

- -

diff --git a/files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_titlebar/index.html b/files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_titlebar/index.html deleted file mode 100644 index 16ea650639..0000000000 --- a/files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_titlebar/index.html +++ /dev/null @@ -1,22 +0,0 @@ ---- -title: ROLE_TITLEBAR -slug: Mozilla/Tech/Accessibility/AT-APIs/Gecko/Roles/ROLE_TITLEBAR -tags: - - AT_APIs - - Accessibility - - Reference -translation_of: Mozilla/Tech/Accessibility/AT-APIs/Gecko/Roles/ROLE_TITLEBAR ---- -

« Gecko Roles ページ

-

ウィンドウのタイトルまたはキャプションバーを表します。

-

別名

- -

使用する要素

-

このロールは、MSAA のみでサポートされており、Microsoft Windows で自動的にサポートされています。

-

diff --git a/files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_toggle_button/index.html b/files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_toggle_button/index.html deleted file mode 100644 index c68f16675c..0000000000 --- a/files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_toggle_button/index.html +++ /dev/null @@ -1,27 +0,0 @@ ---- -title: ROLE TOGGLE BUTTON -slug: Mozilla/Tech/Accessibility/AT-APIs/Gecko/Roles/ROLE_TOGGLE_BUTTON -tags: - - AT_APIs - - Accessibility -translation_of: Mozilla/Tech/Accessibility/AT-APIs/Gecko/Roles/ROLE_TOGGLE_BUTTON ---- -

« Gecko Roles ページ

- -

説明

- -

トグルボタン。オンまたはオフにするが、現在の状態を示す別々のインジケータを提供しないことができる特殊なプッシュボタン。

- -

マッピング

- - - -

使用

- -

使用されていません。

diff --git a/files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_toolbar/index.html b/files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_toolbar/index.html deleted file mode 100644 index 1595276171..0000000000 --- a/files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_toolbar/index.html +++ /dev/null @@ -1,32 +0,0 @@ ---- -title: ROLE_TOOLBAR -slug: Mozilla/Tech/Accessibility/AT-APIs/Gecko/Roles/ROLE_TOOLBAR -tags: - - AT_APIs - - Accessibility - - Reference -translation_of: Mozilla/Tech/Accessibility/AT-APIs/Gecko/Roles/ROLE_TOOLBAR ---- -

« Gecko Roles ページ

-

ツールバーを表します。よく使用される機能への簡単なアクセスを提供するコントロール (プッシュボタンやトグルボタン) のグループです。

-

子要素

-

インターフェイス

- -

別名

- -

使用する要素

- -

diff --git a/files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_tooltip/index.html b/files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_tooltip/index.html deleted file mode 100644 index 47eb22a0e9..0000000000 --- a/files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_tooltip/index.html +++ /dev/null @@ -1,37 +0,0 @@ ---- -title: ROLE_TOOLTIP -slug: Mozilla/Tech/Accessibility/AT-APIs/Gecko/Roles/ROLE_TOOLTIP -tags: - - AT_APIs - - Accessibility - - Reference -translation_of: Mozilla/Tech/Accessibility/AT-APIs/Gecko/Roles/ROLE_TOOLTIP ---- -

« Gecko Roles ページ

-

役立つヒントを提供するツールチップを表します。

-

インターフェイス

- -

子要素

-

子はありません。

-

イベント

- -

別名

- -

使用する要素

- -

diff --git a/files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_tree_table/index.html b/files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_tree_table/index.html deleted file mode 100644 index e97b473952..0000000000 --- a/files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_tree_table/index.html +++ /dev/null @@ -1,29 +0,0 @@ ---- -title: ROLE TREE TABLE -slug: Mozilla/Tech/Accessibility/AT-APIs/Gecko/Roles/ROLE_TREE_TABLE -tags: - - AT_APIs - - Accessibility -translation_of: Mozilla/Tech/Accessibility/AT-APIs/Gecko/Roles/ROLE_TREE_TABLE ---- -

« Gecko Roles ページ

- -

説明

- -

データの複数の列を表示したり、列の展開や折りたたみのできるコントロールを表します。このロールは ROLE_OUTLINE とだまされやすいように見えます。

- -

マッピング

- - - -

使用

- - diff --git a/files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_viewport/index.html b/files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_viewport/index.html deleted file mode 100644 index ca3ada95b7..0000000000 --- a/files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_viewport/index.html +++ /dev/null @@ -1,27 +0,0 @@ ---- -title: ROLE VIEWPORT -slug: Mozilla/Tech/Accessibility/AT-APIs/Gecko/Roles/ROLE_VIEWPORT -tags: - - AT_APIs - - Accessibility -translation_of: Mozilla/Tech/Accessibility/AT-APIs/Gecko/Roles/ROLE_VIEWPORT ---- -

« Gecko Roles ページ

- -

説明

- -

ビューポート。オブジェクトは通常、スクロールペインで使用されます。これは、ユーザーが見ることができるデータ全体の一部を表します。ユーザーがスクロールバーを操作するのに合わせて、ビューポートの内容は変更することができます。また、ROLE_SCROLL_PANE も参照してください。

- -

マッピング

- - - -

使用

- -

使用されていません。

diff --git a/files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_whitespace/index.html b/files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_whitespace/index.html deleted file mode 100644 index f1319ad295..0000000000 --- a/files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_whitespace/index.html +++ /dev/null @@ -1,30 +0,0 @@ ---- -title: ROLE_WHITESPACE -slug: Mozilla/Tech/Accessibility/AT-APIs/Gecko/Roles/ROLE_WHITESPACE -tags: - - AT_APIs - - Accessibility - - Reference -translation_of: Mozilla/Tech/Accessibility/AT-APIs/Gecko/Roles/ROLE_WHITESPACE ---- -

« Gecko Roles ページ

- -

他のオブジェクトとの間の空白を表します。

- -

マッピング

- - - -

使用

- - - -

diff --git a/files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_window/index.html b/files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_window/index.html deleted file mode 100644 index 0a777812d0..0000000000 --- a/files/ja/mozilla/tech/accessibility/at-apis/gecko/roles/role_window/index.html +++ /dev/null @@ -1,23 +0,0 @@ ---- -title: ROLE_WINDOW -slug: Mozilla/Tech/Accessibility/AT-APIs/Gecko/Roles/ROLE_WINDOW -tags: - - AT_APIs - - Accessibility - - Reference -translation_of: Mozilla/Tech/Accessibility/AT-APIs/Gecko/Roles/ROLE_WINDOW ---- -

« Gecko Roles ページ

-

ウィンドウ枠を表します。これは、タイトルバーやクライアント、ウィンドウに含まれる他のオブジェクトなどの子オブジェクトを含みます。

-

別名

- -

使用する要素

-

ロールは、Microsoft Windows により自動的にサポートされています。

-

diff --git a/files/ja/mozilla/tech/accessibility/at-apis/index.html b/files/ja/mozilla/tech/accessibility/at-apis/index.html deleted file mode 100644 index 8cd6f37533..0000000000 --- a/files/ja/mozilla/tech/accessibility/at-apis/index.html +++ /dev/null @@ -1,5 +0,0 @@ ---- -title: AT-APIs -slug: Mozilla/Tech/Accessibility/AT-APIs ---- -{{wiki.localize('System.API.page-generated-for-subpage')}} diff --git a/files/ja/mozilla/tech/accessibility/index.html b/files/ja/mozilla/tech/accessibility/index.html deleted file mode 100644 index db1f1ad9f7..0000000000 --- a/files/ja/mozilla/tech/accessibility/index.html +++ /dev/null @@ -1,28 +0,0 @@ ---- -title: Accessibility API Implementation Details -slug: Mozilla/Tech/Accessibility -tags: - - AT APIs - - Accessibility - - Landing - - Mozilla - - Reference -translation_of: Mozilla/Tech/Accessibility ---- -

{{Draft}}

- -

これらのページには、 Assistive Technology API の Mozilla 固有の実装の詳細に関するドキュメントが含まれています。

- -

{{LandingPageListSubpages}}

- - - - diff --git a/files/ja/mozilla/tech/index.html b/files/ja/mozilla/tech/index.html deleted file mode 100644 index 1a0fa3a176..0000000000 --- a/files/ja/mozilla/tech/index.html +++ /dev/null @@ -1,15 +0,0 @@ ---- -title: Mozilla technologies -slug: Mozilla/Tech -tags: - - Landing - - Mozilla - - NeedsTranslation - - Reference - - TopicStub - - XUL -translation_of: Mozilla/Tech ---- -

Mozilla には、プロジェクトのコンポーネントとして使用されるいくつかのテクノロジーがあります。これらはここに文章化されています。

- -

{{LandingPageListSubpages}}

diff --git a/files/ja/mozilla/tech/xpcom/accessing_the_windows_registry_using_xpcom/index.html b/files/ja/mozilla/tech/xpcom/accessing_the_windows_registry_using_xpcom/index.html deleted file mode 100644 index 28acf4cc24..0000000000 --- a/files/ja/mozilla/tech/xpcom/accessing_the_windows_registry_using_xpcom/index.html +++ /dev/null @@ -1,281 +0,0 @@ ---- -title: Accessing the Windows Registry Using XPCOM -slug: Mozilla/Tech/XPCOM/Accessing_the_Windows_Registry_Using_XPCOM -tags: - - Add-ons - - Extensions -translation_of: Mozilla/Tech/XPCOM/Accessing_the_Windows_Registry_Using_XPCOm ---- -

-


-

{{ 英語版章題("Introduction") }} -

-

導入

-

Windows 専用の機能として実装する場合、環境や他のインストールされているプログラムに関する情報を目的に Windows のレジストリへアクセスするのはよく有用であります。このために、XPCOM インターフェースを利用して、レジストリのデータを読み書きします。この文書では、いくつかの Mozilla 製品で利用可能なインターフェースの利用方法について説明します。 -

この文書のサンプルは、XPCOM を利用して JavaScript で全て記述されています。 -

{{ 英語版章題("Support in Firefox 1.5 or newer") }} -

-

Firefox 1.5 もしくはそれ以降でサポート

-

Firefox 1.5 でレジストリへより広範囲にアクセス可能となる新しい API nsIWindowRegKey が追加されました。このインターフェースにより、Windows API がより近いものになりますが、さまざまな低レベルの詳細な部分についてあなたが対処する必要がでてきます。もし、Firefox 1.5 かそれ以降でのみ利用する拡張を作成する場合は、この章だけを読むことで十分でしょう。 -

{{ 英語版章題("A simple example") }} -

-

簡単なサンプル

-

Here's a simple example showing how to read your Windows ProductId: -

-
var wrk = Components.classes["@mozilla.org/windows-registry-key;1"]
-                    .createInstance(Components.interfaces.nsIWindowsRegKey);
-wrk.open(wrk.ROOT_KEY_LOCAL_MACHINE,
-         "SOFTWARE\\Microsoft\\Windows\\CurrentVersion",
-         wrk.ACCESS_READ);
-var id = wrk.readStringValue("ProductId");
-wrk.close();
-
-

This example, while simple, shows several important things about using the interface. First, you must use createInstance() to get an object implementing this interface, not getService(). Second, you must call open() on the key before attempting to read a value. -

Notice in the open() call that the root key to use is specified using the named constants available on the nsIWindowsRegKey interface, in this case ROOT_KEY_LOCAL_MACHINE, which corresponds to HKEY_LOCAL_MACHINE in the Windows registry. Also notice that the path to the key has backslashes escaped, a necessity in JavaScript and C++ string constants. -

The desired access rights are specified using a named constant from the interface, in this example ACCESS_READ. This can be very important when dealing with non-Administrator accounts with restricted privileges.

The value is read using readStringValue(). You have to specify what type of data you expect to read, which we will expand on later. Finally, note that you should close the key when you are done to avoid wasting system resources. -

{{ 英語版章題("Opening Registry Keys") }} -

-

Opening Registry Keys

-

Before doing anything with a registry key you must first open the key you are interested in. The example above demonstates this using the open() method. If you want to create a new key, you can use the create() method, which takes the same parameters as open(). Note that it is not an error to call create() on an existing key, and doing so has the same result as calling open(). -

Both of these methods take a root key as the first parameter. From JavaScript, you will want to use the named constants on the interface for this parameter. They are: -

- -

The second parameter for open() and create() is the path to the key. As noted in the example above, you will need to escape backslashes within the string. -

The third parameter for open() and create() is the access mode. It is specified as a bitwise combination of flags defined on the interface. You can read the interface documentation for a full explanation, but we will show only the three most commonly used modes here: -

- -

In addition to open() and create(), there are the openChild() and createChild() methods. You can call these methods on an already-opened registry key to open a child key. Both methods take a relative path and access mode as parameters and return a new object implementing nsIWindowsRegKey. Here's the simple example again, but using openChild(): -

-
var wrk = Components.classes["@mozilla.org/windows-registry-key;1"]
-                    .createInstance(Components.interfaces.nsIWindowsRegKey);
-wrk.open(wrk.ROOT_KEY_LOCAL_MACHINE,
-         "SOFTWARE\\Microsoft",
-         wrk.ACCESS_READ);
-var subkey = wrk.openChild("Windows\\CurrentVersion", wrk.ACCESS_READ);
-var id = subkey.readStringValue("ProductId");
-subkey.close();
-wrk.close();
-
-

Once you've opened a registry key, you can begin to make use of it. -

{{ 英語版章題("Reading Registry Values") }} -

-

Reading Registry Values

-

Probably the most common action associated with the Windows registry is reading values. The simple example above shows how to read an existing string value. However, Windows registry values can have several data types, so you need to ensure that you read the correct type. You can check the type of a value using the method getValueType(). This method returns an integer indicating the data type of the value. The data types supported by this interface are defined as named constants on the interface as follows: -

- -

Each of these types (except TYPE_NONE) has a corresponding method to read the value data: -

- -

Since JavaScript is a dynamically-typed language, you may wish to use the following code to handle all types of data. In this function, wrk is expected to be an already opened nsIWindowsRegKey. -

-
function readRegistryValue(wrk, value)
-{
-  switch (wrk.getValueType(value)) {
-    case wrk.TYPE_STRING:
-      return wrk.readStringValue(value);
-    case wrk.TYPE_BINARY:
-      return wrk.readBinaryValue(value);
-    case wrk.TYPE_INT:
-      return wrk.readIntValue(value);
-    case wrk.TYPE_INT64:
-      return wrk.readInt64Value(value);
-  }
-  // unknown type
-  return null;
-}
-
-

{{ 英語版章題("Writing Registry Values") }} -

-

Writing Registry Values

-

Writing registry values is quite similar to reading. For each supported data type, there is a write*Value() method complementary to the read*Value() method. Don't forget that if you are writing a new value, you may need to create() the parent key first. This example demonstrates writing a new string value: -

-
var wrk = Components.classes["@mozilla.org/windows-registry-key;1"]
-                    .createInstance(Components.interfaces.nsIWindowsRegKey);
-wrk.create(wrk.ROOT_KEY_CURRENT_USER,
-           "SOFTWARE\\MDC\\Test",
-           wrk.ACCESS_WRITE);
-wrk.writeStringValue("TestValue", "Hello World!");
-wrk.close();
-
-

{{ 英語版章題("Checking the Existence of Keys and Values") }} -

-

Checking the Existence of Keys and Values

-

Before you attempt to read a value or open a child key, you should check to see whether it exists first. The nsIWindowsRegKey interface provides methods for both of these—hasValue() and hasChild()—as demonstrated in this example: -

-
var wrk = Components.classes["@mozilla.org/windows-registry-key;1"]
-                    .createInstance(Components.interfaces.nsIWindowsRegKey);
-wrk.open(wrk.ROOT_KEY_LOCAL_MACHINE,
-           "SOFTWARE\\Microsoft",
-           wrk.ACCESS_READ);
-if (wrk.hasChild("Windows")) {
-  var subkey = wrk.openChild("Windows\\CurrentVersion", wrk.ACCESS_READ);
-  var id;
-  if (subkey.hasValue("ProductId"))
-    id = subkey.readStringValue("ProductId");
-  subkey.close();
-}
-wrk.close();
-
-

{{ 英語版章題("Enumerating Registry Keys and Values") }} -

-

Enumerating Registry Keys and Values

-

In some situations, you may want to enumerate a number of keys or values whose names you do not know. The nsIWindowsRegKey interface provides the childCount, getChildName(), valueCount, and getValueName() properties and methods for enumerating keys and values respectively. You can use these methods to read a list of values or recursively access a branch of the registry. This example reads all the startup programs in one key of the registry. -

-
var wrk = Components.classes["@mozilla.org/windows-registry-key;1"]
-                    .createInstance(Components.interfaces.nsIWindowsRegKey);
-wrk.open(wrk.ROOT_KEY_LOCAL_MACHINE,
-         "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run",
-         wrk.ACCESS_READ);
-for (var i=0; i<wrk.valueCount; i++) {
-  var name  = wrk.getValueName(i);
-  var value = readRegistryValue(wrk, name);
-  // do something interesting here...
-}
-wrk.close();
-
-

For simplicity, this example assumes the existence of the readRegistryValue() function defined above. -

{{ 英語版章題("Removing Registry Keys and Values") }} -

-

Removing Registry Keys and Values

-

To remove child keys and values from the registry, you can use the removeChild() and removeValue() methods. removeChild() removes a child key and all of its values, but will fail if the key has any child keys of its own. In that case you must manually enumerate the children and remove them individually. This example shows how to recursively delete a registry key and all of its children. Use with caution! -

-
function removeChildrenRecursive(wrk)
-{
-  // we count backwards because we're removing them as we go
-  for (var i = wrk.childCount - 1; i >= 0; i--) {
-    var name   = wrk.getChildName(i);
-    var subkey = wrk.openChild(name, wrk.ACCESS_ALL);
-    removeChildrenRecursive(subkey);
-    subkey.close();
-    wrk.removeChild(name);
-  }
-}
-
-var wrk = Components.classes["@mozilla.org/windows-registry-key;1"]
-                    .createInstance(Components.interfaces.nsIWindowsRegKey);
-wrk.open(wrk.ROOT_KEY_CURRENT_USER,
-         "SOFTWARE\\MDC\\Test",
-         wrk.ACCESS_ALL);
-removeChildrenRecursive(wrk);
-wrk.close();
-
-

{{ 英語版章題("Monitoring Registry Keys") }} -

-

Monitoring Registry Keys

-

If you would like to know whether a registry key has changed since you last checked it, you can use the startWatching(), stopWatching(), and hasChanged() methods. You must call startWatching() for the key to be monitored. The method takes one parameter, a boolean indicating whether child keys should be watched. After that, you can call hasChanged() to determine whether or not you need to reread the value. Calling hasChanged() automatically resets the watch, so you can be sure that if it returns true there are changes. This example demonstrates a trivial registry value cache for one key: -

-
var cache = {};
-
-function readRegistryValueNoCache(wrk, value)
-{
-  switch (wrk.getValueType(value)) {
-    case wrk.TYPE_STRING:
-      return wrk.readStringValue(value);
-    case wrk.TYPE_BINARY:
-      return wrk.readBinaryValue(value);
-    case wrk.TYPE_INT:
-      return wrk.readIntValue(value);
-    case wrk.TYPE_INT64:
-      return wrk.readInt64Value(value);
-  }
-  // unknown type
-  return null;
-}
-
-function readRegistryValue(wrk, value)
-{
-  if (wrk.hasChanged()) {
-    // wipe out the cache
-    cache = {};
-  }
-
-  if (value in cache) {
-    return cache[value];
-  }
-
-  cache[value] = readRegistryValueNoCache(wrk, value);
-  return cache[value];
-}
-
-var wrk = Components.classes["@mozilla.org/windows-registry-key;1"]
-                    .createInstance(Components.interfaces.nsIWindowsRegKey);
-wrk.open(wrk.ROOT_KEY_LOCAL_MACHINE,
-         "SOFTWARE\\Microsoft\\Windows\\CurrentVersion",
-         wrk.ACCESS_READ);
-wrk.startWatching(false); // only watch the values on this key, not child keys
-var id = readRegistryValue(wrk, "ProductId");
-/* later you can read this again,
-   and it should come from the cache unless
-   there have been changes to the registry.
-   Remember to call wrk.close() when you
-   are finished!
-*/
-
-

{{ 英語版章題("Support in Firefox 1.0") }} -

-

Support in Firefox 1.0

-

Firefox 1.0 includes a much simpler interface to the Windows registry, without most of the functionality supported in newer versions. The functionality is exposed in the nsIWindowsShellService interface. It consists of only one method, getRegistryEntry(), and a set of named constants to specify the root key. You can use it as shown in the following example: -

-
var wss = Components.classes["@mozilla.org/browser/shell-service;1"]
-                    .getService(Components.interfaces.nsIWindowsShellService);
-var id = wss.getRegistryEntry(wss.HKLM,
-                              "SOFTWARE\\Microsoft\\Windows\\CurrentVersion",
-                              "ProductId");
-
-
Note: There's no way to set a registry value using this interface.
-

{{ 英語版章題("Support in SeaMonkey and Other Non-toolkit Applications") }} -

-

Support in SeaMonkey and Other Non-toolkit Applications

-

In older versions of SeaMonkey and other non-toolkit-based applications, an interface existed called nsIWindowsRegistry, containing the same method and named constants as the methods described above for Firefox 1.0. It can be used as follows: -

-
var wss = Components.classes["@mozilla.org/winhooks;1"]
-                    .getService(Components.interfaces.nsIWindowsRegistry);
-var id = wss.getRegistryEntry(wss.HKLM,
-                              "SOFTWARE\\Microsoft\\Windows\\CurrentVersion",
-                              "ProductId");
-
-

{{ 英語版章題("Backwards Compatibility") }} -

-

Backwards Compatibility

-

If you need to support Firefox 1.0 and other older browser versions, you should check to see which interfaces are available. The following skeleton code will allow you to determine which interface to use: -

-
if ("@mozilla.org/windows-registry-key;1" in Components.classes) {
-  // Firefox 1.5 or newer
-}
-else if ("@mozilla.org/winhooks;1" in Components.classes) {
-  // SeaMonkey or other older non-toolkit application
-}
-else if ("@mozilla.org/browser/shell-service;1" in Components.classes) {
-  var wss = Components.classes["@mozilla.org/browser/shell-service;1"]
-                      .getService(Components.interfaces.nsIWindowsShellService);
-  if ("getRegistryEntry" in wss) {
-    // Firefox 1.0
-  }
-  else {
-    // nothing supported
-  }
-}
-else {
-  // nothing supported
-}
-
-


-

-
-
-{{ languages( { "en": "en/Accessing_the_Windows_Registry_Using_XPCOM", "fr": "fr/Extraits_de_code/Acc\u00e8s_au_registre_Windows_en_utilisant_les_XPCOM" } ) }} diff --git a/files/ja/mozilla/tech/xpcom/fun_with_xbl_and_xpconnect/index.html b/files/ja/mozilla/tech/xpcom/fun_with_xbl_and_xpconnect/index.html deleted file mode 100644 index 74334c0d77..0000000000 --- a/files/ja/mozilla/tech/xpcom/fun_with_xbl_and_xpconnect/index.html +++ /dev/null @@ -1,88 +0,0 @@ ---- -title: Fun With XBL and XPConnect -slug: Mozilla/Tech/XPCOM/Fun_With_XBL_and_XPConnect -tags: - - XBL - - XPCOM - - 'XPCOM:Language Bindings' - - XPConnect - - 移行 -translation_of: Mozilla/Tech/XPCOM/Fun_with_XBL_and_XPConnect ---- -

はじめに

- -

この文章では、XBL の応用である、XULウィジェットへのアクセスを可能にする簡単な XPCOMインターフェースについて述べます。 XBLのこのインターフェースを定義するという特徴は、自動補完を行う C++ オブジェクトへの XPConnectを介したインターフェースを定義するのに使用されます。 一度通常の XULテキストフィールドをこのインターフェースに結び付ければ、通常の JavaScript を用いて、オブジェクトの自動補完機能を呼び出すようになります。 この相互作用の基本的なモデルは次のとおりです:

- -

 

- -
画像:Xpconnect_xp.gif
- -

XPCOMオブジェクトへ結び付ける

- -

ウィジェットは、自動補完の検索を行う自動補完エンジンである XPCOMオブジェクトを保持します。

- -
 <binding name="autocomplete" extends="xul:box">
- <content>
-   <xul:textfield class="addressingWidget"/>
-   <xul:menupopup/>
- </content>
-
- <interface>
-   <property name="autoCompleteSession">
-     ![CDATA[
-      Components.classes['component://netscape/messenger/autoc...&type=addrbook'].
-       getService(Components.interfaces.nsIAutoCompleteSession);
-     ]]
-   </property>
-
- -

ですので、autoCompleteSession というウィジェットに propetry を定義しました。 この property の初期値は評価されて xp-connectオブジェクトへ入ります。 これで、.autoCompleteSession を呼ぶと xp-connectオブジェクトを返します。

- -

XPCOMインターフェースを公開する

- -

ウィジェットでサポートしたい XPCOM オブジェクトのインターフェースを手動で公開するには、あまりきれいでないトリックをひとつ行う必要があります。 幸運なことに、このデモンストレーションでは我々はインターフェースにメソッドをひとつだけ持っています =). わたしのやることは具体的には、メソッド呼び出しを XPCOMオブジェクトへ中継する XBLウィジェットにメソッドの属性を定義することで全てです。

- -
 <method name="autoComplete">
- <argument name="aSearchString"/>
- <argument name="resultListener"/>
- <body>
-   ![CDATA[
-     return this.autoCompleteSession.autoComplete(null,
-       anonymousContent[0], aSearchString, this.autoCompleteListener);
-    ]]
- </body>
- </method>
-
- -

メソッドの本体がそのまま自動補完のセッションを得て、その上で自動補完メソッドを呼び出しているのが分かるでしょう。

- -

ウィジェットのインターフェースを実装する

- -

次にやるべきことは、自動補完のセッションを渡せるようにウィジェットのインターフェースを実装することです。 自動補完セッションがウィジェットに検索結果付きでコールバックしてほしいところです。 XPCOMオブジェクトのときに行ったのと同じようなトリックを行うことができます。

- -
<property name="autoCompleteListener">
- ![CDATA[
-  ({
-    onAutoCompleteResult: function(aItem, aOriginalString, aMatch)
-      {
-        if ( aItem )
-        {
-          anonymousContent[0].value = aMatch;
-        }
-      }
-   })
-  ]]
-
- -

autoCompleteListener の値を処理する JS がオブジェクトを生成する(そして式をわたしが行ったようなペアの集合につつむ)限りは、その autoCompleteListener の値はわたしのインターフェースを実装したオブジェクトになります。 ここで、.autoCompleteListener の結果を auto complete listener を必要とするメソッド(たとえばわたしの自動補完セッションオブジェクトのような)へ渡すことができます。

- -

イベントハンドラを作る

- -

最後の部分は簡単なところです。 自動補完検索を開始するハンドラが欲しいところです。 このハンドラは、そのまま XPCOMオブジェクトに渡される、我々の公開したウィジェット上の自動補完メソッドを呼んで、nsIAutoCompleteListener の実装に渡します。

- -
 <handlers>
-   <handler type="keypress" keycode="vk_return"
-     value="autoComplete(anonymousContent[0].value,
-       this.autoCompleteListener);"/>
- </handlers>
-
diff --git a/files/ja/mozilla/tech/xpcom/generating_guids/index.html b/files/ja/mozilla/tech/xpcom/generating_guids/index.html deleted file mode 100644 index d992f0e151..0000000000 --- a/files/ja/mozilla/tech/xpcom/generating_guids/index.html +++ /dev/null @@ -1,79 +0,0 @@ ---- -title: Generating GUIDs -slug: Mozilla/Tech/XPCOM/Generating_GUIDs -tags: - - Add-ons - - Developing Mozilla - - 'Developing_Mozilla:Tools' - - Extensions - - Tools - - XPCOM - - 要更新 -translation_of: Mozilla/Tech/XPCOM/Generating_GUIDs ---- -

GUID は、Mozilla プログラミングで、XPCOM インタフェース (このタイプの GUID は IID と呼ばれています) やコンポーネント (CID) 、拡張機能テーマを含むアドオンなどの実体のそれぞれの型を識別するために使われます。とはいえ、Firefox 1.5 からは、アドオンでは extensionname@organization.tld 形式の ID で識別することができます(また、そうするべきです)

- -
-

警告: If you just want an ID for your add-on, generating a GUID is almost definitely not what you want to do. Using the extensionname@organization.tld form is approximately one thousand times easier for everyone involved. Don't have a domain name? Do you have a blog on a subdomain? Use that. If all else fails, using extensionname@yourusername.addons.mozilla.org should be fine; no one will care. Remember, these are identifiers, not e-mail addresses, and they're never resolved.

-
- -

標準形式

-

GUID の共通のフォームは xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxx です。各 x には 16 進数が入ります。ここには、標準形式の GUID の生成に利用できるツールが数多くあります。

- -
-

Note: If you do choose to use an email-style ID for your add-on, you probably don't want it to be a real email address, since it might attract spam.

-
- -

オンラインツール

- -

Windows

-

Windows ユーザは GUID を得るために Microsoft のGuidGen ツールを使用することができます。 (このツールは MS Visual C++ の一部でもあります)

-

Linux

-

/usr/bin/uuidgen を使用します。これは、libuuid1 パッケージ (Debian) にあります。

-

Perl

-

jkeiser's Mozilla tools に C++ および IDL の両方のスタイルの出力ができる UUID generator が含まれています。

-

COM/XPCOM 形式

-

Mozilla C++ コード内で IID および CID を 定義する(#define) 場合は、一般的に次の書式を使用します。

-
// xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxx
-#define NS_...ID \
-{ 0xXXXXXXXX, 0xXXXX, 0xXXXX, \
-  { 0xXX, 0xXX, 0xXX, 0xXX, 0xXX, 0xXX, 0xXX, 0xXX } }
-
-

以下のツールを使用すると、この形式でコードを生成することができます。

-

オンラインツール

- -

guidgen

-

guidgen.exe は UUID をこの形式で生成できます。これは Microsoft Visual Studio の一部です。

-

bash

-

以下をあなたの .bashrc ファイルに追加します:

-
uuidgen-c++()
-{
-    local UUID=$(uuidgen)
-    echo "// $UUID"
-    echo "#define NS__IID \\"
-    echo "{ 0x${UUID:0:8}, 0x${UUID:9:4}, 0x${UUID:14:4}, \\"
-    echo -n "  { 0x${UUID:19:2}, 0x${UUID:21:2}, 0x${UUID:24:2}, "
-    echo -n "0x${UUID:26:2}, 0x${UUID:28:2}, 0x${UUID:30:2}, "
-    echo "0x${UUID:32:2}, 0x${UUID:34:2} } }"
-}
-
-

Perl

-
#!/usr/bin/perl
-$uuid = `uuidgen`;
-chomp $uuid;
-print $uuid, "\n";
-@parts = ($uuid =~ /^(.{8})-(.{4})-(.{4})-(..)(..)-(..)(..)(..)(..)(..)(..)$/);
-print "{ 0x$parts[0], 0x$parts[1], 0x$parts[2], \\", "\n", " { ";
-for (3 .. 9) {
-  print "0x$parts[$_], ";
-}
-print "0x$parts[10] } }", "\n";
-
diff --git a/files/ja/mozilla/tech/xpcom/generic_factory/index.html b/files/ja/mozilla/tech/xpcom/generic_factory/index.html deleted file mode 100644 index 297a49c5f5..0000000000 --- a/files/ja/mozilla/tech/xpcom/generic_factory/index.html +++ /dev/null @@ -1,136 +0,0 @@ ---- -title: Generic factory -slug: Mozilla/Tech/XPCOM/Generic_factory -tags: - - XPCOM -translation_of: Mozilla/Tech/XPCOM/Generic_factory ---- -

XPCOM では、汎用ファクトリxpcom/glue/nsIGenericFactory.h にある機能を利用して生成されたファクトリのことを指します。 -

元の訳では「総称ファクトリー」となっていたが、「汎用」の方が適当ではないか -

-

概要

-

ほとんどの XPCOM ファクトリは、とても単純なもので済みます。Rick Potts は、テンプレートベースの汎用ファクトリ (nsFactory<T>) を書いていますが、これによりファクトリの生成過程が単純化され、CreateInstance() メソッドを書くだけで済むようになります。新しい nsIGenericFactory インタフェースによる、もっと進んだ手段を使うことができます。これは、一つのインタフェースを、nsIFactory の簡易な実装が必要な時にいつでも再使用できるようにしたものです。そのインタフェースとその使用の記述をここに挙げます。 -

-
/**
- * 汎用的な nsIFactory の実装を提供します。この実装は、とても
- * 簡易なファクトリを必要とする DLL で使うことができます。
- */
-class nsIGenericFactory : public nsIFactory {
-public:
-    static const nsIID& IID() { static nsIID iid = NS_IGENERICFACTORY_IID; return iid; }
-
-    typedef NS_CALLBACK(ConstructorProcPtr) (nsISupports *aOuter, REFNSIID aIID, void **aResult);
-
-    /**
-     * 汎用ファクトリのコンストラクタ関数を設定します。
-     * これは CreateInstance によって呼び出されます。
-     */
-    NS_IMETHOD SetConstructor(ConstructorProcPtr constructor) = 0;
-};
-
-

nsIGenericFactory は、簡単に使えます。NS_GENERICFATORY_CIDのCID と NS_IGENERICFACTORY_IID の IID を使って、リポジトリから新しいインスタンスを作成します。ConstructionProcPtr プロトタイプに適合するコンストラクタ関数を定義してください。そして、その関数に対するポインタとともに nsIGenericFactory::SetConstructor を呼び出してください。それでおしまいです。これで、あなたは完全な機能を持つファクトリオブジェクトを使うことができます。 -

-

実例

-
class nsIComponent : public nsISupports {
-public:
-  NS_IMETHOD DoSomething() = 0;
-};
-
-class MyComponent : public nsIComponent {
-public:
-  MyComponent();
-  virtual ~MyComponent();
-
-  static NS_METHOD Create(nsISupports *aOuter, REFNSIID aIID, void **aResult);
-
-  NS_IMPL_ISUPPORTS
-
-  NS_IMETHOD DoSomething();
-};
-
-

このクラスのためのファクトリを作るには、単に以下のように書いてください。 -

-
nsIFactory* NewComponentFactory(nsIRepository* repository)
-{
-    nsIGenericFactory* factory = NULL;
-    nsCID kGenericFactoryCID = NS_GENERICFACTORY_CID;
-    nsresult res = repository->CreateInstance(kGenericFactoryCID, NULL, nsIGenericFactory::IID(), &factory);
-    if (res == NS_OK) {
-        factory->SetConstructor(&MyComponent::Create);
-    }
-    return factory;
-}
-
-

この例では、XPCOM リポジトリは、インタフェースとして使うことができると仮定しています。(もうすぐそうなる予定です) -

-

背景

-

(これは、私のオリジナルのニュース投稿 <beard-2402991733140001@h-198-93-95-151.mcom.com> が元になっています。) -

我々は、異なるファクトリ実装を膨大に作ってきたと思われます。すべての単純なファクトリの代わりとして以下のクラスを使えば、コードサイズ (すべての QueryInterface、AddRef、Release の実装) を縮小できるはずです。 -

-
// アイデア: 汎用ファクトリを作ることで、多くの
- // nsIFactory コードの複製を避けられます。我々に必要なのは、
- // アロケータ関数だけです。その他の実装は、まったく同じです。
-
- #include "nsIFactory.h"
-
- class nsGenericFactory : public nsIFactory {
- public:
-    typedef nsresult (*CreatorProcPtr) (nsISupports *aOuter,
-                                        REFNSIID aIID, void **aResult);
-
-    nsGenericFactory(CreatorProcPtr creator);
-    virtual ~nsGenericFactory();
-
-    NS_DECL_ISUPPORTS
-
-    NS_IMETHOD CreateInstance(nsISupports *aOuter, REFNSIID aIID, void **aResult);
-
-    NS_IMETHOD LockFactory(PRBool aLock);
-
- private:
-    CreatorProcPtr mCreator;
- };
-
- nsGenericFactory::nsGenericFactory(CreatorProcPtr creator)
-    :  mCreator(creator)
- {
-    NS_INIT_REFCNT();
- }
-
- nsGenericFactory::~nsGenericFactory() {}
-
- static NS_DEFINE_IID(kIFactoryIID, NS_IFACTORY_IID);
-
- NS_IMPL_ISUPPORTS(nsGenericFactory, kIFactoryIID)
-
- NS_IMETHODIMP nsGenericFactory::CreateInstance(nsISupports *aOuter,
-                                                REFNSIID aIID, void **aResult)
- {
-    return mCreator(aOuter, aIID, aResult);
- }
-
- NS_IMETHODIMP nsGenericFactory::LockFactory(PRBool aLock)
- {
-    return NS_OK;
- }
-
-

多くのクラスは、クリエータ関数として使うための静的なエントリーポイントをすでに持っています。そのため、多くの場合、クラスのための新しいファクトリを作るのは、単にこんな感じでいいのです。 -

-
nsIFactory* NewMallocFactory()
-{
-   nsIFactory* factory = new nsGenericFactory(&nsMalloc::Create);
-   factory->AddRef();
-   return factory;
-}
-
-

Warren に話すと、彼はこの手順を短縮するために、関数ポインタと一緒にファクトリを登録できるようにしようと提案しました。 -

-
-

原文書の情報

- -
-
-
diff --git a/files/ja/mozilla/tech/xpcom/guide/how_to_build_an_xpcom_component_in_javascript/index.html b/files/ja/mozilla/tech/xpcom/guide/how_to_build_an_xpcom_component_in_javascript/index.html deleted file mode 100644 index 0e12b4f39c..0000000000 --- a/files/ja/mozilla/tech/xpcom/guide/how_to_build_an_xpcom_component_in_javascript/index.html +++ /dev/null @@ -1,190 +0,0 @@ ---- -title: How to Build an XPCOM Component in Javascript -slug: Mozilla/Tech/XPCOM/Guide/How_to_Build_an_XPCOM_Component_in_Javascript -tags: - - Add-ons - - Extensions - - XPCOM -translation_of: Mozilla/Tech/XPCOM/Guide/Building_components_in_JavaScript ---- -

-

これは JavaScript で XPCOM コンポーネントを作成するための "Hello World" 的なチュートリアルです。このチュートリアルでは、XPCOM がどのように、そしてなぜそのように動くのかということや、コードの例が何をするものなのかということは説明しません。詳細は 別の記事 を参照してください。このチュートリアルでは、コンポーネントをできる限り少数かつ簡単なステップで動かすためにすべきことを説明していきます。 -

警告:これは Mac 上での結果です。Windows では手順が異なるかもしれません。 -


-

-

実装

-

このコンポーネントの例では "Hello World!" という文字列を返すメソッド 1 つだけを公開します。 -

-

インタフェースの定義

-

作ったコンポーネントを JavaScript から、あるいは他の XPCOM コンポーネント内で使用したいとなると、公開したいインタフェースを定義しなければなりません(そのコンポーネントを JavaScript からのみ使用したい場合は、ここで説明するインタフェースを作成せずに済むように wrappedJSObject というトリックを使うことができます。ここ に例があります)。 -

Mozilla アプリケーションには定義済みのインタフェースがたくさんあるため、新たに定義する必要がないかもしれません。既存の XPCOM インタフェースは Mozilla のソースコードの中のさまざまな場所で閲覧することができますし、XPCOMViewer という、登録済みのインタフェースやコンポーネントを閲覧するための GUI を使うこともできます。Firefox 1.5 で動作する古いバージョンの XPCOMViewer は mozdev mirrors からダウンロードできます。 -

もし必要なインタフェースが見つかれば、IDL を書いたり typelib をコンパイルしたりする必要はありません。次のセクション に飛んでもかまいません。 -

適当な既存のインタフェースが見つからなかった場合は独自に定義する必要があります。XPCOM はインタフェースの定義に XPIDL という IDL の方言を使用します。ここに今回の HelloWorld コンポーネント用の XPIDL 定義を示します。 -

HelloWorld.idl -

-
#include "nsISupports.idl"
-
-[scriptable, uuid(xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx)]
-interface nsIHelloWorld : nsISupports
-{
-  string hello();
-};
-
-

作成する XPCOM コンポーネントおのおのに新しい UUID を付ける必要があることに注意してください。詳細は GUID の生成 を参照してください。 -

-

typelib のコンパイル

-

インタフェース定義を Mozilla アプリケーションに登録して使用するためには、バイナリ形式 (XPT) にコンパイルする必要があります。コンパイルは Gecko SDK を用いて行うことができます。Mac、Linux、Windows 版の Gecko SDK の入手方法については Gecko SDK という記事をお読みください。 -

-
注意:Mac 版の SDK は PowerPC 版のみダウンロード可能です。Intel 版が必要な場合はそのページの説明に従って自分でコンパイルする必要があります。
-

このコマンドを実行して typelib をコンパイルします。ここで、<tt>{sdk_dir}</tt> は Gecko SDK を解凍したディレクトリです。 -

-
{sdk_dir}/bin/xpidl -m typelib -w -v -I {sdk_dir}/idl -e HelloWorld.xpt HelloWorld.idl
-
-

これで HelloWorld.xpt という typelib ファイルが現在の作業ディレクトリに作成されます。 -

-

コンポーネントの作成

-

HelloWorld.js -

-
/***********************************************************
-定数
-***********************************************************/
-
-// nsIHelloWorld.idl 内のインタフェース定義への参照
-const nsIHelloWorld = Components.interfaces.nsIHelloWorld;
-
-// すべてのコンポーネントがサポートしなければならない必須の基本インタフェースへの参照
-const nsISupports = Components.interfaces.nsISupports;
-
-// このコンポーネントを一意的に識別する UUID
-// http://kruithof.xs4all.nl/uuid/uuidgen にて生成可能
-const CLASS_ID = Components.ID("{xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxx}");
-
-// 説明
-const CLASS_NAME = "My Hello World Javascript XPCOM Component";
-
-// テキスト形式の一意識別子
-const CONTRACT_ID = "@dietrich.ganx4.com/helloworld;1";
-
-/***********************************************************
-クラス定義
-***********************************************************/
-
-// クラスコンストラクタ
-function HelloWorld() {
-};
-
-// クラス定義
-HelloWorld.prototype = {
-
-  // このインタフェースで公開したい関数の定義
-  hello: function() {
-      return "Hello World!";
-  },
-
-  QueryInterface: function(aIID)
-  {
-    if (!aIID.equals(nsIHelloWorld) &&
-        !aIID.equals(nsISupports))
-      throw Components.results.NS_ERROR_NO_INTERFACE;
-    return this;
-  }
-};
-
-/***********************************************************
-クラスファクトリ
-
-このオブジェクトはグローバルスコープである Components.classes のメンバ。
-コントラクト ID がキーになっている。例:
-
-myHelloWorld = Components.classes["@dietrich.ganx4.com/helloworld;1"].
-                          createInstance(Components.interfaces.nsIHelloWorld);
-
-***********************************************************/
-var HelloWorldFactory = {
-  createInstance: function (aOuter, aIID)
-  {
-    if (aOuter != null)
-      throw Components.results.NS_ERROR_NO_AGGREGATION;
-    return (new HelloWorld()).QueryInterface(aIID);
-  }
-};
-
-/***********************************************************
-モジュール定義(xpcom 登録)
-***********************************************************/
-var HelloWorldModule = {
-  registerSelf: function(aCompMgr, aFileSpec, aLocation, aType)
-  {
-    aCompMgr = aCompMgr.
-        QueryInterface(Components.interfaces.nsIComponentRegistrar);
-    aCompMgr.registerFactoryLocation(CLASS_ID, CLASS_NAME,
-        CONTRACT_ID, aFileSpec, aLocation, aType);
-  },
-
-  unregisterSelf: function(aCompMgr, aLocation, aType)
-  {
-    aCompMgr = aCompMgr.
-        QueryInterface(Components.interfaces.nsIComponentRegistrar);
-    aCompMgr.unregisterFactoryLocation(CLASS_ID, aLocation);
-  },
-
-  getClassObject: function(aCompMgr, aCID, aIID)
-  {
-    if (!aIID.equals(Components.interfaces.nsIFactory))
-      throw Components.results.NS_ERROR_NOT_IMPLEMENTED;
-
-    if (aCID.equals(CLASS_ID))
-      return HelloWorldFactory;
-
-    throw Components.results.NS_ERROR_NO_INTERFACE;
-  },
-
-  canUnload: function(aCompMgr) { return true; }
-};
-
-/***********************************************************
-モジュール初期化
-
-アプリケーションがコンポーネントを登録するときにこの関数が呼び出される。
-***********************************************************/
-function NSGetModule(aCompMgr, aFileSpec) { return HelloWorldModule; }
-
-
-

インストール

-

拡張機能に

-
  1. HelloWorld.js と HelloWorld.xpt を {extensiondir}/components/ にコピーする -
  2. プロファイルディレクトリから compreg.dat と xpti.dat を削除する -
  3. アプリケーションを再起動する -
-

Firefox に

-
  1. ソースから実行する場合、HelloWorld.js と HelloWorld.xpt を {objdir}/dist/bin/components ディレクトリにコピーする -
  2. components ディレクトリから compreg.dat と xpti.dat を削除する -
  3. プロファイルディレクトリから compreg.dat と xpti.dat を削除する -
  4. アプリケーションを再起動する -
-

コンポーネントの使用

-
try {
-        // JavaScript 内でコンポーネントを使用できるようにするには、一般にこれが必要
-        netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
-
-        var myComponent = Components.classes['@dietrich.ganx4.com/helloworld;1']
-                                    .createInstance(Components.interfaces.nsIHelloWorld);
-
-        alert(myComponent.hello());
-} catch (anError) {
-        dump("ERROR: " + anError);
-}
-
-

その他の資料

- -
-
-{{ languages( { "en": "en/How_to_Build_an_XPCOM_Component_in_Javascript", "zh-cn": "cn/How_to_Build_an_XPCOM_Component_in_Javascript" } ) }} diff --git a/files/ja/mozilla/tech/xpcom/guide/index.html b/files/ja/mozilla/tech/xpcom/guide/index.html deleted file mode 100644 index 725b612220..0000000000 --- a/files/ja/mozilla/tech/xpcom/guide/index.html +++ /dev/null @@ -1,16 +0,0 @@ ---- -title: XPCOM guide -slug: Mozilla/Tech/XPCOM/Guide -tags: - - Landing - - Mozilla - - NeedsTranslation - - TopicStub - - XPCOM -translation_of: Mozilla/Tech/XPCOM/Guide ---- -

These articles provide tutorials and usage documentation for XPCOM, including how to use it in your own projects and how to build XPCOM components for your Firefox add-ons and the like.

-
-
How to Build an XPCOM Component in Javascript
XPCOM string guide
このガイドは過剰に存在しているstringクラスについてドキュメント化したものです。これによって「こういう場合、いったいどのstringクラスを使ったらいいの?」という長年の疑問に対する答えとなることを期待しています。
-
XPCOM ハッシュテーブル・ガイド
ハッシュテーブルは、アイテムを格納するための構造体です。個々のアイテムは、それぞれを識別するためのキーを持ちます。ハッシュテーブルからアイテムを検索・追加・削除するためにはキーを使います。ハッシュテーブルは配列に似ていますが、以下に示すような大きな違いがあります。
-
diff --git a/files/ja/mozilla/tech/xpcom/guide/mozilla_internal_string_guide/index.html b/files/ja/mozilla/tech/xpcom/guide/mozilla_internal_string_guide/index.html deleted file mode 100644 index bdcb54baa2..0000000000 --- a/files/ja/mozilla/tech/xpcom/guide/mozilla_internal_string_guide/index.html +++ /dev/null @@ -1,834 +0,0 @@ ---- -title: XPCOM string guide -slug: Mozilla/Tech/XPCOM/Guide/Mozilla_internal_string_guide -tags: - - 移行 - - 要更新 -translation_of: Mozilla/Tech/XPCOM/Guide/Internal_strings ---- -

序文

- -
-

by Alec Flett
- Thanks to David Baron for actual docs,
- Peter Annema for lots of direction,
- Myk Melez for some more docs, and
- David Bradley for a diagram
- Revised by Darin Fisher for Mozilla 1.7
- Revised by Jungshik Shin to clarify character encoding issues

-
- -

 このガイドは過剰に存在しているstringクラスについてドキュメント化したものです。これによって「こういう場合、いったいどのstringクラスを使ったらいいの?」という長年の疑問に対する答えとなることを期待しています。

- -
-

 もしあなたがMozillaの組み込み開発者か、もしくはMozillaコードベースとは別個に配布されることを予定しているXPCOMコンポーネントを書いているなら、この文書は多くの場合あなたにとって最適のものとは言えません!もしあなたがMozilla 1.7以降を対象に開発を行っているなら、この文書の代わりに新しい最小版APIである xpcom/glue/nsStringAPI.h とりわけxpcom/string/public/nsEmbedString.h クラスを使うべきです。

-
- -

 お急ぎですか?それなら String Quick-Reference () を見てください。

- -

はじめに

- -

string クラスは、unicode と 1バイト文字の文字列のバッファを扱うために使われる C++ クラスのライブラリです。 これらは xpcom/string ディレクトリの Mozilla コードベースに属します。

- -

Abstract (interface) クラスは"nsA"で始まり、 具象クラスは"ns"で始まります。 "CString" を名前に持つクラスは シングルバイト ASCII 文字列もしくは、UTF-8 やその他の文字セットでエンコードされたマルチバイト unicode 文字列を参照する 8 ビット文字を格納します。 名前に単に "String" を持つ他のすべてのクラスは、 主に UTF16 でエンコードされる 2バイト(PRUnichar)文字列を参照します。 例:nsAString は 2バイト文字を蓄えるための抽象クラスで、 nsDependentCString は 1バイト文字を蓄えるための具象クラスです。 どの 2バイト文字列クラスも同等の 1バイト文字列クラスを持ちます。 例:nsCString クラスは 1バイト文字列クラスで、 nsString と対応します。

- -

1バイトと 2バイトの文字列クラスは完全に異なる基底クラスを持ちますが、 同じ API を共有します。 このように、1バイト文字列を 2バイト文字列へ、何らかのヘルパークラスかルーチンによる変換なしに代入することは出来ません。 このドキュメントの目的は、クラスドキュメントの中で 2バイト文字列クラスについて言及することです。 どの 2バイトクラスも同等の 1バイトクラスを持つと仮定しても安全です。

- -

String ガイドライン

- -

仲間の開発者、レビューワ、ユーザをハッピーにさせるために、コードの中でこれらの単純なルールに従ってください。

- - - -

 

- -

Abstract(抽象)クラス

- -

どの string クラスも nsAString(もしくは nsACString) から派生しています。 このクラスはアクセスと文字列操作のための基礎インタフェースを提供します。 具象クラスが nsAStringから派生する一方、 nsAString自身はインスタンス化できません。

- -

これは、コードベースの他の部分で抽象オブジェクト記述の記述のために Mozilla が使っている "interface" の考え方によく似ています。 インタフェースについて、クラス名は "nsI" で始まり、"I" は "Interface" を意味します。 抽象クラスは "nsA" で始まり、"A" は "Abstract" を意味します。

- -

nsAString から派生した抽象クラスがたくさんあります。 これらの抽象サブクラスもまたインスタンス化できません。 しかし、それらは nsAString よりもわずかながらより詳細に string を記述します。 それからは、抽象クラスの背後で下敷きになった実装が nsAString に加えて特定の能力を提供することを保証します。

- -

以下のリストで主な抽象クラスについて記述します。一度それらになじんだら、どのクラスをいつ使うかを参照してください。

- - - -

その他の string クラスは、nsSubstringnsString かを継承しています。 そのため、どの文字列クラスも nsAString と互換があります。

- -

nsSubstringnsAString は共に null 終端である必要のない一続きの文字の配列を示していることに言及するのは重要なことでしょう。 この似通った二つのクラスが存在する必要があるのは何故なのかと疑問に思う人もいるでしょう。 えぇ、nsSubstring は主として、最適化目的に存在します。それは、nsAString が Mozilla 1.0 とともにリリースされた凍結された nsAString crustバイナリレベルの互換を保たなくてはならないからです。 Mozilla 1.7 のリリースまで、nsAString は複合的な断片に分けられた文字列を表す能力を持っていました。 複合的な断片に分けられた文字列のサポートに関するコストは高く、限られたメリットを提供していました。 文字列クラスの複雑さを減らして、パフォーマンスを改善しようという努力のために、複合的な断片に分けられた文字列のサポートを削減する決定がなされました。詳細は bug 231995 を参照して下さい。

- -

nsSubstring は、下敷きとしている nsAString バッファへのより効果的なインタフェースを提供していますが、nsAString は未だにパラメータ渡しのためにもっとも共通して使われています。 それは、XPIDL の AString と対応した文字辣クラスだからです。 そのために、この文字列ガイドは nsAString に重点を置いた文字列クラスについて言及し続けるでしょう。

- -

どの stiring も nsAString(もしくは nsACString) から派生しているため、それらはいくつかの基礎となる機能を共有します。

- -

読取専用の共通メソッド:

- - - -

文字列修正の共通メソッド:

- - - -

付録に完全なドキュメントがあります。

- -

 

- -

読取専用 strings

- -

string 上でのconst 属性は string が書き込み可能かどうかを示します。 もし、string がconst nsAString のように定義されていたら、string 内のデータは操作不可です。 もし、const でないメソッドを const string 上で呼び出そうとしても、 コンパイラはビルド時にエラーとしてこれを示します。

- -

例:

- -

 

- -
void nsFoo::ReverseCharacters(nsAString& str) {
-      ...
-     str.Assign(reversedStr); // modifies the string
-}
-
- -

これはコンパイルできない。なぜなら、const クラスへ代入しているから:

- -
void nsFoo::ReverseCharacters(const nsAString& str) {
-      ...
-     str.Assign(reversedStr);
-}
-
- -

 

- -

関数の引数としての Abstract(抽象)クラス

- -

関数の引数としては、具象クラスの代わりにできる限りもっとも抽象的なインタフェースを使うことが推奨されます。 文字列を参照渡しする場合には、ポインタ('*'文字)ではなく、C++の参照('&' 文字)を用いるのが習慣です。たとえば:

- -
// 抽象クラスによる参照
-nsFoo::PrintString(const nsAString& str) {..}
-
-// 具象クラスを使っている!
-nsFoo::PrintString(const nsString& str) {..}
-
-// ポインタを使っている!
-nsFoo::PrintString(const nsAString* str) {..}
-
- -

抽象クラスはまた、ときどきオブジェクトへの一時的な参照を蓄えるのにも使われます。 これらの両方の使い方は、後述の共通パターンを参照してください。

- -

 

- -

具象クラス

- -

具象クラスは string データを実際に蓄える必要があるコードの中で使うためのものです。 具象クラスのもっともありがちな使い方は、ローカル変数もしくはクラスや構造体のメンバとして使うというものです。 抽象クラスはそれぞれデータの格納方式が違うために、大抵は具象クラスの格納方針も異なります。

- -

以下はに、もっとも一般的な具象クラスの一覧を示します。一度それらになじんだら、どのクラスをいつ使うかを参照してください。 The following is a list of the most common concrete classes. Once you are familiar with them, see the appendix describing What Class to Use When.

- - - -

ヘルパールーチンなどの副産物として作られた具象クラスはたくさんあります。 これらのクラスは直接使うことを避けるべきです。 string ライブラリから自分のためのクラスを作ってください。

- - - -

もちろん、あなたのコードの中のこれらの string クラスの参照が必要な時はあります。 しかし、一般的なルールでは、これらは使わない方がよいです。

- -

イテレータ

- -

イテレータは string の中の位置への参照を保つオブジェクトです。 ある意味で、これらは配列の中のインデックスを参照する数値や、 文字列の中の位置を参照する文字ポインタのようなものです。 イテレータは、文字列への読み込みと書き込みとを区別する文法的な意味も提供します。

- -

イテレータは文字列の部分文字列の抽出のためにもっともよく用いられるべきです。 これらは文字列の内容の修正のための機能を提供しますが、 たいていはヘルパールーチン、つまり文字列自身のメソッドの方が、複雑な文字列変換より早いでしょう。

- -

イテレータは繰り返している文字列クラスで宣言されます:

- -
nsAString::const_iterator start, end; // 読み取り専用イテレータ
-    nsAStrings
-    nsAFlatString::iterator substr_start, substr_end; // nsString のための書き込み用イテレータ
-
- -

イテレータは string にある4つのメソッドのうちあなたが参照したい一つにより初期化されます:

- -
// 'str' から読み込もう
-str.BeginReading(start); // 'str' の先頭で 'start' を初期化する
-str.EndReading(end); // 'end' は string の終端になるでしょう
-
-// 'url' に書き込みもしたいんです
-url.BeginWriting(substr_start);
-url.EndWriting(substr_end);
-
- -

ポインタ参照オペレータ * によってイテレータが指す文字へアクセス可能です。

- -
if (*start == '[')
-     printf("Starts with a bracket\n");
-
- -

上記例では、'end' と 'substr_end' は実際にかつて string の終端だった文字を指すでしょう。 なので、.EndReading() の結果を直接ポインタ内容参照してはいけないことに注意してください。

- -

二つのイテレータが同じ位置を指すかどうかは、== か != で調べることが出来ます。 ++ でイテレータの参照を進めることも出来ます。 ++ はイテレータの前にもってくることが好まれます。そして、それは一時的なイテレータの作成を防ぐことになります。

- -

 

- -
while (start != end) // string 全体を通して順番に回る
-     ++start;
-
- -

(const-iterators とは反対のように)書き込みイテレータにより、効果的に string に書き込むことが出来ます:

- -

 

- -
// * をすべて ! に変える
-while (substr_start != substr_end) {
-     if (*substr_start == '*')
-          *substr_start = '!';
-     ++substr_start;
-}
-
- -

With the patch for bug 231995, this loop is now as efficient as iterating with raw character pointers.

- -

 

- -

イテレータによるループ

- -

原文ではindex部分には残っていますが、見出し、a nameを含めて削除されています。

- -

ヘルパークラスと関数

- -

文字列検索

- -

FindInReadable() はかつての string.Find(..) の代わりのものです。 構文は:

- -
PRBool FindInReadable(const nsAString& pattern,
-                      nsAString::const_iterator start, nsAString::const_iterator end,
-                      nsStringComparator& aComparator = nsDefaultStringComparator());
-
- -

これを使うために、startend は検索したい文字列のそれぞれ先頭と終端をさしていなくてはなりません。 もし、探している文字列が見つかったら、startend は見つかった部分の先頭と終端を指すように調整されます。 戻り値は、PR_TRUE か PR_FALSE で、文字列が見つかったかどうかを示します。

- -

例:

- -
const nsAString& str = GetSomeString();
-nsAString::const_iterator start, end;
-
-str.BeginReading(start);
-str.EndReading(end);
-
-NS_NAMED_LITERAL_STRING(valuePrefix, "value=");
-
-if (FindInReadable(valuePrefix, start, end)) {
-    // end は今、検索した文字の後ろを指している
-    valueStart = end;
-}
-
- -

メモリ割当

- -

既存の文字列から新しい文字列バッファ(PRUnichar*/char*)を割り当てるために好ましいメソッドは、 以下のメソッドです:

- - - -

これらのメソッドは These methods return a buffer allocated using XPCOM's allocator (nsMemory::Alloc) instead of the traditional allocator (malloc, etc.). You should use nsMemory::Free to deallocate the result when you no longer need it. これらのメソッドは伝統的なアロケータ (malloc など)の代わりに XPCOM のアロケータ (nsMemory::Alloc)で割り当てられたバッファを返すでしょう。 必要としなくなった時、その戻り値を開放するために nsMemory::Free を使うべきです。

- -

既存の文字列の断片

- -

実際に新しいスペースを割り当てたり、その文字列の部分文字列の文字をコピーしたりしないで既存の文字列の部分文字列を参照するのはとても簡単です。Substring() はそのような文字列への参照を生成するのにとてもよいメソッドです。

- -
void ProcessString(const nsAString& str) {
-    const nsAString& firstFive = Substring(str, 0, 5);
-    // firstFive は今最初の 5 文字を示す文字列です
-}
-
- -

 

- -

Unicode 変換

- -

文字列は二つの基本的な形式で保存することができます。 8 ビット文字(char)文字列もしくは、16 ビット文字(PRUnichar)文字列です。 クラス名に大文字の「C」を持つどの文字列クラスも、8 ビット文字を含みます。 それには、nsCString、nsDependentCString などのクラスが含まれます。 「C」を持たないどの文字列クラスも、16 ビット文字を含みます。

- -

格納構造に加え、文字列はまた、エンコードもされているという側面があります。 文字列のエンコーディングは、8 もしくは 16 ビットの文字列として unicode 文字値の組を保持することを意味します。 大きな文字値を小さな容量の文字列として保存する方法がたくさんあるため、エンコーディングがたくさんあります。 文字セットは、特定のエンコーディング方法の人間が理解できる名称です。 例えば、「ASCII」は 7 ビット値を 8 ビット文字列にマッピングした文字セットです。 「isolatin1」は8 ビット文字列で西欧文字エンコーディングするための共通文字セットです。

- -

文字列の文字セットは、文字列クラスの名前によって定義されていません。 そのかわり、文字列の適切なエンコーディングを決定することは実装者の責任です。 もっとも一般的なのエンコーディングは:

- - - -

加えて、国際化ライブラリによって提供される文字通り何百のエンコーディングがあります。 これらのライブラリへのアクセスは、アプリケーションの一部であるか(例えば Mozilla の nsICharsetConversionManager のように)、オペレーティングシステムへビルドされている(例えば Unix 系 OS の iconv() のように)でしょう。

- -

既存のコードで作業する時、正しい変換機構を決定するために、操作している文字列の現在の使い方を吟味することは重要です。

- -

新しいコードを書く時、どの格納クラスそしてエンコーディングがもっとも適切かを知ろうとしても混乱するかもしれません。この問題への単純な答えはありません。しかし、少数の重要なガイドラインがあります:

- - - -

ASCII、UTF8、UCS2 の変換を助けるため、 いくつかのヘルパーメソッドとヘルパークラスがあります。 これらのクラスのうちいくつかは、スタック上の一時オブジェクトとしてもっともよく使われるため、関数のように見えます。

- -

To assist with ASCII, UT8 and UCS2 conversions, there are some helper methods and classes. Some of these classes look like functions, becuase they are most often used as temporary objects on the stack.

- -

UTF8 / UCS2 変換

- - - -
/* シグネチャ: void HandleUnicodeString(const nsAString& str); */
-object->HandleUnicodeString(NS_ConvertUTF8toUCS2(utf8String));
-
- -
/* シグネチャ: void HandleUnicodeBuffer(const PRUnichar* str); */
-object->HandleUnicodeBuffer(NS_ConvertUTF8toUCS2(utf8String).get())
-
-
- - - -
/* シグネチャ: void HandleUTF8String(const nsACString& str); */
-object->HandleUTF8String(NS_ConvertUCS2toUTF8(unicodeString));
-
- -
/* シグネチャ: void HandleUTF8Buffer(const char* str); */
-object->HandleUTF8Buffer(NS_ConvertUCS2toUTF8(unicodeString).get())
-
- - - -
// UCS2 値を返す
-void Foo::GetUnicodeValue(nsAString& result) {
-    CopyUTF8toUCS2(mLocalUTF8Value, result);
-}
-
- - - -
// UTF8 値を返す
-void Foo::GetUTF8Value(nsACString& result) {
-    CopyUCS2toUTF8(mLocalUnicodeValue, result);
-}
-
- - - -
void Foo::GetUTF8Value(const char** result) {
-  *result = ToNewUTF8String(mLocalUnicodeValue);
-}
-
- -

 

- -

損失の多い変換

- -

以下はオリジナル文字列が ASCII ベースであることが保証できるときだけ使われるべきです。

- -

UCS2 から ASCII へのコンバータ

- -

これらのコンバータ(変換機構)は、変換プロセスの中で情報の消失があるためとても危険です。UCS2 から ASCII への変換は、文字列が ASCII であることが保証されない限りさけるべきです。どの UCS2(16 ビット)文字も、8 ビット文字は単に 8 ビット文字にキャストされます。それは、0xFF を超えるすべての文字の値は任意の 8 ビット文字に変換されてしまうということです。

- - - -

 

- -

ASCII から UCS2 へのコンバータ

- -

これらは、ASCII でない文字列を無意味な unicode 文字列に壊してしまうため、とても危険です。 ASCII から UCS2 への変換は、文字列が ASCII であることが保証されない限りさけるべきです。 つまり、もし複数バイト文字セットの 8 ビット文字列エンコードされたものを持っている場合、文字列のどのバイトもただキャストによって 16 バイト数値に"水増し"されるだけなのです。

- -

例えば、文字列の最初の unicode 文字が 4 バイトの UTF-8 シーケンスで表されているような UTF-8 文字列を想像してください。"水増しされた" unicode 文字列の最初の 4 バイトは最初の文字をあらわす 4 つの値を含んでいます。これらの値は文字列を UCS2 として扱うなら無意味です。

- - - -

 

- -

共通パターン

- -

多くの API は、呼び出し元に文字列を返すためのバッファを割り当てるメソッドとなります。 バッファを使い終えた時に呼び出し元が文字列を解放することを覚えている必要があるため、これはトリッキーでもあります。 幸運にも、nsXPIDLString クラスでこれを簡単に行えます。

- -


- メソッドはこのような感じです:

- -
void GetValue(PRUnichar** aValue)
-{
-    *aValue = ToNewUnicode(foo);
-}
-
- -

文字列クラスなしで、呼び出し元は文字列を解放する必要があるでしょう:

- -
{
-    PRUnichar* val;
-    GetValue(&val);
-
-    if (someCondition) {
-        // 値を解放することを忘れてはいけない
-        // don't forget to free the value!
-        nsMemory::Free(val);
-        return NS_ERROR_FAILURE;
-    }
-
-    ...
-    // 後で、やはり解放を忘れてはいけない!
-    // and later, still don't forget to free!
-    nsMemory::Free(val);
-}
-
- -

nsXPIDLString を使えば、このことを心配する必要はありません。 getter_Copies() を使って文字列クラスをラップするだけで、 スコープの外へ出た時にクラスがバッファを解放するでしょう。

- -
{
-    nsXPIDLString val;
-    GetValue(getter_Copies(val));
-
- -
    // val はここで自身によって解放されるでしょう
-    // val will free itself here
-    if (someCondition)
-        return NS_ERROR_FAILURE;
-    ...
-    // 後で、やはり解放する必要がない
-    // and later, still nothing to free
-}
-
- -

結果としてのコードはとても単純で、読みやすいです。

- -

 

- -

リテラル文字列

- -

リテラル文字列は C++ コードに書かれた生の文字列の値です。 例えば、printf("Hello World\n"); ステートメント中の値 "Hello World\n" はリテラル文字列です。 nsAString や nsACString が必要なとき、リテラル文字列値を挿入する必要がしばしば発生します。 これら 4 つのマクロは必要な変換のために提供されています:

- - - -

nsDependentCString もまた nsCString の中の文字列の値をラップすることを考えれば、これらのマクロの CSTRING 版は、一見不要に見えます。これらのマクロの長所は、これらの文字列の長さがコンパイル時に計算できるため、実行時に長さを決めるために文字列を読み込む必要がありません。

- -

これらのマクロの STRING 版は、(例えば、MSVC++ や -fshort-wchar オプション付きの GCC のように)リテラル unicode 文字列をサポートするプラットフォーム上での実行時の変換をしないで、unicode 版の固定のリテラル string を宣言する移植性のある方法を提供します。

- -
// Init(const PRUnichar*) 呼び出し
-Init(L"start value"); // よくない - L"..." は移植性が低い!
-Init(NS_ConvertASCIItoUCS2("start value").get()); // よくない - 実行時の ASCII->UCS2 変換!
-
-// Init(const nsAString&) 呼び出し
-Init(nsDependentString(L"start value")); // よくない - 移植性が低い!
-Init(NS_ConvertASCIItoUCS2("start value")); // よくない - 実行時の ASCII->UCS2 変換!
-
-// Init(const nsACString&) 呼び出し
-Init(nsDependentCString("start value")); // よくない - 文字列長が実行時に決まる
-
- -

適切な NS_LITERAL_[C]STRING 使用法を以下にいくつか示します。

- -
// Init(const PRUnichar*) 呼び出し
-Init(NS_LITERAL_STRING("start value").get());
-
-// Init(const nsAString&) 呼び出し
-Init(NS_LITERAL_STRING("start value"));
-
-// Init(const nsACString&) 呼び出し
-Init(NS_LITERAL_CSTRING("start value"));
-
- -


- これらのマクロを使った問題の追跡に役に立つであろう詳細をいくつか示します:

- -

NS_LITERAL_STRING は(Windows や Macintosh などといった)いくつかのプラットフォーム上でコンパイル時に UCS2 への変換をしますが、他のプラットフォームでは実行時に変換されます。NS_LITERAL_STRING を使うことによって、あなたのコードで問題のプラットフォームのために最良の変換が使われることを保証します。

- -

いくつかのプラットフォームで実行時変換が行われるため、NS_LITERAL_STRING/NS_NAMED_LITERAL_STRING マクロ内部でのリテラル文字列連結の使用は、それらのプラットフォームではコンパイルされるでしょうが、コンパイル時変換をサポートするプラットフォーム上ではコンパイルできないでしょう。

- -

以下に例示します:

- -

 

- -
// Init(nsAString&) 呼び出し
-Init(NS_LITERAL_STRING("start "
-     "value")); // いくつかのプラットフォームでだけコンパイルされます。
-
- -

その理由は、いくつかのプラットフォームでL"..." 構文が使われますが、これは連結の最初の文字列にだけ適用されるためです("start ")。コンパイラは unicode でない文字列 "value" との連結を試みると困惑します。

- -

文字列連結

- -

文字列は + 演算子を用いて互いに連結可能です。結果となる文字列は const nsAString オブジェクトとなります。 結果となる文字列は、その他の nsAString のように振る舞いをさせることも参照もできます。 連結は部分文字列のコピーではありません。代わりに、オリジナルの文字列を参照するに過ぎません。 結果としての文字列は、少なくとも連結された文字列と同じだけの生存期間を持つという意味で、その部分文字列のすべてに依存します。

- -

例えば、二つの文字列の値を使うことができ、接続を const nsAString& をとる他の関数に引き渡すことができます:

- -
void HandleTwoStrings(const nsAString& one, const nsAString& two) {
-    // HandleString(const nsAString&) 呼び出し
-    HandleString(one + two);
-}
-
- -

注意:このケースでは、二つの文字列は暗黙のうちに一時的な nsString に結びつけられ、 一時的 string は、HandleString に渡されます。 もし、HandleString がその入力を他の nsString へ代入したならば、 いくつかの文字列を連結し、その結果を一時変数に格納することもできます:

- -
NS_NAMED_LITERAL_STRING(start, "start ");
-NS_NAMED_LITERAL_STRING(middle, "middle ");
-NS_NAMED_LITERAL_STRING(end, "end");
-// 3つの相互依存した断片を持つ string を生成 - 複雑なコピーではない!
-nsString combinedString = start + middle + end;
-
- -

 

- -
// void HandleString(const nsAString&); 呼び出し
-HandleString(combinedString);
-
- -

もし、一度きりだけ使う一時的なものを作るために NS_LITERAL_STRING を使うのなら、 結合の中で定義するのが安全でしょう。なぜなら、文字列バッファは(nsSubstringTuple 型の)一時的結合オブジェクトと同じ生存期間となるからです。

- -
// HandlePage(const nsAString&); 呼び出し
-// 結合された文字列はその部分文字列と同じ生存期間なので安全
-HandlePage(NS_LITERAL_STRING("start ") + NS_LITERAL_STRING("end"));
-
- -

ローカル変数

- -

関数内のローカル変数は通常、スタック上に確保されます。 nsAutoString/nsCAutoString クラスは、 nsString/nsCString の派生物です。 これらが、文字列自身と同じ格納領域に割り当てられた 64 文字のバッファを持ちます。 もし、nsAutoString がスタック上に割り当てられていれば、文字列は破棄時に 64 文字スタックバッファ持ちます。 They own a 64-character buffer allocated in the same storage space as the string itself. If the nsAutoString is allocated on the stack, then it has at its disposal a 64-character stack buffer. このことにより、小さな文字列を扱う時、余計なメモリの割り当てをしないで実装することができます。

- -
...
-nsAutoString value;
-GetValue(value); // 結果が 64 文字より少なければ、
-                 // 割り当てを省くことができる。
-GetValue(value); // if the result is less than 64 characters,
-                 // then this just saved us an allocation
-...
-
- -

メンバ変数

- -

一般に、メンバ変数としては、nsStringnsCString といった具象クラスを使うべきでしょう。

- -
class Foo {
-    ...
-    // これらは UTF8 や unicode 値を各々格納する
-    // these store UTF8 and Unicode values respectively
-    nsCString mLocalName;
-    nsString mTitle;
-};
-
- -

文字列は直接クラスの中で宣言され、文字列へのポインタとして宣言されるのではないことに注意してください。 このようにはしないでください:

- -

Note that the strings are declared directly in the class, not as pointers to strings. Don't do this:

- -
class Foo {
-public:
-    Foo() { mLocalName = new nsCString(); }
-    ~Foo() { delete mLocalName; }
-
-private:
-    // これらは UTF8 や unicode 値を各々格納する
-    // these store UTF8 and Unicode values respectively
-    nsCString* mLocalName;
-};
-
- -

上記のコードは文字列オブジェクトのコストを節約しているように見えるかもしれませんが、 nsString/nsCString は小さなオブジェクトです。 割り当てのオーバーヘッドは、ポインタで節約するよりも数バイト勝っているだけです。

- -


- その他の間違ったパターンとしては、メンバ変数として、 nsAutoString/nsCAutoString を使うというものがあります。 ローカル変数で述べたように、 これらのクラスはとても大きなバッファを中にもって作られます。 もしクラスの中にこれらを持つことは、クラスを 64 バイト(nsCAutoString)もしくは 128 バイト(nsAutoString)膨らませることになります。

- -


- 例:

- -
class Foo {
-    ...
-
-    // Foo クラスが 128 バイト膨らむ!
-    // bloats 'Foo' by 128 bytes!
-    nsAutoString mLocalName;
-};
-
- -

 

- -

生の文字ポインタ

- -

PromiseFlatString() は、元になった文字列と同じ値を含む null 終端のバッファを持つ一時バッファを生成するのに使うことができます。 PromiseFlatString() は必要ならば一時バッファを作ります。 これは多くの場合、nsAString を null 終端文字列を要求する API に通すために使われます。

- -

以下の例では、nsAString はリテラル文字列と一体化されます。そして結果は単純な文字バッファを求める API に通されます。

- -
// URL を修正し、AddPage(const PRUnichar* url) へ通す
-void AddModifiedPage(const nsAString& url) {
-    NS_NAMED_LITERAL_STRING(httpPrefix, "http://");
-    const nsAString& modifiedURL = httpPrefix + url;
-
-    // 一時バッファ生成
-    AddPage(PromiseFlatString(modifiedURL).get());
-}
-
- -

既に null 終端である文字列を扱うとき、PromiseFlatString() は洗練された方法です。 そのようなケースで一時バッファを作らなくてすみます。

- -

 

- -
// URL を修正し、AddPage(const PRUnichar* url) へ通す
-void AddModifiedPage(const nsAString& url, PRBool addPrefix) {
-    if (addPrefix) {
-        // 一時バッファを作成なければならない - 文字列は複数の断片でできている
-        NS_NAMED_LITERAL_STRING(httpPrefix, "http://");
-        AddPage(PromiseFlatString(httpPrefix + modifiedURL));
-    } else {
-        // 一時バッファを作成してもよい、実行時にチェックする
-        AddPage(PromiseFlatString(url).get());
-    }
-}
-
- -

 

- -

IDL

- -

文字列ライブラリは IDL を通しても利用できます。 特別に IDL 型を定義することによって属性やメソッドを宣言することで、 string クラスは対応メソッドへの引数として使えます。

- -

 

- -

IDL 文字列型

- -

C++ シグネチャにより、メソッドのすべての引数が抽象クラスをベースにしているようなのような上述通りの抽象型を定義することができます。 以下のテーブルには IDL のそれぞれの文字列型の目的を記します。

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
IDL typeC++ TypePurpose
stringchar*Raw character pointer to ASCII (7-bit) string, no string classes used. High bit is not guaranteed across XPConnect boundaries
wstringPRUnichar*Raw character pointer to UTF-16 string, no string classes used
AStringnsAStringUTF-16 string
ACStringnsACString8-bit string, all bits are preserved across XPConnect boundaries
AUTF8StringnsACStringUTF-8 string - converted to UTF-16 as necessary when value is used across XPConnect boundaries
DOMStringnsAStringUTF-16 string used in the DOM. More or less the same as AString, but in JavaScript it has no distinction between whether the string is void or just empty. (not sure on this, looking for corrections.
- -

C++ シグネチャ

- -

IDL では、in 引数は読み込み専用で、*String 引数に対する C++ シグネチャにより、それらの引数のための const nsAString& を使った上記ガイドラインが行えます。 outinout 引数は、呼ばれた側で書き込み可能なよう単純に nsAString として定義されています。

- - - - - - - - - - - - -
IDLC++
-
-interface nsIFoo : nsISupports {
-
-    attribute AString utf16String;
-
-
-
-
-    AUTF8String getValue(in ACString key);
-
-};
-
-
-
-class nsIFoo : public nsISupports {
-
-     NS_IMETHOD GetUtf16String(nsAString&
-                               aResult) = 0;
-     NS_IMETHOD SetUtf16String(const nsAString&
-                              aValue) = 0;
-
-     NS_IMETHOD GetValue(const nsACString& aKey,
-                     nsACString& aResult) = 0;
-};
-
-
- -

上記の例では、unicodeString は Unicode 文字列として扱われています。 GetUnicodeString() のインプリメントでは aResult.Assign を値を返す("return"する)のに使っています。 SetUnicodeString() では、文字列の値はイテレータPromiseFlatString、その他の文字列への代入などを含む雑多なメソッドを通して使うことができます。

- -

GetValue() では、最初の引数である aKey は、生の 8 ビット 値の連続として扱われます。 aKey 内の ASCII でないどの文字列も、XPConnect 境界を越えた場合も内容が保証されます。 GetValue() のインプリメンテーションは UTF-8 エンコードされた 8 ビット文字列の aResult への代入となっています。 もし、このメソッドがスクリプトからの呼び出しなどによって XPConnect の境界を越えて呼ばれたとき、結果は UTF-8 から UCS2へデコードされ、Unicode 値として利用されます。

- -

文字列型の選択

- -

IDL で使う正しい文字列型を決めるのは難しいかもしれません。 以下の点は適切な文字列型を決める助けになるでしょう。

- - - -

付録 A: どのクラスをいつ使うか

- -

この表はどのクラスをいつ使うべきかを示すクィックリファレンスです。

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
内容クラスメモ
ローカル変数nsAutoStringnsCAutoString 
クラスのメンバ変数nsStringnsCString 
メソッドの引数の型nsAStringnsACString引数に抽象クラスを使う。入力引数には const nsAString& を使い、出力引数には nsAString& を使う。
出力文字列を回収するRetrieving "out" string/wstringsnsXPIDLStringnsXPIDLCStringgetter_Copies() を使う。nsString / nsCString と似ている。
文字バッファをラップするbuffersnsDependentStringnsDependentCStringconst char* / const PRUnichar* バッファをラップする。
リテラル文字列NS_LITERAL_STRINGNS_LITERAL_CSTRINGnsDependent[C]String と似ているが、ビルド時に長さが事前計算される。
- -

付録 B: nsAString リファレンス=

- -

読み込み専用メソッド

- - - -

文字列を修正するメソッド

- - diff --git a/files/ja/mozilla/tech/xpcom/guide/xpcom_hashtable_guide/index.html b/files/ja/mozilla/tech/xpcom/guide/xpcom_hashtable_guide/index.html deleted file mode 100644 index 9d2c618917..0000000000 --- a/files/ja/mozilla/tech/xpcom/guide/xpcom_hashtable_guide/index.html +++ /dev/null @@ -1,297 +0,0 @@ ---- -title: XPCOM ハッシュテーブル・ガイド -slug: Mozilla/Tech/XPCOM/Guide/XPCOM_hashtable_guide -translation_of: Mozilla/Tech/XPCOM/Guide/Hashtables ---- -

ハッシュテーブルとは何ですか?

- -

ハッシュテーブルは、アイテムを格納するための構造体です。個々のアイテムは、それぞれを識別するためのキーを持ちます。ハッシュテーブルからアイテムを検索・追加・削除するためにはキーを使います。ハッシュテーブルは配列に似ていますが、以下に示すような大きな違いがあります。

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 配列ハッシュテーブル
キー:整数。配列ではキーとして常に整数が利用され、またキーは連続している必要があります。任意の型。文字列、整数、 XPCOM インターフェースのポインタ、 IID を含む、ほとんどすべてのデータ型がキーとして利用できます。また、キーは連続している必要はありません(たとえば 1, 5, 3000 を利用できます)。
検索にかかる時間:O(1)。検索時間は定数時間です。O(1)。検索時間は一般に定数時間ですが、配列よりも定数時間だけ長くかかる可能性があります。
ソート:ソートされています。アイテムはソートされて保管されます。また、ソートされた順序で列挙されます。ソートされていません。アイテムはソートされずに保管されます。また、ソートされずに列挙されます。
追加・削除:O(n)。大きな配列へのアイテムの追加・削除は時間がかかる可能性があります。O(1)。ハッシュテーブルへのアイテムの追加・削除は高速に行われます。
余計に消費される領域:なし。配列は中が詰まった構造体であり、アイテムのサイズ以上に消費される領域はありません。あり。ハッシュテーブルは中が詰まった構造体ではありません。実装によりますが、大量のメモリが無駄に消費される可能性があります。
- -

実装としては、ハッシュテーブルはキーを渡されるとそのキーに数学的なハッシュ関数を適用してキーを乱数化します。以後、キーのハッシュ値がアイテムの場所の検索に利用されます。優れたハッシュテーブルの実装は、メモリが余計に必要になったとき、または多すぎる量のメモリが割り当てられているとき、自動的にハッシュテーブルのサイズを変更します。

- -

どんなときにハッシュテーブルを使うべきですか?

- -

ハッシュテーブルは以下のような場合に有用です。

- - - -

以下のような場合、ハッシュテーブルは利用されるべきではありません

- - - -

このような状況では、配列、連結リスト、様々な木構造などが効果的です。

- -

Mozilla のハッシュテーブル実装

- -

Mozilla ではいくつかのハッシュテーブルの実装を用意しています。これらはテスト・調整されており、また実装にかかわる内部の複雑さが隠蔽されています。

- - - -

どのハッシュテーブルを使えば良いですか?

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 キーの型:
integerString/CStringnsIDnsISupports*Complex
データ型:None (Hash Set)nsInt32HashSetns(C)StringHashSetnsTHashtable<...>
Simple (PRUint32)nsDataHashtablensTHashtable<...>
<nsUint32HashKey,
- PRUint32>
<ns(C)StringHashKey,
- PRUint32>
<nsIDHashKey,
- PRUint32>
<nsISupportsHashKey,
- PRUint32>
Interface (nsISupports)nsInterfaceHashtable
<nsUint32HashKey,
- nsISupports>
<ns(C)StringHashKey,
- nsISupports>
<nsIDHashKey,
- nsISupports>
<nsISupportsHashKey,
- nsISupports>
Class (nsString*)nsClassHashtable
<nsUint32HashKey,
- nsString>
<ns(C)StringHashKey,
- nsString>
<nsIDHashKey,
- nsString>
<nsISupportsHashKey,
- nsString>
Complex
- (structures, etc.)
nsTHashtable<...>
- -

PLDHash (JSDHash)

- -

PLDHash JSDHash は同じものです。 PLDHash は XPCOM ライブラリから、 JSDHash は JavaScript のライブラリからリンクされています。 JSDHash は SpiderMonkey の JavaScript エンジンで広く利用されています。

- -

PLDHash は C で書かれた低レベルな実装です。非常に柔軟ですが、 PLDHash を理解し、利用するためには多少の時間がかかります。基本的なガイドはここにありますが、 PLDHash を利用するつもりであれば、 xpcom/glue/pldhash.h のほとんどを読む必要があります。 C++ のコードから利用する場合、キャストにかかわるエラーの可能性を容易に避けられるため、 C++ によるラッパ(後述)の方がずっと易しく、また安全です。

- -

利用者はまず <code>PLDHashEntryHdr</code> から派生するエントリー構造体を宣言する必要があります。エントリー構造体はハッシュテーブルに格納するデータ(任意のポインタ、固定長のデータ型)を持ちます。ノート: double-hashing 実装のため、ハッシュテーブルの内容が変更された際、エントリーはメモリ上で移動される可能性があります。エントリーへのポインタを定数としたい場合は、 PLHashTable が代わりに利用できます。

- -

また、利用者は <code>PLDHashTableOps</code> 構造体を初期化しなくてはいけません。この構造体は C++ の vtable と似たようなもので、エントリーを初期化・比較・検索するための適切なユーザ定義関数へのポインタを提供します。 PLDHash はキーの型が何であるかを知らないため、キーを扱う全ての関数は const void* で宣言されなければなりません。また、利用者のコードはこれらのポインタを適切な型にキャストする必要があります。

- -

PLDHashTables は、スタック・ヒープのどちらにも配置することができます。:

- - - -

PLHashTable

- -

PLHashTable は NSPR の一部です。ヘッダファイルは nsprpub/lib/ds/plhash.h にあります。 PLHashTable はヒープに多数の領域を割り当てようとするため、一般的には PLDHash の方が PLHashTable よりも優れています。

- -

PLDHash よりも PLHashTable の方が好ましい状況は以下の2つです。

- - - -

nsTHashtable

- -

nsTHashtablePLDHash をラップする C++ のテンプレートで、 PLDHash の複雑な部分(コールバック関数、構造体など)を隠蔽します。 xpcom/glue/nsTHashtable.h に目を通しておいてください。

- -

nsTHashtable を利用するためには、利用者は pre-defined format にある通りにエントリークラスを宣言する必要があります。このエントリークラスは、ハッシュテーブルに格納するキーとデータを保持します(上記の PLDHash と同様です)。また、クラスの中でキーを処理する関数も宣言します。ほとんどの場合、エントリークラスは完全にインラインで書くことができます。エントリークラスの例については xpcom/glue/nsHashKeys.h を参照してください。

- -

テンプレートのパラメータはエントリークラスです。テーブルを正しく初期化するためには Init() を利用しなくてはいけません。また現在のところ、テーブルの内容を変更するためには PutEntry/GetEntry/RemoveEntry 関数を利用してください。 EnumerateEntries 関数では列挙ができますが、並び順は見かけ上ランダムである(ソートされていない)ことに気をつけてください。

- - - -

nsTHashtable を使用する前に、 nsBaseHashtable とその関連クラスが利用用途に合うかどうか確認してください。エントリークラスを宣言する必要がないため、それらの方がずっと使いやすくなっています。もし単純なキー型・データ型を利用するのであれば、多くの場合こちらの方が良い選択肢です。

- -

nsBaseHashtable とその関連クラス: nsDataHashtable, nsInterfaceHashtable, nsClassHashtable

- -

これらの C++ テンプレートは、 PLDHash の複雑な部分のほとんどを隠蔽しつつ、ハッシュテーブルを利用するための高レベルなインタフェースを提供します。以下のような機能を持ちます:

- - - -

nsBaseHashtable は直接利用しません。ここから派生した3つの派生クラスから、保持するデータ型に合わせて利用するクラスを1つ選んでください。 KeyClassnsHashKeys.h で定義されています。他3つも同様です:

- - - -

目を通しておくべき重要なファイルは xpcom/glue/nsBaseHashtable.hxpcom/glue/nsHashKeys.h です。これらのクラスはスタック、クラスメンバ、ヒープに置くことができます。初期化には Init() 関数を利用してください。このとき、スレッドセーフな排他制御を行うかどうかを決められます。ハッシュテーブルの内容を変更するには Put(), Get(), Remove() 関数を利用してください。

- -

2つの列挙関数が用意されています:

- - - -

nsTHashtable をハッシュセットとして利用する

- -

ハッシュセットはキーの存在だけを追跡します。キーとデータとの関連づけは行いません。このような動作は、 nsTHashtable<nsSomeHashKey> を利用することで実現できます。The appropriate entries are GetEntry and PutEntry.

- -

Future Plans

- -

nsISimpleEnumerator support

- -

The (obsolete) nsHashtable has a wrapper that exposes an nsISimpleEnumerator on its items. I will add this support to the various nsBaseHashtable classes as well, as needed.

- -

Hash Functions

- -

All of the above hashtables need a Hash Function. This function converts the key into a semi-unique integer. The mozilla codebase already contains hash functions for most key types, including narrow and wide strings, pointers, and most binary data:

- - - - - - - - - - - - - - - - - - - - - - - - - - -
void*
- (or nsISupports*)
cast using NS_PTR_TO_INT32
char* stringnsCRT::HashCode()
PRUnichar* string
nsAStringHashString()
nsACString
nsID&nsIDHashKey::HashKey()
- -

Writing a good hash function is well beyond the scope of this document, and has been discussed extensively in computer-science circles for many years. There are many different types of hash functions. Mozilla has tuned a good general-purpose hash algorithm for strings and nsID.

- -

Mozilla's Old/Obsolete/Deprecated/Decrepit Hashtables

- -

nsHashtable

- -

nsHashtable was a C++ wrapper around PLHashTable, and now wraps PLDHash. The design of the key classes is not optimal, however, and nsHashtable has been deprecated in favor of nsDataHashtable and friends.

- -

nsObjectHashtable

- -

nsObjectHashtable is a form of nsHashtable. It has been replaced by nsClassHashtable.

- -

nsSupportsHashtable

- -

nsSupportsHashtable is a form of nsHashtable. It has been replaced by nsInterfaceHashtable.

- -

nsHashSets

- -

nsHashSets has predefined hash sets for common keys, which are trivially easy to use. See xpcom/ds/nsHashSets.h. This functionality has been replaced by nsTHashtable<nsSomeHashKey>.

- -

nsDoubleHashtable

- -

nsDoubleHashtable is the (obsolete) precursor to nsTHashtable. It uses macros instead of C++ templates.

- -
-

Original Document Information

- - -
- -

 

diff --git a/files/ja/mozilla/tech/xpcom/index.html b/files/ja/mozilla/tech/xpcom/index.html deleted file mode 100644 index ceea8f01cb..0000000000 --- a/files/ja/mozilla/tech/xpcom/index.html +++ /dev/null @@ -1,114 +0,0 @@ ---- -title: XPCOM -slug: Mozilla/Tech/XPCOM -tags: - - Landing - - Mozilla - - XPCOM - - アドオン - - 拡張機能 -translation_of: Mozilla/Tech/XPCOM ---- -

XPCOM は Microsoft COM と同じクロスプラットフォームのコンポーネントオブジェクトモデルです。これには複数の言語バインディングがあり、XPCOM コンポーネントを C++ に加えて JavaScript、Java、Pythonで使用および実装することができます。XPCOM のインタフェースは XPIDL という IDL の方言で定義されています。

- -
-

XPCOM は Firefox 拡張機能ではもはや利用できません。代わりに WebExtensions を使用してください。

-
- -

XPCOM 自体は一連のコアコンポーネントとクラスを提供します。XPCOM コンポーネントの大部分はこのコアセットの一部ではなく、プラットフォームの他の部分 (例えば GeckoNecko) によって提供されます。アプリケーション、または拡張機能を使用することもできます。

- - - -
-
-
-
Accessing the Windows Registry Using XPCOM
-
-
Fun With XBL and XPConnect
-
この文章では、XBL の応用である、XULウィジェットへのアクセスを可能にする簡単な XPCOMインターフェースについて述べます。 XBLのこのインターフェースを定義するという特徴は、自動補完を行う C++ オブジェクトへの XPConnectを介したインターフェースを定義するのに使用されます。 一度通常の XULテキストフィールドをこのインターフェースに結び付ければ、通常の JavaScript を用いて、オブジェクトの自動補完機能を呼び出すようになります。 この相互作用の基本的なモデルは次のとおりです:
-
Generating GUIDs
-
GUID は、Mozilla プログラミングで、XPCOM インタフェース (このタイプの GUID は IID と呼ばれています) やコンポーネント (CID) 、拡張機能テーマを含むアドオンなどの実体のそれぞれの型を識別するために使われます。とはいえ、Firefox 1.5 からは、アドオンでは extensionname@organization.tld 形式の ID で識別することができます(また、そうするべきです)
-
Generic factory
-
XPCOM では、汎用ファクトリxpcom/glue/nsIGenericFactory.h にある機能を利用して生成されたファクトリのことを指します。
-
Interfacing with the XPCOM cycle collector
-
これは Firefox 3 の XPCOM に導入されたサイクルコレクタの簡単な概要です。既存の C++ クラスを XPCOM サイクルコレクションに加えるための変更を順を追って説明します。cyclical-ownership リークに困っているクラスがあれば、このページが役立つでしょう。
-
Introduction to XPCOM for the DOM
-
Fabian Guisset <fguisset@softhome.net>
-
Setting HTTP request headers
-
HTTP は Web の中核を成す技術の一つです。実際のコンテンツに加え、HTTP ヘッダによっていくつかの重要な情報が HTTP リクエストとレスポンスの両方で渡されます。
-
Storage
-
Storage は SQLite データベース API です。信頼できる呼び出し元、つまり拡張機能と Firefox コンポーネントのみが利用できます。
-
The Thread Manager
-
-
Using nsCOMPtr
-
このドキュメントは、nsCOMPtr について書かれたすべてを集めたものです。もしあなたが nsCOMPtr について疑問があり、このドキュメントでは分からないのであれば、 おそらくそれに答えられるドキュメントはないでしょう。XPCOM ニュースグループ、または他のベテランの nsCOMPtr ユーザに尋ねる、あるいは実験して答えを見つける、などの別の手段で答えを得るしかありません。
-
- -
-
-
- -
-
-
Weak reference
-
In XPCOM, a weak reference is a special object that contains a pointer to an XPCOM object, but doesnot keep that object alive. If the referent object is destroyed before the weak reference, the pointer inside the weak reference is set to nsnull.
-
wrappedJSObject
-
wrappedJSObjectXPConnectラッパで利用できることがあるプロパティです。利用できる場合、それはあなたに、ラッパによって隠蔽されたJavaScriptオブジェクトへのアクセスを可能にします。
-
XPCOM ABI
-
XPCOM ABIは、XPCOMコンポーネントのバイナリインターフェースです。スクリプト言語(JavaScriptなど)によって書かれたXPCOMコンポーネントは、特に改変をしなくてもプラットフォーム(WindowsやOS Xなど)を越えて動作させられますが、コンパイルが必要な言語(C++など)で書かれたコンポーネントの場合、異なるプラットフォームで動かすためには再コンパイルが必要です。コンパイルされたXPCOMコンポーネントは多くの場合、「バイナリ」や「ネイティブ」などと呼ばれます。
-
XPCOM guide
-
These articles provide tutorials and usage documentation for XPCOM, including how to use it in your own projects and how to build XPCOM components for your Firefox add-ons and the like.
-
XPCOM ownership guidelines
-
...自然なことです。もしあなたが一時的なオブジェクトを作ったのであれば、明らかにそれを破壊するのはあなたの責任です。それは確かに所有の徴候です。もしあなたがより長い生存期間を持つオブジェクトを作ったのであれば、あなたは所有権を失うまでそれを所有することになるでしょう。
-
XPCOM reference
-
This reference describes the interfaces and functions provided by the XPCOM library. In addition, it details the various helper classes and functions, as well as the components, provided by the XPCOM glue library. The contents herein are oriented primarily toward extension developers and people embedding XPCOM in other projects.
-
XPCOM 言語バインディング
-
XPCOM 言語バインディングは、以下の目的のために特定の言語と XPCOM との橋渡しを行います。
-
xptcall FAQ
-
xptcall は、低レベルの XPCOM メソッド呼び出しのための小さなライブラリです。プラットフォーム固有の C/C++ とアセンブラ言語のコードを使って実装されています。異なる言語間の呼び出しと異なるスレッドへのメソッド呼び出しを容易にするためのものです。 Mozillaをあらゆるプラットフォーム上で動作させるためには、このコードを移植する必要があります。
-
-
-
- - - - - -
-
-

XPCOMコミュニティに参加してください

- -
-
あなたの好きな方法でディスカッションに参加してください
- - -
- - -
-
- - - - - - diff --git a/files/ja/mozilla/tech/xpcom/interfacing_with_the_xpcom_cycle_collector/index.html b/files/ja/mozilla/tech/xpcom/interfacing_with_the_xpcom_cycle_collector/index.html deleted file mode 100644 index 3c154bd1fe..0000000000 --- a/files/ja/mozilla/tech/xpcom/interfacing_with_the_xpcom_cycle_collector/index.html +++ /dev/null @@ -1,67 +0,0 @@ ---- -title: Interfacing with the XPCOM cycle collector -slug: Mozilla/Tech/XPCOM/Interfacing_with_the_XPCOM_cycle_collector -tags: - - Firefox 3 - - XPCOM - - 要更新 -translation_of: Mozilla/Tech/XPCOM/Interfacing_with_the_XPCOM_cycle_collector ---- -
-

これは Firefox 3 の XPCOM に導入されたサイクルコレクタの簡単な概要です。既存の C++ クラスを XPCOM サイクルコレクションに加えるための変更を順を追って説明します。cyclical-ownership リークに困っているクラスがあれば、このページが役立つでしょう。

-

このドキュメントは Mozilla C++ 開発者向けです。

- - -

サイクルコレクタの役割

- -

サイクルコレクタは、そのほとんどの時間を費やして、ガーベッジサイクルに加わる かもしれない、XPCOM オブジェクトへのポインタを蓄積して (または捨てて) います。これは、コレクタ作業の待機 (idle)ステージにおいて "疑わしい" refcount イベント (0 ではない N の N+1 から N) を通過する、とても素早い nsAutoRefCnt レジスタおよび、そのアンレジスタの特殊な変異型です。

-

コレクタはバッファに居座る疑わしいポインタを定期的に検査します。これはコレクタ作業の調査 (scan)ステージです。このステージでは、コレクタは単独のサイクルコレクション・ヘルパークラスの各候補に繰り返し尋ね、ヘルパーが存在するときは、コレクタが候補 (自身) の子を記述するようにヘルパーに要求します。この方法で、コレクタが、疑わしいオブジェクトの手がかりとなる所有者の部分グラフを構築します。

-

すべての参照をもう一つのオブジェクトへ再び問い合わせ、参照カウントがすべてグループ内の内部ポインタで占められているオブジェクトを確立するオブジェクトのグループをコレクタが見つけた場合、開放の対象となる cyclical garbage グループに入れるかどうかが考慮されます。これはコレクタ作業のリンク解除 (unlink)ステージです。このステージでは、コレクタは見つかったガーベッジオブジェクトをざっと見渡し、それらのヘルパーオブジェクトに再び相談して、各オブジェクトをそれらの子から "リンク解除" するか尋ねます。

-

コレクタは JS ヒープを見渡す方法も知っており、所有者のサイクルをそこへ提出したり、そこから去らせたりできます。

- - - -

コレクタの失敗例

- -

サイクルコレクタは保守的なデバイスです。以下はガーベッジサイクルの収集に失敗する状況です。

-
    -
  1. デフォルトで任意のポインタを疑うことはありません。オブジェクトは それら自身で疑う べきです。一般的に、nsAutoRefCnt よりも nsCycleCollectingAutoRefCnt が使用されます。
  2. -
  3. nsICycleCollectionParticipant に QI された (QI'ed)時は、ヘルパーオブジェクトを返すオブジェクトを横断するだけです。横断中に未知の境目 (edge)に遭遇した場合は、その境目で断念します。これはサイクルに加えられたすべての境目が関与していなければならないことを意味します。そうでなければ、サイクルは見つかりません。
  4. -
  5. ヘルパーオブジェクト上の Traverse メソッドと Unlink メソッドは魔法ではありません。これらはプログラマが提供しており、正しく動作しなければなりませんが、正しく動作しないとコレクタが失敗します。
  6. -
  7. コレクタはスタック上に存在する一時的な自身へのポインタを見つける方法を知りません。そのため、プログラムのトップループの近くからだけ実行することが重要です。追加の自身へのポインタがあってもクラッシュしませんが、自身のオブジェクト内で見つかる、参照カウントに加えることができないポインタ自身を見つけるため、サイクルの収集に失敗する可能性があります。
  8. -
- - - -

クラスをサイクルコレクタに加える方法

- -

サイクルコレクタとあなたのクラスの間のインタフェースは、xpcom/base/nsCycleCollector.h のコンテンツを使用して直接アクセスできます。しかし、あなたのクラスに注釈をつけるための、もっと簡単に使用できる便利なマクロが xpcom/base/nsCycleCollectionParticipant.h にあります。一般的に、mBarmBaz の 2 つの nsCOMPtr エッジを持つ nsFoo クラスを調整すると仮定すると、処理はいくつかの簡単な調整に絞られます:

-
    -
  1. nsFoo.hnsFoo.cpp の両方に nsCycleCollectionParticipant.h ヘッダを include します。
  2. -
  3. nsFoo の定義で、NS_DECL_ISUPPORTS の行を NS_DECL_CYCLE_COLLECTING_ISUPPORTS に変更します。
  4. -
  5. nsFoo の定義のパブリックな部分に NS_DECL_CYCLE_COLLECTION_CLASS(nsFoo) の行を追加します。
  6. - -
  7. nsFoo.cpp 内の nsFoo のインタフェースマップに NS_INTERFACE_MAP_ENTRIES_CYCLE_COLLECTION(nsFoo) の行を追加します。 -
    NS_INTERFACE_TABLE_HEAD(nsFoo)
    -  NS_INTERFACE_TABLE2(nsFoo,
    -                      nsIBar,
    -                      nsIBaz)
    -  NS_INTERFACE_TABLE_TO_MAP_SEGUE_CYCLE_COLLECTION(nsFoo)
    -NS_INTERFACE_MAP_END
    -
  8. -
  9. nsFoo.cpp 内の NS_IMPL_ADDREF(nsFoo) の行を NS_IMPL_CYCLE_COLLECTING_ADDREF(nsFoo) に変更します。
  10. -
  11. nsFoo.cpp 内の NS_IMPL_RELEASE(nsFoo) の行を NS_IMPL_CYCLE_COLLECTING_RELEASE(nsFoo) に変更します。
  12. -
  13. nsFoo.cppNS_IMPL_CYCLE_COLLECTION_CLASS_2(nsFoo, mBar, mBaz) の行を追加します。
  14. -
- -

あなたのクラスを、この設計図よりもさらに複雑な構造にすることも可能です。例えば、あなたのクラスが複数の nsISupports ベースクラスを持っており、破滅を明確にするいくつかの *_AMBIGUOUS マクロを使用する必要がある場合です。または、あなたのクラスが NS_IMPL_CYCLE_COLLECTION_CLASS_N マクロで効果が無い、複雑な所有者構造をしている場合です。後者の場合は、あなたのヘルパークラスに Traverse メソッドと Unlink メソッドを自分で実装する必要があるでしょう。これらの例では NS_IMPL_CYCLE_COLLECTION_TRAVERSE_{BEGIN,END} マクロと NS_IMPL_CYCLE_COLLECTION_UNLINK_{BEGIN,END} マクロの使用が役立ちます。これらの使用例は、より複雑な content/base/src/nsGenericElement.cpp などのクラスを参照してください。あなたのクラスが切取られた部分であるか、他のクラスの集合である場合、切り取られたクラスや外部のクラスもサイクルコレクションに加えられることが重要です。そうしないと、サイクルコレクタにオブジェクトも収集させてしまいます。

- - -

Each field that may contain cycle collected objects needs to be passed to the cycle collector, so it can detect cycles that pass through those fields.

-

The main macro for Traverse is NS_IMPL_CYCLE_COLLECTION_TRAVERSE:
-  NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mSomeMember)

- -

Unlink works similarly:
-  NS_IMPL_CYCLE_COLLECTION_UNLINK(mSomeMember)

- -

These macros should handle a variety of cases, such as reference counted pointers to cycle collected nsISupports or non-nsISupports objects, as well as arrays of these pointers.

diff --git a/files/ja/mozilla/tech/xpcom/introduction_to_xpcom_for_the_dom/index.html b/files/ja/mozilla/tech/xpcom/introduction_to_xpcom_for_the_dom/index.html deleted file mode 100644 index ed14941416..0000000000 --- a/files/ja/mozilla/tech/xpcom/introduction_to_xpcom_for_the_dom/index.html +++ /dev/null @@ -1,319 +0,0 @@ ---- -title: Introduction to XPCOM for the DOM -slug: Mozilla/Tech/XPCOM/Introduction_to_XPCOM_for_the_DOM -translation_of: Mozilla/Tech/XPCOM/Introduction_to_XPCOM_for_the_DOM ---- -

Fabian Guisset <fguisset@softhome.net> -

注意: この文書はまだ DOM の権威の校正を経ておりませんので、正確でない部分があるかもしれません。 -

この文書は DOM コードのコンテキストで XPCOM を使用する方法の入門書です。文書に記述されています XPCOM や nsCOMPtr の使用法は DOM コードを読んだり、書いたりするために必要な知識の 8 割をカバーしています。XPCOM の上級向けの内容については XPCOM のページをご参照ください。 -

この文書のバグの追跡は バグ 99592 で可能です。 -

対象読者: DOM コードに C++ と XPCOM を使用するための手っ取り早い入門書が必要な読者。DOM ハッキングガイド の残りの部分を読むには、この文書の内容を理解している必要があります。 -

-
-

重要な注意事項: この文書は C++ の知識、特にそのオブジェクト指向の部分の理解を前提としています。Stanley Lippman と Josee Lajoie による「C++ Primer」を読んで、私は C++ を学んでから、DOM コードをあれこれ試してみました。この本は、その分野に関わるすべての初心者にお勧めできます。

-
-

入門への手引き

-

DOM は XPCOM を広く使います。事実、 DOM を実装して使用するには XPCOM が必要になります。しかし、コードを読んだり既存のフレームワークに何かするだけならば、詳細まで知る必要はありません。nsCOMPtr も含めて DOM が提供する数多くのマクロや機能はとても便利なものです。この章では、できるだけ枝葉末節の解説を避けて、 XPCOM のうち DOM で最も広く使われている範囲をカバーしたいと思います。そして nsCOMPtr のインターフェイス、参照カウント、 nsISupports インターフェイスを解説します。新しいインターフェイスの追加方法についてのチュートリアルや、最後に C++ におけるクラスの継承についての詳細の議論についても解説します。 -

-

インターフェイス

-

オブジェクト指向のプログラミングはクラス間の継承の使用を基本にしています。さらに、メソッドを宣言しても実装しないメソッドがある場合、クラスは「抽象クラス」として宣言することができます。この概念を最大限に推し進めると、メソッドを実装せずに宣言したクラスは「完全に仮想的」になります。そのようなクラスはインターフェイスと呼ばれます。インターフェイスの目的は、ひとつのインターフェイスに・・・実装の詳細内容を心配することなく、(普通クラスとして表される) オブジェクトを操作する一セットのメソッドを持たせることです。もしあるクラスが、あるインターフェイスを実装しているならば、そのままインターフェイスのメソッドを使うようにしてください。そうすれば、インターフェイスの実装 (具象クラス) に変更があっても、気にする必要がなくなります。XPCOM はこの考えを究極まで推進しています。純粋な仮想メソッドが以下の構文で宣言されます:

-
virtual nsresult FunctionFoo() = 0;
-
-

インターフェイスはこのようにすべてのメンバ関数が純粋に仮想関数として宣言される、単に C++ のクラスです。インターフェイスはまた XPIDL を使って定義されます。この件は、 1.E の節「新しいインターフェイスの追加方法」で解説されます。 -

インターフェイスは実装を備えていないので、非抽象クラス (具象クラス) によって実装される必要があります。その際、インターフェイスが nsIFoo 、クラスが nsFoo である場合、「nsFoo は nsIFoo を実装する」あるいは「nsFoo は nsIFoo を継承する」と言います。C++ クラスのコードは次のようになります: -

-
class nsFoo : public nsIFoo
-
-

オブジェクト指向の C++ を知らない人のために言うと、nsFoo は nsIFoo からの「派生」として宣言されることになります。そしてこの時、nsIFoo は nsFoo の「基底クラス」になります。この入門書では、オブジェクト指向の C++ についてもっと多くを知る必要はありません。しかし、1.F 節ではその件でさらに詳しい議論があり、DOM コードのほとんどを理解することが必要になります。 -

(オブジェクトと呼ばれる) クラスのインスタンスは (ヒープや空き領域に)、下記の構文を使って動的に割り付けられます。

-
nsFoo *fooptr = new nsFoo;
-
-

その時オブジェクトは、 fooptr 経由でのみ操作されます。この時、nsFoo クラスが nsIFoo インターフェイスを実装するならどうなるかを考えてみましょう。nsFoo オブジェクトを fooptr 経由で直接操作可能ですね。しかし、コードはあまり頑健ではありません。事実、使われているメソッドの名前やシグニチャーを変更する者がいると、全コードに渡りこれらのメソッドへの呼び出しをすべて変えなければなりません。具象クラスとは反対に、インターフェイスは時が経過しても安定しているはずです。事実、Mozilla コードの多くのインターフェイスは凍結されて (インターフェイス定義の最初に @Frozen コメントで指示されて) います。これは、それらのインターフェイスがこの先変わることがないという意味です。メリットは、こうして作られたコードが将来永遠に (最高の条件で) 存在し続けることです。反対に欠点は、そのようなインタフェースを改善する方法を見つけなければならないということと、それらを凍結すると実装者に新しいインタフェースを作らせるのを強いることになってしまう、ということです。要するに、必要な時はいつでも実装ではなくインターフェイスを操作することです。nsFoo によって実装される nsIFoo インターフェイスへのポインタは以下のように宣言されます。 -

-
nsIFoo *fooptr = new nsFoo;
-
-

fooptr のようなポインタはその時、「nsFoo クラスのインスタンスによって実装される nsIFoo インターフェイスへのポインタ」とか、それを短縮して「nsIFoo へのポインタ」と呼ばれます。今後私が「インターフェイスへのポインタ」について言う時は、「C++ 具象クラスのインターフェイスによって実装されたインターフェイスへのポインタ」を事実上意味します。注意すべき重要点は、nsIFoo へのポインタのみが nsIFoo インターフェイスやその親で定義されたメソッドを呼び出せることです。たとえば、nsFoo が nsIFoo と nsIBa というふたつの異なるインターフェイスを実装するなら、nsIFoo へのポインタは nsIBa で定義されたメソッドを呼び出せません。その逆もありません。 -

注意: 前の段落は大変重要です。もしそれが完全に理解できていないならば、これ以上読み進める必要はありません。 -

参照カウントの基本 -

XPCOM は参照カウントのメカニズム(短縮形 refcount )を使って、インターフェイスのポインタがオブジェクトを指している間にオブジェクトが削除されていないことを確認します。事実、削除されたオブジェクトを指し示すポインタを間接参照することは悪い影響を及ぼす可能性があります。そんな訳で、インターフェイスへのポインタがオブジェクトのアドレスを代入される都度、そのオブジェクトのカウントを一つ増やす必要があります。これを実行する関数は、”AddRef”と呼ばれ、nsISupports インターフェイスで定義されます。ポインタがすでにオブジェクトのアドレスを保持しない時、そのオブジェクトの参照カウントを一つ減じる必要があります。これには同じく、nsISupports インターフェイスで定義された”Release”関数を使用します。オブジェクトの参照カウントが 0(zero) に達するとオブジェクトは自分自身を削除します。こんなわけで、各々のオブジェクトの参照カウントの記録を確保することは大変重要になります。最初のケースでは、もし AddRef を使ってオブジェクトのカウントを増やすのを忘れると、私たちがポインタを使用して何かする前にオブジェクトは自分自身を削除するかもしれません。そのために、間接参照される時に、クラッシュを引き起こすことがあります。次のケースでは、もしオブジェクトを Release 関数を使って開放することを忘れると、オブジェクトは自分自身を削除しません。それで「メモリリーク」を発生させ、つまり、不要になってもオブジェクトを確保しているので、メモリがシステムに返されることはありません。どちらのケースも不都合なので、参照カウントには細心の注意を払わなくてはなりません。 -

幸運なことに、とっても便利な nsCOMPtr があります。

-

nsCOMPtr

-

Scott Collins は私たちに nsCOMPtr を授けてくれたので、すぐにそれを使用しましょう。 nsCOMPtr は C++ auto_ptr の拡張機能で、参照カウントの操作を管理します。そして、比較、初期化などに対していくつかの機能を提供します。nsCOMPtr は大抵の場合インターフェイスへの通常のポインタのように使われます。nsIFoo インターフェイスへのポインタは、通常下記のように宣言されます: -

-
nsIFoo *fooptr;
-
-

同じ nsIFoo インターフェイスへの nsCOMPtr は下記のように宣言されます: -

-
nsCOMPtr<nsIFoo> fooptr;
-
-

nsCOMPtr は次の節で解説されます。nsCOMPtr についての詳細情報は ユーザの手引き を読んでください。 -

-

QueryInterface()

-

再び、nsIFoo と nsIFoo2 の 2 つのインターフェイスを実装する nsFoo クラスを考えてください: -

-
class nsFoo : public nsIFoo, public nsIFoo2
-
-

ともかく nsFoo のインスタンスが作られることを前提としましょう (この断定はほとんど常に正しいです)。そうすると、nsIFoo インターフェイスで定義されたメソッドを使ってそのオブジェクトを操作したくなるでしょう。目的は nsIFoo インターフェイスへポインタを確保することです。そのために、主な 2 つのテクニックが存在し、コンテキストによってするべきことが分かります。最初のテクニックは「Getter」を使うことであり、次のテクニックは「this」ポインタで static なキャストを使うことです。 -

getter は、グローバルな領域やクラスの領域で定義され、要求されたインターフェイスへのポインタを「返す」関数です。一般的に getter は以下のように機能します:最初にインターフェイスへのポインタである ifooptr を代入なしに宣言します。それから、getter 関数へポインタのアドレスを渡します。この時 getter 関数は、ポインタへ正確なアドレスを代入し、要求されたインターフェイスへのポインタへ QueryInterface します。ifooptr はすでに、実際のオブジェクトのアドレスを代入されたインターフェイスへのポインタとなっています。このようにして、ifooptr 経由で nsIFoo で定義されたメソッドをすぐに呼び出せます。以下にコードの例を示します。

-
nsCOMPtr<nsIFoo> ifooptr;
-GetInterfaceIFoo(getter_AddRefs(ifooptr));
-ifooptr->FunctionOfnsIFoo();
-
-

独特の構文である getter_AddRefs(pointer) は、通常の「&」(address-of) C++ 演算子に対して nsCOMPtr が対応するものと同じです。すなわち、Getter メソッドは AddRef メソッドを呼び出します。これは、「このオブジェクトに参照を追加しません。もうすでにあなたが追加していますからね」という呼び出し元と「このオブジェクトへは私が参照を追加しますので、追加しないでください」という呼び出し先との間の契約になります。もし、呼び出し元と呼び出し先が両方で AddRef を実行すると、どちらかの参照は解放されないので、オブジェクトはメモリリークとなります。 -

すべての Getter 関数は返されたポインタを AddRef しなければならないことに注意してください。それでも今 Getter 関数 を使用しているとしても、心配することはありません。XPCOM 所有の手引き で詳しい情報を参照できます。 -

フレームやビューのように、インターフェイスには参照カウントされないものがあることにも注意してください。これらに対しては生のインターフェイスポインタを使用しなければなりません。マニュアルで参照カウントする必要はありません。

-
今 nsIFoo2 インターフェイスで宣言され、nsFoo で実装された関数を実行したいとしましょう。しかしこの時、ifooptr 経由ではその関数にアクセスできません。それは 1.B の節で述べた理由のために ifooptr が nsIFoo へのポインタだからです。XPCOM には便利なメソッドがあり、別のインターフェイスへのポインタがある時、インターフェイスへのポインタを持てます。そして、2 つのインターフェイスは同じオブジェクトによって実装されます。この時のメソッドが QueryInterface() です。それは nsISupports インターフェイスで定義されます。Mozilla の各々のインターフェイスは nsISupports を継承しています。このことは、XPCOM の主要規則の 1 つです。目的はこうです。オブジェクト (クラスのインスタンス) が所定のインターフェイスを実装するかどうかを知る。これが QueryInterface() の働きです。インターフェイスとインターフェイスを保持するポインタのアドレスを QueryInterface() に渡します。その時インターフェイスがオブジェクトによって実装されていれば、渡されたポインタはオブジェクトのアドレスを代入されます。もし実装されていなければ、 QueryInterface() は NS_NOINTERFACE を返し、渡されたポインタは null になります。
-
-

QueryInterface() はユーザへオブジェクトの実装を隠蔽するのに便利です。 QueryInterface() をただ呼び出してから、インターフェイスのメソッドを呼び出します。その外は知る必要がありません。それでは、nsIFoo へのポインタがある時、どのように QueryInterface() を使って nsIFoo2 へのポインタを得るのでしょうか? ifooptr を再利用できない以上、nsIFoo2 への新ポインタである ifooptr2 を作ります。以下の構文が (nsCOMPtr とだけ使う場合) 推奨されます:

-
nsCOMPtr<nsIFoo2> ifooptr2 (do_QueryInterface(ifooptr));
-
-

この構文は nsCOMPtr の宣言と初期化を同時にするのに推奨されます。あとで、別のアドレスをそこへ代入する必要があるならば、簡単にこうできます: -

-
ifooptr2 = do_QueryInterface(another_pointer);
-
-
-

しかしこの構文は、単に実際の関数への便利なショートカットにすぎません。以下の構文は生のポインタで QueryInterface() を使用する方法を表します。 -

-
nsIFoo2 *ifooptr2;
-ifooptr->QueryInterface(NS_GET_IID(nsIFoo2), (void **)&ifooptr2);
-
-

NS_GET_IID は引数の IID に対して評価をするマクロです。2 つのインターフェイスを比較して同一性を調べるのに便利です。nsCOMPtr への getter_AddRefs() の働きについてはすでに見たとおりです。今回は、ifooptr2 のアドレスを渡します。nsFoo は nsIFoo2 を実装するので、ifooptr2 は nsFoo の現在のインスタンスのアドレスを代入されます。すると、ifooptr2 経由で nsIFoo2 で定義されたメソッドを呼び出せます: -

-
ifooptr2->FunctionOfnsIFoo2();
-
-

ところで、 nsFoo で実装されないインターフェイスへ QueryInterface を試みるならば、渡されたポインタは null となります。そんな訳で、自分の処理を本当に確実に明白に間違いないと思われないなら、nsCOMPtr が null になっていないかどうか必ず確認してください。以下のサンプルを参考にしてください。 -

-
nsCOMPtr<nsINotImplemented> iptr(do_QueryInterface(ifooptr));
-if(!iptr) {
-  // nsFoo は nsINotImplemented を実装しない。 iptr はそのため null である
-  return NS_OK;
-}
-
-

QueryInterface が null-safe であることに注意することも大切です。たとえば前の例では、ifooptr がnull であっても、不都合は発生しません。さらに、QueryInterface の呼び出しの戻り値は正当な理由がない限りは返されるべきではありません。NS_NOINTERFACE を返すことが心配ならば、前のサンプルが示すように NS_OK を返してください。 -

この節の始めに、インターフェイスへのポインタを取得する 2 つ目の方法について話しました。これは、getter 関数が有効でない場合に使われるはずです。おそらくご存知でしょうが、オブジェクトの”this”メンバはそのオブジェクトへのポインタです。そこで必要なインターフェイスへ static に”this”を単にキャストできます。しかしキャストする前にご自分の処理が絶対間違いようにしてください。間違いがあれば参照カウントで問題が発生します。 -

最近遭遇した問題の例を紹介します: nsHTMLAnchorElement クラスのメンバ関数で、nsHTMLAnchorElement オブジェクトによって実装された nsIContent インターフェイスへのポインタを取得する必要がありました。しかし、getter 関数がなかったので 2 つ目の方法を使わなければなりませんでした:

-
nsCOMPtr<nsIContent> content = getter_AddRefs(NS_STATIC_CAST(nsIContent*, this));
-// または自分自身をカウントしたいならば、
-nsIContent *content = NS_STATIC_CAST(nsIContent*, this);
-
-

この 2 つめの構文は注意して扱われる必要があり、XPCOM プログラマーの上級者だけに推奨されます。 -

ここまでに解説しました XPCOM と nsCOMPtr の使用方法はコードを読んだり少しでも書くのに必要な知識の 8 割をカバーしています。引き続き do_GetService へ進んで、QueryInterface などの実装の説明は可能ですが、そこまでする必要があると思いません。そこで XPCOM のさらに詳しい内容については XPCOM プロジェクトのページ を参照してください。 -

次の節は Mozilla DOM へ新しいインターフェイスを追加する方法に関するチュートリアルであり、ビルドの解説やその他を含みます。最後の節はオブジェクト指向の C++ 、インターフェイスの継承、その他面白いトピックに関する詳細の内容についての議論になっています。

-

チュートリアル: 新しいインターフェイスの追加方法

-

始めに

-

このチュートリアルの目的は、DOM に新しいインターフェイスを追加しそれを実装する方法を解説することです。チュートリアルを理解するために前節をよく理解してください。新しいインターフェイスを追加したくなるのにはいくつかの理由があります。新しい DOM のオブジェクトを追加したり、最終的な「インターフェイスの凍結”を順守するためです。最初に XPIDL を調べて、それがどのようにインターフェイスの定義を支援できるか見てみましょう。次にビルドシステム、makefiles、などを解説します。最後に、 nsIDOMFabian インターフェイス (Fabian は私の名前なのですが ;-) を通じてこれらの新しいインターフェイスの実装を観てみましょう。 -

-

XPIDL

-

XPIDL は Cross-Platform Interface Definition Language の頭文字です。 C++ でインターフェイスを直接コーディングせずに、 XPIDL を使うことが可能です。それを使用するとインターフェイスの定義のタスクを簡略化し、文書の自動生成や XPT の生成などの面白い機能をいくつか提供します。最初にするべきことは、私たちのインターフェイスである nsIDOMFabian が何をするか決めます。この文書のために、私は nsIDOMFabian という新しい HTML インターフェイスを実装することにしました。そのインターフェイスは nsHTMLDocument クラスによって実装されます。 -

XPIDL の構文は簡単です:

-

- #include "domstubs.idl";
-
- [scriptable, uuid(xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx)]
- interface nsIDOMFabian : nsISupports
- {
-   void fabian();
-   readonly attribute boolean neat;
- };
- 
-
-

これが nsIDOMFabian インターフェイスの定義です。インターフェイスの uuid は一意の識別子であり、すべてのインターフェイスに 1 つ必要です。ウインドウで guidgen を使うか、また irc.mozilla.org の #mozilla で「mozbot uuid」コマンドを発行して uuid を生成できます。 -

コンパイル時に、XPIDL コンパイラはこのインターフェイスの定義を実際の C++ コードに変換しますが、これは純粋な抽象クラスを備えたヘッダファイルです。このクラスは以下のようになっています:

-

- #define NS_IDOMFABIAN_IID \
-   {0xxxxxxxxx, 0xxxxx, 0xxxxx, \
-     { 0xxx, 0xxx, 0xxx, 0xxx, 0xxx, 0xxx, 0xxx, 0xxx }}
-
- class nsIDOMFabian : public nsISupports {
-  public:
-
-   NS_IMETHOD Fabian(void) = 0;
-   NS_IMETHOD GetNeat(PRBool *aNeat) = 0;
-
- };
-
- #define NS_DECL_NSIDOMFABIAN
- #define NS_FORWARD_NSIDOMFABIAN(_to)
- #define NS_FORWARD_SAFE_NSIDOMFABIAN(_to)
- 
-
-

見て分かるとおり、自動生成のヘッダは私たちのインターフェイスの IID を備えており、「純粋な抽象クラス」は正しく定義されます。XPIDL コンパイラは IDL メソッドと属性を以下の規則に従って C++ の関数へ変換します: -

インターフェイスのメソッドは C++ でも同じ名前を保持します。しかし IDL ではいわゆる「interCaps」モデルを使用しなければなりません。つまり最初の文字は小文字になり、そのあとの新しい単語の最初の文字は大文字になります。たとえば、IDL では getElementById と書くので、C++ では GetElementById に翻訳されることになります。 -

NS_IMETHOD は基本的に「virtual nsresult」を意味するマクロです。ここでは解説していませんが、規則に従って引数のリストと戻り値の型は正しい C++ の型へ変換されます。 -

インターフェイスの属性は 2 つの関数になります: getter と setter です。私たちの例では、属性は read-only で宣言されるので、getter だけが定義されます: GetNeat です。引数は自動的に XPIDL によって生成される PRBool 型のオブジェクトへのポインタです。賢いですね。同じ interCaps のモデルが同様に IDL の属性へ適用されることに注意してください。 -

1.E.d で 3 つのマクロが詳細に解説されます。次のステップは新しいインターフェイスをビルドすることです。


-

-

ビルドシステム

-

ここはとても簡単なところです: すでにあるものをコピーするだけですから。最初にどのディレクトリへインターフェイスを置くか決めなければなりません。最も論理的選択は、すべての HTML インターフェイスが存在する dom/public/idl/html です。次に、このディレクトリのすべての makefiles へ nsIDOMFabian.idl を追加しなければなりません。これには必要であれば、「MANIFEST」「makefile.win」「Makefile.in」などが含まれます。単に nsIDOMFabian の既存のエントリをコピーしてください。注意: Makefiles では、TABS と ホワイトスペースが混在します。他のエントリはかならず正確にコピーしてください。 -

次にインターフェイスをビルドするために dom/ へ「make」とタイプしてください。すべてうまく行けば、 nsIDOMFabian.h ファイルが dom/public/idl/html/_xpidlgen/ にあり、インターフェイスに対して C++ コードを保持しているはずです。私の経験ではインターフェイスを機能させる前に、残念ながら「distclean」をビルドしなければならないことがあります。

-

インターフェイスの実装

-

インターフェイスの実装方法をさらに詳細に観てみましょう。 C++ の具象クラスによってインターフェイスが実装されなければならないことをすでに知っています。このクラスは複数のインターフェイスを直接または継承によって実装できます (継承の議論は次の節を参照してください)。また私たちは XPIDL で定義されたインターフェイスがメソッドと属性を保持し、これらは XPIDL コンパイラによって C++ の関数に変換されることも知りました。インターフェイスを実装するクラスは明示的に、インターフェイスで定義された各メソッドを実装し、各属性の setter と getter を実装しなければなりません。もし属性が read-only であればもちろん getter だけが必要になります。 -

nsHTMLDocument.h で定義されている nsHTMLDocument クラスに nsIDOMFabian を実装することにしました。するべきことが 3 つあります: クラスの宣言を変更すること、クラスの本体を変更すること、インターフェイスで宣言された関数をコード化することです。 -

クラス宣言とクラス本体の変更:

-

- #include "nsIDOMFabian.h"
- class nsHTMLDocument: public ... ,
-                       public nsIDOMFabian
- {
-   // ...
-   NS_DECL_NSIDOMFABIAN
-   // ...
- };
- 
-
-

最初に nsIDOMFabian を継承するように、nsHTMLDocument クラスを宣言する必要があります。それからクラスの public なインターフェイスで、マクロの NS_DECL_NSIDOMFABIAN を使ってインターフェイスの実装に必要なメソッドを宣言します。このマクロは XPIDL コンパイラによって自動生成されることを憶えてください。 それは nsIDOMFabian インターフェイスのためのクラスで実装されるメソッドをすべて宣言します。典型的な NS_DECL_NSIFOO マクロは以下のようになっています: -

-

- #define NS_DECL_NSIFOO \
-   NS_IMETHOD GetBar();
- 
-
-

このマクロはクラスの定義で使われる必要があり、nsFoo クラスは nsFoo::GetBar() メソッドを備えることになります。関数が宣言されたので、最後にコード化が可能になります。 -

関数を実装する様々な可能性があります。最初の方法は最も簡単です。実装しなければならない関数は nsHTMLDocument::Fabian() と nsHTMLDocument::GetNeat() です。それでは、コード化してみましょう。

-
NS_IMETHODIMP nsHTMLDocument::Fabian(void)
-{
-  printf("Hello from the nsIDOMFabian interface\n");
-  // 任意のコード...
-  return NS_OK;
-}
-
-NS_IMETHODIMP nsHTMLDocument::GetNeat(PRBool *aNeat)
-{
-  if(!aNeat) {
-    return NS_ERROR_NULL_POINTER;
-  }
-
-  nsresult rv = Fabian();
-  if( rv == NS_OK ) {
-    *aNeat = PR_TRUE;
-  } else {
-    *aNeat = PR_FALSE;
-  }
-  return NS_OK;
-}
-
-

このコードはもちろん nsHTMLDocument.cpp で書かれます。関数はとても簡単であり、ただ概念を説明しているだけです。2 番めの可能性は「インターフェイス転送マクロ」を使うことです。このマクロはまた XPIDL コンパイラによって自動生成されます。以下はインターフェイス転送の背景にある理論で、そのあとに来るのは nsIDOMFabian のサンプルです。 -

-
理論
-

実際のクラス nsBar を継承する実際のクラス nsFoo があると仮定しましょう。また nsFoo が nsIFoo インターフェイスを実装するとも仮定しましょう。nsFoo が nsIFoo を実装する可能性の 1 つは、 nsIFoo インターフェイスのメソッドを、クラス nsBar のこれらの同じメソッドの実装へ転送することです。 -

-
// XPIDLでの nsIFoo インターフェイス (最低限の実装)
-interface nsIFoo {
-    attribute type prop;
-    void meth();
-};
-
-class nsBar {
-    NS_IMETHOD GetProp();
-    NS_IMETHOD SetProp();
-    NS_IMETHOD Meth();
-};
-
-class nsFoo : public nsIFoo,
-              public nsBar {
-// nsFoo クラスの定義
-};
-
-nsFoo::GetProp() { return nsBar::GetProp(); }
-nsFoo::SetProp() { return nsBar::SetProp(); }
-nsFoo::Meth() { return nsBar::Meth(); }
-
-

このようなコードが機能するのに nsBar はもちろん GetProp、 SetProp、 Meth を実装しなければなりません。注意が必要なのは、nsBar は nsIFoo インターフェイスのメソッドを実装しますが、nsIFoo インターフェイスを継承しません。 そしてこの場合だけインターフェイス転送を使用できます。 -

この時 3 つのメソッドをタイプして nsBar へ送らなくても、代わりに「インターフェイス転送マクロ」の NS_FORWARD_NSIFOO を使用できます。

-

- #define NS_FORWARD_NSIFOO(_to)                       \
-   NS_IMETHOD GetProp() { return _to GetProp(); }  \
-   NS_IMETHOD SetProp() { return _to SetProp(); }  \
-   NS_IMETHOD Meth() { return _to Meth(); }
- 
-
-

このマクロの意味を理解するのは簡単です。 _to クラスの実装に対して nsIFoo インターフェイスのすべてのメソッドを転送します。 -

nsIDOMFabian のアプリケーション: nsDocument で 2 つの関数をコード化し nsHTMLDocument から nsDocument へ nsIDOMFabian を転送できます。こうすることで例えば、 nsXMLDocument で nsDocument のコードを再利用することもできます。この技術はすでに大抵のドキュメントメソッドで使われています。

-
// File nsDocument.h:
-class nsDocument : public ...
-{
-  // ...
-  NS_IMETHOD Fabian(void);
-  NS_IMETHOD GetNeat(PRBool *aNeat);
-  // ...
-}
-
-// File nsDocument.cpp:
-nsDocument::Fabian()
-{
-  // ...
-}
-nsDocument::GetNeat(PRBool *aNeat)
-{
-  // ...
-}
-
-// File nsHTMLDocument.h:
-class nsHTMLDocument : public ... ,
-                       public nsIDOMFabian
-{
-  // ...
-  NS_FORWARD_NSIDOMFABIAN(nsDocument::)
-  // ...
-}
-
-// Nothing needed in nsHTMLDocument.cpp
-
-

これは「インターフェイス転送」の簡単な例です。これらの2つの方法は DOM でインターフェイスを実装する最も一般的方法です。もう少し複雑な他の方法がありますが、ここでは扱いません -

重要な注記: どの DOM クラスによって実装される nsISupports インターフェイスも、転送マクロや宣言マクロを使って実装されません。nsISupports の実装には特別なマクロが提供されます -

新しいインターフェイスの追加方法についてのチュートリアルはここで終わりです。ただ全面的に rebuild してください。distclean でビルドするといいでしょう。しかし、JavaScript からメソッドを有効にすることはできません。というのは、nsIDOMFabian は Class Info. にないからです。その追加方法に関しては Class Info の使い方 を参照してください。

-

インターフェイスの継承 (上級者向け)

-

Mozilla における継承モデルは当然 C++ クラスの継承モデルと同じです。オブジェクト指向のプログラミングに詳しい方であれば、この議論の理解には問題はないでしょう。 -

-
生のインターフェイスの継承
-

最初の概念を理解するのは難しくありません。それは、「インターフェイスの継承」です。XPIDL や header にインターフェイスの定義があれば、そのインターフェイスは必ず他のインターフェイスを継承しています。たとえば、 nsIDOMHTMLAnchorElement インターフェイスにとって以下の「連鎖」が備わっています:
nsISupports -> nsIDOMNode -> nsIDOMElement -> nsIDOMHTMLElement -> nsIDOMHTMLAnchorElement -

すなわち、クラスが連鎖にあるインターフェイスの 1 つを実装すると、そのクラスは実装されたインターフェイスのすべての祖先を実装しなければならないということです。たとえば、実際のクラスが、nsIDOMElement を実装するなら、そのクラスは nsIDOMNode と nsISupports をも実装しなければならないのです。

-
理論
-

インターフェイスの継承がどういうことであるかを理解できたので、もっと一般的なケースを調べてみましょう。最初にごく理論的に考えて、次に nsHTMLAnchorElement のサンプルを使って議論を解説します。 -

実際のクラス nsFoo によって実装されている DOM オブジェクト Foo があると仮定しましょう。nsIFoo1、nsIFoo2、nsIFoo3 の 3 つのインターフェイス に加えて別の実際のクラス nsBar もあるとしましょう。この状況は以下のようになります:

-
nsBar <- nsIFoo1
-  |
-  V
-nsFoo <- nsIFoo2 <- nsIFoo3
-
-

この状況で上記に記されているように nsIFoo2 インターフェイスは nsIFoo3 インターフェイスを継承します。 nsFoo は nsIFoo2 を実装しその結果 nsIFoo3 も実装します。nsBar は nsIFoo1 を実装します。実際のクラス nsFoo は別の実際のクラス nsBar を継承します。継承を説明する規則は以下のようになっています: -

- -

これらの規則はとても簡単であり DOM のコードで広く使われています。クラスやインターフェイスが増えるにつれてコードはより複雑になりますが、上記の方法を使えば必ず問題を低減することができます。 -

-
サンプル
-

簡単なサンプルである HTML Anchor Element を見てみましょう。 最初に、インターフェイスの継承規則を解説しましょう。nsIDOMHTMLAnchorElement(HTML Anchor Element のために W3C によって定義されたメソッドやプロパティを備えているが)を見れば、それが別のインターフェイスである nsIDOMHTMLElement を継承してるのが分かります: -

-
interface nsIDOMHTMLAnchorElement : nsIDOMHTMLElement
-
-

すなわち、nsIDOMHTMLAnchorElement インターフェイスを実装するクラスはすべて nsIDOMHTMLElement インターフェイスも実装しなければならないということです。 nsIDOMHTMLElement を見ると、それが nsIDOMElement を継承しており、後者は nsIDOMNode を継承しており、さらに nsIDOMNode が、nsISupports を継承しているのが分かります。 nsIDOMHTMLAnchorElement は継承のために今述べたすべてのインターフェイスを実装しなければなりません。インターフェイスの実装方法は 1.E.d.の段落を参照してください。 -

インターフェイスの継承によってトップレベルのインターフェイスが nsISupports であることが分かります。すべてのインターフェイスは直接的にまた間接的に nsISupports を継承しなければなりません。このインターフェイスは 1.B. の節で説明された AddRef()、 Release()、QueryInterface() という3 つのメソッドを定義します。 nsISupports は xpcom/base/ で 1999 年以降変更されることなく平和に息づいています。 XPCOM インターフェイスと nsISupports については、モジュール化の方法 をご参照ください。 -

インターフェイスが継承された時の実装を解説するのに、HTML Anchor Element を実装している実際のクラスを調べてみましょう。調べるのは nsHTMLAnchorElement です。実際のクラスの継承の連鎖はこのようになっています:

-
nsGenericElement -> nsGenericHTMLElement -> nsGenericHTMLContainerElement -> nsHTMLAnchorElement
-
-

クラスの定義は以下のようになっています: -

-
class nsHTMLAnchorElement : public nsGenericHTMLContainerElement
-class nsGenericHTMLContainerElement : public nsGnericHTMLElement
-class nsGenericHTMLElement : public nsGenericElement
-
-
クラスの定義を見ると、nsGenericHTMLElement と nsGenericHTMLContainerElement は直接インターフェイスを実装していません。しかし、nsGenericElement は実装しています:
-
-
class nsGenericElement : public nsIHTMLContent
-
-

これはもちろん nsGenericElement が nsIHTMLContent インターフェイスを実装していることになります。 nsIHTMLContent への継承の連鎖は以下のようになります: -

-
nsISupports -> nsIContent -> nsIStyledContent -> nsIXMLContent -> nsIHTMLContent
-
-

nsGenericElement は上記のすべてのインターフェイスを実装しなくてはなりません。そして、nsGenericElement を継承するすべての実際のクラスは自動的にこれらのインターフェイスを実装します。 このことはすでにこの段落で定義した規則と一致しています。 -

-

関連資料

- -
-
diff --git a/files/ja/mozilla/tech/xpcom/language_bindings/components.classes/index.html b/files/ja/mozilla/tech/xpcom/language_bindings/components.classes/index.html deleted file mode 100644 index 0095fbdc58..0000000000 --- a/files/ja/mozilla/tech/xpcom/language_bindings/components.classes/index.html +++ /dev/null @@ -1,109 +0,0 @@ ---- -title: Components.classes -slug: Mozilla/Tech/XPCOM/Language_Bindings/Components.classes -tags: - - 'XPCOM:Language Bindings' - - XPConnect -translation_of: Mozilla/Tech/XPCOM/Language_Bindings/Components.classes ---- -

 

- -

Components.classes は、プロパティが ContractID によって索引付けされたクラスである、読み出し専用オブジェクトです。

- -

はじめに

- -

Components.classes は、nsIJSCID インターフェースを実装した読み出し専用オブジェクトです。それぞれのオブジェクトは、XPCOM サービスとして構築またはアクセスされうる XPCOM コンポーネントのクラスのひとつを表します。

- -

このオブジェクトのプロパティは、コンポーネントクラスの ContractID (または人間が読める形式の名前) で索引付けされています。

- -

All of the properties and methods of the nsIJSCID and its ancestor interface nsIJSID are available for use on the objects contained in this object.

- -

Note that Components.classes reflects only those component classes that have been previously installed and registered with the component manager using ContractIDs. If you want to use a class which was only registered with their CID, use Components.classesByID instead of Components.classes to retrieve it.

- -

あるマシンには ContractID を指定されたアドオンコンポーネントが存在し、別のマシンにはインストールされていないこともあり得ます。Components.classes は、以前にインストールされ ProgId を用いてコンポーネントマネージャに登録されたコンポーネントクラスのみを反映します。ですから、あるマシンには ProgID を指定されたアドオンコンポーネントが存在し、別のマシンにはインストールされていないこともあり得ます。Components.classes オブジェクトに与えられた要素がそのマシンに登録されていない場合、その要素にアクセスを試みると、ストリクトモードでは JavaScript の警告が生成され、戻り値は JavaScript の undefined になります。要素にアクセスする際は、あらかじめ in オペレータを使って、その要素をテストするべきです。

- -
if (!("@some/bogus/class;1" in Components.classes))
-  // do something...
-
- -

Components.classes オブジェクトのプロパティは for...in ループを使って列挙できます。

- -

使い方

- -

与えられた ContractID のためのオブジェクトを取得する

- -

In order to retrieve the object for a given ContractID, you can query the Components.classes array as follows:

- -
var clazz0 = Components.classes["@mozilla.org/preferences;1"];
-var clazz1 = Components.classes["@mozilla.org/messenger;1"];
-
- -

The first line will return you the class object for the ContractID @mozilla.org/preferences;1, the second line will return you the class object for the ContractID @mozilla.org/messenger;1.

- -
-

It may be helpful to abbreviate Components.classes by storing a reference to the object as a constant:

- -
// use whatever name suits your fancy -- Cc is probably the most common abbreviation
-const Cc = Components.classes;
-const C = Components.classes;
-
-var clazz0 = Cc["@mozilla.org/preferences;1"];
-var clazz1 = C["@mozilla.org/messenger;1"];
-
-
- -

XPCOM コンポーネントのインスタンスを作成する

- -

An XPCOM component instance can be created from the returned class object as follows:

- -
var clazz = Components.classes["@mozilla.org/messenger;1"];
-var obj   = clazz.createInstance();
-
- -

createInstance() calls will return XPConnect wrappers for these native objects which only expose the methods of the nsISupports interface. This is because the specific interface on the component that the caller desires has not been specified. Specifying that interface is done using the properties of the Components.interfaces object:

- -
var obj = Components.classes["@mozilla.org/supports-array;1"]
-                    .createInstance(Components.interfaces.nsISupportsArray);
-
- -

which is equivalent to:

- -
var obj = Components.classes["@mozilla.org/supports-array;1"];
-                    .createInstance()
-                    .QueryInterface(Components.interfaces.nsISupportsArray);
-
- -

Alternatively, you can use the new operator on the class object to create a new instance of that class:

- -
var clazz = Components.classes["@mozilla.org/supports-array;1"];
-var inst  = new clazz(Components.interfaces.nsISupportsArray);
-
- -

This implicitly calls the createInstance() method for you.

- -

XPCOM サービスコンポーネントへのアクセス

- -

既存のインスタンスは、以下のように、サービスとしてアクセスできます。

- -
var clazz = Components.classes["@mozilla.org/preferences;1"];
-var obj   = clazz.getService();
-
- -

getService() は、createInstance() のように、ネイティブオブジェクトへの XPConnect ラッパーを返し、nsISupports インターフェースのメソッドのみを見せます。これは、呼び出し側の求めるコンポーネント上の特殊なインターフェースが特定されないようにするためです。このインターフェースの指定は、Components.interfaces オブジェクトの要素を使って行います。

- -
var clazz = Components.classes["@mozilla.org/preferences;1"]
-var srv   = clazz.getService(Components.interfaces.nsIPref);
-
- -

これは以下と同等です。

- -
var clazz = Components.classes["@mozilla.org/preferences;1"]
-var obj   = clazz.getService();
-var srv   = obj.QueryInterface(Components.interfaces.nsIPref);
-
- -

あるコンポーネントについて、インスタンスの作成が必要か、サービスとして利用可能かを調べる

- -

It is not possible to programmatically determine if a given component has to be instantiated or used as a service.

- -

Often, this is stated in the documentation of the component you want to use. If this is not the case, you might want to try and find example usages of that component within LXR.

diff --git a/files/ja/mozilla/tech/xpcom/language_bindings/components.classesbyid/index.html b/files/ja/mozilla/tech/xpcom/language_bindings/components.classesbyid/index.html deleted file mode 100644 index ca8065fee2..0000000000 --- a/files/ja/mozilla/tech/xpcom/language_bindings/components.classesbyid/index.html +++ /dev/null @@ -1,20 +0,0 @@ ---- -title: Components.classesByID -slug: Mozilla/Tech/XPCOM/Language_Bindings/Components.classesByID -tags: - - 'XPCOM:Language Bindings' - - XPConnect -translation_of: Mozilla/Tech/XPCOM/Language_Bindings/Components.classesByID ---- -

-

Components.classesByID は、プロパティが CID によって索引付けされたクラスである、読み出し専用オブジェクトです。 -

-

はじめに

-

Components.classesByID は、nsIJSCID インターフェースを実装した読み出し専用オブジェクトです。それぞれのオブジェクトは、XPCOM サービスとして構築またはアクセスされうる XPCOM コンポーネントのクラスのひとつを表します。 -

Components.classesByID は、要素が CID の「標準的な」形式で索引付けされている以外は Components.classes と同様です。また、コンポーネントマネージャによって ContractID を使って登録されたコンポーネントクラスだけでなく、プレーンの CID を使って登録されたクラスも表します。 -

-

使い方

-

In order to retrieve the object for a given CID, you can use that CID as an index with Components.classesByID as follows: -

-
var clazz = Components.classesByID["{ed132c20-eed1-11d2-baa4-00805f8a5dd7}"];
-
diff --git a/files/ja/mozilla/tech/xpcom/language_bindings/components.constructor/index.html b/files/ja/mozilla/tech/xpcom/language_bindings/components.constructor/index.html deleted file mode 100644 index dba394eb69..0000000000 --- a/files/ja/mozilla/tech/xpcom/language_bindings/components.constructor/index.html +++ /dev/null @@ -1,109 +0,0 @@ ---- -title: Components.Constructor -slug: Mozilla/Tech/XPCOM/Language_Bindings/Components.Constructor -tags: - - 'XPCOM:Language Bindings' - - XPConnect -translation_of: Mozilla/Tech/XPCOM/Language_Bindings/Components.Constructor ---- -

-

-

-

概要

-

XPCOM コンポーネントの新規インスタンスを作成/生成するのに使用できる JavaScript 関数を作成します。 -

-

-

構文

-
var func = [ new ] Components.Constructor(contractID [, interfaceName [, initializer ] ]);
-
-

-

-

パラメータ

-
contractID
コンポーネントのコントラクト ID を含む文字列 -
interfaceName 
与えられると、新規作成されるインスタンスそれぞれに対してこの文字列の名前のインターフェイスで QueryInterface が呼び出される -
initializer 
与えられると、この文字列の名前の関数が、新規作成されるインスタンスに対してその時に与えられる引数を使って呼び出される -
-

-

-

説明

-

Components.Constructor() は XPCOM コンポーネントのインスタンス作成に便利なショートカットです。これを使うと、インスタンスを作りたい時に毎回 Components.classesComponents.interfacescreateInstance などをタイピングする手間が無くなります。また、より JavaScript 的な構文で XPCOM オブジェクトを作成できるようになります。もう一つの重要な恩恵として、Components.Constructor() はいくつかの計算をあらかじめ行うので、Components.Constructor() から返される関数を使って XPCOM オブジェクトを作成した方が下記に示すように基本原則に基づいてオブジェクトを作成するよりも高速になります。 (JavaScript エンジンと XPCOM の間のレイヤーをまたぐ回数がより少なくて済むというのも高速になる理由の一つです。) -

Components.Constructor() によって返される関数のふるまいは、 Components.Constructor() が呼び出されたときに与えられた引数によって異なります。与えられた引数が 1 つだけなら、その引数は作成される XPCOM コンポーネントのコントラクト ID になります。コンポーネントはすぐ返されますが、そのコンポーネントからは基本インターフェイスの nsISupports しか利用できません。なのでそのオブジェクトのメソッドを呼び出すためにはそれに対して QueryInterface を呼び出さなければなりません。例えば、 -

-
var BinaryInputStream = Components.Constructor("@mozilla.org/binaryinputstream;1");
-var bis = new BinaryInputStream();
-print(bis.toString()); // "[xpconnect wrapped nsISupports]"
-
-try
-{
-  // someInputStream は既存の nsIInputStream
-  // bis は nsIBinaryInputStream に QI されていないのでエラーを投げる
-  bis.setInputStream(someInputStream);
-}
-catch (e)
-{
-  bis.QueryInterface(Components.interfaces.nsIBinaryInputStream);
-  bis.setInputStream(someInputStream); // これで成功
-}
-
-

引数が 2 つ与えられると、作成されるインスタンスは第 2 引数の名前を持つ XPCOM インターフェイスに QueryInterface されます。 -

-
var BinaryInputStream = Components.Constructor("@mozilla.org/binaryinputstream;1",
-                                               "nsIBinaryInputStream");
-var bis = new BinaryInputStream();
-print(bis.toString()); // "[xpconnect wrapped nsIBinaryInputStream]"
-
-// someInputStream は既存の nsIInputStream
-bis.setInputStream(someInputStream); // 成功
-
-

引数が 3 つ与えられると、インスタンスに対して QueryInterface されるだけでなく、初期化メソッドも呼び出されたことになります。初期化メソッドに使われる引数は、Components.Constructor() によって作成された関数を呼び出す時に渡された引数です。 -

-
var BinaryInputStream = Components.Constructor("@mozilla.org/binaryinputstream;1",
-                                               "nsIBinaryInputStream",
-                                               "setInputStream");
-try
-{
-  // 引数の数が nsIBinaryInputStream.setInputStream が
-  // 取るものと異なるのでエラーを投げる
-  var bis = new BinaryInputStream();
-}
-catch (e)
-{
-  // someInputStream は既存の nsIInputStream
-  bis = new BinaryInputStream(someInputStream); // 成功
-  var bytes = bis.readByteArray(someNumberOfBytes); // 成功
-}
-
-

基本原則に基づいたインスタンスの作成と Components.Constructor() を使ったインスタンスの作成を比較して下さい。後者の方が前者よりもずっと (たくさんの違う場所でコンポーネントのインスタンスを作成している場合には特に) 読みやすくなります。 -

-
var bis = Components.classes["@mozilla.org/binaryinputstream;1"]
-                    .createInstance(Components.interfaces.nsIBinaryInputStream);
-bis.setInputStream(someInputStream);
-
-
// 前もって BinaryInputStream が初期化されているとして
-var bis = new BinaryInputStream(someInputStream);
-
-

Components.Constructor() は、他の一般的なメソッドを使って実現できる挙動のシンタックスシュガーに過ぎません (高速できれいなシンタックスシュガーですが)。 次の JavaScript 関数と等価です。 -

-
function Components_Constructor(contractID, interfaceName, initializer)
-{
-  var ccArgs = arguments;
-
-  function ctor()
-  {
-    var instance = Components.classes[contractID]
-                             .createInstance(Components.interfaces.nsISupports);
-
-    if (ccArgs.length > 1)
-    {
-      instance.QueryInterface(Components.interfaces[interfaceName]);
-
-      if (ccArgs.length > 2)
-        instance[initializer].apply(instance, arguments);
-    }
-
-    return instance;
-  }
-
-  return ctor;
-}
-
diff --git a/files/ja/mozilla/tech/xpcom/language_bindings/components.exception/index.html b/files/ja/mozilla/tech/xpcom/language_bindings/components.exception/index.html deleted file mode 100644 index f7a4540734..0000000000 --- a/files/ja/mozilla/tech/xpcom/language_bindings/components.exception/index.html +++ /dev/null @@ -1,26 +0,0 @@ ---- -title: Components.Exception -slug: Mozilla/Tech/XPCOM/Language_Bindings/Components.Exception -tags: - - 'XPCOM:Language Bindings' - - XPConnect -translation_of: Mozilla/Tech/XPCOM/Language_Bindings/Components.Exception ---- -

-

-

要約

-

Components.Exception は、nsIXPCException オブジェクトを作る JavaScript コンストラクタです。これらの例外オブジェクトは JavaScript で XPCOM インターフェースを実装する際に投げられるでしょう。例外が補足 (catch) できなかった場合、単純に nsresult の値を投げるよりも、この方がエラーコンソールにより分かりやすい診断結果を表示できるでしょう。 -

nsIXPCException もご覧ください。 -

-

構文

-
var exception = [ new ] Components.Exception([ message [, result [, stack [, data ] ] ] ]);
-
-

パラメータ

-
message 
例外が投げられた場合に、あるいは開発者が指定した場所で、エラーコンソールに表示する文字列。デフォルトは「exception」 -
result 
例外の nsresult 値。デフォルトは NS_ERROR_FAILURE -
stack 
例外にセットされる XPCOM スタック。デフォルトは現在のスタックチェーン -
data 
保存したい任意の追加データ。デフォルトは null -
-

実例

-
throw Components.Exception("I am throwing an Exception from a Javascript XPCOM component.");
-
diff --git a/files/ja/mozilla/tech/xpcom/language_bindings/components.id/index.html b/files/ja/mozilla/tech/xpcom/language_bindings/components.id/index.html deleted file mode 100644 index 5908f888b6..0000000000 --- a/files/ja/mozilla/tech/xpcom/language_bindings/components.id/index.html +++ /dev/null @@ -1,23 +0,0 @@ ---- -title: Components.ID -slug: Mozilla/Tech/XPCOM/Language_Bindings/Components.ID -tags: - - 'XPCOM:Language Bindings' - - XPConnect -translation_of: Mozilla/Tech/XPCOM/Language_Bindings/Components.ID ---- -

-

-

要約

-

Components.ID は、nsIJSID インターフェースに合わせたネイティブオブジェクトを作成するコンストラクタです。 -

-

構文

-
var interfaceID = [ new ] Components.ID(iid);
-
-

パラメータ

-
iid
A string of the format '{00000000-0000-0000-0000-000000000000}' giving the interface ID of the interface -
-

説明

-

Components.ID は、インターフェース ID をパラメータとして取る、QueryInterface、getInterfaces などのメソッドを実装するために使われるインターフェース ID を作成します。 -

Components.classesComponents.classesByIDComponents.interfaces は、ほとんどの JavaScript コードが扱うことのない nsID をほぼすべて提供します。Components.classes, Components.classesByID, Components.interfaces はほとんどの JavaScript コードが扱う必要がある nsID のほぼ全てです。例外は、コンポーネントが JavaScript で書かれていて、自身を独自の nsID でコンポーネントマネージャに登録する必要がある場合です。その際の ID は未登録のため、Components.classes には現れません。 -

diff --git a/files/ja/mozilla/tech/xpcom/language_bindings/components.interfaces/index.html b/files/ja/mozilla/tech/xpcom/language_bindings/components.interfaces/index.html deleted file mode 100644 index 8105f7f239..0000000000 --- a/files/ja/mozilla/tech/xpcom/language_bindings/components.interfaces/index.html +++ /dev/null @@ -1,37 +0,0 @@ ---- -title: Components.interfaces -slug: Mozilla/Tech/XPCOM/Language_Bindings/Components.interfaces -tags: - - 'XPCOM:Language Bindings' - - XPConnect -translation_of: Mozilla/Tech/XPCOM/Language_Bindings/Components.interfaces ---- -

-

Components.interfaces は、プロパティがそれらの名前によって索引付けされたクラスである、読み出し専用オブジェクトです。 -

-

はじめに

-

Components.interfaces は、nsIJSCID インターフェースを実装した読み出し専用オブジェクトです。それぞれのオブジェクトは、いくつかのコンポーネントが実装している (あるいは未実装の可能性もあります) XPCOM インターフェースのひとつを表します。 -


-対応する .idl の宣言が [scriptable] として設計されたインターフェースのみを反映します。つまり、XPConnect が JavaScript へ反映することのできるインターフェースということです。 -

Components.interfaces オブジェクトのプロパティは、nsID nsID 型のパラメータを除いた XPCOM メソッドで利用されます。これには nsISupports::QueryInterfacensICID::getService が受け取る追加パラメータ、nsICID::createInstance (JavaScript から呼ばれた場合)、nsIClassInfo::getInterfaces が含まれます。 -

Components.interfaces オブジェクトのプロパティは for...in ループを使って列挙できます。 -

-

使い方

-

インターフェースオブジェクトへのアクセス

-

Components.interfaces オブジェクトのプロパティはインターフェース名で索引付けされます。インターフェースオブジェクトは以下のようにして取得できます。 -

-
var iface = Components.interfaces.nsISupportsArray;
-
-

この戻り値は nsISupportsArray インターフェースのインターフェースオブジェクトです。 -

-

インターフェースで定義されたコンスタントへのアクセス

-

Interface descriptions (cf. XPIDL) may not only contain method declarations, but also constants. For example, assume we have the following interface declaration: -

-
interface nsIFoo : nsISupports {
-  const PRUint32 MYFLAG = 5;
-};
-
-

The constant MYFLAG can then be accessed using -

-
var myFlag = Components.interfaces.nsIFoo.MYFLAG;
-
diff --git a/files/ja/mozilla/tech/xpcom/language_bindings/components.lastresult/index.html b/files/ja/mozilla/tech/xpcom/language_bindings/components.lastresult/index.html deleted file mode 100644 index d830cc301c..0000000000 --- a/files/ja/mozilla/tech/xpcom/language_bindings/components.lastresult/index.html +++ /dev/null @@ -1,57 +0,0 @@ ---- -title: Components.lastResult -slug: Mozilla/Tech/XPCOM/Language_Bindings/Components.lastResult -tags: - - 'XPCOM:Language Bindings' - - XPConnect -translation_of: Mozilla/Tech/XPCOM/Language_Bindings/Components.lastResult ---- -

-

Components.lastResult は XPConnect を介した直前の XPCOM メソッド呼び出しの結果コードである数値コード nsresult を返します。 -

-

はじめに

-

Components.lastResult は一般的に、「成功」コードを返す XPCOM メソッドの結果のテストにのみ役立ちます。というのは、失敗した結果コードは XPConnect が例外に変換して、呼び出し元の JavaScript メソッドへ投げるからです。ほとんどのインターフェースは 1 つの成功コード (NS_OK) だけを返すので、Components.lastResult はほとんど必要ありません。 -

Components.lastResult が利用される場合は、対象の呼び出しの後テストのためにローカル変数に保存することが、複数のテストを Components.lastResult に対して行うよりも適当です。多くの「Components」プロパティとメソッドは XPConnect で実装されていて、それに続く Components.lastResult 呼び出しは対象とした呼び出しでなく「暗黙的な」 XPConnect 呼び出しの結果を返すかもしれないからです。 -

-

実例

-

In the following example, the local variable i contains the actual result returned by bar() (assuming that bar() is called via XPConnect), and Components.lastResult contains the success code returned by bar(). -

-
// Given that foo.bar is a method that might return
-// the success codes NS_OK, '5', and '6' OR some error code...
-try
-{
-  var i = foo.bar();
-
-  switch (Components.lastResult)
-  {
-    case Components.results.NS_OK:
-      // NS_OK is good!
-      break;
-    case 5:
-      // do something with 5 here
-      break;
-    case 6:
-      // do something with 6 here
-      break;
-    default:
-      // this was a success code we did not expect. Bad component!
-      break;
-  }
-  // and so on....
-}
-catch (e)
-{
-  // the call threw an exception or a native component returned
-  // a failure code!
-  if (e instanceof Components.interfaces.nsIXPCException)
-  {
-    // we might do something interesting here with the exception object
-    var rv = e.result;
-  }
-  else
-  {
-    // if we don't know how to handle it then rethrow
-    throw e;
-  }
-}
-
diff --git a/files/ja/mozilla/tech/xpcom/language_bindings/components.manager/index.html b/files/ja/mozilla/tech/xpcom/language_bindings/components.manager/index.html deleted file mode 100644 index 29aea92083..0000000000 --- a/files/ja/mozilla/tech/xpcom/language_bindings/components.manager/index.html +++ /dev/null @@ -1,11 +0,0 @@ ---- -title: Components.manager -slug: Mozilla/Tech/XPCOM/Language_Bindings/Components.manager -tags: - - 'XPCOM:Language Bindings' - - XPConnect -translation_of: Mozilla/Tech/XPCOM/Language_Bindings/Components.manager ---- -

-

Components.manager はグローバルなネイティブコンポーネントマネージャーサービスの便利な反映です。nsIComponentManager インターフェースのスクリプト可能なメソッドはこのオブジェクトで直接呼び出しできます。 -

diff --git a/files/ja/mozilla/tech/xpcom/language_bindings/components.results/index.html b/files/ja/mozilla/tech/xpcom/language_bindings/components.results/index.html deleted file mode 100644 index 129d147668..0000000000 --- a/files/ja/mozilla/tech/xpcom/language_bindings/components.results/index.html +++ /dev/null @@ -1,40 +0,0 @@ ---- -title: Components.results -slug: Mozilla/Tech/XPCOM/Language_Bindings/Components.results -tags: - - 'XPCOM:Language Bindings' - - XPConnect -translation_of: Mozilla/Tech/XPCOM/Language_Bindings/Components.results ---- -

-

Components.results は、js/src/xpconnect/src/xpc.msg にあるマクロの最初のパラメータとしてリストされた名前のプロパティを持つ、読み出し専用オブジェクトです。各オブジェクトの値はそのコンスタントの値に対応しています。 -

-

はじめに

-

Components.results は、よく知られた XPCOM の結果コードの名前をプロパティに持つオブジェクトで、それぞれの値は対応する結果コードに対応しています。このオブジェクトのプロパティは、未知の nsresult 変数をテストするのに利用したり、失敗を示すために「投げ」たりできます。 -

-
  if(something_unexpected_happened)
-     throw Components.results.NS_ERROR_UNEXPECTED;
-
-

Components.results オブジェクトのプロパティは for...in ループを使って列挙できます。 -

-

使い方

-

nsISupports の実装

-

The standard nsISupports is usually implemented in JavaScript by using Components.results to get a failure return value if does not implement the given interface. Note the common use of an abbreviation for <code>Components.results, Cr: -

-
const Ci = Components.interfaces, Cr = Components.results;
-
-function Class()
-{
-  /* ... */
-}
-Class.prototype =
-{
-  /* ... */
-  QueryInterface: function(id)
-  {
-    if (id.equals(Ci.IMyInterface))
-      return this;
-    throw Cr.NS_ERROR_NO_INTERFACE;
-  }
-};
-
diff --git a/files/ja/mozilla/tech/xpcom/language_bindings/components.returncode/index.html b/files/ja/mozilla/tech/xpcom/language_bindings/components.returncode/index.html deleted file mode 100644 index ad0542e783..0000000000 --- a/files/ja/mozilla/tech/xpcom/language_bindings/components.returncode/index.html +++ /dev/null @@ -1,28 +0,0 @@ ---- -title: Components.returnCode -slug: Mozilla/Tech/XPCOM/Language_Bindings/Components.returnCode -tags: - - 'XPCOM:Language Bindings' - - XPConnect -translation_of: Mozilla/Tech/XPCOM/Language_Bindings/Components.returnCode ---- -

-

Components.returnCode は、return 命令による戻り値に加えて XPCOM の結果コードを保持できるプロパティです。 -

-
-

Note that Components.returnCode is currently non-functional due to バグ 287107. This problem was introduced in Mozilla 1.4. -

-
-

使い方

-

Components.returnCode は、JavaScript メソッドが特定の nsresult コードを返すことを、そのメソッドの XPCOM 呼び出し元へ示すのに利用できるプロパティです。 -

一般的には、XPConnect は JavaScript コードが nsresult コードを心配する必要のないようにうまく働きます。デフォルトでは、JavaScript メソッドの結果が成功だと、XPConnect は結果コード NS_OK を呼び出し元へ返します。もし JavaScript コードが失敗のシグナルを送る必要がある場合は、例外を投げることで果たします。しかし、成功コードの返り値を規定した XPCOM インターフェースがごくわずかに存在します。Components.returnCode はそれら稀なインターフェースを JavaScript で実装できるようにするために存在します。

-

実例

-
var foo = {
-  bar: function(i) {
-    if (yada_yada)
-      Components.returnCode = 5;
-
-    return i * 2;
-  }
-};
-
diff --git a/files/ja/mozilla/tech/xpcom/language_bindings/components.stack/index.html b/files/ja/mozilla/tech/xpcom/language_bindings/components.stack/index.html deleted file mode 100644 index f5b60e5c92..0000000000 --- a/files/ja/mozilla/tech/xpcom/language_bindings/components.stack/index.html +++ /dev/null @@ -1,11 +0,0 @@ ---- -title: Components.stack -slug: Mozilla/Tech/XPCOM/Language_Bindings/Components.stack -tags: - - 'XPCOM:Language Bindings' - - XPConnect -translation_of: Mozilla/Tech/XPCOM/Language_Bindings/Components.stack ---- -

-

Components.stack は、現在の JavaScript コールスタックのスナップショットを表す nsIStackFrame (IDL 定義) 型の読み出し専用プロパティです。これは様々な診断目的で利用できます。 -

diff --git a/files/ja/mozilla/tech/xpcom/language_bindings/components.utils.evalinsandbox/index.html b/files/ja/mozilla/tech/xpcom/language_bindings/components.utils.evalinsandbox/index.html deleted file mode 100644 index 6c0cd7bf78..0000000000 --- a/files/ja/mozilla/tech/xpcom/language_bindings/components.utils.evalinsandbox/index.html +++ /dev/null @@ -1,34 +0,0 @@ ---- -title: Components.utils.evalInSandbox -slug: Mozilla/Tech/XPCOM/Language_Bindings/Components.utils.evalInSandbox -tags: - - Add-ons - - Developing Mozilla - - Extensions - - JavaScript - - 'XPCOM:Language Bindings' - - XPConnect -translation_of: Mozilla/Tech/XPCOM/Language_Bindings/Components.utils.evalInSandbox ---- -

-

-

はじめに

-

制限付き特権を持つ環境下で JavaScript のコードを評価したい場合があるかもしれません。Firefox 1.5 (Gecko 1.8) 以降にはこのための API が存在します。それにはそのコンテキスト内でコードを作成し、評価できる「サンドボックス (sandbox)」という概念が含まれています。このメソッドを用いて評価されるコードは常に普通のウェブページと同様の制限付き特権を持つ環境下で評価されます。 -

-

使用法

-

evalInSandbox を使用するには、まず Components.utils.Sandbox というコンストラクタを用いてサンドボックスオブジェクトを作成する必要があります。サンドボックスは主要な URI で初期化しなければなりません。この URI は同一生成元 (same origin) セキュリティチェックに使用されます。例えば、http://www.example.com/ という URI を渡すと、このサンドボックスを用いて評価されるコードは http://www.example.com からのデータにアクセスできるようになります。ウェブページの JavaScript から document.domain をセットして同一生成元セキュリティチェックを変更することができるため、DOM window オブジェクトをサンドボックスのコンストラクタに渡してしまうこともできます。 -

-
// 主要な URI を渡してサンドボックスを作成
-var s = Components.utils.Sandbox("http://www.example.com/");
-// サンドボックスオブジェクトは実行するスクリプトに対して
-// グローバルスコープを持つ
-s.y = 5;
-var result = Components.utils.evalInSandbox("x = y + 2; x + 3", s);
-// result は 10、s.x は 7 となる
-
-s.foo = Components;
-// この場合は "Permission Denied" というエラーが生じる
-Components.utils.evalInSandbox("foo.classes", s);
-
-
-
diff --git a/files/ja/mozilla/tech/xpcom/language_bindings/components.utils.forcegc/index.html b/files/ja/mozilla/tech/xpcom/language_bindings/components.utils.forcegc/index.html deleted file mode 100644 index cafc9f1ca9..0000000000 --- a/files/ja/mozilla/tech/xpcom/language_bindings/components.utils.forcegc/index.html +++ /dev/null @@ -1,20 +0,0 @@ ---- -title: Components.utils.forceGC -slug: Mozilla/Tech/XPCOM/Language_Bindings/Components.utils.forceGC -tags: - - NeedsContent - - 'XPCOM:Language Bindings' - - XPConnect -translation_of: Mozilla/Tech/XPCOM/Language_Bindings/Components.utils.forceGC ---- -

このメソッドはスクリプトにガベージコレクションサイクルを強制します。 JavaScript ヒープがある大きさを超えると Mozilla JavaScript エンジンは自動的にガベージコレクションを実行するでしょう。もっとも、この機構は JS オブジェクトにぶら下がる ネイティブ (C++) XPCOM オブジェクトを把握してはいません。多くの場合、 JavaScript アプリケーションは巨大な XPCOM (のツリー) を参照している JavaScript オブジェクトについての内部情報を持っており、いつ参照しなくなるかを知っています。この場合 JavaScript からガベージコレクションサイクルを強制できることが重要になることがあります。

- -

ガベージコレクションを強制することは、他にも弱い JavaScript 参照のハッシュからの死んだ参照 (dead reference)をクリーニングする前です。

- -

このメソッドを使う人はガベージコレクションが非常に負担の大きい (expensive)操作で、絶対必要だと知っている 時のみ使用すべきだとことに注意してください。

- -
: nsIDOMWindowUtils.garbageCollect() は同様の機能を提供しますが、 JavaScript エンジンのガベージコレクターに加えてサイクルコレクターも起動します。これにより、ガベージコレクターに依存するテストケースなど、 JavaScript オブジェクトのサイクルを構築する XPCOM コンポーネントも回収されることが重要になるかもしれないと分かるでしょう。
- -

UniversalXPConnect 特権が必要です。

- -

もし、実行されている JavaScript コードがない状態で、将来的にガベージコレクションを起こすことをスケジューリングしたい場合は、代わりに Components.utils.schedulePreciseGC() を使用することができます。

diff --git a/files/ja/mozilla/tech/xpcom/language_bindings/components.utils.getweakreference/index.html b/files/ja/mozilla/tech/xpcom/language_bindings/components.utils.getweakreference/index.html deleted file mode 100644 index 7d07c19b32..0000000000 --- a/files/ja/mozilla/tech/xpcom/language_bindings/components.utils.getweakreference/index.html +++ /dev/null @@ -1,45 +0,0 @@ ---- -title: Components.utils.getWeakReference -slug: Mozilla/Tech/XPCOM/Language_Bindings/Components.utils.getWeakReference -tags: - - XPCOM - - 'XPCOM:Language Bindings' - - XPConnect -translation_of: Mozilla/Tech/XPCOM/Language_Bindings/Components.utils.getWeakReference ---- -

このメソッドは Firefox 3 で導入され、オブジェクトの弱い参照 (weak reference)を得るために使います。オブジェクトの参照を得るには、結果のオブジェクトに対して get() を実行する必要があります。

- -

加えて、 get() が成功しても、オブジェクトが有効であるとは限りません。単にまだガベージコレクトされていないからかもしれないからです。オブジェクトが本当に欲しいものであるかを確認するには、 (DOM ノードの Node.parentNode() のように) 他の角度からチェックする必要があります。

- -

文法

- -
weakRef = Components.utils.getWeakReference(obj);
-
- -

引数

- -
-
obj
-
弱い参照を得ようとするオブジェクト。
-
- -
-

注: Gecko 11.0 では、 このメソッドは objnull の場合に例外を投げるように変更されました。 Gecko 12.0 で、暗黙に失敗するという以前の動作に戻されました。

-
- -

- -

こちらの例では、ウィンドウへの弱い参照を把握します。そして後から、配列の中から一致するものを探して使用します。

- -
var arr = [];
-
-arr.push(Cu.getWeakReference(window));
-
-// この部分は他のブロックで実行されます。
-for (var i=0; i<arr.length; i++) {
-  if (arr[i].get() == window) {
-    // ウィンドウが見つかった
-    break;
-  }
-}
-
diff --git a/files/ja/mozilla/tech/xpcom/language_bindings/components.utils.import/index.html b/files/ja/mozilla/tech/xpcom/language_bindings/components.utils.import/index.html deleted file mode 100644 index 68cf7c5539..0000000000 --- a/files/ja/mozilla/tech/xpcom/language_bindings/components.utils.import/index.html +++ /dev/null @@ -1,118 +0,0 @@ ---- -title: Components.utils.import -slug: Mozilla/Tech/XPCOM/Language_Bindings/Components.utils.import -tags: - - NeedsContent - - 'XPCOM:Language Bindings' - - XPConnect -translation_of: Mozilla/Tech/XPCOM/Language_Bindings/Components.utils.import ---- -

このメソッドは Firefox 3 で導入され、異なるスコープ間でコードを簡単に共有するのに使われます。例えば、自分のコンポーネントの中で、コンポーネント登録の長い定型文をコピー&ペーストすることを避けるために XPCOMUtils.jsm をインポートすることができます。

- -

詳細は、JavaScript コードモジュールの利用 を参照してください。

- -
-

注記: Gecko 2.0 以前、JavaScript コードモジュールは file: URL または resource: URL のみでしか読み込めませんでした。Gecko 2.0chrome: URL からの読み込みに対応しました。JAR アーカイブ内にあっても使用できます。

-
- -

- -

構文

- -
Components.utils.import(url [, scope]);
-
-// 上記のコードでは jslint などの構文チェックツールコンパイラエラーが報告される場合は以下のように書けます。
-
-Components.utils["import"](url [, scope]);
- -

- -

引数

- -
-
url
-
読み込まれるスクリプトの URL の文字列。URL は、ディスク上のファイルを指さなくてはなりません。JAR ファイル内を指すことがあります。
-
scope
-
スクリプト上にインポートされる任意のオブジェクト。省略した場合、グローバルオブジェクトが使用されます。
-
-
-

Under Boot2Gecko, the scope is not optional. If your code is meant to work on all platforms, you should always provide a scope.

- -

In case of doubt, this is generally a good scope.

-
-
-
return value
-
the module's global object.
- use of the return value is discouraged since it grants access to the module's internal properties which are not part of its public API.
-
- -

読み込んだファイル内でエラー (構文エラーなど) が発生した場合、import が例外を投げます。

- -

- -

- -
Components.utils.import("resource://gre/modules/XPCOMUtils.jsm");
-
- -

- -

mozIJSSubScriptLoader との違い

- -

mozIJSSubScriptLoader との違い:

- - - -

- -

追加リソース

- -
- -
- -
-
-
-
 
-
-
-
diff --git a/files/ja/mozilla/tech/xpcom/language_bindings/components.utils.reporterror/index.html b/files/ja/mozilla/tech/xpcom/language_bindings/components.utils.reporterror/index.html deleted file mode 100644 index 56489ade2e..0000000000 --- a/files/ja/mozilla/tech/xpcom/language_bindings/components.utils.reporterror/index.html +++ /dev/null @@ -1,40 +0,0 @@ ---- -title: Components.utils.reportError -slug: Mozilla/Tech/XPCOM/Language_Bindings/Components.utils.reportError -tags: - - 'XPCOM:Language Bindings' - - XPConnect -translation_of: Mozilla/Tech/XPCOM/Language_Bindings/Components.utils.reportError ---- -

Components.utils.reportError は、エラーコンソールに JavaScript の Error オブジェクトを送り、プログラムの実行に戻ります。例外を「食べて」おきながらも、例外をコンソールに送りたい例外処理ブロックで用います。

- -

これは必ずパラメータを 1 つ用いて呼び出します。通常、このパラメータは例外ハンドラが受け取ったオブジェクトです。それが JavaScript のエラーオブジェクトでなければ、パラメータは文字列に変換され、新しくエラーとして送られます。つまり、Components.utils.reportError を用いてデバッグメッセージをエラーコンソールに送ることができるということです。dump() を用いるとネイティブコンソールにメッセージを出力できるのと同じようなものです。

- -

しかしながらログをとるには nsIConsoleService を使用すべきです。これは reportError とは異なり、メッセージを通常の深刻度で記録するためです。

- -
function myDump(aMessage) {
-  var consoleService = Components.classes["@mozilla.org/consoleservice;1"]
-                                 .getService(Components.interfaces.nsIConsoleService);
-  consoleService.logStringMessage("My component: " + aMessage);
-}
-
- -

Firefox 3: エラーコンソールにはデフォルトではクロームエラーが表示されません。それらを表示するには、 'javascript.options.showInConsole' の設定を true に設定するか、代わりに nsConsoleService を使用してメッセージを表示します。

- -

Firefox 4: このバージョンでは、デフォルトで 'javascript.options.showInConsole' の設定が true に設定されています。

- -

- -

例外ハンドラでの使用:

- -
try {
-  this.could.raise.an.exception;
-} catch(e) {
-  Components.utils.reportError(e); // エラーを送り、実行を続ける
-}
-
- -

エラーコンソールへのデバッグメッセージの出力:

- -
Components.utils.reportError("init() called");
-
diff --git a/files/ja/mozilla/tech/xpcom/language_bindings/components.utils/index.html b/files/ja/mozilla/tech/xpcom/language_bindings/components.utils/index.html deleted file mode 100644 index 6a581462b2..0000000000 --- a/files/ja/mozilla/tech/xpcom/language_bindings/components.utils/index.html +++ /dev/null @@ -1,46 +0,0 @@ ---- -title: Components.utils -slug: Mozilla/Tech/XPCOM/Language_Bindings/Components.utils -tags: - - 'XPCOM:Language Bindings' - - XPConnect -translation_of: Mozilla/Tech/XPCOM/Language_Bindings/Components.utils ---- -

-

Components.utils は便利でありながらも必須というわけではない、さまざまな XPConnect の機能のまとまりです。そのインタフェースは js/src/xpconnect/idl/xpccomponents.idl で定義されています。オブジェクトには今のところ次のメンバがあります。 -

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
プロパティ説明
evalInSandboxサンドボックスで JavaScript コードを実行する。普通、制限付き特権を持つ環境下でコードを実行するのに使用する。
forceGC ガベージコレクションサイクルを強制する。
getWeakReference 渡されたオブジェクトの弱い参照を得る。
import JS のモジュールを、スコープを共有することなく現在のスクリプトに読み込む -
lookupMethodXPCOM オブジェクトのネイティブな(つまり、インタフェースで宣言されている)メソッドやプロパティを探す。XPCNativeWrapper と同様の目的を果たす。
reportErrorJavaScript の Error オブジェクトを JavaScript コンソールに送る。
SandboxevalInSandbox で使用するサンドボックス (sandbox) オブジェクトを作成する。
-
-
diff --git a/files/ja/mozilla/tech/xpcom/language_bindings/components_object/index.html b/files/ja/mozilla/tech/xpcom/language_bindings/components_object/index.html deleted file mode 100644 index 7bf0a7f0d0..0000000000 --- a/files/ja/mozilla/tech/xpcom/language_bindings/components_object/index.html +++ /dev/null @@ -1,108 +0,0 @@ ---- -title: Components object -slug: Mozilla/Tech/XPCOM/Language_Bindings/Components_object -tags: - - DOM - - Gecko - - Gecko DOM Reference - - 'XPCOM:Language Bindings' - - XPConnect - - 要更新 -translation_of: Mozilla/Tech/XPCOM/Language_Bindings/Components_object ---- -

Components オブジェクトは、XPConnect 機能が JavaScript へ反映されるのを仲介するオブジェクトです。Components オブジェクトは、実際には、XPConnect を利用するトップレベルのオブジェクトとして、JavaScript へ反映される {{Source("js/src/xpconnect/idl/xpccomponents.idl", "nsIXPCComponents")}} インタフェースのネイティブインスタンスです。

-

Components のプロパティの一部は高度な特権を必要とするため、Web ページ上では機能しません。

-

Components オブジェクトは次のメンバを持ちます。

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
メンバ説明
classesContractID によるクラスの配列
classesByIDCID によるクラスの配列
function Object() { [native code] }コンポーネントのコンストラクタのためのコンストラクタ
ExceptionXPConnect の例外のためのコンストラクタ
IDXPCOM nsID のためのコンストラクタ
interfacesインタフェース名によるインタフェースの配列
interfacesByIDIID によるインタフェースの配列
isSuccessCode与えられた結果コードが成功かどうかを判別するための関数
lastResult直前の XPConnect 呼び出しの結果コード
managerグローバル XPCOM コンポーネントマネージャ
results名前による既知の結果コードの配列
returnCode現在の呼び出しの未決定の結果
stack現在の JavaScript のコールスタック
utilsいくつかの便利な機能へのアクセスを提供します。
utils.evalInSandboxJavaScript コードをサンドボックス内で実行。通常は限られた特権でコードを実行するときに使われます。
utils.forceGC{{Gecko_minversion_inline(1.9)}} ガベージコレクションサイクルを強制します。
utils.getWeakReference{{Gecko_minversion_inline(1.9)}} 渡されたオブジェクトの弱い参照を取得します。
utils.import{{Gecko_minversion_inline(1.9)}} JavaScript モジュールを、スコープを共有せずに現在のスクリプトに読み込みます。
utils.lookupMethodXPCOM オブジェクトのネイティブの (例えばインタフェースで宣言された) メソッドやプロパティを参照します。XPCNativeWrapper と同じ役割を果たします。
utils.reportErrorJavaScript エラーオブジェクトを エラーコンソール に出力します。
utils.SandboxevalInSandbox で利用するサンドボックスオブジェクトを生成します。
-

EDITORS! please keep descriptions of the following properties in sync with Components.utils page.

diff --git a/files/ja/mozilla/tech/xpcom/language_bindings/index.html b/files/ja/mozilla/tech/xpcom/language_bindings/index.html deleted file mode 100644 index f576a1cbb6..0000000000 --- a/files/ja/mozilla/tech/xpcom/language_bindings/index.html +++ /dev/null @@ -1,25 +0,0 @@ ---- -title: XPCOM 言語バインディング -slug: Mozilla/Tech/XPCOM/Language_Bindings -translation_of: Mozilla/Tech/XPCOM/Language_Bindings ---- -

XPCOM 言語バインディングは、以下の目的のために特定の言語と XPCOM との橋渡しを行います。

- - - -

XPCOM レイヤー自身は C/C++ で書かれているため、 XPCOM API は C/C++ でサンドボックスの外側から呼び出すことができます。また、他の言語から XPCOM API を利用できるようにするためには別のレイヤーが必要になります。

- -

そのようなバインディング層が様々な言語に対して提供されています。

- - - -

利用法が必要な場合は、それぞれのバインディングのページを参照してください。

diff --git a/files/ja/mozilla/tech/xpcom/language_bindings/javaxpcom/development/index.html b/files/ja/mozilla/tech/xpcom/language_bindings/javaxpcom/development/index.html deleted file mode 100644 index 6d9b1ca50b..0000000000 --- a/files/ja/mozilla/tech/xpcom/language_bindings/javaxpcom/development/index.html +++ /dev/null @@ -1,24 +0,0 @@ ---- -title: Development -slug: Mozilla/Tech/XPCOM/Language_Bindings/JavaXPCOM/Development -tags: - - JavaXPCOM - - 'XPCOM:Language Bindings' -translation_of: Mozilla/Tech/XPCOM/Language_bindings/JavaXPCOM/Development ---- -

-

-

ソース

-

最新のソースコードは、Mozilla trunk上の {{ Source("extensions/java/xpcom") }} ディレクトリ内にあります。 -

-

構築手順

-

ビルドの手順はここにあります: Building JavaXPCOM。 -

-

バグ

-

すべての JavaXPCOM バグは、 Bugzilla内で、"Core" プロダクトと "Java to XPCOM Bridge" コンポーネントを使って記録されています。 -

- -{{ languages( { "en": "en/JavaXPCOM/Development", "zh-cn": "cn/JavaXPCOM/\u5f00\u53d1" } ) }} diff --git a/files/ja/mozilla/tech/xpcom/language_bindings/javaxpcom/embedding_mozilla_in_a_java_application_using_javaxpcom/index.html b/files/ja/mozilla/tech/xpcom/language_bindings/javaxpcom/embedding_mozilla_in_a_java_application_using_javaxpcom/index.html deleted file mode 100644 index d523b94ce1..0000000000 --- a/files/ja/mozilla/tech/xpcom/language_bindings/javaxpcom/embedding_mozilla_in_a_java_application_using_javaxpcom/index.html +++ /dev/null @@ -1,156 +0,0 @@ ---- -title: Embedding Mozilla in a Java Application using JavaXPCOM -slug: >- - Mozilla/Tech/XPCOM/Language_Bindings/JavaXPCOM/Embedding_Mozilla_in_a_Java_Application_using_JavaXPCOM -tags: - - Embedding Mozilla - - JavaXPCOM - - 'XPCOM:Language Bindings' -translation_of: Archive/Mozilla/Embedding_Mozilla_in_a_Java_Application_using_JavaXPCOM ---- -

-

XULRunnerにはJavaXPCOMが標準搭載されており、これは、JavaのコードとXPCOMの相互利用を可能にするものです。この記事で示すとおり、JavaでのXPCOMオブジェクトの操作は、C++の場合とそれほど大きな差はありません。 -

-

必要な環境

- -

組み込み

-

Mozilla を Java アプリケーションに埋め込むためには、<tt>xulrunner/sdk/lib</tt>フォルダーにある<tt>MozillaInterfaces.jar</tt>というライブラリをclasspathに追加する必要があります。このライブラリは Mozilla をブートストラップし、XPCOM メソッドを呼び出すために必要なインターフェースを提供します。 -

組み込みを開始するために、Mozilla共有クラスの提供するメソッドを使用します。はじめに、Java アプリケーションは適切な XULRunner installationを見つける必要があります。 -

-
 Mozilla mozilla = Mozilla.getInstance();
- GREVersionRange[] range = new GREVersionRange[1];
- range[0] = new GREVersionRange("1.8.0", true, "1.9", false);
-   // work with trunk nightly version 1.9a1  ^^
-
- try {
-   File grePath = Mozilla.getGREPathWithProperties(range, null);
-   LocationProvider locProvider = new LocationProvider(grePath);
-   mozilla.initEmbedding(grePath, grePath, locProvider);
- } catch (FileNotFoundException e) {
-   // この例外は greGREPathWithProperties が GRE を見つけられなかったときに送出されます
- } catch (XPCOMException e) {
-   // この例外は initEmbedding が失敗したときに送出されます
- }
-
-

LocationProviderはJavaアプリケーションによって提供されるクラスです。これはインターフェースIAppFileLocProviderを実装しているもので、 -and tells XPCOM where to find certain files and directories. -

initEmbeddingメソッドは embedding process を開始するもので、Java アプリケーションと XPCOM や Mozilla の連携を可能にするものです。ひとたび Java アプリケーションが Mozilla を使う作業を終えたとき、それは embedding process を terminate する必要があります。 -

-
 try {
-   mozilla.termEmbedding();
- } catch (XPCOMException e) {
-   // この例外は termEmbedding が失敗したときに送出されます
- }
-
-

XPCOMオブジェクトを利用する

-

Mozilla が組み込まれると、Java アプリケーションは XPCOM オブジェクトを利用することができるようになります。Mozilla クラスはこれの手助けをするメソッドを提供しており、たとえば、getServiceManagergetComponentManagernewLocalFileがあります。JavaXPCOM により、 Java アプリケーションがXPCOM オブジェクトを取得し、メソッドを呼び出すのに加え、Java クラスオブジェクトを XPCOM メソッドに渡すことも可能になります。 -

例えば: -

-
 Mozilla mozilla = Mozilla.getInstance();
- WindowCreator creator = new WindowCreator();  // nsIWindowCreator を実装
-
- nsIServiceManager serviceManager = mozilla.getServiceManager();
-
- nsIWindowWatcher windowWatcher = (nsIWindowWatcher) serviceManager
-   .getServiceManagerByContractID(NS_WINDOWWATCHER_CONTRACTID,
-     nsIWindowWatcher.NS_IWINDOWWATCHER_IID);
- windowWatcher.setWindowCreator(creator);
-
-

この例では、nsIWindowCreatorインターフェースを実装した Java のクラスであるWindowCreatorが存在し、それを Mozilla に登録しようとしています。そのために、まず service manager を取得するのですが、それは Mozilla のwindow watcherのリファレンスにある方法によります。 -

別の例: (rayh.co.ukにあるもの) -

-
     // linux 上ではこのコードが実行されるより前に gtk が初期化されている必要があることに注意
-     Mozilla moz = Mozilla.getInstance();
-
-     // 次に XUL アプリケーションを実行するために、XPCOMのservice managerのインスタンスを取得する必要がある
-     nsIServiceManager serviceManager = moz.getServiceManager();
-
-     // 次に @mozilla.org/toolkit/app-startup;1 サービスを取得する必要がある
-     nsIAppStartup appStartup = (nsIAppStartup)serviceManager.getServiceByContractID("@mozilla.org/toolkit/app-startup;1", nsIAppStartup.NS_IAPPSTARTUP_IID);
-
-     // 上のものへの nsIWindowWatcher インターフェースを取得する
-     nsIWindowCreator windowCreator = (nsIWindowCreator)appStartup.queryInterface(nsIWindowCreator.NS_IWINDOWCREATOR_IID);
-
-     // window watcher サービスを取得する
-     nsIWindowWatcher windowWatcher = (nsIWindowWatcher)serviceManager.getServiceByContractID("@mozilla.org/embedcomp/window-watcher;1", nsIWindowWatcher.NS_IWINDOWWATCHER_IID);
-
-     // window creator をsetする (from step 6)
-     windowWatcher.setWindowCreator(windowCreator);
-
-     // Create the root XUL window を作成:
-     nsIDOMWindow win = windowWatcher.openWindow(null, "chrome://your-app/content/window.xul", "mywindow", "chrome,resizable,centerscreen", null);
-
-     // これを active window にする
-     windowWatcher.setActiveWindow(win);
-
-     // application を xpcom/xul に手渡し、ここでブロックする:
-     appStartup.run();
-
-

これは動作する LocationProvider の例です : -

-
       public class LocationProvider implements IAppFileLocProvider {
-
-
       private final File libXULPath;
-       int counter = 0;
-
-       public LocationProvider(File grePath) {
-       this.libXULPath = grePath;
-       }
-
-
       public File getFile(String aProp, boolean[] aPersistent) {
-       File file = null;
-       if (aProp.equals("GreD") || aProp.equals("GreComsD")) {
-           file = libXULPath;
-           if (aProp.equals("GreComsD")) {
-               file = new File(file, "components");
-           }
-       }
-       else if (aProp.equals("MozBinD") ||
-                aProp.equals("CurProcD") ||
-                aProp.equals("ComsD") ||
-                aProp.equals("ProfD"))
-           {
-               file = libXULPath;
-               if (aProp.equals("ComsD")) {
-                   file = new File(file, "components");
-               }
-           }
-       return file;
-   }
-
-
   public File[] getFiles(String aProp) {
-       File[] files = null;
-       if (aProp.equals("APluginsDL")) {
-           files = new File[1];
-           files[0] = new File(libXULPath, "plugins");
-       }
-       return files;
-   }
-
-


-

-

XPCOM の UI を別のスレッドから呼び出す

-

appStartup.run() はメインのイベントループを始動し、アプリケーションが終了するまでそこに留まります。これ以降の場所で XPCOM とcommunicateするためには、nsIProxyObjectManager を使用する必要があります。 -

上の例に引き続き新しいウインドウを作成するためには、このようにします : -

-
 // まず、event queue service を取得します。これは、XPCOM の全てのイベントキューを処理するものです。
- nsIEventQueueService eventQueueServive = (nsIEventQueueService)serviceManager.getServiceByContractID("@mozilla.org/event-queue-service;1",nsIEventQueueService.NS_IEVENTQUEUESERVICE_IID);
-
- // 次に、ウインドウを開くために、UI スレッドを取得します。
- // nsIEventQueueService が所有するstatic変数がUIイベント用の特別なキューを所有しています。
- nsIEventQueue eventQueue = eventQueueServive.getSpecialEventQueue(nsIEventQueueService.UI_THREAD_EVENT_QUEUE);
-
- // 次に、proxy object manager 用の proxy を作成します。
- nsIProxyObjectManager proxy = (nsIProxyObjectManager)componentManager.createInstanceByContractID("@mozilla.org/xpcomproxy;1",null,nsIProxyObjectManager.NS_IPROXYOBJECTMANAGER_IID);
-
- // そして、proxy object manager を使って、さきほど作成した nsIWindowWatcher のインスタンスへの proxy を作成します。
- nsIWindowWatcher windowProxy = (nsIWindowWatcher)proxy.getProxyForObject(eventQueue,windowWatcher.NS_IWINDOWWATCHER_IID,windowWatcher,nsIProxyObjectManager.INVOKE_SYNC);
-
- // そうすれば、proxy を使ってメソッドを普通に呼び出すことができます。
- windowProxy.openWindow(null, chromeUri, name, "centerscreen", null);
-
-

さらに詳しい情報は、XulPlanet's documentation of nsIProxyObjectManagerを参照してください。 -

これは、Injecting Events onto XPCOM’s UI Threadからとられたものです。 -

diff --git a/files/ja/mozilla/tech/xpcom/language_bindings/javaxpcom/examples/index.html b/files/ja/mozilla/tech/xpcom/language_bindings/javaxpcom/examples/index.html deleted file mode 100644 index 9c34d27c84..0000000000 --- a/files/ja/mozilla/tech/xpcom/language_bindings/javaxpcom/examples/index.html +++ /dev/null @@ -1,13 +0,0 @@ ---- -title: Examples -slug: Mozilla/Tech/XPCOM/Language_Bindings/JavaXPCOM/Examples -tags: - - JavaXPCOM - - 'XPCOM:Language Bindings' -translation_of: Mozilla/Tech/XPCOM/Language_bindings/JavaXPCOM/Examples ---- -

-

いくつかの Java テストアプリケーションがソースツリーにチェックインされています。ここには、Java から Gecko の埋め込みや XPCOM の初期化をする方法の例があります。mozilla/extensions/java/xpcom/tests -

-
-
diff --git a/files/ja/mozilla/tech/xpcom/language_bindings/javaxpcom/index.html b/files/ja/mozilla/tech/xpcom/language_bindings/javaxpcom/index.html deleted file mode 100644 index c2707f8de0..0000000000 --- a/files/ja/mozilla/tech/xpcom/language_bindings/javaxpcom/index.html +++ /dev/null @@ -1,73 +0,0 @@ ---- -title: JavaXPCOM -slug: Mozilla/Tech/XPCOM/Language_Bindings/JavaXPCOM -tags: - - JavaXPCOM - - 'XPCOM:Language Bindings' - - 要更新 -translation_of: Mozilla/Tech/XPCOM/Language_bindings/JavaXPCOM ---- -

 

-
-

JavaXPCOM は Java と XPCOM のコミュニケーションを可能にします。つまり、Java アプリケーションは、XPCOM オブジェクトにアクセスでき、XPCOM オブジェクトも XPCOM インターフェースを実装するすべての Java class にアクセスできます。 JavaXPCOM を使うことで、開発者は Java アプリケーションから XPCOM や埋め込み Gecko にデータを伝送することができます。 JavaXPCOM は XPConnect (JavaScript-XPCOM ブリッジ) に非常によく似ていて XPIDL を使用します。

-

JavaXPCOM は XULRunner の一部として標準で構築されています。 最近のビルドまたは XULRunner 1.8.0.4 をダウンロードして試してみてください。

-
- - - - - - - -
-

ドキュメンテーション

-
-
- JavaXPCOM Development
-
- ソースの取得・構築方法、それから読み方・バグの報告の方法。
-
-
-
- サンプルコード
-
- いくつかの Java テストアプリケーションがソースツリーにチェックインされており、Java から Gecko の埋め込みや XPCOM を初期化する方法の例があります。
-
-
-
- JavaXPCOM を使って Java アプリケーションへ Mozilla を組み込む
-
- XULRunner には JavaXPCOM が標準搭載されており、これは、Java のコードと XPCOM の相互利用を可能にするものです。この記事で示すとおり、Java での XPCOM オブジェクトの操作は C++ の場合とそれほど大きな差はありません。
-
-

すべて見る...

-
-

コミュニティ

-
    -
  • Mozilla Java フォーラムを見る...
  • -
- -
    -
  • Mozilla Embedding フォーラムを見る...
  • -
- - -

関連項目

-
-
- XPCOM, Embedding Mozilla
-
-
diff --git a/files/ja/mozilla/tech/xpcom/language_bindings/javaxpcom/other_resources/index.html b/files/ja/mozilla/tech/xpcom/language_bindings/javaxpcom/other_resources/index.html deleted file mode 100644 index 14a9eb1ee0..0000000000 --- a/files/ja/mozilla/tech/xpcom/language_bindings/javaxpcom/other_resources/index.html +++ /dev/null @@ -1,15 +0,0 @@ ---- -title: その他の情報源 -slug: Mozilla/Tech/XPCOM/Language_Bindings/JavaXPCOM/Other_Resources -tags: - - JavaXPCOM - - 'XPCOM:Language Bindings' -translation_of: Mozilla/Tech/XPCOM/Language_bindings/JavaXPCOM/Other_Resources ---- -

その他の情報源

- diff --git a/files/ja/mozilla/tech/xpcom/language_bindings/plxpcom/index.html b/files/ja/mozilla/tech/xpcom/language_bindings/plxpcom/index.html deleted file mode 100644 index 4bb9b94597..0000000000 --- a/files/ja/mozilla/tech/xpcom/language_bindings/plxpcom/index.html +++ /dev/null @@ -1,17 +0,0 @@ ---- -title: PlXPCOM -slug: Mozilla/Tech/XPCOM/Language_Bindings/PlXPCOM -tags: - - PlXPCOM - - XPCOM - - 'XPCOM:Language Bindings' -translation_of: Mozilla/Tech/XPCOM/Language_bindings/PlXPCOM ---- -

Perl XPCOM (plXPCOM): Perl と XPCOM のバインディング -

- diff --git a/files/ja/mozilla/tech/xpcom/language_bindings/pyxpcom/index.html b/files/ja/mozilla/tech/xpcom/language_bindings/pyxpcom/index.html deleted file mode 100644 index 5dfb513534..0000000000 --- a/files/ja/mozilla/tech/xpcom/language_bindings/pyxpcom/index.html +++ /dev/null @@ -1,62 +0,0 @@ ---- -title: PyXPCOM -slug: Mozilla/Tech/XPCOM/Language_Bindings/PyXPCOM -tags: - - PyXPCOM - - 'XPCOM:Language Bindings' -translation_of: Mozilla/Tech/XPCOM/Language_bindings/PyXPCOM ---- -

-

-
-

PyXPCOMPythonXPCOM の間で通信を可能にします。すなわち、Python アプリケーションが XPCOM オブジェクトにアクセスできるように、また XPCOM が XPCOM インタフェースを実装したあらゆる Python クラスにアクセスできるようにします。PyXPCOM によって開発者は Python アプリケーションから XPCOM や組み込み Gecko に通話が可能になります。PyXPCOM は JavaXPCOM (Java と XPCOM のブリッジ) や XPConnect (JavaScript と XPCOM のブリッジ) と類似しています。 -

-Python のクラスとインタフェース: Mozilla は組み込み開発者やコンポーネント開発者が利用できる多くの外部インターフェイスを定義しています。PyXPCOM はこれらのインタフェースを Python インタフェースとしてアクセスできる機能を提供します。PyXPCOM は Python から XPCOM や Gecko の初期化や終了を行う関数にアクセスを提供するいくつかのクラスや、さらに XPCOM のヘルパー関数をいくつか含みます。
- - -
-

ドキュメント

-
PyXPCOM のビルド -
PyXPCOM のビルド手順。 -
-
Creating a Python XPCOM component -
Python を使って簡単な XPCOM コンポーネントを作る方法のサンプル。 -
-
PyXPCOM 入門 -
PyXPCOM は XPCOM と Python の間を橋渡しする技術です。この記事はこれから PyXPCOM を学ぶ開発者のためのスタートガイドです。 -
-

すべて見る... -

-

歴史

-

PyXPCOM は当初 ActiveState Tool Corporation によって開発され、彼らの Komodo プロジェクト の一部として 知られています。現在のリリースでは Mozilla ビルドシステムにすでに 統合されています。 -

-
-

コミュニティ

-
  • Mozilla XPCOM フォーラムを見る... -
- - - -

ソースコード

-
  • PyXPCOM のコードは trunk の extensions/python/xpcom/ ディレクトリから利用可能です。 -
  • PyXPCOM は標準ではビルドされないことに気をつけてください。PyXPCOM をビルドするには PyXPCOM のビルド を参照してください。 -
-

関連事項

-
XPCOM -
PyDOM: JavaScript を Python で置き換える -
-
-

Categories -

Interwiki Language Links -


-

-
-
diff --git a/files/ja/mozilla/tech/xpcom/language_bindings/rbxpcom/index.html b/files/ja/mozilla/tech/xpcom/language_bindings/rbxpcom/index.html deleted file mode 100644 index ff1cec39a2..0000000000 --- a/files/ja/mozilla/tech/xpcom/language_bindings/rbxpcom/index.html +++ /dev/null @@ -1,16 +0,0 @@ ---- -title: RbXPCOM -slug: Mozilla/Tech/XPCOM/Language_Bindings/RbXPCOM -tags: - - RbXPCOM - - XPCOM - - 'XPCOM:Language Bindings' -translation_of: Mozilla/Tech/XPCOM/Language_bindings/RbXPCOM ---- -

Ruby Cross-Platform COM (rbXPCOM): Ruby と XPCOM のバインディング -

- diff --git a/files/ja/mozilla/tech/xpcom/reference/components/index.html b/files/ja/mozilla/tech/xpcom/reference/components/index.html deleted file mode 100644 index 930d831c1e..0000000000 --- a/files/ja/mozilla/tech/xpcom/reference/components/index.html +++ /dev/null @@ -1,18 +0,0 @@ ---- -title: Standard XPCOM components -slug: Mozilla/Tech/XPCOM/Reference/Components -tags: - - Components - - Landing - - Mozilla - - NeedsContent - - NeedsTranslation - - TopicStub - - XPCOM -translation_of: Mozilla/Tech/XPCOM/Reference/Components ---- -

There are a number of components provided in the standard implementation of XPCOM; these are as follows.

-
-
nsCategoryManager
The XPCOM Category Manager.
nsDirectoryService
XPCOM ディレクトリサービス。このサービスは、OS 固有のマナーで "よく知られた" ディレクトリの場所を返します。例えば、システムの一時ディレクトリやデスクトップディレクトリ、現在の作業ディレクトリなどのパスを提供します。
nsLocalFile
nsILocalFile を実装するコンポーネント。
-
nsObserverService
XPCOM Observer サービス。
nsScriptableInputStream
nsIScriptableInputStream を実装するコンポーネント。
-
diff --git a/files/ja/mozilla/tech/xpcom/reference/components/nscategorymanager/index.html b/files/ja/mozilla/tech/xpcom/reference/components/nscategorymanager/index.html deleted file mode 100644 index 06226a5d35..0000000000 --- a/files/ja/mozilla/tech/xpcom/reference/components/nscategorymanager/index.html +++ /dev/null @@ -1,30 +0,0 @@ ---- -title: nsCategoryManager -slug: Mozilla/Tech/XPCOM/Reference/Components/nsCategoryManager -tags: - - Components - - 'Components:Frozen' - - XPCOM - - XPCOM API Reference -translation_of: Mozilla/Tech/XPCOM/Reference/Components/nsCategoryManager ---- -

« XPCOM API Reference

- -

要約

- -

The XPCOM Category Manager.

- -
-
Class ID
-
16d222a6-1dd2-11b2-b693-f38b02c021b2
-
ContractID
-
@mozilla.org/categorymanager;1
-
- -

サポートされたインタフェース

- -

nsICategoryManager

- -

コメント

- -

このコンポーネントは、単独で使用するか、XPCOM サービスマネージャを通してアクセスします。

diff --git a/files/ja/mozilla/tech/xpcom/reference/components/nsdirectoryservice/index.html b/files/ja/mozilla/tech/xpcom/reference/components/nsdirectoryservice/index.html deleted file mode 100644 index dbec00fb06..0000000000 --- a/files/ja/mozilla/tech/xpcom/reference/components/nsdirectoryservice/index.html +++ /dev/null @@ -1,71 +0,0 @@ ---- -title: nsDirectoryService -slug: Mozilla/Tech/XPCOM/Reference/Components/nsDirectoryService -tags: - - Components - - 'Components:Frozen' - - XPCOM - - XPCOM API Reference -translation_of: Mozilla/Tech/XPCOM/Reference/Components/nsDirectoryService ---- -

« XPCOM API Reference

- -

要約

- -

XPCOM ディレクトリサービス。このサービスは、OS 固有のマナーで "よく知られた" ディレクトリの場所を返します。例えば、システムの一時ディレクトリやデスクトップディレクトリ、現在の作業ディレクトリなどのパスを提供します。

- -
-
Class ID
-
f00152d0-b40b-11d3-8c9c-000064657374
-
ContractID
-
@mozilla.org/file/directory_service;1
-
- -

サポートされたインタフェース

- -

nsIProperties, nsIDirectoryService

- -

コメント

- -

このコンポーネントは、単独で使用するか、XPCOM サービスマネージャを通してアクセスします。

- -

コード例

- -
#include "nsXPCOM.h"
-#include "nsCOMPtr.h"
-#include "nsDirectoryServiceDefs.h"
-#include "nsIServiceManager.h"
-#include "nsIProperties.h"
-
-/**
- * Get the location of the system's "temp" directory.
- */
-nsresult GetTempDir(nsIFile **aResult)
-{
-  nsresult rv;
-
-  nsCOMPtr<nsIServiceManager> svcMgr;
-  rv = NS_GetServiceManager(getter_AddRefs(svcMgr));
-  if (NS_FAILED(rv))
-    return rv;
-
-  nsCOMPtr<nsIProperties> directory;
-  rv = svcMgr->GetServiceByContractID("@mozilla.org/file/directory_service;1",
-                                      NS_GET_IID(nsIProperties),
-                                      getter_AddRefs(directory));
-  if (NS_FAILED(rv))
-    return rv;
-
-  rv = directory->Get(NS_OS_TEMP_DIR, NS_GET_IID(nsIFile), aResult);
-
-  return rv;
-}
-
- -

NS_OS_TEMP_DIR は、他の多くの Directory Service キーと共に、nsDirectoryServiceDefs.h で定義されているので注意してください。

- -

参考

- -

Using nsIDirectoryService, nsIProperties::get, nsIDirectoryServiceProvider

- -
 
diff --git a/files/ja/mozilla/tech/xpcom/reference/components/nslocalfile/index.html b/files/ja/mozilla/tech/xpcom/reference/components/nslocalfile/index.html deleted file mode 100644 index 2b7872b2b8..0000000000 --- a/files/ja/mozilla/tech/xpcom/reference/components/nslocalfile/index.html +++ /dev/null @@ -1,41 +0,0 @@ ---- -title: nsLocalFile -slug: Mozilla/Tech/XPCOM/Reference/Components/nsLocalFile -tags: - - Components - - 'Components:Frozen' - - XPCOM - - XPCOM API Reference -translation_of: Mozilla/Tech/XPCOM/Reference/Components/nsLocalFile ---- -

« XPCOM API Reference

- -

要約

- -

nsILocalFile を実装するコンポーネント。

- -
-
Class ID
-
2e23e220-60be-11d3-8c4a-000064657374
-
ContractID
-
@mozilla.org/file/local;1
-
- -

サポートされたインタフェース

- -

nsILocalFile, nsIFile

- -

コメント

- -

このコンポーネントは XPCOM コンポーネントマネージャを通してアクセスします。

- -

コード例

- -
function getFileSize(path) {
-  var file =
-      Components.classes["@mozilla.org/file/local;1"].
-      createInstance(Components.interfaces.nsILocalFile);
-  file.initWithPath(path);
-  return file.fileSize;
-}
-
diff --git a/files/ja/mozilla/tech/xpcom/reference/components/nsobserverservice/index.html b/files/ja/mozilla/tech/xpcom/reference/components/nsobserverservice/index.html deleted file mode 100644 index 579189906f..0000000000 --- a/files/ja/mozilla/tech/xpcom/reference/components/nsobserverservice/index.html +++ /dev/null @@ -1,30 +0,0 @@ ---- -title: nsObserverService -slug: Mozilla/Tech/XPCOM/Reference/Components/nsObserverService -tags: - - Components - - 'Components:Frozen' - - XPCOM - - XPCOM API Reference -translation_of: Mozilla/Tech/XPCOM/Reference/Components/nsObserverService ---- -

« XPCOM API Reference

- -

要約

- -

XPCOM Observer サービス。

- -
-
Class ID
-
D07F5195-E3D1-11d2-8ACD-00105A1B8860
-
ContractID
-
@mozilla.org/observer-service;1
-
- -

サポートされたインタフェース

- -

nsIObserverService

- -

コメント

- -

このコンポーネントは、単独で使用するか、XPCOM サービスマネージャを通してアクセスします。これはメインスレッドからのみ使用されるべきです。

diff --git a/files/ja/mozilla/tech/xpcom/reference/components/nsscriptableinputstream/index.html b/files/ja/mozilla/tech/xpcom/reference/components/nsscriptableinputstream/index.html deleted file mode 100644 index ce98722492..0000000000 --- a/files/ja/mozilla/tech/xpcom/reference/components/nsscriptableinputstream/index.html +++ /dev/null @@ -1,66 +0,0 @@ ---- -title: nsScriptableInputStream -slug: Mozilla/Tech/XPCOM/Reference/Components/nsScriptableInputStream -tags: - - Components - - 'Components:Frozen' - - XPCOM - - XPCOM API Reference -translation_of: Mozilla/Tech/XPCOM/Reference/Components/nsScriptableInputStream ---- -

« XPCOM API Reference

- -

要約

- -

nsIScriptableInputStream を実装するコンポーネント。

- -
-
Class ID
-
7225c040-a9bf-11d3-a197-0050041caf44
-
ContractID
-
@mozilla.org/scriptableinputstream;1
-
- -

サポートされたインタフェース

- -

nsIScriptableInputStream, nsIInputStream

- -

コメント

- -

このコンポーネントは XPCOM コンポーネントマネージャを通してアクセスします。

- -

コード例

- -
const nsIScriptableInputStream = Components.interfaces.nsIScriptableInputStream;
-
-function consumeStream(inputStream)
-{
-  var factory = Components.classes["@mozilla.org/scriptableinputstream;1"];
-
-  var sis = factory.createInstance(nsIScriptableInputStream);
-  sis.init(inputStream);
-
-  try
-  {
-    while (true)
-    {
-      var chunk = sis.read(512);
-      if (chunk.length == 0)
-        break;
-
-      // ok, chunk now contains a portion of the stream's data.
-      // Do something with it!
-    }
-  }
-  catch (e)
-  {
-    dump("Error: failed reading from stream:\n" + e + "\n");
-  }
-}
-
- -

参考

- -

nsIScriptableInputStream

- -
 
diff --git a/files/ja/mozilla/tech/xpcom/reference/glue_classes/index.html b/files/ja/mozilla/tech/xpcom/reference/glue_classes/index.html deleted file mode 100644 index 370f7ffe1e..0000000000 --- a/files/ja/mozilla/tech/xpcom/reference/glue_classes/index.html +++ /dev/null @@ -1,16 +0,0 @@ ---- -title: XPCOM glue classes -slug: Mozilla/Tech/XPCOM/Reference/Glue_classes -tags: - - Classes - - Landing - - NeedsTranslation - - TopicStub - - XPCOM -translation_of: Mozilla/Tech/XPCOM/Reference/Glue_classes ---- -

These "glue" classes are provided to make it easier to use XPCOM from C++ code. When these classes are used by a component, you may need to link the component against the XPCOM glue library.

-
-
-
nsCOMPtr
このユーティリティクラスは、 C++ のコードからの XPCOM インタフェースの参照の管理をシンプルにします。
-
diff --git a/files/ja/mozilla/tech/xpcom/reference/glue_classes/nscomptr/index.html b/files/ja/mozilla/tech/xpcom/reference/glue_classes/nscomptr/index.html deleted file mode 100644 index 3de5c924b8..0000000000 --- a/files/ja/mozilla/tech/xpcom/reference/glue_classes/nscomptr/index.html +++ /dev/null @@ -1,27 +0,0 @@ ---- -title: nsCOMPtr -slug: Mozilla/Tech/XPCOM/Reference/Glue_classes/nsCOMPtr -tags: - - XPCOM - - XPCOM API Reference -translation_of: Mozilla/Tech/XPCOM/Reference/Glue_classes/nsCOMPtr ---- -
« XPCOM API Reference
- -

概要

- - -

このユーティリティクラスは、 C++ のコードからの XPCOM インタフェースの参照の管理をシンプルにします。

- -
#include "nsCOMPtr.h"
- - -

備考

- -

詳細については『 nsCOMPtr の使用』 を参照して下さい。

- - - - - -このクラスを使用するには、コンポーネントまたはアプリケーションから XPCOM glue library にリンクする必要があります。クラス自体とそれに使用されている支援機能は凍結されていませんが、容易な再利用のために XPCOM glue library の一部として提供されています。 diff --git a/files/ja/mozilla/tech/xpcom/reference/index.html b/files/ja/mozilla/tech/xpcom/reference/index.html deleted file mode 100644 index 49949e50fd..0000000000 --- a/files/ja/mozilla/tech/xpcom/reference/index.html +++ /dev/null @@ -1,21 +0,0 @@ ---- -title: XPCOM reference -slug: Mozilla/Tech/XPCOM/Reference -tags: - - Landing - - Mozilla - - NeedsTranslation - - Reference - - TopicStub - - XPCOM -translation_of: Mozilla/Tech/XPCOM/Reference ---- -

This reference describes the interfaces and functions provided by the XPCOM library. In addition, it details the various helper classes and functions, as well as the components, provided by the XPCOM glue library. The contents herein are oriented primarily toward extension developers and people embedding XPCOM in other projects.

-
-

Note: If you're working on a module in the Mozilla codebase that's compiled with the MOZILLA_INTERNAL_API flag set, some of these APIs -- the string functions and classes in particular -- are not the ones you should be using. See the XPCOM internal string guide for documentation of the internal string API used within the Mozilla codebase.

-
-
-
NS ENSURE TRUE
マクロ
Standard XPCOM components
There are a number of components provided in the standard implementation of XPCOM; these are as follows.
XPCOM glue classes
These "glue" classes are provided to make it easier to use XPCOM from C++ code.
XPCOM Interface Reference group
このページには2010年12月1日現在の Mozilla インターフェースが一覧となっています。the XPCOM interface Reference の一覧はアルファベット順に並べられていますが、このページではそれらを機能ごとにグループ化するという試みがなされています。グループ化とカテゴリの名称は著者【訳注: 英語版のこのページの著者】による独断が多少入り混じっています。(これについては涙を流す結末になりうる重大な論点であるとは認識しています。ですが、どうやら私がこの編集を行った最初の人物であるようなので、最初の編集者としての権利を得たものとします。)
-
XPCOM インタフェースリファレンス
これは Mozilla プラットフォームにおいて提供されている XPCOM インタフェースのリファレンスです。
-
-

Many XPCOM pages return an nsresult. Prior to Gecko 19 (Firefox 19 / Thunderbird 19 / SeaMonkey 2.16), this was an integer that simply returned an error code. It is now a strongly typed enum when XPCOM is built using a C++11 compiler. This causes compile-time errors to occur when improper values are returned as nsresult values, thereby making it easier to catch many bugs.

diff --git a/files/ja/mozilla/tech/xpcom/reference/ns_ensure_true/index.html b/files/ja/mozilla/tech/xpcom/reference/ns_ensure_true/index.html deleted file mode 100644 index cf931e4a21..0000000000 --- a/files/ja/mozilla/tech/xpcom/reference/ns_ensure_true/index.html +++ /dev/null @@ -1,49 +0,0 @@ ---- -title: NS ENSURE TRUE -slug: Mozilla/Tech/XPCOM/Reference/NS_ENSURE_TRUE -tags: - - XPCOM - - XPCOM_Macros -translation_of: Mozilla/Tech/XPCOM/Reference/NS_ENSURE_TRUE ---- -

概要

- -

マクロ

- -

expr の評価値が false の場合に return-value を返す。

- -

構文

- -
NS_ENSURE_TRUE( expr, return-value );
-
- -

 

- -

使い方

- -
nsresult mozMyClass::MozStringMucking()
-{
-  char *foo = new char[123];
-  NS_ENSURE_TRUE(foo, NS_ERROR_OUT_OF_MEMORY);
-
-  // This is equivalent to doing:
-  // これは以下の式と同等です。
-  if (!foo)
-    return NS_ERROR_OUT_OF_MEMORY;
-
-  // Thou shalt not return NS_ERROR_FAILURE..
-  // これは、NS_ERROR_FAILURE を返さない。。
-  int i = 3;
-  NS_ENSURE_TRUE(i == 3, NS_ERROR_FAILURE);
-
-  return NS_OK;
-}
-
-char* mozMyClass::DoStuff()
-{
-  char* bar = new char[321];
-  NS_ENSURE_TRUE(bar, nsnull);
-
-  return bar;
-}
-
diff --git a/files/ja/mozilla/tech/xpcom/reference/xpcom_interface_reference/imgiloader/index.html b/files/ja/mozilla/tech/xpcom/reference/xpcom_interface_reference/imgiloader/index.html deleted file mode 100644 index 58a3045835..0000000000 --- a/files/ja/mozilla/tech/xpcom/reference/xpcom_interface_reference/imgiloader/index.html +++ /dev/null @@ -1,27 +0,0 @@ ---- -title: imgILoader -slug: Mozilla/Tech/XPCOM/Reference/XPCOM_Interface_Reference/imgILoader -tags: - - Interfaces - - MDC Project - - NeedsContent - - XPCOM - - XPCOM API Reference -translation_of: Mozilla/Tech/XPCOM/Reference/Interface/imgILoader ---- -

以下のコードスニペットを使用して imgLoader のインスタンスを生成することができます。

-
var imgLoader = Components.classes["@mozilla.org/image/loader;1"]
-                          .getService(Components.interfaces.imgILoader);
-
-

インタフェースは以下のメソッドがあります:

- -

参考

- -
-  
diff --git a/files/ja/mozilla/tech/xpcom/reference/xpcom_interface_reference/index.html b/files/ja/mozilla/tech/xpcom/reference/xpcom_interface_reference/index.html deleted file mode 100644 index d797fde123..0000000000 --- a/files/ja/mozilla/tech/xpcom/reference/xpcom_interface_reference/index.html +++ /dev/null @@ -1,15 +0,0 @@ ---- -title: XPCOM インタフェースリファレンス -slug: Mozilla/Tech/XPCOM/Reference/XPCOM_Interface_Reference -tags: - - XPCOM - - XPCOM Interface Reference -translation_of: Mozilla/Tech/XPCOM/Reference/Interface ---- -

これは Mozilla プラットフォームにおいて提供されている XPCOM インタフェースのリファレンスです。

-
-
-

関連情報

- diff --git a/files/ja/mozilla/tech/xpcom/reference/xpcom_interface_reference/mozijssubscriptloader/index.html b/files/ja/mozilla/tech/xpcom/reference/xpcom_interface_reference/mozijssubscriptloader/index.html deleted file mode 100644 index 5a0cb305dc..0000000000 --- a/files/ja/mozilla/tech/xpcom/reference/xpcom_interface_reference/mozijssubscriptloader/index.html +++ /dev/null @@ -1,80 +0,0 @@ ---- -title: mozIJSSubScriptLoader -slug: Mozilla/Tech/XPCOM/Reference/XPCOM_Interface_Reference/mozIJSSubScriptLoader -tags: - - Interfaces - - 'Interfaces:Scriptable' - - XPCOM - - XPCOM API Reference - - XPCOM Interface Reference -translation_of: Mozilla/Tech/XPCOM/Reference/Interface/mozIJSSubScriptLoader ---- -
-
js/src/xpconnect/idl/mozIJSSubScriptLoader.idlScriptable
- - -このインタフェースは、 実行時に与えられた URL の JavaScript コードを読み込み実行するために、特権を持つ JavaScript から使用されます。 - - -
- -
66
- -
- -
Introduced
-
Gecko 1.0
- -
- -
- -
-継承元: nsISupports -最終更新: Gecko 2.0 (Firefox 4 / Thunderbird 3.3 / SeaMonkey 2.1)
-
-

実装元: @mozilla.org/moz/jssubscript-loader;1。このサービスを取得するには次のコードを使用します:

-
var mozIJSSubScriptLoader = Components.classes["@mozilla.org/moz/jssubscript-loader;1"]
-                            .getService(Components.interfaces.mozIJSSubScriptLoader);
-
-
補足: もう一つの JavaScript コードをインポートする方法は、Components.utils.import を参照してください。
-

メソッドの概要

- -
void loadSubScript(in wstring url, in targetObj Optional, in charset Optional);
-

メソッド

-

loadSubScript()

-

スクリプトを指定された URL から同期的に読み込み、実行します。

-

指定されたスクリプトはシステムの規則に従って実行されます。これは、スクリプトができることに、全く制限がないことを意味します。

-
註: このメソッドは JavaScript からのみ呼び出されます!
-
void loadSubScript(
-  in wstring url,
-  in targetObj Optional,
-  in charset   Optional,
-);
-
-
引数
-
url
読み込むスクリプトを指す URL。これは、ローカルの chrome: または resource:, file: URL であるべきです (バグ 307686 および バグ 418356 を参照)。
-Gecko 1.9 note -
(Firefox 3)
-

Firefox 3.0 より前のバージョンでは、data: URL が使用できましたが、セキュリティ上の問題から許可されなくなりました。

targetObj
スクリプトが実行されるためのスコープオブジェクトとして使用されるオブジェクト。デフォルトでは、呼び出し元のグローバルオブジェクトになります。
-
-
charset
読み込むスクリプトファイルの文字エンコーディングを指定する任意の文字列。省略すると、ファイルは ASCII 文字列として処理されます。
-
-

-
var global = this;
-var obj = {};
-var loader = Components.classes["@mozilla.org/moz/jssubscript-loader;1"]
-                       .getService(Components.interfaces.mozIJSSubScriptLoader);
-loader.loadSubScript("data:text/plain,var a=1", obj)
-loader.loadSubScript("data:text/plain,this.b=1", obj)
-loader.loadSubScript("data:text/plain,c=1", obj)
-loader.loadSubScript("data:text/plain,function f(){}", obj)
-
-alert(obj.toSource()); // ({a:1, b:1, f:function f() {}})
-alert("a" in global); // false
-alert("b" in global); // false
-alert(global.c); // 1
-
-
- -
diff --git a/files/ja/mozilla/tech/xpcom/reference/xpcom_interface_reference/moziregistry/index.html b/files/ja/mozilla/tech/xpcom/reference/xpcom_interface_reference/moziregistry/index.html deleted file mode 100644 index 0eb074f536..0000000000 --- a/files/ja/mozilla/tech/xpcom/reference/xpcom_interface_reference/moziregistry/index.html +++ /dev/null @@ -1,89 +0,0 @@ ---- -title: mozIRegistry -slug: Mozilla/Tech/XPCOM/Reference/XPCOM_Interface_Reference/mozIRegistry -tags: - - Outdated_articles -translation_of: Mozilla/Tech/XPCOM/Reference/Interface/mozIRegistry ---- -
-

警告: この記事の内容は古くなっている可能性があります。 これは実装されなかった機能の設計書のようです。

-
-

はじめに

-

このドキュメントのタイトルは、とても誤解を受けやすいものになっています。実は、「レジストリインタフェース」についてのドキュメントではありません。このドキュメントは、インタフェースのクライアントとインタフェースの実装を実際に提供するコードとの間の、よりダイナミックな結合を Mozilla がどのように支援しているか、ということについて述べています。

-

この目的のため、ソースコードの中の明確なある場所において (実際には) どの実装が使われるか、という情報の保存が必要になります。 そして、今までのところ、我々はその情報を「Netscape レジストリ」ファイルに格納することにしています。 以上が、この (ドキュメントの) 情報が「レジストリ」という概念とどのように関係するようになるのかということの説明です。

-

いつか (私の希望ですが) このページのタイトルが適切に付けられるはずです。そうすれば、この場所が、Mozilla ブラウザを形成する様々な XPCOM コンポーネントがどのように互いに結びつくように考えられているか、を発見するための場所であることを皆さんが理解できるようになるでしょう。以下の情報は、それがどのように行われるかについて、あなたが知るべきすべてのことを説明するためのものです。

-

要約

-

クライアントは、任意のクラスのインスタンスを作成するために、nsRepository に依存します。 CLSID のダイナミックな結合を必要とするクライアントは、使用する CLSID を解決するために、ある高水準のサービス (TBD) を使う必要があります。 そのようにする意図は、そのようなサービス自身が新しい mozIRegistry インタフェースの上層部に作られるからです。

-

我々は、新しい XPCOM インタフェース「mozIRegistry」を提案します。これは、libreg で実装されていた「Netscape レジストリ」の機能と同じレベルの機能を提供します。nsRepository は、このインタフェースを使用するように修正されるでしょう。それによって、別のレジストリの実装を実行時/リンク時に置き換えることができるようになります。2 つのレジストリインタフェースの実装が存在するでしょう。ひとつは、libreg だけに基づいたもの (互換性のため) で、もうひとつはより装飾的な RDF ベースのものです。

-

未解決の問題

-

我々は、2 つの未解決な問題を認識しています。どちらもタイムリーに解決できないほど、大変なようには見えません。

-
    -
  1. もし現在の CLSID の静的な結合を取り除いた時は、要求された CLSID が存在しないリスクがあるかもしれません。 必然的結果として、新しいクラス実装へアクセスできるように、ビルド/インストールプロセスがユーザ「レジストリ」の更新をしなければならないでしょう。 我々の現在のビルド/インストールプロセスは、まだそれらの問題を解決していません。
  2. -
  3. 起動時において、mozIRegistry インタフェースにアクセスするためのサービスマネージャの使用に関係する問題がいくつかあります。現在のところ、nsIServiceManager は、そのサービスの実装をハードコードしているサービスにアクセスするために CLSID を必要とします。この問題は、別の mozIRegistry の実装を可能にするために、または実行時に結合される他のサービスマネージャの実装を可能にするためにも解決されなければなりません。私は、単純な CLSID の「別名」の仕組み (ある意味で COM の「コンポーネントカテゴリ」と同等の仕組み)、およびサービスを「設定する」ことができるようにする (これは、サービスマネージャがサービス自身を作成するというのと対立します) ことで、解決できると思います。最悪の場合は、クライアントは mozIRegistry シングルトンを他の手段 (つまり「NSGetRegistry」関数) を通じて取得するかもしれません。
  4. -
-

アーキテクチャ

-

Image:mozIRegistry.jpg

-

この図は、他の Mozilla コンポーネントと相互作用するために使われる、様々なコンポーネントを示しています。

-

いくつかは、説明のためのものです (図の上部付近の明るい色の箱)。これらには、(実際に) あなたが設計し、かつ実装するコンポーネントの型が入ります。 私は、それらについて説明して、あなたが他の箱をどのように使うべきかということの例を示そうと思います。

-

暗い色の箱で示されるコンポーネントは、あなたが使うサービスです。 このドキュメントで、これらのコンポーネントの設計と実装の原則について説明します。

-

最後に、(「mozRDFRegistry/nsIRDFDatabase」というラベルが付いている) ひとつのコンポーネントがあります。このコンポーネントは、mozIRegistry インタフェースのひとつの改良された実装として明らかになるかもしれません。 私は、その実装についてほんの短く論じる予定です。(その主な理由は、その実装を誰かにやって欲しいからです。)

-
-

コードを他の Mozilla コンポーネントに接続する時に、とても重要なコンポーネントがもうひとつあります。 それは「サービスマネージャ」です。 私は、ちょうどその役割を理解し始めたところです。まだ把握しきれていないので、今のところは(言えることは)何もありません。 将来的には、サービスマネージャについての情報を追加するつもりです。少なくとも、そのドキュメントへのリンクを張るつもりです。

-
-

高水準のアプリケーションコンポーネント

-

この箱は、潜在的ユーザのコアのレジストリ/リポジトリインタフェースを表しています。

-

あなたのコードは、(たぶん) この箱に収まるでしょう。

-

これらのコンポーネントは、その任務を果たすために、様々な度合で、他のコンポーネントを使う必要があるでしょう。これらの他のコンポーネントは、おそらく特定の XPCOM インタフェースを実装します。 あなたのコンポーネントが必要とするインタフェースを実装するオブジェクトを生成するにはどうすればよいでしょうか。

-

ひとつの方法は、nsRepository を使ってインタフェースを生成することです。 nsRepository は、元々 XPCOM の CLSID からクラスファクトリーへのマッピングであり、加えてそのマッピングを管理し、与えられた CLSID のインスタンスを生成する関数を含むものです。

-

nsRepository 関数は、nsRepository.h で宣言されています。 nsRepository についてのもっと多くの情報は、 にあります。

-

他のコンポーネントにアクセスする 2 つ目の方法は、サービスマネージャを経由することです。これについては、このドキュメントではカバーされません。上の注 を見てください。

-

このセクションでは、多くの異なるコンポーネント、それらの他のコンポーネントへのダイナミックな結合の要求、そしてそれらがその要求を満たすためにどのようにコア XPCOM コンポーネントを利用するか、について論じるつもりです。

- -

CLSID 結合プロトコル

-

ここには、レジストリーへの CLSID 情報の保存と、nsRepository を使った、コア XPCOM サービスの上層部でのインスタンス作成プロトコルを実装するための、その情報の使用の特定のイディオムの潜在的なカプセル化について書く予定です。

-

これらは、提供している基本的なサービスによって、2 つのカテゴリーに分かれると思います。

- -

nsRepository

-

これは、基本的に今提供されているものと同じです (mozilla/xpcom/public/nsRepository.h を参照してください)。 このコンポーネントに対する主な変更は、今まで呼んでいた NSReg.h の関数ではなく、新しい mozIRegistry インタフェースを利用するようにしたことです。 加えて、あまり重要ではない、いくつかの拡張があります。

- -

このことは、(今よりは) もう少し柔軟性を増すことにつながり、その結果、XPCOM をより汎用的にすることができるでしょう。

- -

そのため、より進んだ実装 (例えば RDF ベースのもの) と基本的な libreg ベースのレジストリーの実装との間で選択することができます。

-

nsRepository は CLSID だけを知っています。クライアントコンポーネント/アプリケーションは CLSID を取得する責任があります。 このテーマは、いくつかの点でもう少し説明が必要です。 基本的に、それらのサービスが mozIRegistry インタフェースに基づくべきだと想像します。 言い替えると、Rick が先週示唆したように、それらはレジストリーとリポジトリーの上層部にプロトコルを実装するでしょう。

-
-

私は、これは nsRepository のコードを改善するのに役立つと思います。これにより、サービスマネージャと同じように構造化されるでしょう。そうすると、nsRepository 自身をサービスとし、XPCOM モジュールを XPCOM の実装から完全に (?!) 引き離すことができるでしょう。

-
-
-
- mozIRegistry
-
- これは、新しいインタフェースで、現在 mozilla/modules/libreg/include/NSReg.h で定義されている libreg (「Netscapeレジストリー」としても知られている) が提供しているのと基本的に同じ関数を外に見せるものです。 クライアントは、このインタフェースをサービスマネージャを通じて、取得します (mozilla/xpcom/public/nsIServiceManager.h を見てください)。
-
- mozRegistry
-
- これは、とても簡単な mozIRegistry インタフェースの実装です。 NSReg.h の関数のための単純な C++ ラッパーとして作られています。 これは、現在の libreg の使用と完全に互換性のある (もう少し) 軽い実装を提供することを意図しています。
-
- mozRDFRegistry
-
- これは、付加的な能力を提供する RDF ベースの mozIRegistry 実装です。 これらの付加的な能力は、nsRepository によっては利用されないことに注意してください。 libreg の .reg ファイル、共有ライブラリのインストール、net を通じてアクセス可能な追加のコンポーネント、などに対応する基本的な RDF データソースの複数のタイプがあるでしょう。
-
-

この RDF データベースのコンテンツは、プレーンテキストの rdf/xml ファイルとして保存されます。そのため、中を見たり編集したりするのが簡単にできます。 またそれにより、人々が表示したりそのコンテンツを編集したりできるような、ブラウザーベースのアプリケーションの構築が容易になります。

-
-

原文書の情報

- -
diff --git a/files/ja/mozilla/tech/xpcom/reference/xpcom_interface_reference/mozistoragestatementparams/index.html b/files/ja/mozilla/tech/xpcom/reference/xpcom_interface_reference/mozistoragestatementparams/index.html deleted file mode 100644 index 4ea6f0c619..0000000000 --- a/files/ja/mozilla/tech/xpcom/reference/xpcom_interface_reference/mozistoragestatementparams/index.html +++ /dev/null @@ -1,25 +0,0 @@ ---- -title: mozIStorageStatementParams -slug: >- - Mozilla/Tech/XPCOM/Reference/XPCOM_Interface_Reference/mozIStorageStatementParams -translation_of: Mozilla/Tech/XPCOM/Reference/Interface/mozIStorageStatementParams ---- -

このインターフェースは定義済みのプロパティを1つも持ちませんが、与えられたステートメントのSQL内で見つかった名前付きパラメータに基づいたプロパティを持ちます。例えば、次のようにステートメントを構築します:

-
var statement = dbConn.createStatement("SELECT * FROM table_name WHERE id = :item_id");
-
-

このオブジェクトは item_id という1つのプロパティを持つことになり、次のようにして値を名前付きパラメータに束縛することができる:

-
statement.params.item_id = 2;
-
-

なぜ値をハードコーディングせずに、パラメータへの束縛を行うべきかについてのより詳しい情報は、overview document about binding parametersをご覧ください。

-

プロパティの列挙

-

このオブジェクトの全てのプロパティは for..in により列挙することが出来ます:

-
// valuesToBind は ステートメントの実行前にバインドすべき
-// key-value ペアを持つオブジェクト
-for (let param in statement.params)
-  statement.params[param] = valuesToBind[param];
-
-

参照

- diff --git a/files/ja/mozilla/tech/xpcom/reference/xpcom_interface_reference/nsiaccessible/index.html b/files/ja/mozilla/tech/xpcom/reference/xpcom_interface_reference/nsiaccessible/index.html deleted file mode 100644 index 32251140ee..0000000000 --- a/files/ja/mozilla/tech/xpcom/reference/xpcom_interface_reference/nsiaccessible/index.html +++ /dev/null @@ -1,484 +0,0 @@ ---- -title: nsIAccessible -slug: Mozilla/Tech/XPCOM/Reference/XPCOM_Interface_Reference/nsIAccessible -tags: - - Accessibility - - Interfaces - - XPCOM - - XPCOM API Reference -translation_of: Mozilla/Tech/XPCOM/Reference/Interface/nsIAccessible ---- -

 

-

nsIAccessible インタフェースは、MSAA や ATK のようなプラットフォーム固有のアクセシビリティ API をサポートする、クロスプラットフォームなインタフェースです。ATK の一般的な accessibility オブジェクトと同様に、IAccessible をサポートするのに必要なもののすべてが含まれています。

-

accessible tree 内のオブジェクトについての情報を取得するために、処理中の accessibility クライアントによって使用されます。accessible tree は DOM tree 内の (ドキュメントやフォーカス可能な要素、テキストのような) ノード のサブセットです。Mozilla は nsIAccessible の実装を要求があるときに生成します。

-

参照: http://www.mozilla.org/projects/ui/accessibility に詳しい情報があります。

-
accessible/public/nsIAccessible.idlScriptable
- - -Please add a summary to this article. - - -
-  -最終更新: Gecko 1.9 (Firefox 3)
-
-

継承元: nsISupports

-

-

メソッドの概要

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
nsIDOMDOMStringList getKeyBindings(in PRUint8 aActionIndex);
void getFinalState(out unsigned long aState, out unsigned long aExtraState);
void groupPosition(out long aGroupLevel, out long aSimilarItemsInGroup, out long aPositionInGroup);
nsIAccessible getChildAtPoint(in long x, in long y);
nsIAccessible getChildAt(in long aChildIndex);
nsIAccessible getAccessibleToRight();
nsIAccessible getAccessibleToLeft();
nsIAccessible getAccessibleAbove();
nsIAccessible getAccessibleBelow();
nsIAccessible getAccessibleRelated(in unsigned long aRelationType);
nsIAccessibleRelation getRelation(in unsigned long index);
nsIArray getRelations();
void getBounds(out long x, out long y, out long width, out long height);
void setSelected(in boolean isSelected);
void extendSelection();
void takeSelection();
void takeFocus();
AString getActionName(in PRUint8 index);
AString getActionDescription(in PRUint8 aIndex);
void doAction(in PRUint8 index);
-

-

属性

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
属性説明
parentnsIAccessibleaccessible tree 内の親ノード。
nextSiblingnsIAccessibleaccessible tree 内の次の兄弟ノード。
previousSiblingnsIAccessibleaccessible tree 内の前の兄弟ノード。
firstChildnsIAccessibleaccessible tree 内の最初の子ノード。
lastChildnsIAccessibleaccessible tree 内の最後の子ノード。
childrennsIArrayこの要素の子ノードすべての配列。
childCountlongaccessible 子ノードの数。
indexInParentlongこの親に含まれる子ノードのリストの、0 を基点とした accessible の index。または、この accessible が親ノードを持たない場合は -1 を返す。
nameAStringAccessible の名前 -- このノードのメインテキストと同等。
valueAStringAccessible の値 -- このノードの数量または二次テキストと同等。role 属性を使用するウィジェットは、この値に valuenow 属性の使用を強制することができます。
descriptionAStringAccessible の説明 -- このノードに関連付けられた長いテキスト。
keyboardShortcutAStringAlt+D のように accesskey 名のローカライズされた文字列を提供。修飾子はユーザおよびプラットフォームの設定に影響されます。通常は alt+文字、または単にアクセスキーの文字がメニュー項目に使用されます。
defaultKeyBindingAStringファイルを開くための Ctrl+O など、既定の動作のためのグローバルキーボードアクセラレータのローカライズされた文字列を提供。
roleunsigned long関連付けられた要素の accessible role の数。値はプラットフォームごとに異なります。nsIAccessibleRole 内で定義された ROLE_* 定数を参照してください。 -

これは、finalRole がするように role 属性を考慮に入れません。

-
finalRoleunsigned longaccessible role の数。値はプラットフォームごとに異なります。nsIAccessibleRole 内で定義された ROLE_* 定数を参照してください。ウィジェットは、final role を強制するために role 属性を使用することができます。
helpAStringノードに関連付けられたヘルプテキスト。
focusedChildnsIAccessibleフォーカスされたノードの accessible 子ノード。
attributesnsIPersistentPropertiesAccessible の属性。
relationsCountunsigned longこのオブジェクトに関連する accessible の数を返す。
numActionsPRUint8この accessible に関連付けられた accessible action の数。
-

-

メソッド

-

getKeyBindings()

-

このメソッドは、与えられた accessible にサポートされた action index のための、グローバルキーボードアクセラレータのローカライズされた文字列を提供します。

-
 nsIDOMDOMStringList getKeyBindings(
-   in PRUint8 aActionIndex
- );
-
-
引数
-
-
- <tt>aActionIndex</tt>
-
- 与えられた action の index。
-
-
戻り値
-

グローバルキーボードアクセラレータのローカライズされた文字列の配列を返す。

-

getFinalState()

-

このメソッドは final state を回収します。Accessible state -- ノードの真偽値プロパティについて書かれたビットフィールド。多くの state は、既知の確かな role 属性がサポートする有効なものだけです。

-
 void getFinalState(
-   out unsigned long aState,
-   out unsigned long aExtraState
- );
-
-
引数
-
-
- <tt>aState</tt>
-
- 最初のビットフィールド (参照: nsIAccessibleStates STATE_* constants)。
-
- <tt>aExtraState</tt>
-
- 2 番目のビットフィールド (参照: nsIAccessibleStates EXT_STATE_* constants)。
-
-

groupPosition()

-

このメソッドはグループ化情報を返します。tree 項目、list 項目、tab パネルの label、radio ボタンなどに使用されます。また、テキストではないオブジェクトの収集にも使用されます。

-
 void groupPosition(
-   out long aGroupLevel,
-   out long aSimilarItemsInGroup,
-   out long aPositionInGroup
- );
-
-
引数
-
-
- <tt>aGroupLevel</tt>
-
- 1 を基点とする。ARIA level プロパティと同様。
-
- <tt>aSimilarItemsInGroup</tt>
-
- 現在の項目を含み、1 を基点とする。ARIA setsize プロパティと同様。
-
- <tt>aPositionInGroup</tt>
-
- 1 を基点とする。ARIA posinset プロパティと同様。
-
-

getChildAtPoint()

-

このメソッドは、スクリーンピクセルの (x, y) 座標を含む、accessible の子ノードを返します。

-

この点の位置が現在の accessible 内で子ノードの外にある場合は、現在の accessible が返されます。

-

この点の位置が現在の accessible または 子ノード内のどちらにもない場合は、NULL が返されます。

-
 nsIAccessible getChildAtPoint(
-   in long x,
-   in long y
- );
-
-
引数
-
-
- <tt>x</tt>
-
- Accessible の X 座標。
-
- <tt>y</tt>
-
- Accessible の Y 座標。
-
-
戻り値
-

(x, y) 座標で与えられた accessible の子ノードを返す。

-

getChildAt()

-

このメソッドは、0 を基点とした index または 0 より小さい場合は最後の子ノードを使用して、accessible の N 番目の子ノードを返します。

-
 nsIAccessible getChildAt(
-   in long aChildIndex
- );
-
-
引数
-
-
- <tt>aChildIndex</tt>
-
- N 番目の子ノードの index。
-
-
戻り値
-

0 を基点とした index または 0 より小さい場合は最後の子ノードを使用して、accessible の N 番目の子ノードを返す。

-

getAccessibleToRight()

-

このメソッドは、このノードの右側に配置された accessible ノードを返します。

-
 nsIAccessible getAccessibleToRight();
-
-
引数
-

なし。

-
戻り値
-

このノードの右側に配置された accessible ノードを返す。

-

getAccessibleToLeft()

-

このメソッドは、このノードの左側に配置された accessible ノードを返します。

-
 nsIAccessible getAccessibleToLeft();
-
-
引数
-

なし。

-
戻り値
-

このノードの左側に配置された accessible ノードを返す。

-

getAccessibleAbove()

-

このメソッドは、このノードの上側に配置された accessible ノードを返します。

-
 nsIAccessible getAccessibleAbove();
-
-
引数
-

なし。

-
戻り値
-

このノードの上側に配置された accessible ノードを返す。

-

getAccessibleBelow()

-

このメソッドは、このノードの下側に配置された accessible ノードを返します。

-
 nsIAccessible getAccessibleBelow();
-
-
引数
-

なし。

-
戻り値
-

このノードの下側に配置された accessible ノードを返す。

-

getAccessibleRelated()

-

このメソッドは、与えられた relation type (参照: nsIAccessibleRelation で定義された定数) によって、これに関連する accessible を返します。

-
 nsIAccessible getAccessibleRelated(
-   in unsigned long aRelationType
- );
-
-
引数
-
-
- <tt>aRelationType</tt>
-
- accessible 間の relation type。
-
-
戻り値
-

与えられた relation type によって提供された accessible に関連する accessible を返す。

-

getRelation()

-

このメソッドは、このオブジェクトに対する accessible relation を一つ返します。

-
 nsIAccessibleRelation getRelation(
-   in unsigned long index
- );
-
-
引数
-
-
- <tt>index</tt>
-
- 回収される relation の index。
-
-
戻り値
-

このオブジェクトに対する accessible relation を一つ返す。

-

getRelations()

-

このメソッドは、このオブジェクトに対する複数の accessible relations を返します。

-
 nsIArray getRelations();
-
-
引数
-

なし。

-
戻り値
-

このオブジェクトに対する複数の accessible relations を返す。

-

getBounds()

-

このメソッドは、画面上の accessible の (x および y) 座標ならびに accessible の width および height を返します。

-
 void getBounds(
-   out long x,
-   out long y,
-   out long width,
-   out long height
- );
-
-
引数
-
-
- <tt>x</tt>
-
- Accessible の X 座標。
-
- <tt>y</tt>
-
- Accessible の Y 座標。
-
- <tt>width</tt>
-
- Accessible の幅。
-
- <tt>height</tt>
-
- Accessible の高さ。
-
-
戻り値
-

画面上の accessible の (x および y) 座標ならびに accessible の width および height を返す。

-

setSelected()

-

このメソッドは、この accessible を現在選択されたものに追加、または削除します。

-
 void setSelected(
-   in boolean isSelected
- );
-
-
引数
-
-
- <tt>isSelected</tt>
-
- 現在選択されたもの。
-
-

extendSelection()

-

このメソッドは、現在の accessible アンカーノードからこの accessible へ、現在選択されたものを広げます。

-
 void extendSelection();
-
-
引数
-

なし。

-

takeSelection()

-

このメソッドは、この accessible ノードのみを選択します。

-
 void takeSelection();
-
-
引数
-

なし。

-

takeFocus()

-

このメソッドは、この accessible ノードにフォーカスします。

-

STATE_FOCUSABLE の状態は、このノードが普通にフォーカス可能かどうか示します。このノードがフォーカス可能かどうかを決めるのは、呼び出し側に責任があります。通常、フォーカス不能なノード (table など) 上の accTakeFocus はそのノードにフォーカスを設定していますが、通常は、ほとんどのスタイルシートで視覚的に示されません。

-
 void takeFocus();
-
-
引数
-

なし。

-

getActionName()

-

このメソッドは、0 を基点とした index で accessible action の name を取得します。

-
 AString getActionName(
-   in PRUint8 index
- );
-
-
引数
-
-
- <tt>index</tt>
-
- 0 を基点とする index。
-
-
戻り値
-

accessible action の name を返す。

-

getActionDescription()

-

このメソッドは、0 を基点とした index で accessible action の description を取得します。

-
 AString getActionDescription(
-   in PRUint8 aIndex
- );
-
-
引数
-
-
- <tt>aIndex</tt>
-
- 0 を基点とする index。
-
-
戻り値
-

accessible action の description を返す。

-

doAction()

-

このメソッドは、0 を基点とした index で accessible action を実行します。Action 番号 0 はデフォルトの action です。

-
 void doAction(
-   in PRUint8 index
- );
-
-
引数
-
-
- <tt>index</tt>
-
- 0 を基点とする index。
-
-

-

参照

- -
-  
diff --git a/files/ja/mozilla/tech/xpcom/reference/xpcom_interface_reference/nsiaccessibleprovider/index.html b/files/ja/mozilla/tech/xpcom/reference/xpcom_interface_reference/nsiaccessibleprovider/index.html deleted file mode 100644 index 23a49f7cf2..0000000000 --- a/files/ja/mozilla/tech/xpcom/reference/xpcom_interface_reference/nsiaccessibleprovider/index.html +++ /dev/null @@ -1,49 +0,0 @@ ---- -title: nsIAccessibleProvider -slug: Mozilla/Tech/XPCOM/Reference/XPCOM_Interface_Reference/nsIAccessibleProvider -tags: - - Accessibility - - Interfaces - - XPCOM - - XPCOM API Reference -translation_of: Mozilla/Tech/XPCOM/Reference/Interface/nsIAccessibleProvider ---- -

 

-


-

-
accessible/public/nsIAccessibleProvider.idlScriptable
- - -Please add a summary to this article. - - -
-  -最終更新: Gecko 1.9 (Firefox 3)
-
-

継承元: nsISupports

-

属性

- - - - - - - - - - - - - -
属性説明
accessiblensIAccessibleaccessible を返す。 - - 読み取り専用 -
-

参照

- -
-  
diff --git a/files/ja/mozilla/tech/xpcom/reference/xpcom_interface_reference/nsiannotationobserver/index.html b/files/ja/mozilla/tech/xpcom/reference/xpcom_interface_reference/nsiannotationobserver/index.html deleted file mode 100644 index 04355548d1..0000000000 --- a/files/ja/mozilla/tech/xpcom/reference/xpcom_interface_reference/nsiannotationobserver/index.html +++ /dev/null @@ -1,128 +0,0 @@ ---- -title: nsIAnnotationObserver -slug: Mozilla/Tech/XPCOM/Reference/XPCOM_Interface_Reference/nsIAnnotationObserver -tags: - - Developing Mozilla - - Extensions - - Interfaces - - Places - - XPCOM - - XPCOM API Reference -translation_of: Mozilla/Tech/XPCOM/Reference/Interface/nsIAnnotationObserver ---- -
-
toolkit/components/places/public/nsIAnnotationService.idlScriptable
- - -Please add a summary to this article. - - -
- -
1.0
- -
66
- -
- -
- -
Introduced
-
Gecko 1.8
- -
- -
- -
-継承元: nsISupports -最終更新: Gecko 1.9 (Firefox 3)
-
- -

メソッドの概要

- - - - - - - - - - - - - - - -
void onItemAnnotationRemoved(in long long aItemId, in AUTF8String aName);
void onItemAnnotationSet(in long long aItemId, in AUTF8String aName);
void onPageAnnotationRemoved(in nsIURI aURI, in AUTF8String aName);
void onPageAnnotationSet(in nsIURI aPage, in AUTF8String aName);
- -

メソッド

- -

onItemAnnotationRemoved()

-

あるアイテムに対するアノテーションが削除された場合に呼ばれます。もし aName が空であれば、与えられた URI に対する全ての削除されたアノテーションを意味します。アノテーションの期限が切れている (expired) 場合はこのメソッドは呼び出されません。(通常アプリケーションが終了する場合などにこれが起こります)

-
void onItemAnnotationRemoved(
-  in long long aItemId,
-  in aUTF8String aName
-);
-
-
引数
-
-
aItemId
-
アノテーションが削除されるアイテムの ID
-
aName
-
アノテーションの名前
-
- -

onItemAnnotationSet()

-

アノテーションの値があるアイテムにセットされたときに呼ばれます。アノテーションは新しいアノテーションであっても、既に存在するアノテーションに対する新しい値のセットであっても構いません。

-
void onItemAnnotationSet(
-  in long long aItemId,
-  in AUTF8String aName
-);
-
-
引数
-
-
aItemId
-
アノテーションがセットされるアイテムの ID
-
aName
-
アノテーションの名前
-
- -

onPageAnnotationRemoved()

-

URIに対するアノテーションが削除されたときに呼ばれます。もし aName が空であれば、与えられたURIに対する全ての削除されたアノテーションを意味します。アノテーションの期限が切れている (expired) 場合はこのメソッドは呼び出されません。(通常アプリケーションが終了する場合などにこれが起こります)

-
void onPageAnnotationRemoved(
-  in nsIURI aPage,
-  in AUTF8String aName
-);
-
-
引数
-
-
aURI
-
アノテーションが削除される URI
-
aName
-
アノテーションの名前
-
- -

onPageAnnotationSet()

-

アノテーションが URI に対してセットされたときに呼ばれます。アノテーションは新しいアノテーションであっても、既に存在するアノテーションに対する新しい値のセットであっても構いません。

-
void onPageAnnotationSet(
-  in nsIURI aPage,
-  in AUTF8String aName
-);
-
-
引数
-
-
aURI
-
アノテーションがセットされる URI
-
aName
-
アノテーションの名前
-
- -

参照

- diff --git a/files/ja/mozilla/tech/xpcom/reference/xpcom_interface_reference/nsiasyncinputstream/index.html b/files/ja/mozilla/tech/xpcom/reference/xpcom_interface_reference/nsiasyncinputstream/index.html deleted file mode 100644 index 9679edc1f1..0000000000 --- a/files/ja/mozilla/tech/xpcom/reference/xpcom_interface_reference/nsiasyncinputstream/index.html +++ /dev/null @@ -1,96 +0,0 @@ ---- -title: nsIAsyncInputStream -slug: Mozilla/Tech/XPCOM/Reference/XPCOM_Interface_Reference/nsIAsyncInputStream -translation_of: Mozilla/Tech/XPCOM/Reference/Interface/nsIAsyncInputStream ---- -
-
xpcom/io/nsIAsyncInputStream.idlScriptable
- - -Please add a summary to this article. - - -
-継承元: nsIInputStream -最終更新: Gecko 1.7
-
-

 

-

ノンブロッキングな入力ストリームは、読み込みの際にNS_BASE_STREAM_WOULD_BLOCKを返すことがあります。この場合、呼び出し元では、ストリームに読み取り対象のデータが到着するまで待機する必要があります。もしもストリームがnsIAsyncInputStreamを実装していれば、呼び出し元はこのインタフェースを使って、( AsyncWait() メソッドを介して)、ストリームが読み取り可能になるか閉じたときに、非同期で通知するよう要求できます。

-
- このインタフェースはもっぱらノンブロッキングなストリームに対して使用されますが、 nsIInputStream.isNonBlocking() は必ずしもtrueを返す必要はありません。ノンブロッキングな nsIInputStream がnsIAsyncInputStreamを必ず実装している必要もありません。
-
-  
-

Method overview

- - - - - - - - - -
void asyncWait(in nsIInputStreamCallback aCallback, in unsigned long aFlags, in unsigned long aRequestedCount, in nsIEventTarget aEventTarget);
void closeWithStatus(in nsresult aStatus);
-

Constants

- - - - - - - - - - - - - -
ConstantValueDescription
WAIT_CLOSURE_ONLY(1<<0) -

asyncWait() に渡すと、このフラグはデフォルトの挙動を上書きし、OnInputStreamReadyによる通知がストリームが閉じるまで抑制されるようになります( closeWithStatusかcloseがストリームに対して呼ばれるか、おそらくストリーム内の何らかのエラーが原因で閉じられるまで抑制されます)。

-
-

Methods

-

asyncWait()

-

ストリームが読み取り可能になるか閉じられるのを、非同期に待ち受けます。通知は1度だけ、つまりasyncWaitの呼び出しごとにちょうど一度だけcallbackによる通知が行われます。OnInputStreamReady イベントが送信されると、ストリームは nsIInputStreamCallback イベントへの参照を解放します。この通知イベントのハンドラの中で再びasyncWaitを呼び出しても安全です。

-
- このメソッドは任意のタイミングで(まだ読み出しが行われていない場合ですら)呼び出される可能性があります。言い換えればこれは、ストリームに既に読み取り対象のデータがある場合に呼び出される可能性もあるということです。ストリームが閉じているときに呼び出される可能性もあります。asyncWaitが呼び出された時にストリームが既に読み取り可能または閉じていた場合、 nsIInputStreamCallback.onInputStreamReady() イベントはただちに送信されます。それ以外の場合、ストリームが読み取り可能になるまたは閉じるのを待って、イベントは送信されます。
-

 

-
void asyncWait(
-  in nsIInputStreamCallback aCallback,
-  in unsigned long aFlags,
-  in unsigned long aRequestedCount,
-  in nsIEventTarget aEventTarget
-);
-
-
Parameters
-
-
- aCallback
-
- ストリームの準備が整うと呼び出されるオブジェクトです。既存のコールバックをクリアするためにnullをセットすることもできます。
-
- aFlags
-
- このメソッドの動作を設定するために渡すフラグを、オプションで指定します。何も指定しない場合は0を渡してください。
-
- aRequestedCount
-
- 指定されたバイト数以上データが読み込み可能になるまで待機します。このパラメータは実際のストリームに対する提案にすぎず、実際には無視されるかもしれません。特に指定が無い場合は0を渡すとよいでしょう。
-
- aEventTarget
-
- nullを指定すると、通知を任意のスレッドで受け取ります(呼び出し元スレッド上で再帰的に受け取り、同期呼び出しになる可能性もあります)。特定のイベントターゲットを指定すると、そこに通知されるようになります。  
-
-

closeWithStatus()

-

このメソッドは、ストリームを閉じて内部ステータスをセットします。ストリームが既に閉じられている場合、このメソッドの呼び出しは無視されます。いったんストリームが閉じられると、ストリームのステータスを変更することはできません。成功ステータスをこのメソッドに渡した場合はNS_BASE_STREAM_CLOSEDとして扱われ、これはnsIInputStream.close()と同等の効果があります。

-
註: このメソッドは、入力側と出力側を持ったパイプをサポートするために存在しているようなところがあります。パイプの入力側が閉じられると、パイプの出力側への書き込みは失敗するようになります。"壊れた"パイプに書き込もうとした時に返ってくるエラーコードが、パイプの入力側を閉じたときに渡されたステータスコードに相当します。これにより、パイプの取り扱いが非常に簡単になるケースがあります。
-
void closeWithStatus(
-  in nsresult aStatus
-);
-
-
Parameters
-
-
- aStatus
-
- 閉じられたストリームがアクセスされた場合に返るエラーです。
-
diff --git a/files/ja/mozilla/tech/xpcom/reference/xpcom_interface_reference/nsiconsoleservice/index.html b/files/ja/mozilla/tech/xpcom/reference/xpcom_interface_reference/nsiconsoleservice/index.html deleted file mode 100644 index 0db6957354..0000000000 --- a/files/ja/mozilla/tech/xpcom/reference/xpcom_interface_reference/nsiconsoleservice/index.html +++ /dev/null @@ -1,51 +0,0 @@ ---- -title: nsIConsoleService -slug: Mozilla/Tech/XPCOM/Reference/XPCOM_Interface_Reference/nsIConsoleService -tags: - - Interfaces - - 'Interfaces:Scriptable' - - MDC Project - - NeedsContent - - XPCOM - - XPCOM API Reference -translation_of: Mozilla/Tech/XPCOM/Reference/Interface/nsIConsoleService ---- -

 

-

概要

-

コンソールサービスは、すべての Mozilla アプリケーションに付属する JavaScript コンソール 【訳注: Firefox 2 ではエラーコンソールという名称に変更されている】 ツールのバックエンド部分です。色々なメッセージ、警告、エラーをロギングしたり、ロギングされたメッセージを取得したりするために使用します。

-

インタフェース定義: xpcom/base/nsIConsoleService.idl

-

Contract ID: @mozilla.org/consoleservice;1

-

このインタフェースは未凍結で、将来的に変更される可能性があります (バグ 228205)。

-

サンプル

-

単純なメッセージをロギングする

-

文字列のメッセージをコンソールへ出力するための一般的な使い方:

-
function LOG(msg) {
-  var consoleService = Components.classes["@mozilla.org/consoleservice;1"]
-                                 .getService(Components.interfaces.nsIConsoleService);
-  consoleService.logStringMessage(msg);
-}
-
-

ロギングのための代替手段となるメソッドには Components.utils.reportErrordump() があります。

-

追加情報とともにメッセージをロギングする

-

ソースファイルや行番号といった他の情報を含めるためには、より複雑なコードを使う必要があります。

-
function myLogToConsole(aMessage, aSourceName, aSourceLine, aLineNumber,
-                        aColumnNumber, aFlags, aCategory)
-{
-  var consoleService = Components.classes["@mozilla.org/consoleservice;1"]
-                                 .getService(Components.interfaces.nsIConsoleService);
-  var scriptError = Components.classes["@mozilla.org/scripterror;1"]
-                              .createInstance(Components.interfaces.nsIScriptError);
-  scriptError.init(aMessage, aSourceName, aSourceLine, aLineNumber,
-                   aColumnNumber, aFlags, aCategory);
-  consoleService.logMessage(scriptError);
-}
-
- -

Interwiki Languages Links

diff --git a/files/ja/mozilla/tech/xpcom/reference/xpcom_interface_reference/nsicontentprefobserver/index.html b/files/ja/mozilla/tech/xpcom/reference/xpcom_interface_reference/nsicontentprefobserver/index.html deleted file mode 100644 index af2a563df5..0000000000 --- a/files/ja/mozilla/tech/xpcom/reference/xpcom_interface_reference/nsicontentprefobserver/index.html +++ /dev/null @@ -1,79 +0,0 @@ ---- -title: nsIContentPrefObserver -slug: Mozilla/Tech/XPCOM/Reference/XPCOM_Interface_Reference/nsIContentPrefObserver -tags: - - Firefox 3 - - Interfaces - - XPCOM - - XPCOM API Reference -translation_of: Mozilla/Tech/XPCOM/Reference/Interface/nsIContentPrefObserver ---- -

nsIContentPrefObserver インタフェースは、コンテンツ設定項目の値に対する変更を容易に監視できるようにします。

-


-

-
toolkit/components/contentprefs/public/nsIContentPrefService.idlScriptable
- - -Please add a summary to this article. - - -
-  -最終更新: Gecko 1.9 (Firefox 3)
-
-

継承元: nsISupports

-

メソッドの概要

- - - - - - - - - -
void onContentPrefSet(in AString aGroup, in AString aName, in nsIVariant aValue);
void onContentPrefRemoved(in AString aGroup, in AString aName);
-

メソッド

-

onContentPrefSet()

-

設定項目の値が変更されたときに呼び出されます。(既存の設定項目の値が変更されたときと、新しい設定項目が作成されたときのいずれも)

-
 void onContentPrefSet(
-   in AString aGroup,
-   in AString aName,
-   in nsIVariant aValue
- );
-
-
引数
-
-
- <tt>aGroup</tt>
-
- 設定項目が属するグループ。これは Web サイトの URI になります。設定項目がグローバルで、すべての Web サイトに適用される場合、この値は null となります。
-
- <tt>aName</tt>
-
- 値が変更された設定項目の名前。
-
- <tt>aValue</tt>
-
- 設定項目の新しい値。
-
-

onContentPrefRemoved()

-

設定項目が削除されたときに呼び出されます。

-
 void onContentPrefSet(
-   in AString aGroup,
-   in AString aName
- );
-
-
引数
-
-
- <tt>aGroup</tt>
-
- 設定項目が属するグループ。これは Web サイトの URI になります。設定項目がグローバルで、すべての Web サイトに適用される場合、この値は null となります。
-
- <tt>aName</tt>
-
- 削除された設定項目の名前。
-
-

関連記事

-

nsIContentPrefService, Using content preferences

diff --git a/files/ja/mozilla/tech/xpcom/reference/xpcom_interface_reference/nsicontentprefservice/index.html b/files/ja/mozilla/tech/xpcom/reference/xpcom_interface_reference/nsicontentprefservice/index.html deleted file mode 100644 index 15a3e9a837..0000000000 --- a/files/ja/mozilla/tech/xpcom/reference/xpcom_interface_reference/nsicontentprefservice/index.html +++ /dev/null @@ -1,203 +0,0 @@ ---- -title: nsIContentPrefService -slug: Mozilla/Tech/XPCOM/Reference/XPCOM_Interface_Reference/nsIContentPrefService -tags: - - Interfaces - - XPCOM - - XPCOM API Reference -translation_of: Mozilla/Tech/XPCOM/Reference/Interface/nsIContentPrefService ---- -

nsIContentPrefService は、拡張機能やブラウザのコードにおいて、特定の URI のための設定を保存する方法を提供します。設定項目はキーと値のペアで URI ごとに保存されます。使用例は Using content preferences を参照してください。

-


-

-
toolkit/components/contentprefs/public/nsIContentPrefService.idlScriptable
- - -Please add a summary to this article. - - -
-  -最終更新: Gecko 1.9 (Firefox 3)
-
-

継承元: nsISupports

-

実装: @mozilla.org/content-pref/service;1。インスタンスを作成するには、以下のように記述します。

-
var prefService = Components.classes["@mozilla.org/content-pref/service;1"]
-                  .getService(Components.interfaces.nsIContentPrefService);
-
-

メソッドの概要

- - - - - - - - - - - - - - - - - - - - - - - - -
void addObserver(in AString aName, in nsIContentPrefObserver aObserver);
nsIVariant getPref(in nsIURI aURI, in AString aName);
nsIPropertyBag2 getPrefs(in nsIURI aURI);
boolean hasPref(in nsIURI aURI, in AString aName);
void removeObserver(in AString aName, in nsIContentPrefObserver aObserver);
void removePref(in nsIURI aURI, in AString aName);
void setPref(in nsIURI aURI, in AString aName, in nsIVariant aValue);
-

属性

- - - - - - - - - - - - - -
属性説明
groupernsIContentURIGrouperURI が属するグループを判別するのにサービスが使用するコンポーネント。デフォルトでは、これは完全なホスト名で (つまりサイトごとに) URI をグループ化する「hostname grouper」になります。
-

メソッド

-

getPref()

-

特定の URI のために保存された設定の値を返します。

-
 nsIVariant getPref(
-   in nsIURI aURI,
-   in AString aName
- );
-
-
引数
-
-
- <tt>aURI</tt>
-
- 設定を取得する URI。グローバル設定空間から設定を取得する場合は null を指定します。グローバル設定はすべての URI に適用されます。
-
- <tt>aName</tt>
-
- 値を取得する設定の名前。
-
-
戻り値
-

設定の値が返されます。これには、文字列、整数値、真偽値、あるいはその他の値が含まれる可能性があります。指定された名前で保存されている値がなく、設定の値が null (nsIDataType:VTYPE_EMPTY) もしくは undefined (nsIDataType:VTYPE_VOID) であった場合、結果は null になる場合があります。

-

setPref()

-

特定の URI のために設定の値を設定します。

-
 nsIVariant setPref(
-   in nsIURI aURI,
-   in AString aName,
-   in nsIVariant aValue
- );
-
-
引数
-
-
- <tt>aURI</tt>
-
- 設定を保存する URI。グローバル設定空間にある設定を設定する場合は null を指定します。グローバル設定はすべての URI に適用されます。
-
- <tt>aName</tt>
-
- 値を設定する設定の名前。
-
- <tt>aValue</tt>
-
- 設定に割り当てる値。
-
-

hasPref()

-

特定の設定項目が存在するかどうかを判別します。

-
 boolean hasPref(
-   in nsIURI aURI,
-   in AString aName
- );
-
-
引数
-
-
- <tt>aURI</tt>
-
- 設定項目が存在するかどうかを判別する URI。グローバル設定空間にある設定を判別する場合は null を指定します。
-
- <tt>aName</tt>
-
- 設定項目が存在するかどうかを判別する設定の名前。
-
-
戻り値
-

設定が存在する場合は true、存在しなければ false

-

removePref()

-

特定の設定項目を削除します。

-
 void removePref(
-   in nsIURI aURI,
-   in AString aName
- );
-
-
引数
-
-
- <tt>aURI</tt>
-
- 削除する設定の URI。グローバル設定空間にある設定を削除する場合は null を指定します。
-
- <tt>aName</tt>
-
- 削除する設定の名前。
-
-

getPrefs()

-

特定の URI のための設定とそれらの値をすべて含んだ nsIPropertyBag2 を返します。

-
 nsIPropertyBag2 getPrefs(
-   in nsIURI aURI,
- );
-
-
引数
-
-
- <tt>aURI</tt>
-
- 取得したい設定の URI。グローバル設定空間にある設定を取得する場合は null を指定します。
-
-
戻り値
-

設定とそれらの値をすべて含んだ nsIPropertyBag2

-

addObserver()

-

特定の設定の変更を監視するオブザーバを追加します。

-
 void addObserver(
-   in AString aName,
-   in nsIContentPrefObserver aObserver
- );
-
-
引数
-
-
- <tt>aName</tt>
-
- 監視を行う設定の名前。すべての設定の変更を監視する包括的オブザーバを追加する場合は null を指定します。
-
- <tt>aObserver</tt>
-
- 設定の値が変更された場合に通知を受ける nsIContentPrefObserver を実装したオブジェクトの名前。
-
-

removeObserver()

-

特定の設定の変更を監視している既存のオブザーバを削除します。

-
 void addObserver(
-   in AString aName,
-   in nsIContentPrefObserver aObserver
- );
-
-
引数
-
-
- <tt>aName</tt>
-
- 監視を停止する設定の名前。すべての設定の変更を監視する包括的オブザーバを削除する場合は null を指定します。
-
- <tt>aObserver</tt>
-
- 設定の値が変更された場合に通知を受けるオブザーバの名前。
-
-

関連記事

-

nsIContentPrefObserver, Using content preferences

diff --git a/files/ja/mozilla/tech/xpcom/reference/xpcom_interface_reference/nsicryptohash/index.html b/files/ja/mozilla/tech/xpcom/reference/xpcom_interface_reference/nsicryptohash/index.html deleted file mode 100644 index bd17097a4f..0000000000 --- a/files/ja/mozilla/tech/xpcom/reference/xpcom_interface_reference/nsicryptohash/index.html +++ /dev/null @@ -1,265 +0,0 @@ ---- -title: nsICryptoHash -slug: Mozilla/Tech/XPCOM/Reference/XPCOM_Interface_Reference/nsICryptoHash -tags: - - Add-ons - - Extensions - - Interfaces - - 'Interfaces:Scriptable' - - XPCOM - - XPCOM API Reference -translation_of: Mozilla/Tech/XPCOM/Reference/Interface/nsICryptoHash ---- -

 

- -

導入

- -

nsICryptoHash はデータの暗号化ハッシュ関数を計算するために使用することができます。例えば、ファイルの MD5 ハッシュを計算することができます。サポートされているハッシュアルゴリズムは MD2 と MD5, SHA-1, SHA-256, SHA-384 そして SHA-512 です。このインターフェースは Firefox 1.5 以上でのみ利用できます。

- -
-
netwerk/base/public/nsICryptoHash.idlScriptable
- - -Please add a summary to this article. - - -
-  -最終更新: Gecko 1.8 (Firefox 1.5 / Thunderbird 1.5 / SeaMonkey 1.0)
-
- -

定数

- -

ハッシュアルゴリズム

- -

これらの定数はこのインターフェースでサポートされているハッシュアルゴリズムを表しています。利用可能な値は以下の通りです:

- - - -

メソッド

- -

init

- -
void init(in unsigned long aAlgorithm);
-
- -

インタフェースで定義された定数の1つを指定してどのハッシュアルゴリズムを使用するか指示して、init() はオブジェクトを初期化します。どんなデータであれオブジェクトを更新する前にこのメソッドか initWithString() を呼ばなければなりません。

- -
パラメタ
- -

aAlgorithm

- -
-
使用するハッシュアルゴリズム。インタフェースで定義されている定数の 1 つでなくてはなりません。
-
- -
例外
- -

NS_ERROR_INVALID_ARG

- -
-
サポートされていないアルゴリズムの種類が渡されたことを示します。
-
- -

initWithString

- -
void initWithString(in ACString aAlgorithm);
-
- -

initWithString()"MD5" のような文字列としてアルゴリズムの名前を指定することで、どのハッシュアルゴリズムを使用するか指定し、オブジェクトを初期化します。 どんなデータであれオブジェクトを更新する前にこのメソッドか init() を呼ばなければなりません。

- -
パラメタ
- -

aAlgorithm

- -
-
使用するハッシュアルゴリズム
-
- -
例外
- -

NS_ERROR_INVALID_ARG

- -
-
サポートされていないアルゴリズムの種類が渡されたことを示します。
-
- -

update

- -
void update([const, array, size_is(aLen)] in octet aData, in unsigned long aLen);
-
- -

update() はハッシュを計算されるデータの配列をオブジェクトに追加します。このメソッドのを使った例は文字列のハッシュを計算するを参照してください。

- -
パラメタ
- -

aData

- -
-
ハッシュを計算されるバッファ
-
- -

aLen

- -
-
aData バッファの長さ
-
- -
例外
- -

NS_ERROR_NOT_INITIALIZED

- -
-
init()initWithString() が呼び出されていないことを表します。
-
- -

updateFromStream

- -
void updateFromStream(in nsIInputStream aStream, in unsigned long aLen);
-
- -

updateFromStream()nsIInputStream からハッシュを計算されるデータを追加します。このメソッドのを使った例はファイルのハッシュを計算するを参照してください。

- -
パラメタ
- -

aStream

- -
-
読み込まれる入力ストリーム
-
- -

aLen

- -
-
与えられた aStream をどれだけ読み込むか。PR_UINT32_MAX が渡されることは利用できる全てのデータがハッシュを更新するために使われることを示しています。
-
- -
例外
- -

NS_ERROR_NOT_INITIALIZED

- -
-
init()initWithString() が呼び出されていないことを表します。NS_ERROR_NOT_AVAILABLE
-
ハッシュを計算するための要求された量のデータのが利用できないことを示しています。
-
- -

finish

- -
ACString finish(in PRBool aASCII);
-
- -

finish() はハッシュオブジェクトを完成させ、実際のハッシュデータを生成します。

- -
パラメタ
- -

aASCII

- -
-
もし true なら戻り値は base-64 エンコードされた文字列です。もし false なら戻り値にはバイナリデータです。
-
- -
戻り値
- -

このメソッドはオブジェクトから読み込まれたハッシュデータを返します。これはバイナリか base-64 エンコードされた文字列のどちらかが可能です。

- -
例外
- -

NS_ERROR_NOT_INITIALIZED

- -
-
init()initWithString() が呼び出されていないことを表します。
-
- -
注意: このメソッドは init() が呼ばれた後ではいつでも呼ばれるかもしれません。この呼び出しはオブジェクトを初期化する前の状態にリセットします。
- -

サンプルコード

- -
注意: 下のサンプルは Firefox 2 で実装された JavaScript 1.7 の機能を使っています。この例を Firefox 1.5 で使うには、配列内包をループに置き換えて下さい。
- -

ファイルのハッシュを計算する

- -

nsICryptoHash を使うと簡単にファイルのハッシュを計算することができます。nsICryptoHash のインスタンスを作り、ファイルから入力ストリームを開き、ファイルのハッシュを更新する必要があります。以下の例はファイルの MD5 ハッシュを計算する方法を示しています:

- -
// 便宜上ここではハードコードしています。
-var path = "c:\\windows\\notepad.exe";
-var f = Components.classes["@mozilla.org/file/local;1"]
-                  .createInstance(Components.interfaces.nsILocalFile);
-f.initWithPath(path);
-var istream = Components.classes["@mozilla.org/network/file-input-stream;1"]
-                        .createInstance(Components.interfaces.nsIFileInputStream);
-// 読み出すためにストリームを開きます。
-istream.init(f, 0x01, 0444, 0);
-var ch = Components.classes["@mozilla.org/security/hash;1"]
-                   .createInstance(Components.interfaces.nsICryptoHash);
-// MD5 アルゴリズムを使います。
-ch.init(ch.MD5);
-// これはファイル全体を読む込むことを updateFromStream に指示します。
-const PR_UINT32_MAX = 0xffffffff;
-ch.updateFromStream(istream, PR_UINT32_MAX);
-// ここで false を渡すとバイナリデータが戻ってきます
-// true は base-64 文字列が戻ってきます
-var hash = ch.finish(false);
-
-// 1 バイトに対して 2 つの 16 進数コードを返す。
-function toHexString(charCode)
-{
-  return ("0" + charCode.toString(16)).slice(-2);
-}
-
-// バイナリのハッシュデータを 16 進数文字列に変換する。
-var s = Array.from(hash, (c, i) => toHexString(hash.charCodeAt(i))).join("");
-// s は今 16 進数でハッシュを保持しています。
-
- -

私の Windows XP SP2 システムでは、これはハッシュの値として 5eb63bbbe01eeed093cb22bb8f5acdc3 を返しましたが、 あなたのマイレージは違うかもしれません。単純ですがこの例はインターフェースの大部分の機能を示しました。

- -

最初に注意すべきことは init() メソッドを呼んだときに、使うハッシュアルゴリズムを指定しなければならいないことです。利用可能なアルゴリズムの全てはインタフェースの定数として指定されています。

- -

さらに注意すべきことは updateFromStream() メソッドを呼び出したとき、2 番目のパラメタは呼び出すバイト数であることがです。ここで PR_UINT32_MAX を渡すことでファイル全体を読み出したいことを要求します。

- -

最後に finish() メソッドの呼び出しがハッシュ値を生成することに注意してください。このメソッドの 1 つのパラメタはこの例ではバイナリデータを返すために false です。true を渡すことで base 64 エンコードされた文字列としてハッシュを返します。この例ではバイナリデータを使い、ハッシュプログラムが通常出力するように結果を 16 進数文字列を生成しました。

- -

文字列のハッシュを計算する

- -

もう一つの一般的な操作は文字列のハッシュを計算することです。ハッシュ関数はバイトで計算するため、最初に文字列を nsIScriptableUnicodeConverter とあ指定した Unicode エンコーディングを使いバイトの並びに変換する必要があります。

- -
注意: 異なるエンコーディングは異なるハッシュ値を生成します!もしあなたが結果を比較するなら、常に同じエンコーディングを使うべきです。
- -

下の例では 文字列を UTF-8 エンコーディングでバイトに変換し、その MD5 ハッシュを計算する方法を示しています。前の例と同じように結果は 16 進数文字列として計算しました。

- -
var str = "hello world";
-var converter = Components.classes["@mozilla.org/intl/scriptableunicodeconverter"]
-                          .createInstance(Components.interfaces.nsIScriptableUnicodeConverter);
-// ここでは UTF-8 を使います。他のエンコーディングも選ぶこともできます。
-converter.charset = "UTF-8";
-// result は出力用パラメータです。
-// result.value は配列の長さを保持します。
-var result = {};
-// data はバイトの配列です。
-var data = converter.convertToByteArray(str, result);
-var ch = Components.classes["@mozilla.org/security/hash;1"]
-                   .createInstance(Components.interfaces.nsICryptoHash);
-ch.init(ch.MD5);
-ch.update(data, data.length);
-var hash = ch.finish(false);
-
-// 1 バイトに対して 2 つの 16 進数コードを返す。
-function toHexString(charCode)
-{
-  return ("0" + charCode.toString(16)).slice(-2);
-}
-
-// バイナリのハッシュデータを 16 進数文字列に変換する。
-var s = Array.from(hash, (c, i) => toHexString(hash.charCodeAt(i))).join("");
-// 今 s はハッシュを 16 進数で保持しており、以下のようになるはずです。
-// 5eb63bbbe01eeed093cb22bb8f5acdc3
-
- -

この例では、ハッシュを計算されるバイトの配列を渡すために update() メソッドを使いました。先ほどの例と同じように、バイナリの結果を 16 進数文字列に変換しています。

diff --git a/files/ja/mozilla/tech/xpcom/reference/xpcom_interface_reference/nsidomfile/index.html b/files/ja/mozilla/tech/xpcom/reference/xpcom_interface_reference/nsidomfile/index.html deleted file mode 100644 index 39a1336dcb..0000000000 --- a/files/ja/mozilla/tech/xpcom/reference/xpcom_interface_reference/nsidomfile/index.html +++ /dev/null @@ -1,108 +0,0 @@ ---- -title: nsIDOMFile -slug: Mozilla/Tech/XPCOM/Reference/XPCOM_Interface_Reference/nsIDOMFile -tags: - - DOM - - Firefox 3 - - Interfaces - - XPCOM - - XPCOM API Reference -translation_of: Mozilla/Tech/XPCOM/Reference/Interface/nsIDOMFile ---- -

-

-nsIDOMFile インターフェイスは、フォーム上で input の type "file" を使ってサブミットされたファイルからデータを読み出します。これはオフラインで web アプリケーションを使っているユーザがフォームにサブミットした時に保存されるファイルを参照可能にし、そしてそのデータは読み込む事ができ、またインターネット接続が再開された時にアップロードが可能となります。 -

註: 
-


-

-
content/base/public/nsIDOMFile.idlScriptable
- - -Please add a summary to this article. - - -
-  -最終更新: Gecko 1.9 (Firefox 3)
-
-

Inherits from: nsISupports -

-

-

Method overview

- - - - - - -
DOMString getAsBinary(); -
DOMString getAsDataURL(); -
DOMString getAsText(in DOMString encoding); -
-

-

-

Attributes

- - - - - -
Attribute -Type -Description -
fileName -DOMString - nsIDOMFile オブジェクトから参照されるファイルの名前を含む読み込み専用の属性 -
fileSize -unsigned long long - 参照されたファイルのbyteのサイズ -
-

-

-

Methods

-

-

-

getAsBinary()

-

ファイル上のデータの生のバイナリフォーマットを含む DOMString を -返します。 -

-
 DOMString getAsBinary();
-
-
引数
-

無し。 -

-
返り値
-

ファイル上の生のバイナリを含む DOMString 。 -

-

-

getAsDataURL()

-

参照されたファイルのコンテンツをdata: URL でエンコードした DOMStringを返します。 -

-
 DOMString getAsDataURL();
-
-
Parameters
-

無し -

-
Return value
-

data: URL としてエンコードされたファイルのデータを含む DOMString

-

-

getAsText()

-

与えられたエンコーディングを用いたテキストとして判断されたファイルのデータを DOMString として含んだファイルを返します。 -

-
 DOMString getAsText(
-   in DOMString encoding
- );
-
-
Parameters
-
<tt>encoding</tt> -
指定したエンコードの文字列を利用して返り値のデータとします。もし、文字列が空であれば、UTF-8 が代りに使われます。 -
-
Return value
-

特定の <tt>エンコーディング</tt> で解釈されたテキストとしてファイルのデータを含むDOMString 。 -

-

-

See also

-

nsIDOMFileList, nsIDOMFileException -

-
-
diff --git a/files/ja/mozilla/tech/xpcom/reference/xpcom_interface_reference/nsidomfileexception/index.html b/files/ja/mozilla/tech/xpcom/reference/xpcom_interface_reference/nsidomfileexception/index.html deleted file mode 100644 index b84fee1d18..0000000000 --- a/files/ja/mozilla/tech/xpcom/reference/xpcom_interface_reference/nsidomfileexception/index.html +++ /dev/null @@ -1,57 +0,0 @@ ---- -title: nsIDOMFileException -slug: Mozilla/Tech/XPCOM/Reference/XPCOM_Interface_Reference/nsIDOMFileException -tags: - - DOM - - Firefox 3 - - Interfaces - - XPCOM - - XPCOM API Reference -translation_of: Mozilla/Tech/XPCOM/Reference/Interface/nsIDOMFileException ---- -

- -nsIDOMFileException インタフェースは、nsIDOMFile インタフェース内でのメソッドの呼び出しによって発生する例外を表します。 -


-

-
content/base/public/nsIDOMFileException.idlScriptable
- - -Please add a summary to this article. - - -
-  -最終更新: Gecko 1.9 (Firefox 3)
-
- -

属性

- - - -
属性 -型 -説明 -
code -unsigned short -エラーが起きた状態を表すエラーコード。詳しくは 定数一覧 を参照してください。 -
-

定数

- - - - - -
定数 -値 -説明 -
NOT_FOUND_ERR - 0 -指定されたファイルが見つかりませんでした。 -
NOT_READABLE_ERR - 1 -指定されたファイルが読み取り可能ではありませんでした。 -
-

関連記事

-

nsIDOMFile, nsIDOMFileList -

diff --git a/files/ja/mozilla/tech/xpcom/reference/xpcom_interface_reference/nsidomfilelist/index.html b/files/ja/mozilla/tech/xpcom/reference/xpcom_interface_reference/nsidomfilelist/index.html deleted file mode 100644 index f599ddb061..0000000000 --- a/files/ja/mozilla/tech/xpcom/reference/xpcom_interface_reference/nsidomfilelist/index.html +++ /dev/null @@ -1,80 +0,0 @@ ---- -title: nsIDOMFileList -slug: Mozilla/Tech/XPCOM/Reference/XPCOM_Interface_Reference/nsIDOMFileList -tags: - - DOM - - Firefox 3 - - Interfaces - - XPCOM - - XPCOM API Reference -translation_of: Mozilla/Tech/XPCOM/Reference/Interface/nsIDOMFileList ---- -

- -nsIDOMFileList インタフェースには、ユーザが Web フォーム上の「file」入力フィールドで選択したファイルを説明した nsIDOMFile オブジェクトのリストが含まれています。 -

すべての <INPUT> 要素ノードは、このリスト内の項目へのアクセスを許可する fileList 配列を持っています。例えば、HTML に以下のファイル入力フィールドが含まれていた場合、 -

-
<input id="fileItem" type=file>
-
-

以下のようなコードで、このノードのファイルリストの最初のファイルを、様々な形式で取得できます。 -

-
// UTF-8 (既定の文字エンコーディング) でファイルのデータを取得します
-document.getElementById('fileItem').fileList[0].getAsText("");
-
-// 具体的に UTF-8 として解釈されたファイルのデータを取得します
-document.getElementById('fileItem').fileList[0].getAsText("utf8")
-
-// data: URL としてファイルのデータを取得します
-document.getElementById('fileItem').fileList[0].getAsDataURL()
-
-// 生のバイナリデータとしてファイルのデータを取得します
-document.getElementById('fileItem').fileList[0].getAsBinary()
-
-


-

-
content/base/public/nsIDOMFileList.idlScriptable
- - -Please add a summary to this article. - - -
-  -最終更新: Gecko 1.9 (Firefox 3)
-
-

継承元: nsISupports -

-

メソッドの概要

- - -
nsIDOMFile item(in unsigned long index); -
-

属性

- - - -
属性 -型 -説明 -
length -unsigned long -リスト内のファイル数を示す読み取り専用の属性。 -
-

属性

-

item()

-

ファイルリスト内の指定されたインデックスにある nsIDOMFile を返します。 -

-
 nsIDOMFile item(
-   in unsigned long index
- );
-
-
引数
-
<tt>index</tt> -
リストから取得するファイルの、ゼロベースのインデックス。 -
-
戻り値
-

リクエストされたファイルを表す nsIDOMFile。 -

-

関連記事

-

nsIDOMFile, nsIDOMFileException -

diff --git a/files/ja/mozilla/tech/xpcom/reference/xpcom_interface_reference/nsidomhtmlmediaelement/index.html b/files/ja/mozilla/tech/xpcom/reference/xpcom_interface_reference/nsidomhtmlmediaelement/index.html deleted file mode 100644 index 736e9da5b3..0000000000 --- a/files/ja/mozilla/tech/xpcom/reference/xpcom_interface_reference/nsidomhtmlmediaelement/index.html +++ /dev/null @@ -1,39 +0,0 @@ ---- -title: NsIDOMHTMLMediaElement -slug: Mozilla/Tech/XPCOM/Reference/XPCOM_Interface_Reference/NsIDOMHTMLMediaElement -tags: - - Firefox 3.5 - - Gecko 1.9.1 - - Interfaces - - 'Interfaces:Scriptable' - - XPCOM - - XPCOM Interface Reference -translation_of: Mozilla/Tech/XPCOM/Reference/Interface/NsIDOMHTMLMediaElement ---- -
-
dom/interfaces/html/nsIDOMHTMLMediaElement.idlScriptable
- HTML5 の新要素である <audio> 要素と <video> 要素に対しぞれぞれ nsIDOMHTMLAudioElement インターフェース、nsIDOMHTMLVideoElement インターフェースを実装する為の基礎となるインターフェース - -
- -
1.0
- -
67
- -
- -
- -
Introduced
-
Gecko 1.9.1
- -
- -
- -
-継承元: nsIDOMHTMLElement -最終更新: Gecko 11.0 (Firefox 11.0 / Thunderbird 11.0 / SeaMonkey 2.8)
-
- -
nsIDOMHTMLMediaElementインターフェースにはHTMLMediaElementインターフェースが実装されています。詳細については各ページを参照して下さい。
diff --git a/files/ja/mozilla/tech/xpcom/reference/xpcom_interface_reference/nsidomofflineresourcelist/index.html b/files/ja/mozilla/tech/xpcom/reference/xpcom_interface_reference/nsidomofflineresourcelist/index.html deleted file mode 100644 index db33da81d4..0000000000 --- a/files/ja/mozilla/tech/xpcom/reference/xpcom_interface_reference/nsidomofflineresourcelist/index.html +++ /dev/null @@ -1,184 +0,0 @@ ---- -title: nsIDOMOfflineResourceList -slug: >- - Mozilla/Tech/XPCOM/Reference/XPCOM_Interface_Reference/nsIDOMOfflineResourceList -tags: - - Interfaces - - XPCOM - - XPCOM API Reference -translation_of: Mozilla/Tech/XPCOM/Reference/Interface/nsIDOMOfflineResourceList ---- -

-

nsIDOMOfflineResourceList インタフェースは、アプリケーションキャッシュへのアクセスを提供します。これは、Web コンテンツのリソースをオフラインでも利用できるよう、ローカルにキャッシュできるようにする機能です。キャッシュにリソースを追加したり、キャッシュからリソースを削除したり、動的に管理されたリソースリストを列挙するためのメソッドが含まれます。 -


-

-
dom/public/idl/offline/nsIDOMOfflineResourceList.idlScriptable
- - -Please add a summary to this article. - - -
-  -最終更新: Gecko 1.9 (Firefox 3)
-
-

継承元: nsISupports -

-

メソッドの概要

- - - - - - - - - - -
void add(in DOMString uri); -
DOMString item(in unsigned long index); -
void remove(in DOMString uri); -
void swapCache(); -
void update(); -
-

属性

- - - - - - - - - - - - - - - - - - - -
属性 -型 -説明 -
length - unsigned long - 動的に管理されたオフラインリソースリスト内のエントリー数。読み取り専用。 -
onchecking - nsIDOMEventListener - アプリケーションキャッシュマニフェストを取得したり、更新を確認する際に呼び出されるイベントリスナー。 -
onerror - nsIDOMEventListener - キャッシュプロセスの途中でエラーが発生した場合に呼び出されるイベントリスナー。 -
onnoupdate - nsIDOMEventListener - ダウンロードス売る更新がない場合に呼び出されるイベントリスナー。 -
ondownloading - nsIDOMEventListener - リソースがキャッシュにダウンロードされる際に呼び出されるイベントリスナー。 -
onprogress - nsIDOMEventListener - ダウンロードプロセスの途中で定期的に呼び出されるイベントリスナー。 -
onupdateready - nsIDOMEventListener - リソースの更新が完了した際に呼び出されるイベントリスナー。バージョン管理されたアプリケーションキャッシュがサポートされていないため、このイベントはまだ使われていません。 -
oncached - nsIDOMEventListener - キャッシュが完了した際に呼び出されるイベントリスナー。 -
status - unsigned short - アプリケーションキャッシュの状態を示す、いずれかの定数。 -
-

定数

- - - - - - - - - - - -
定数 -値 -説明 -
UNCACHED - 0 - オブジェクトはアプリケーションキャッシュと関連付けられていません。 -
IDLE - 1 - アプリケーションキャッシュは更新プロセスの途中ではありません。 -
CHECKING - 2 - アプリケーションキャッシュマニフェストを取得して、更新を確認しています。 -
DOWNLOADING - 3 - リソースをダウンロードしてキャッシュに追加しています。 -
UPDATEREADY - 4 - 新しいバージョンのアプリケーションキャッシュが利用可能です。 -
註: バージョン管理されたアプリケーションキャッシュはまだ実装されていません。このため、このステータス値は現時点では使われていません。
- -
-

メソッド

-

add()

-

動的に管理されたエントリーにアイテムを追加します。リソースは取得され、アプリケーションキャッシュに追加されます。 -

-
 void add(
-   in DOMString uri
- );
-
-
引数
-
<tt>uri</tt> -
リストに追加するリソースの URI。 -
-

item()

-

キャッシュされたリソースのリストから、特定のオフセットにあるアイテムの URI を返します。 -

-
 DOMString item(
-   in unsigned long index
- );
-
-
引数
-
<tt>index</tt> -
URI を取得する、キャッシュされたアイテムのインデックス。 -
-
戻り値
-

指定されたリソースの URI を含む DOMString。 -

-

remove()

-

動的に管理されたエントリーのリストからアイテムを削除します。アプリケーションキャッシュ内の指定された URI に対する最後の参照であった場合、キャッシュエントリーが削除されます。 -

-
 void remove(
-   in DOMString uri
- );
-
-
引数
-
<tt>uri</tt> -
リストから削除するアイテムの URI。 -
-

swapCache()

-

アプリケーションキャッシュの最新版でやりとりを行います。 -

註: バージョン管理されたアプリケーションキャッシュはまだサポートされていないため、このメソッドは例外を投げます。
- -
 void swapCache();
-
-
引数
-

なし。 -

-

update()

-

アプリケーションキャッシュの更新プロセスを開始します。 -

-
 void update();
-
-
引数
-

なし。 -

-

参考資料

- diff --git a/files/ja/mozilla/tech/xpcom/reference/xpcom_interface_reference/nsidomsimplegestureevent/index.html b/files/ja/mozilla/tech/xpcom/reference/xpcom_interface_reference/nsidomsimplegestureevent/index.html deleted file mode 100644 index 70719d4b06..0000000000 --- a/files/ja/mozilla/tech/xpcom/reference/xpcom_interface_reference/nsidomsimplegestureevent/index.html +++ /dev/null @@ -1,61 +0,0 @@ ---- -title: nsIDOMSimpleGestureEvent -slug: >- - Mozilla/Tech/XPCOM/Reference/XPCOM_Interface_Reference/NsIDOMSimpleGestureEvent -translation_of: Mozilla/Tech/XPCOM/Reference/Interface/NsIDOMSimpleGestureEvent ---- -

nsIDOMSimpleGestureEvent インターフェースはマウスやトラックパッドによるジェスチャイベントを表現します。

-
-
dom/public/idl/events/nsIDOMSimpleGestureEvent.idlScriptable
- - -Please add a summary to this article. - - -
-  -最終更新: Gecko 1.9.1 (Firefox 3.5 / Thunderbird 3.0 / SeaMonkey 2.0)
-
-

継承元: nsIDOMMouseEvent

-

メソッドの概要

- -
void initSimpleGestureEvent(in DOMString typeArg,
                            in boolean canBubbleArg,
                            in boolean cancelableArg,
                            in nsIDOMAbstractView viewArg,
                            in long detailArg,
                            in long screenXArg,
                            in long screenYArg,
                            in long clientXArg,
                            in long clientYArg,
                            in boolean ctrlKeyArg,
                            in boolean altKeyArg,
                            in boolean shiftKeyArg,
                            in boolean metaKeyArg,
                            in unsigned short buttonArg,
                            in nsIDOMEventTarget relatedTargetArg,
                            in unsigned long directionArg,
                            in double deltaArg);
-

属性

- -
属性 説明
direction unsigned long ジェスチャの移動方向。このページの Direction constantsRotation constants を参照。読み取り専用。
delta double

ジェスチャがどれほど移動したかを示す変化量。Update イベント (MozXxxGestureUpdate イベント) では前回の更新からの変化を示します。MozRotateGestureMozMagnifyGesture イベントでは、これはイベントが処理されてからの総変化量を表します。

回転イベントでは、この値は度で指定されます (正の値は時計回りの回転を表し、負の値は反時計回りの回転を表します)。拡大ジェスチャでは、単位は実装独自ですが、正の値は拡大を表し、負の値は縮小を表します。

注意: 現時点において Mac OS X では拡大ジェスチャでつかわれる単位が文書化されていません。典型的な値は 0.0 から 100.0 の範囲のようです。しかし、現在信頼できるのは、値が正になるか負になるかのみです。Windows では、今回とその直前における、2 つのタッチ点間の幅の変化をピクセル単位で表します。
-

方向についての定数

- -
定数 説明
DIRECTION_UP 1 上向きスワイプ。
DIRECTION_DOWN 2 下向きスワイプ。
DIRECTION_LEFT 4 左向きスワイプ。
DIRECTION_RIGHT 8 右向きスワイプ。
-

回転についての定数

- -
定数 説明
ROTATION_COUNTERCLOCKWISE 1 反時計回りの回転。
ROTATION_CLOCKWISE 2 時計回りの回転。
-

メソッド

-

initSimpleGestureEvent()

-

ジェスチャイベントの初期化

-
void initSimpleGestureEvent(
-  in DOMString typeArg,
-  in boolean canBubbleArg,
-  in boolean cancelableArg,
-  in nsIDOMAbstractView viewArg,
-  in long detailArg,
-  in long screenXArg,
-  in long screenYArg,
-  in long clientXArg,
-  in long clientYArg,
-  in boolean ctrlKeyArg,
-  in boolean altKeyArg,
-  in boolean shiftKeyArg,
-  in boolean metaKeyArg,
-  in unsigned short buttonArg,
-  in nsIDOMEventTarget relatedTargetArg,
-  in unsigned long directionArg,
-  in double deltaArg
-);
-
-
パラメータ
-
directionArg
direction 属性に代入する値。
deltaArg
delta 属性に代入する値。
-

参照

- - -

 

diff --git a/files/ja/mozilla/tech/xpcom/reference/xpcom_interface_reference/nsidownload/index.html b/files/ja/mozilla/tech/xpcom/reference/xpcom_interface_reference/nsidownload/index.html deleted file mode 100644 index 454d955e70..0000000000 --- a/files/ja/mozilla/tech/xpcom/reference/xpcom_interface_reference/nsidownload/index.html +++ /dev/null @@ -1,135 +0,0 @@ ---- -title: nsIDownload -slug: Mozilla/Tech/XPCOM/Reference/XPCOM_Interface_Reference/nsIDownload -tags: - - Firefox 3 - - Interfaces - - XPCOM - - XPCOM API Reference -translation_of: Mozilla/Tech/XPCOM/Reference/Interface/nsIDownload ---- -

nsIDownload インタフェースは、ダウンロードオブジェクトを表します。ダウンロードオブジェクトは、ダウンロードマネージャによって利用されています。(ダウンロード待ち、ダウンロード中、ダウンロード完了後のファイルを管理する nsIDownloadManager を参照してください)

-
- 注意: ダウンロードが完了すると、ダウンロードマネージャは nsIDownload オブジェクトの更新を停止します。完了ステータスは、nsIDownloadManager::DOWNLOAD_FINISHEDnsIDownloadManager::DOWNLOAD_FAILEDnsIDownloadManager::DOWNLOAD_CANCELED のいずれかになります。
-


-

-
toolkit/components/downloads/public/nsIDownload.idlScriptable
- - -Please add a summary to this article. - - -
-  -最終更新: Gecko 1.9 (Firefox 3)
-
-

継承元: nsITransfer

-

属性

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
属性説明
targetFilensILocalFileダウンロードされたファイルが保存される (あるいはダウンロードが完了している場合は保存された) 場所を示します。 - - 読み取り専用。 -
percentCompletePRint32完了したファイル転送の割合。ファイルサイズが不明な場合は -1 となります。 - - 読み取り専用。 -
amountTransferredPRUint64完了したダウンロードのバイト数。 - - 読み取り専用。 -
sizePRUint64ファイルの合計サイズ (バイト)。ファイルサイズが不明な場合は LL_MAXUINT となります。 - - 読み取り専用。 -
sourcensIURIダウンロードファイルの取得元 URI。 - - 読み取り専用。 -
cancelablensICancelableダウンロードをキャンセルするために使用できるオブジェクト。ダウンロード完了後、この値は null に設定されます。 - - 読み取り専用。 -
displayNameAStringユーザが読める形での転送の説明。 - - 読み取り専用。 -
startTimelong longファイル転送が開始された時刻。 - - 読み取り専用。 -
speeddoubleダウンロードの転送速度 (バイト/秒)。 - - 読み取り専用。 -
MIMEInfonsIMIMEInfoこの任意の属性は、MIME タイプ、ヘルパーアプリケーション、ダウンロード完了後にヘルパーアプリケーションを自動的に実行するかどうかなど、ターゲットに関連する MIME 情報を提供します。
idunsigned longデータベース内でダウンロードを固有に識別できる ID。
stateshortダウンロードの状況。nsIDownloadManager の定数一覧 を参照してください。
referrernsIURIダウンロードのリファラ URI。これは HTTP ダウンロードの場合のみ使用され、null になる可能性もあります。
resumablebooleanダウンロードを中止後に再開できるかどうかを示します。これは、ダウンロードが HTTP/1.1 あるいは FTP を通じて行われていて、サーバが再開に対応している場合のみ有効になります。
-

関連記事

-

nsIDownloadManager, nsIDownloadProgressListener, nsIXPInstallManagerUI

diff --git a/files/ja/mozilla/tech/xpcom/reference/xpcom_interface_reference/nsidownloadmanager/index.html b/files/ja/mozilla/tech/xpcom/reference/xpcom_interface_reference/nsidownloadmanager/index.html deleted file mode 100644 index 813eca1337..0000000000 --- a/files/ja/mozilla/tech/xpcom/reference/xpcom_interface_reference/nsidownloadmanager/index.html +++ /dev/null @@ -1,424 +0,0 @@ ---- -title: nsIDownloadManager -slug: Mozilla/Tech/XPCOM/Reference/XPCOM_Interface_Reference/nsIDownloadManager -tags: - - Firefox 3 - - Interfaces - - XPCOM - - XPCOM API Reference -translation_of: Mozilla/Tech/XPCOM/Reference/Interface/nsIDownloadManager ---- -

nsIDownloadManager インタフェースは、アプリケーションや拡張機能がダウンロードマネージャとやりとりできるようにします。例えば、ダウンロードするファイルの追加や削除、ダウンロードに関する情報の取得、ダウンロード完了時の通知取得、といった機能を備えています。

-


-

-
toolkit/components/downloads/public/nsIDownloadManager.idlScriptable
- - -Please add a summary to this article. - - -
-  -最終更新: Gecko 1.9 (Firefox 3)
-
-

継承元: nsISupports

-

実装: @mozilla.org/download-manager;1。インスタンスを作成するには、以下のように記述します。

-
var dm = Components.classes["@mozilla.org/download-manager;1"]
-                   .createInstance(Components.interfaces.nsIDownloadManager);
-
-

メソッドの概要

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
nsIDownload addDownload(in short aDownloadType, in nsIURI aSource, in nsIURI aTarget, in AString aDisplayName, in nsIMIMEInfo aMIMEInfo, in PRTime aStartTime, in nsILocalFile aTempFile, in nsICancelable aCancelable)
nsIDownload getDownload(in unsigned long aID)
void cancelDownload(in unsigned long aID)
void removeDownload(in unsigned long aID)
void pauseDownload(in unsigned long aID)
void resumeDownload(in unsigned long aID)
void retryDownload(in unsigned long aID)
void cleanUp()
void addListener(in nsIDownloadProgressListener aListener)
void removeListener(in nsIDownloadProgressListener aListener)
-

属性

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
属性説明
DBConnectionmozIStorageConnectionダウンロードデータベースへのデータベース接続。 - - 読み取り専用。 -
canCleanUpbooleanダウンロードが、完了時、失敗時、キャンセル時に削除可能かどうかを示します。 - - 読み取り専用。 -
activeDownloadCountlong現在ダウンロード中のファイル数。 - - 読み取り専用。 -
activeDownloadsnsISimpleEnumeratorアクティブな nsIDownloads の列挙。 - - 読み取り専用。 -
defaultDownloadsDirectorynsILocalFileプラットフォーム標準のダウンロードディレクトリを返します。 - - 読み取り専用。 -
userDownloadsDirectorynsILocalFileユーザが設定したダウンロードディレクトリを返します。 - - 読み取り専用。 -

上記のパスは、ユーザが編集可能な 2 つの設定項目に依存します。

-

browser.download.folderList は、標準のダウンロード場所を定義します。

-
    -
  • 0: ファイルは初期設定ではデスクトップにダウンロードされます。
  • -
  • 1: ファイルは初期設定ではシステム標準のダウンロードフォルダにダウンロードされます。
  • -
  • 2: ファイルは browser.download.dir で設定されたローカルパスにダウンロードされます。この設定値が不正な場合、ダウンロードディレクトリは初期設定値にフォールバックされます。
  • -
-
-

定数

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
定数説明
DOWNLOAD_NOTSTARTED-1ダウンロードはまだ開始されていません。
DOWNLOAD_DOWNLOADING0ダウンロードは現在進行中です。
DOWNLOAD_FINISHED1ダウンロードは完了しました。
DOWNLOAD_FAILED2ダウンロードは失敗しました。
DOWNLOAD_CANCELED3ユーザがダウンロードをキャンセルしました。
DOWNLOAD_PAUSED4ダウンロードは中止されています。
DOWNLOAD_QUEUED5ダウンロードは待ち状態で、まだダウンロードは開始されていません。
DOWNLOAD_BLOCKED6保護者による制限 (ペアレンタルコントロール) が働いたために、あるいは、そのファイルがウイルスに感染していて駆除できないとウイルス対策ソフトによって判断されたために、ダウンロードはブロックされました。
DOWNLOAD_SCANNING7ダウンロードはウイルス対策ソフトによってスキャンが行われています。
DOWNLOAD_TYPE_DOWNLOAD0 - - 不明 -
-

メソッド

-

addDownload()

-

nsIDownload を作成し、ダウンロードマネージャが管理できるように追加します。

-
nsIDownload addDownload(
-  in short aDownloadType,
-  in nsIURI aSource,
-  in nsIURI aTarget,
-  in AString aDisplayName,
-  in nsIMIMEInfo aMIMEInfo,
-  in PRTime aStartTime,
-  in nsILocalFile aTempFile,
-  in nsICancelable aCancelable
-)
-
-
引数
-
-
- <tt>aDownloadType</tt>
-
- 転送するダウンロードの種類。 - - 詳細不明 -
-
-
-
- <tt>aSource</tt>
-
- ファイルの取得元 URI。null にはなりません。
-
-
-
- <tt>aTarget</tt>
-
- 転送されたファイルが保存される場所を示した URI。null にはなりません。
-
-
-
- <tt>aDisplayName</tt>
-
- ユーザが読める形での転送の説明。空白文字になる可能性があります。
-
-
-
- <tt>aMIMEInfo</tt>
-
- ターゲットファイルに関連付けられた MIME 情報。これには、MIME タイプや、適切な場合にはヘルパーアプリケーションが含まれます。このパラメータはオプションです。
-
-
-
- <tt>startTime</tt>
-
- ダウンロードの開始時刻。
-
-
-
- <tt>aTempFile</tt>
-
- 一時ファイル (受信したデータが保存されるファイルで、ターゲットファイルとは異なります) の場所。ダウンロードが完了すると、ファイルは <tt>aTarget</tt> によって示される場所に移動されます。これは null になる可能性があります。
-
-
-
- <tt>aCancelable</tt>
-
- ダウンロードをキャンセルするために使用できるオブジェクト。null にはなりません。
-
-
戻り値
-

新たに作成された、渡されたプロパティを伴ったダウンロード項目。

-
- 注: ダウンロードを追加しても、即座に転送が開始されるわけではありません。追加した後ダウンロードを開始したい場合は、nsIWebBrowserPersist オブジェクトを作成し、このメソッドを呼び出し、戻り値となるダウンロードオブジェクトのための progressListener を設定し、その後で saveURI() メソッドを呼び出す必要があります。
-

getDownload()

-

ダウロードマネージャによって管理されているダウンロードを取得します。これは、進行中、あるいは完了したダウンロードで、データベースに保存されている項目になります。

-
nsIDownload getDownload(
-  in unsigned long aID
-)
-
-
引数
-
-
- <tt>aID</tt>
-
- ダウンロードの固有 ID。
-
-
戻り値
-

指定された ID のダウンロード。

-
投げられる例外
-
-
- <tt>NS_ERROR_NOT_AVAILABLE</tt>
-
- 指定されたダウンロードはデータベース内にありません。
-
-

cancelDownload()

-

指定された ID のダウンロードが進行中であった場合、そのダウンロードをキャンセルします。これは、そのダウンロードによって提供された nsICancelablecancel(NS_BINDING_ABORTED) を呼び出します。

-
 void cancelDownload(
-   in unsigned long aID
- )
-
-
引数
-
-
- <tt>aID</tt>
-
- ダウンロードの固有 ID。
-
-
投げられる例外
-
-
- <tt>NS_ERROR_FAILURE</tt>
-
- ダウンロードが進行中ではありません。
-
-

removeDownload()

-

指定された ID のダウンロードが進行中でなかった場合、そのダウンロードを削除します。cancelDownload() が単純に転送をキャンセルしつつ関連情報を残すのに対して、removeDownload() は関連情報もすべて削除します。

-
 void removeDownload(
-   in unsigned long aID
- )
-
-
引数
-
-
- <tt>aID</tt>
-
- ダウンロードの固有 ID。
-
-
投げられる例外
-
-
- <tt>NS_ERROR_FAILURE</tt>
-
- ダウンロードはアクティブです。
-
-

pauseDownload()

-

指定されたダウンロードを中止します。

-
 void pauseDownload(
-   in unsigned long aID
- )
-
-
引数
-
-
- <tt>aID</tt>
-
- 中止するダウンロードの固有 ID。
-
-
投げられる例外
-
-
- <tt>NS_ERROR_FAILURE</tt>
-
- ダウンロードが進行中ではありません。
-
-

resumeDownload()

-

指定されたダウンロードを再開します。

-
 void resumeDownload(
-   in unsigned long aID
- )
-
-
引数
-
-
- <tt>aID</tt>
-
- 再開するダウンロードの固有 ID。
-
-
投げられる例外
-
-
- <tt>NS_ERROR_FAILURE</tt>
-
- ダウンロードが進行中ではありません。
-
-

retryDownload()

-

失敗したダウンロードを再試行します。

-
 void retryDownload(
-   in unsigned long aID
- )
-
-
引数
-
-
- <tt>aID</tt>
-
- ダウンロードの固有 ID。
-
-
投げられる例外
-
-
- <tt>NS_ERROR_NOT_AVAILALE</tt>
-
- ダウンロードが不明です。
-
-

cleanUp()

-

完了、失敗、キャンセルされたダウンロードをリストから削除します。

-
 void cleanUp()
-
-
引数
-

ありません。

-

addListener()

-

ダウンロードマネージャにリスナーを追加します。

-
 void addListener(
-   in nsIDownloadProgressListener aListener
- )
-
-
引数
-
-
- <tt>aListener</tt>
-
- ダウンロードマネージャからステータス情報を受け取る nsIDownloadProgressListener オブジェクト。
-
-

removeListener()

-

ダウンロードマネージャからリスナーを削除します。

-
 void removeListener(
-   in nsIDownloadProgressListener aListener
- )
-
-
引数
-
-
- <tt>aListener</tt>
-
- ダウンロードマネージャのリスニングを中止する nsIDownloadProgressListener オブジェクト。
-
-

関連記事

- -
-  
diff --git a/files/ja/mozilla/tech/xpcom/reference/xpcom_interface_reference/nsidownloadmanagerui/index.html b/files/ja/mozilla/tech/xpcom/reference/xpcom_interface_reference/nsidownloadmanagerui/index.html deleted file mode 100644 index 958b1fc5e6..0000000000 --- a/files/ja/mozilla/tech/xpcom/reference/xpcom_interface_reference/nsidownloadmanagerui/index.html +++ /dev/null @@ -1,111 +0,0 @@ ---- -title: nsIDownloadManagerUI -slug: Mozilla/Tech/XPCOM/Reference/XPCOM_Interface_Reference/nsIDownloadManagerUI -tags: - - Firefox 3 - - Interfaces - - XPCOM - - XPCOM API Reference -translation_of: Mozilla/Tech/XPCOM/Reference/Interface/nsIDownloadManagerUI ---- -

nsIDownloadManagerUI インタフェースは、ダウンロードマネージャのためのユーザインタフェースを実装するために利用されます。標準のダウンロードマネージャのユーザインタフェースを置き換えたい場合は、このインタフェースを実装してください。

-


-

-
toolkit/components/downloads/public/nsIDownloadManagerUI.idlScriptable
- - -Please add a summary to this article. - - -
-  -最終更新: Gecko 1.9 (Firefox 3)
-
-

継承元: nsISupports

-

メソッドの概要

- - - - - - - - - -
void getAttention();
void show([optional] in nsIInterfaceRequestor aWindowContext, [optional] in unsigned long aID, [optional] in short aReason);
-

属性

- - - - - - - - - - - - - -
属性説明
visibleboolean読み取り専用。ダウンロードマネージャのユーザインタフェースが開かれている場合は true、そうでなければ false を返します。
-

定数

- - - - - - - - - - - - - - - - - - -
定数説明
REASON_USER_INTERACTED0ダウンロードマネージャのユーザインタフェースを開く際、この値は、ユーザのリクエストによって開かれたかどうかを示します。
REASON_NEW_DOWNLOAD1ダウンロードマネージャのユーザインタフェースを開く際、この値は、新たなダウンロードが開始されたために開かれたどうかを示します。
-

メソッド

-

getAttention()

-

ダウンロードマネージャのユーザインタフェースがすでに開かれている場合、そこに注意を促します。

-
 void getAttention();
-
-
引数
-

None.

-
投げられる例外
-
-
- NS_ERROR_UNEXPECTED
-
- ユーザインタフェースが開かれていません。
-
-

show()

-

ダウンロードマネージャのユーザインタフェースをユーザに表示します。

-
 void show(
-   [optional] in nsIInterfaceRequestor aWindowContext,
-   [optional] in unsigned long aID,
-   [optional] in short aReason
- );
-
-
引数
-
-
- <tt>aWindowContext</tt>
-
- ユーザインタフェースを表示するための親ウィンドウコンテキスト。この情報を使えば、ダウンロードマネージャを同じウィンドウのタブに、親としておくことができます。
-
- <tt>aID</tt>
-
- ダウンロードマネージャのユーザインタフェースを開く際、事前に選択されるダウンロードの ID。
-
- <tt>aReason</tt>
-
- ユーザインタフェースが表示された理由を示す 定数 のいずれか。
-
-

関連記事

- diff --git a/files/ja/mozilla/tech/xpcom/reference/xpcom_interface_reference/nsidownloadprogresslistener/index.html b/files/ja/mozilla/tech/xpcom/reference/xpcom_interface_reference/nsidownloadprogresslistener/index.html deleted file mode 100644 index e1878800fc..0000000000 --- a/files/ja/mozilla/tech/xpcom/reference/xpcom_interface_reference/nsidownloadprogresslistener/index.html +++ /dev/null @@ -1,295 +0,0 @@ ---- -title: nsIDownloadProgressListener -slug: >- - Mozilla/Tech/XPCOM/Reference/XPCOM_Interface_Reference/nsIDownloadProgressListener -tags: - - Firefox 3 - - Interfaces - - XPCOM - - XPCOM API Reference -translation_of: Mozilla/Tech/XPCOM/Reference/Interface/nsIDownloadProgressListener ---- -

nsIDownloadProgressListener インタフェースは、アプリケーションや拡張機能が、ダウンロードマネージャによって処理されているダウンロードの状況を監視する方法を提供します。開発者は、自分のコードでこのインタフェースを実装し、nsIDownloadManageraddListener() 関数を呼び出すだけで、監視を開始できます。

-

ダウンロードマネージャの状況を監視する必要がなくなったら、nsIDownloadManagerremoveListener() 関数を呼び出せば監視が中止されます。

-

ダウンロードの状況に変更があると、ダウンロードマネージャによって、ここで説明されているメソッドが呼び出されるので、必要なタイミングで処理を行えます。

-

このインタフェースの挙動は、nsIWebProgress インタフェースと非常に似ています。

-


-

-
toolkit/components/downloads/public/nsIDownloadProgressListener.idlScriptable
- - -Please add a summary to this article. - - -
-  -最終更新: Gecko 1.9 (Firefox 3)
-
-

継承元: nsISupports

-

メソッドの概要

- - - - - - - - - - - - - - - - - - -
void onDownloadStateChange(in short aState, in nsIDownload aDownload)
void onProgressChange(in nsIWebProgress aWebProgress, in nsIRequest aRequest, in long long aCurSelfProgress, in long long aMaxSelfProgress, in long long aCurTotalProgress, in long long aMaxTotalProgress, in nsIDownload aDownload)
void onStatusChange(in nsIWebProgress aWebProgress, in nsIRequest aRequest, in nsresult aStatus, in wstring aMessage, in nsIDownload aDownload)
void onLocationChange(in nsIWebProgress aWebProgress, in nsIRequest aRequest, in nsIURI aLocation, in nsIDownload aDownload)x
void onSecurityChange(in nsIWebProgress aWebProgress, in nsIRequest aRequest, in unsigned long aState, in nsIDownload aDownload)
-

属性

- - - - - - - - - - - - - -
属性説明
documentnsIDOMDocumentダウンロードマネージャのウィンドウを表すダウンロードドキュメント。
-

メソッド

-

onDownloadStateChange()

-

特定のダウンロードの状況に変更があったときに呼び出されます。

-
 void onDownloadStateChange(
-   in short aState,
-   in nsIDownload aDownload
- );
-
-
引数
-
-
- <tt>aState</tt>
-
- ダウンロードの変更前の状況。取り得る値の一覧nsIDownloadManager を参照してください。
-
-
-
- <tt>aDownload</tt>
-
- ダウンロード状況に変更があったファイルを表す nsIDownload オブジェクト。このオブジェクトから、ダウンロードの変更後の状況を取得できます。
-
-

onStateChange()

-

特定のダウンロードの状況に変更があったときに呼び出されます。

-
 void onStateChange(
-   in nsIWebProgress aWebProgress,
-   in nsIRequest aRequest,
-   in unsigned long aStateFlags,
-   in nsresult aStatus,
-   in nsIDownload aDownload
- );
-
-
引数
-
-
- <tt>aWebProgress</tt>
-
- ダウンロードを監視するためにダウンロードマネージャによって利用される nsIWebProgress インスタンス。
-
-
-
- <tt>aRequest</tt>
-
- 状況を変更した nsIChannel。この引数は NULL を取ることができません。
-
-
-
- <tt>aStateFlags</tt>
-
- ダウンロードの変更後の状況を示すフラグ。この値は、nsIWebProgressListener の記事に書かれている 状況遷移フラグ のいずれかの組み合わせになります。
-
-
-
- <tt>aStatus</tt>
-
- ダウンロードの変更後の状況に関する情報。詳しくは nsIWebProgressListener]] の [[nsIWebProgressListener#onStateChange|onStateChange() を参照してください。これは nsIDownloadManager の状況を示す定数 のいずれかになる場合もあります。
-
-
-
- <tt>aDownload</tt>
-
- 状況が変更されたダウンロード。
-
-

onProgressChange()

-

ダウンロードの進捗レベルがダウンロードによって変更されたときに呼び出されます。

-
 void onProgressChange(
-   in nsIWebProgress aWebProgress,
-   in nsIRequest aRequest,
-   in long long aCurSelfProgress,
-   in long long aMaxSelfProgress,
-   in long long aCurTotalProgress,
-   in long long aMaxTotalProgress,
-   in nsIDownload aDownload
- );
-
-
引数
-
-
- <tt>aWebProgress</tt>
-
- ダウンロードを監視するためにダウンロードマネージャによって利用される nsIWebProgress インスタンス。
-
-
-
- <tt>aRequest</tt>
-
- 状況を変更した nsIChannel。この引数は NULL を取ることができません。
-
-
-
- <tt>aCurSelfProgress</tt>
-
- <tt>aDownload</tt> で指定されたダウンロードに対して行われた、現在の進捗の量。
-
-
-
- <tt>aMaxSelfProgress</tt>
-
- ダウンロード完了を示すために達成しなければならない、個別進捗状況の値。
-
-
-
- <tt>aCurTotalProgress</tt>
-
- すべてのダウンロードに対して行われた、現在の進捗の量。
-
-
-
- <tt>aMaxTotalProgress</tt>
-
- すべてのダウンロード完了を示すために達成しなければならない、合計進捗状況の値。
-
-
-
- <tt>aDownload</tt>
-
- 進捗状況が <tt>aCurSelfProgress</tt> と <tt>aMaxSelfProgress</tt> の引数によって表される nsIDownload オブジェクト。
-
-

onStatusChange()

-

ダウンロードのリクエストの状況に変更があったときに呼び出されます。受け取る状況メッセージは、ユーザに直接表示することを意図したものです。

-
- 警告: このメソッドは Firefox 3 (Gecko 1.9) で削除されました。それ以前のバージョンでも、このメソッドが呼び出されているコードはありません。
-
 void onStatusChange(
-   in nsIWebProgress aWebProgress,
-   in nsIRequest aRequest,
-   in nsresult aStatus,
-   in wstring aMessage,
-   in nsIDownload aDownload
- );
-
-
引数
-
-
- <tt>aWebProgress</tt>
-
- ダウンロードを監視するためにダウンロードマネージャによって利用される nsIWebProgress インスタンス。
-
-
-
- <tt>nsIChannel</tt>
-
- 状況を変更した nsIChannel。この引数は NULL を取ることができません。
-
-
-
- <tt>aStatus</tt>
-
- ダウンロードの変更後の状況に関する情報。詳しくは nsIWebProgressListener]] の [[nsIWebProgressListener#onStateChange|onStateChange() を参照してください。
-
-
-
- <tt>aMessage</tt>
-
- 画面上に表示されることを意図した、ユーザが読める形での状況メッセージ
-
-
-
- <tt>aDownload</tt>
-
- 状況が変更されたダウンロード。
-
-

onLocationChange()

-
- 警告: このメソッドは Firefox 3 (Gecko 1.9) で削除されました。それ以前のバージョンでも、このメソッドが呼び出されているコードはありません。
-
 void onLocationChange(
-   in nsIWebProgress aWebProgress,
-   in nsIRequest aRequest,
-   in nsIURI aLocation,
-   in nsIDownload aDownload
- );
-
-
引数
-
-
- <tt>aWebProgress</tt>
-
- ダウンロードを監視するためにダウンロードマネージャによって利用される nsIWebProgress インスタンス。
-
-
-
- <tt>aRequest</tt>
-
- 状況を変更した nsIChannel。この引数は NULL を取ることができません。
-
-
-
- <tt>aLocation</tt>
-
- ダウンロード中のファイルの URI。
-
-
-
- <tt>aDownload</tt>
-
- ダウンロード中のファイルを表す nsIDownload オブジェクト。
-
-

onSecurityChange()

-

ダウンロード中に使われるセキュリティレベルが変更されたときに呼び出されます。例えば、最初のリクエストが HTTPS を通じて行われ、その後ダウンロードが HTTP に変わった場合、この関数が呼び出され、その遷移を通知します。

-
 void onSecurityChange(
-   in nsIWebProgress aWebProgress,
-   in nsIRequest aRequest,
-   in unsigned long aState,
-   in nsIDownload aDownload
- );
-
-
-
引数
-
-
- <tt>aWebProgress</tt>
-
- ダウンロードを監視するためにダウンロードマネージャによって利用される nsIWebProgress インスタンス。
-
-
-
- <tt>aRequest</tt>
-
- 状況を変更した nsIChannel。この引数は NULL を取ることができません。
-
-
-
- <tt>aState</tt>
-
- ダウンロードの変更後の状況。取り得る値の一覧nsIDownloadManager を参照してください。
-
-
-
- <tt>aDownload</tt>
-
- セキュリティレベルが変更されたダウンロード。
-
-

関連記事

-

nsIDownloadManager, nsIDownload, nsIWebProgressListener

diff --git a/files/ja/mozilla/tech/xpcom/reference/xpcom_interface_reference/nsidragservice/index.html b/files/ja/mozilla/tech/xpcom/reference/xpcom_interface_reference/nsidragservice/index.html deleted file mode 100644 index 66878aa9ec..0000000000 --- a/files/ja/mozilla/tech/xpcom/reference/xpcom_interface_reference/nsidragservice/index.html +++ /dev/null @@ -1,227 +0,0 @@ ---- -title: nsIDragService -slug: Mozilla/Tech/XPCOM/Reference/XPCOM_Interface_Reference/nsIDragService -tags: - - Interfaces - - XPCOM - - XPCOM API Reference -translation_of: Mozilla/Tech/XPCOM/Reference/Interface/nsIDragService ---- -
-

草案
- このページは完成していません。

- -
-


-

-
widget/public/nsIDragService.idlScriptable
- - -Please add a summary to this article. - - -
-  -最終更新: Gecko 1.9 (Firefox 3)
-
-

継承元: nsISupports

-

メソッドの概要

- - - - - - - - - - - - - - - - - - - - - - - - -
void invokeDragSession(in nsIDOMNode aDOMNode, in nsISupportsArray aTransferables, in nsIScriptableRegion aRegion, in unsigned long aActionType);
void invokeDragSessionWithImage(in nsIDOMNode aDOMNode, in nsISupportsArray aTransferableArray, in nsIScriptableRegion aRegion, in unsigned long aActionType,in nsIDOMNode aImage, in long aImageX, in long aImageY, in nsIDOMMouseEvent aDragEvent);
void invokeDragSessionWithSelection(in nsISelection aSelection, in nsISupportsArray aTransferableArray, in unsigned long aActionType, in nsIDOMMouseEvent aDragEvent);
nsIDragSession getCurrentSession();
voidstartDragSession();
void endDragSession(in PRBool aDoneDrag);
void fireDragEventAtSource(in unsigned long aMsg);
-

定数

- - - - - - - - - - - - - - - - - - - - - - - - - - - - -
定数説明
DRAGDROP_ACTION_NONE0LONG データ形式。
DRAGDROP_ACTION_COPY1LONG データ形式。
DRAGDROP_ACTION_MOVE2LONG データ形式。
DRAGDROP_ACTION_LINK3LONG データ形式。
-

メソッド

-

invokeDragSession()

-

移転可能なオブジェクトの配列を伴った、モーダルなドラッグセッションを開始します。

-
  void invokeDragSession (
-   in nsIDOMNode aDOMNode,
-   in nsISupportsArray aTransferables,
-   in nsIScriptableRegion aRegion,
-   in unsigned long aActionType
- );
-
-
引数
-
-
- <tt>aDOMNode</tt>
-
-  
-
-
-
- <tt>aTransferables</tt>
-
- ドラッグされる移転可能なオブジェクトの配列。
-
-
-
- <tt>aRegion</tt>
-
- カーソルフィードバックの矩形を含む範囲。ウィンドウ座標で指定。
-
-
-
- <tt>aActionType</tt>
-
- コピー、移動、リンクのうち、いずれが可能かを指定。
-
-

invokeDragSessionWithImage()

-

画像を利用して、モーダルなドラッグセッションを開始します。最初 4 つの引数は invokeDragSession と同じです。

-

aImage 引数を使って独自の画像を指定することができます。画像が指定された場合、aImageXaImageY 引数で、その画像の中でカーソルが位置するオフセットを指定できます。つまり、画像が表示されたときに、指定された量だけ左上に画像がずらされて、画像内のその位置にカーソルが現れます。aImagenull の場合、aImageXaImageY は使われず、代わりにソースノードである aDOMNode から画像が判別され、オフセットは自動計算されます。このため、画像の初期位置は、要素が位置するのと同じ画面上の位置になります。ノードはドキュメント内になくてはなりません。

-

今のところ、サポートされている画像はすべて DOM ノードです。これが HTML <image> あるいは <canvas> 要素の場合、ドラッグに付随する画像はその画像データから取得されます。要素がドキュメント上にある場合は、画像は表示されているサイズで表示されます。ドキュメント上にない場合は、実際のサイズで表示されます。他の種類の要素については、現在表示されているのと同じ方法で、画面外のバッファとして表示されます。ドキュメント上の選択範囲はドラッグ中非表示となります。画像の位置を計算するのに、イベントの現在の画面座標が必要となるため、aDragEvent は必ず指定する必要があります。

-
  void invokeDragSessionWithImage(in nsIDOMNode aDOMNode,
-                                  in nsISupportsArray aTransferableArray,
-                                  in nsIScriptableRegion aRegion,
-                                  in unsigned long aActionType,
-                                  in nsIDOMNode aImage,
-                                  in long aImageX,
-                                  in long aImageY,
-                                  in nsIDOMMouseEvent aDragEvent
-  );
-
-
引数
-
-
- <tt>aImage</tt>
-
- 画像オブジェクト
-
-
-
- <tt>aImageX</tt>
-
- 画像の X 座標
-
-
-
- <tt>aImageY</tt>
-
- 画像の Y 座標
-
-
-
- <tt>aDragEvent</tt>
-
-  
-
-

invokeDragSessionWithSelection()

-

選択範囲をドラッグ画像として利用して、モーダルなドラッグセッションを開始します。画像の位置を計算するのに、イベントの現在の画面座標が必要となるため、aDragEvent は必ず指定する必要があります。

-
  void invokeDragSessionWithSelection(
-     in nsISelection aSelection,
-     in nsISupportsArray aTransferableArray,
-     in unsigned long aActionType,
-     in nsIDOMMouseEvent aDragEvent
-  );
-
-
引数
-
-
- <tt>aSelection</tt>
-
-  
-
-
-
- <tt>aTransferableArray</tt>
-
-  
-
-
-
- <tt>aActionType</tt>
-
- コピー、移動、リンクのうち、いずれが可能かを指定。
-
-
-
- <tt>aDragEvent</tt>
-
-  
-
-

getCurrentSession()

-

現在のドラッグセッションを返します。

-
  nsIDragSession getCurrentSession ( ) ;
-
-

startDragSession()

-

ドラッグサービスにドラッグセッションを開始するよう伝えます。これは外部でドラッグが発生したときに呼び出されます。

-
  void startDragSession ( ) ;
-
-

endDragSession()

-

ドラッグサービスにドラッグセッションを終了するよう伝えます。これは外部でドラッグが発生したときに呼び出されます。

-
  void endDragSession (
-     in PRBool aDoneDrag
-  ) ;
-
-
引数
-
-
- <tt>aDoneDrag </tt>
-
- aDoneDragtrue の場合、ドラッグはすでに終了しています。そうでない場合、ドラッグはウィンドウを離れたところです。この引数は Firefox 3 以前のバージョンには存在しません。
-
-

fireDragEventAtSource()

-

ドラッグのソースに対してドラッグイベントを発生させます。このメソッドは Firefox 3 以降で利用可能です。

-
  void fireDragEventAtSource (
-     in unsigned long aMsg
-  );
-
-
引数
-
-
- <tt>aMsg </tt>
-
-  
-
-
-  
diff --git a/files/ja/mozilla/tech/xpcom/reference/xpcom_interface_reference/nsieffectivetldservice/index.html b/files/ja/mozilla/tech/xpcom/reference/xpcom_interface_reference/nsieffectivetldservice/index.html deleted file mode 100644 index 3e4a0adab5..0000000000 --- a/files/ja/mozilla/tech/xpcom/reference/xpcom_interface_reference/nsieffectivetldservice/index.html +++ /dev/null @@ -1,173 +0,0 @@ ---- -title: nsIEffectiveTLDService -slug: Mozilla/Tech/XPCOM/Reference/XPCOM_Interface_Reference/nsIEffectiveTLDService -tags: - - Interfaces - - XPCOM - - XPCOM API Reference -translation_of: Mozilla/Tech/XPCOM/Reference/Interface/nsIEffectiveTLDService ---- -

nsIEffectiveTLDServiceはホスト名を検証し、それがTLDであるように見えるもっとも長い部分を決定します。URIのベースドメインを決定する役割も持ちます。

-
-
netwerk/dns/public/nsIEffectiveTLDService.idlScriptable
- - -Please add a summary to this article. - - -
-  -最終更新: Gecko 1.9 (Firefox 3)
-
-

継承元: nsISupports

-

実装: @mozilla.org/network/effective-tld-service;1

-

このサービスを使うには:

-
var eTLDService = Components.classes["@mozilla.org/network/effective-tld-service;1"]
-                                .getService(Components.interfaces.nsIEffectiveTLDService);
-
-

メソッドの概要

- - - - - - - - - - - - - - - -
ACString getPublicSuffix(in nsIURI aURI);
ACString getBaseDomain(in nsIURI aURI, [optional] in PRUint32 aAdditionalParts);
ACString getPublicSuffixFromHost(in AUTF8String aHost);
ACString getBaseDomainFromHost(in AUTF8String aHost, [optional] in PRUint32 aAdditionalParts);
-

メソッド

-

getPublicSuffix()

-

URIのパブリック接尾辞を返します。パブリック接尾辞はその下に個々のドメインが登録される最高位レベルのドメインです。パブリック接尾辞はひとつまたはそれ以上のドットを含みます。例えば、www.bbc.co.ukのパブリック接尾辞はco.ukになります、なぜならば.uk TLDはその下にドメインを登録することを許していないからです。その他の例として、developer.mozilla.orgではorgになります。

-
ACString getPublicSuffix(
-  in nsIURI aURI
-);
-
-
引数
-
-
- aURI
-
- 解析するURI
-
-

戻り値

-

パブリック接尾辞を含むACStringオブジェクト

-
例外
-
-
- NS_ERROR_INVALID_ARG
-
- この例外はaURIに含まれるホスト名が空であった場合に発生します。
-
- NS_ERROR_HOST_IS_IP_ADDRESS
-
- この例外はaURIが数値、IPv4アドレス、IPv6アドレスのいずれかであった場合に発生します。
-
-

getBaseDomain()

-

URIのベースドメインを返します。ベースドメインは、パブリック接尾辞に指定された数の追加ドメイン名を追加したものです。

-
ACString getBaseDomain(
-  in nsIURI aURI
-  [optional] in PRUint32 aAdditionalParts
-);
-
-
引数
-
-
- aURI
-
- 解析するURI
-
- aAdditionalParts
-
- パブリック接尾辞に追加するドメイン名の数
-
-
戻り値
-

ベースドメインを含むACStringオブジェクト(パブリック接尾辞に、追加パート部分を足したもの)

-
例外
-
-
- NS_ERROR_INVALID_ARG
-
- この例外はaURIが空であった場合に発生します。
-
- NS_ERROR_INSUFFICIENT_DOMAIN_LEVELS
-
- この例外はaAdditionalPartsで指定された値に対してサブドメインが不足する場合に発生します。
-
- NS_ERROR_HOST_IS_IP_ADDRESS
-
- この例外はaURIが数値、IPv4アドレス、IPv6アドレスのいずれかであった場合に発生します。
-
-

getPublicSuffixFromHost()

-

ホスト文字列のパブリック接尾辞を返します。さもなくば機能的にはgetPublicSuffix()と同じです。

-
ACString getPublicSuffixFromHost(
-  in AUTF8String aHost
-);
-
-
引数
-
-
- aHost
-
- 解析されるホスト名
-
-
戻り値
-

パブリック接尾辞を含むACStringオブジェクト

-
例外
-
-
- NS_ERROR_INVALID_ARG
-
- この例外はaHostが空であった場合に発生します。
-
- NS_ERROR_UNEXPECTED
-
- この例外はaHostがURI中に含まれることを許可されない文字を含む場合にnsIIDNService内のNormalize()メソッドにより発生します。
-
-

getBaseDomainFromHost()

-

ホスト名のベースドメイン部分を返します。さもなくば機能的にはgetBaseDomain()と同じです。

-
ACString getBaseDomainFromHost(
-  in AUTF8String aHost,
-  [optional] in PRUint32 aAdditionalParts
-);
-
-
引数
-
-
- aHost
-
- 解析されるホスト名
-
- aAdditionalParts
-
- パブリック接尾辞に追加するドメイン名の数
-
-
戻り値
-

ベースドメインを含むACStringオブジェクト(パブリック接尾辞に、追加パート部分を足したもの)

-
例外
-
-
- NS_ERROR_INVALID_ARG
-
- aHostが空であった場合に発生します。
-
- NS_ERROR_UNEXPECTED
-
- この例外はaHostがURI中に含まれることを許可されない文字を含む場合にnsIIDNService内のNormalize()メソッドにより発生します。
-
- NS_ERROR_INSUFFICIENT_DOMAIN_LEVELS
-
- この例外はaAdditionalPartsで指定された値に対してサブドメインが不足する場合に発生します。
-
- NS_ERROR_HOST_IS_IP_ADDRESS
-
- この例外はaHostが数値、IPv4アドレス、IPv6アドレスのいずれかであった場合に発生します。
-
-

言及

-

全ての戻り値はASCII/ACEでエンコーディングされ、RFC 3454に沿っています。

diff --git a/files/ja/mozilla/tech/xpcom/reference/xpcom_interface_reference/nsienumerator/index.html b/files/ja/mozilla/tech/xpcom/reference/xpcom_interface_reference/nsienumerator/index.html deleted file mode 100644 index f90f1ef647..0000000000 --- a/files/ja/mozilla/tech/xpcom/reference/xpcom_interface_reference/nsienumerator/index.html +++ /dev/null @@ -1,40 +0,0 @@ ---- -title: nsIEnumerator -slug: Mozilla/Tech/XPCOM/Reference/XPCOM_Interface_Reference/nsIEnumerator -tags: - - Interfaces - - XPCOM - - XPCOM API Reference - - XPCOM Interface Reference -translation_of: Mozilla/Tech/XPCOM/Reference/Interface/nsIEnumerator ---- -
-
-

廃止
- この機能は廃止されました。一部のブラウザーでは引き続き機能する可能性がありますが、いつでも削除できるため使用は推奨されません。使用しないようにして下さい。

-
-
- -

nsIEnumerator.idl

- -
警告:これは壊れたインターフェイスです;必要がない限り使用しないでください。列挙子に一般的に使用されるインターフェイスは nsISimpleEnumerator です。
- -

使用例

- -
var iter = --------();
-try {
-  iter.first();
-  do {
-    var data = iter.currentItem();
-    if( data instanceof Ci.nsI------ ) {
-      ...
-       ...
-    }
-    iter.next();
-  } while( Components.lastResult == 0 );
-} catch(e) {}
-
- -

この件に関するいくつかのメモについては、1999-04-21 16:11:03の "Warren Harris" からのEメールを検索して下さい。

- -

このバージョン は上手く機能していない様なので、 Google キャッシュを使用する必要があるかもしれません。

diff --git a/files/ja/mozilla/tech/xpcom/reference/xpcom_interface_reference/nsifeed/index.html b/files/ja/mozilla/tech/xpcom/reference/xpcom_interface_reference/nsifeed/index.html deleted file mode 100644 index 639be1b844..0000000000 --- a/files/ja/mozilla/tech/xpcom/reference/xpcom_interface_reference/nsifeed/index.html +++ /dev/null @@ -1,125 +0,0 @@ ---- -title: nsIFeed -slug: Mozilla/Tech/XPCOM/Reference/XPCOM_Interface_Reference/nsIFeed -tags: - - Interfaces - - XPCOM - - XPCOM API Reference -translation_of: Mozilla/Tech/XPCOM/Reference/Interface/nsIFeed ---- -

nsIFeed インターフェースは単一の Atom か RSS(Really Simple Syndication) ニュースフィードに相当します。アイテムかフィードのエントリにアクセスするのと同じように、フィードに関する情報を提供する属性を含んでいます。

-


-

-
toolkit/components/feeds/public/nsIFeed.idlScriptable
- - -Please add a summary to this article. - - -
-  -最終更新: Gecko 1.8.1 (Firefox 2 / Thunderbird 2 / SeaMonkey 1.1)
-
-

継承元: nsIFeedContainer

-

属性

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
属性説明
cloudnsIWritablePropertyBag2フィードの cloud 属性が何なのか確証を持っている人は誰もいません。XML-RPC か SOAP サービスと関係があるように推測されます。
enclosureCountlongフィードに関連づけられたエンクロージャの数を表します。
generatornsIFeedGeneratorフィードを生成したソフトウェアを記述します。
imagensIWritablePropertyBag2RSS 2 で定義された画像の URL とメターデータを提供します。
itemsnsIArraynsIFeedEntry オブジェクトの配列として、アイテムの配列かフィードのエントリを定義します。
skipDaysnsIArray一週間の中でフィードがフェッチされたくない曜日の配列です。配列のそれぞれのエントリは、週のスキップする曜日の名前です。例えば、月曜日にフェッチをスキップする、フィードが月曜日にフェッチされたくないならこの配列の中に "Monday" と指定します。 -
- 注意: このフィールドはまれにしか実装されていません
-
skipHoursnsIArray一日の中でフェッチすべきでない時間の配列です。時間は、0(真夜中)から 23 (午後11:00)までの整数値で表され、常に UTC を使って表されます。 -
- 注意: このフィールドはまれにしか実装されていません
-
subtitlensIFeedTextConstructフィードの description と subtitle, 及び適切な拡張に基づいてフィードのサブタイトルを返します。
textInputnsIWritablePropertyBag2フィードのソースに読者が返信を送ることを可能にするテキストボックスに関する情報。サポートしているアグリゲータはフィードと一緒に表示することができる -
- 注意: このフィールドは滅多に使われておらず、多くのアグリゲータと非互換です。
-
typelongフィードが提供するコンテントの種類を表します。取りうる種類の型は: -
-
- TYPE_FEED
-
- 標準のテキストベースのフィード。
-
-
-
- TYPE_AUDIO
-
- Podcast のような音声フィード
-
-
-
- TYPE_IMAGE
-
- Photocast のような画像フィード
-
-
-
- TYPE_VIDEO
-
- Videocast のようなビデオフィード
-
-

- - この属性は読み込み専用です。 -

-
- 注意: これを値のビットマスクと考えるべきです。ある時には、type は一緒に OR された一つ以上の値を含みます。これが Firefox 2 の前または後で起こるかどうかは明確ではありません。
-
-

参照

-

nsIFeedContainer

diff --git a/files/ja/mozilla/tech/xpcom/reference/xpcom_interface_reference/nsifeedcontainer/index.html b/files/ja/mozilla/tech/xpcom/reference/xpcom_interface_reference/nsifeedcontainer/index.html deleted file mode 100644 index 2450d88d63..0000000000 --- a/files/ja/mozilla/tech/xpcom/reference/xpcom_interface_reference/nsifeedcontainer/index.html +++ /dev/null @@ -1,101 +0,0 @@ ---- -title: nsIFeedContainer -slug: Mozilla/Tech/XPCOM/Reference/XPCOM_Interface_Reference/nsIFeedContainer -tags: - - Interfaces - - XPCOM - - XPCOM API Reference -translation_of: Mozilla/Tech/XPCOM/Reference/Interface/nsIFeedContainer ---- -

nsIFeedContainer インタフェースはフィード(nsIFeed) とフィードエントリ(nsIFeedEntry) の両方で使われる標準的なフィールドを提供します。

-


-

-
toolkit/components/feeds/public/nsIFeedContainer.idlScriptable
- - -Please add a summary to this article. - - -
-  -最終更新: Gecko 1.8.1 (Firefox 2 / Thunderbird 2 / SeaMonkey 1.1)
-
-

継承元: nsIFeedElementBase

-

メソッドの概要

- - - - - - -
normalize();
-

属性

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
属性説明
authorsnsIArrayフィードあるいはエントリの著者を記述する nsIFeedPerson オブジェクトの配列。
categoriesnsIArrayフィードあるいはエントリで見付かったカテゴリの配列。 -
- 注意: 返される配列は nsIFeedCategory オブジェクトを含むでしょう。ただしそのインタフェースはまだ実装されていません。
-
contributorsnsIArrayフィードあるいはエントリの貢献者を記述する nsIFeedPerson オブジェクトの配列。
fieldsnsIWritablePropertyBag2ドキュメントで見つかったすべてのフィールドへのアクセスを提供します。一般的な Atom 及び RSS フィールドは "dc:subject" や "content:encoded" のようないくつかの名前空間づけられた拡張を含めてノーマライズされます。フィードの種類をチェックし特定のフィールドにアクセスすることによって消費者はノーマライズを避けることができます。 -

一般的な名前空間は接頭辞を使うことで get("dc:subject"); のようにアクセスできます。接頭辞に関する更なる情報は nsIFeedResult.registerExtensionPrefix() を参照してください。

-
idAStringフィードあるいはエントリの識別する文字列。フィード全てがこれらを持つわけでは無いですがメジャーなフィードフォーマットはそれぞれのエントリに ID を持っています。
linknsIURIフィードあるいはエントリの第一のリンクを含む URI。
rightsnsIFeedTextConstructフィードあるいはエントリの権利あるいはライセンスのテキスト。
titlensIFeedTextConstructフィードあるいはエントリのタイトルいくつかのフィードはタイトルがないことに覚えておいてください。またいくつかはタイトルにマークアップを使っており、この属性をデコードするときには注意してください。
updatedAStringRFC822 フォーマットでのフィードあるいはエントリが最後に更新された日付を含む文字列。この文字列は JavaScript と mail コードでパース可能です。
-

メソッド

-

normalize()

-

コンテナのフィールドを便利な属性とを同期させます。

-
 void normalize();
-
-

参照

-

nsIURI, nsIFeedTextConstruct

-

Interwiki link

-
-  
diff --git a/files/ja/mozilla/tech/xpcom/reference/xpcom_interface_reference/nsifeedelementbase/index.html b/files/ja/mozilla/tech/xpcom/reference/xpcom_interface_reference/nsifeedelementbase/index.html deleted file mode 100644 index fe7d1a107f..0000000000 --- a/files/ja/mozilla/tech/xpcom/reference/xpcom_interface_reference/nsifeedelementbase/index.html +++ /dev/null @@ -1,46 +0,0 @@ ---- -title: nsIFeedElementBase -slug: Mozilla/Tech/XPCOM/Reference/XPCOM_Interface_Reference/nsIFeedElementBase -tags: - - Interfaces - - XPCOM - - XPCOM API Reference -translation_of: Mozilla/Tech/XPCOM/Reference/Interface/nsIFeedElementBase ---- -

nsIFeedElementBase インタフェースは基本となるインタフェースです。

-


-

-
toolkit/components/feeds/public/nsIFeedElementBase.idlScriptable
- - -Please add a summary to this article. - - -
-  -最終更新: Gecko 1.8.1 (Firefox 2 / Thunderbird 2 / SeaMonkey 1.1)
-
-

継承元: nsISupports

-

属性

- - - - - - - - - - - - - - - - - - -
属性説明
attributesnsISAXAttributesその要素で見つかったすべての属性。ほとんどの派生インタフェースが標準のフィールドに便利なアクセサを提供するので、標準的でないフィールドを探すときにのみ役に立ちます。
baseURInsIURIフィードまたはエントリの base URI。
-

Interwiki link

-
-  
diff --git a/files/ja/mozilla/tech/xpcom/reference/xpcom_interface_reference/nsifeedentry/index.html b/files/ja/mozilla/tech/xpcom/reference/xpcom_interface_reference/nsifeedentry/index.html deleted file mode 100644 index ee585a4147..0000000000 --- a/files/ja/mozilla/tech/xpcom/reference/xpcom_interface_reference/nsifeedentry/index.html +++ /dev/null @@ -1,68 +0,0 @@ ---- -title: nsIFeedEntry -slug: Mozilla/Tech/XPCOM/Reference/XPCOM_Interface_Reference/nsIFeedEntry -tags: - - Interfaces - - XPCOM - - XPCOM API Reference -translation_of: Mozilla/Tech/XPCOM/Reference/Interface/nsIFeedEntry ---- -

nsIFeedEntry インタフェースは RSS か Atom ニュースフィードの単一のエントリを記述し、エントリのデータにアクセスできる属性を提供します。

-


-

-
toolkit/components/feeds/public/nsIFeedEntry.idlScriptable
- - -Please add a summary to this article. - - -
-  -最終更新: Gecko 1.8.1 (Firefox 2 / Thunderbird 2 / SeaMonkey 1.1)
-
-

継承元: nsIFeedContainer

-

属性

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
属性説明
contentnsIFeedTextConstructエントリのコンテントの完全なテキスト。これは atom:content 及び/または content:encoded フィールドに由来します。
enclosuresnsIArrayエントリに含まれている全てのエンクロージャの配列。これらは podcast や photocast 等で使われます。
mediaContentnsIArrayエンクロージャまたはエントリ内でインライン表示されるその他のメディアの全ての配列。
parentnsIFeedContainerエントリの親への参照。フィード (nsIFeed) かもう一つのエントリのどちらかです。
publishedAStringRFC822 フォーマットでのエントリが配信された日付を表す文字列。この日付は JavaScript と mail コードの両方でパース可能です。
summarynsIFeedTextConstructフィードエントリのコンテントの要約。これはエントリの description と subtitle, summary, content および適切な拡張を使って生成されます。
-

参照

-

nsIFeedContainer

-

Interwiki link

-
-  
diff --git a/files/ja/mozilla/tech/xpcom/reference/xpcom_interface_reference/nsifeedgenerator/index.html b/files/ja/mozilla/tech/xpcom/reference/xpcom_interface_reference/nsifeedgenerator/index.html deleted file mode 100644 index 02e51e7ced..0000000000 --- a/files/ja/mozilla/tech/xpcom/reference/xpcom_interface_reference/nsifeedgenerator/index.html +++ /dev/null @@ -1,51 +0,0 @@ ---- -title: nsIFeedGenerator -slug: Mozilla/Tech/XPCOM/Reference/XPCOM_Interface_Reference/nsIFeedGenerator -tags: - - Interfaces - - XPCOM - - XPCOM API Reference -translation_of: Mozilla/Tech/XPCOM/Reference/Interface/nsIFeedGenerator ---- -

nsIFeedGenerator インタフェースは RSS か Atom ニュースフィードを生成したソフトウェアを記述します。

-


-

-
toolkit/components/feeds/public/nsIFeedGenerator.idlScriptable
- - -Please add a summary to this article. - - -
-  -最終更新: Gecko 1.8.1 (Firefox 2 / Thunderbird 2 / SeaMonkey 1.1)
-
-

継承元: nsIFeedElementBase

-

属性

- - - - - - - - - - - - - - - - - - - - - - - -
属性説明
agentAStringフィードを作成したソフトウェアの名前。
urinsIURIジェネレータソフトウェアに関連づけられた URI。
versionAStringフィードを作成したジェネレータソフトウェアのバージョンを表す文字列。
-

Interwiki link

-
-  
diff --git a/files/ja/mozilla/tech/xpcom/reference/xpcom_interface_reference/nsifeedperson/index.html b/files/ja/mozilla/tech/xpcom/reference/xpcom_interface_reference/nsifeedperson/index.html deleted file mode 100644 index bb0efa8e92..0000000000 --- a/files/ja/mozilla/tech/xpcom/reference/xpcom_interface_reference/nsifeedperson/index.html +++ /dev/null @@ -1,53 +0,0 @@ ---- -title: nsIFeedPerson -slug: Mozilla/Tech/XPCOM/Reference/XPCOM_Interface_Reference/nsIFeedPerson -tags: - - Interfaces - - XPCOM - - XPCOM API Reference -translation_of: Mozilla/Tech/XPCOM/Reference/Interface/nsIFeedPerson ---- -

nsIFeedPerson インタフェースは RSS または Atom フィードの著者か貢献者を記述します。

-


-

-
toolkit/components/feeds/public/nsIFeedPerson.idlScriptable
- - -Please add a summary to this article. - - -
-  -最終更新: Gecko 1.8.1 (Firefox 2 / Thunderbird 2 / SeaMonkey 1.1)
-
-

継承元: nsIFeedElementBase

-

属性

- - - - - - - - - - - - - - - - - - - - - - - -
属性説明
emailAStringその人の email アドレス。
nameAStringその人の名前。
urinsIURIその人に関連づけられた URI。ほとんどの場合、これはその人のホームページです。
-

参照

-

nsIFeedElementBase

-

Interwiki link

-
-  
diff --git a/files/ja/mozilla/tech/xpcom/reference/xpcom_interface_reference/nsifeedprocessor/index.html b/files/ja/mozilla/tech/xpcom/reference/xpcom_interface_reference/nsifeedprocessor/index.html deleted file mode 100644 index c7b4cb306a..0000000000 --- a/files/ja/mozilla/tech/xpcom/reference/xpcom_interface_reference/nsifeedprocessor/index.html +++ /dev/null @@ -1,116 +0,0 @@ ---- -title: nsIFeedProcessor -slug: Mozilla/Tech/XPCOM/Reference/XPCOM_Interface_Reference/nsIFeedProcessor -tags: - - Interfaces - - XPCOM - - XPCOM API Reference -translation_of: Mozilla/Tech/XPCOM/Reference/Interface/nsIFeedProcessor ---- -

nsIFeedProcessor インタフェースは RSS または Atom フィードをパースします。これは処理中と処理後にそれらのコンテンツに基づいてコールバックを引き起こします。

-


-

-
toolkit/components/feeds/public/nsIFeedProcessor.idlScriptable
- - -Please add a summary to this article. - - -
-  -最終更新: Gecko 1.8.1 (Firefox 2 / Thunderbird 2 / SeaMonkey 1.1)
-
-

継承元: nsIStreamListener

-

実装元: @mozilla.org/feed-processor;1。インスタンスを作成するには次のコードを使用します:

-
var fp = Components.classes["@mozilla.org/feed-processor;1"]
-                   .createInstance(Components.interfaces.nsIFeedProcessor);
-
-

メソッドの概要

- - - - - - - - - - - - -
void parseAsync(in nsIRequestObserver requestObserver, in nsIURI uri);
void parseFromStream(in nsIInputStream stream, in nsIURI uri);
void parseFromString(in AString str, in nsIURI uri);
-

属性

- - - - - - - - - - - - - -
属性説明
listenernsIFeedResultListenerfeed result listener はフィードイベントに反応します。
-

メソッド

-

parseAsync()

-

非同期にフィードをパースします。そして、呼び出し元はパース処理を開始するためにプロセッサの nsIStreamListener メソッドを呼び出さなくてはなりません。非同期パース中に nsIFeedProcessor インタフェースの他のパースメソッドを呼び出してはなりません。

-
 void parseAsync(
-   in nsIRequestObserver requestObserver,
-   in nsIURI uri
- );
-
-
パラメータ
-
-
- <tt>requestObserver</tt>
-
- パースが始まったときと終わりにオブザーバは通知されます。これは null が可能です。
-
- <tt>uri</tt>
-
- フィードの中の URI を解決するための base URI。
-
-

parseFromStream()

-

nsInputStream からフィードをパースします。

-
 void parseFromStream(
-   in nsIInputStream stream,
-   in nsIURI uri
- );
-
-
パラメータ
-
-
- <tt>stream</tt>
-
- フィードを読み込んでパースする nsInputStream へのポインタ。
-
- <tt>uri</tt>
-
- フィードの中の URI を解決するための base URI。
-
-

parseFromString()

-

AString からフィードをパースをします。

-
 void parseFromString(
-   in AString str,
-   in nsIURI uri
- );
-
-
パラメータ
-
-
- <tt>str</tt>
-
- フィードとして処理される文字列。
-
- <tt>uri</tt>
-
- フィードの中の URI を解決するための base URI。
-
-

参照

-

nsIStreamListener, nsIFeedResultListener

-

Interwiki link

-
-  
diff --git a/files/ja/mozilla/tech/xpcom/reference/xpcom_interface_reference/nsifeedprogresslistener/index.html b/files/ja/mozilla/tech/xpcom/reference/xpcom_interface_reference/nsifeedprogresslistener/index.html deleted file mode 100644 index e655256058..0000000000 --- a/files/ja/mozilla/tech/xpcom/reference/xpcom_interface_reference/nsifeedprogresslistener/index.html +++ /dev/null @@ -1,102 +0,0 @@ ---- -title: nsIFeedProgressListener -slug: Mozilla/Tech/XPCOM/Reference/XPCOM_Interface_Reference/nsIFeedProgressListener -tags: - - Interfaces - - XPCOM - - XPCOM API Reference -translation_of: Mozilla/Tech/XPCOM/Reference/Interface/nsIFeedProgressListener ---- -

nsIFeedProgressListener インタフェースは、RSS あるいは Atom フィードの処理中に使われるコールバックを定義します。フィードコンテントアクセス API を使うプログラムはこれらのコールバックのいずれも実装する必要はありません。それらは任意ですが、パース処理中にフィードバックを提供することができます。

-


-

-
toolkit/components/feeds/public/nsiFeedListener.idlScriptable
- - -Please add a summary to this article. - - -
-  -最終更新: Gecko 1.8.1 (Firefox 2 / Thunderbird 2 / SeaMonkey 1.1)
-
-

継承元: nsIFeedResultListener

-

メソッドの概要

- - - - - - - - - - - - - - - -
void handleEntry(in nsIFeedEntry entry, in nsIFeedResult result);
void handleFeedAtFirstEntry(in nsIFeedResult result);
void handleStartFeed(in nsIFeedResult result);
void reportError(in AString errorText, in long lineNumber, in boolean bozo);
-

メソッド

-

handleEntry()

-

エントリあるいはアイテムが処理された後に呼ばれます。もしドキュメントが単独のアイテムあるいはエントリなら、 handleFeedAtFirstEntry() メソッドが呼ばれることなく、nsIFeedEntryparent の値に null を持つでしょう。

-
 void handleEntry(
-   in nsIFeedEntry entry,
-   in nsIFeedResult result
- );
-
-
パラメータ
-
-
- <tt>entry</tt>
-
- ちょうど処理されたエントリに関する情報を含んでいる nsIFeedEntry のポインタ。
-
- <tt>result</tt>
-
- 処理されているフィードに関する現在の情報を含む nsIFeedResult のポインタ。
-
-

handleFeedAtFirstEntry()

-

そのフィードで最初にエントリあるいはアイテムに出会った時に呼ばれます。Atomでは全てのフィードデータがエントリーに先行する必要があります; RSSではこれは必要ではありませんが通常はそうです。言い替えるとこのメソッドが呼ばれるとき、十中八九、ほとんどあるいは全てのフィードレベルのメタデータが処理され、受け取った nsIFeedResult オブジェクトで利用できるでしょう。

-
 void handleFeedAtFirstEntry(
-   in nsIFeedResult result
- );
-
-
パラメータ
-
-
- <tt>result</tt>
-
- 最初のエントリが見付かったが、処理される前の時点のフィードを表す nsIFeedResult
-
-
- 注意: もしフィードのタイプがエントリのみあるいはアイテムのみのタイプの場合、このイベントが呼ばれることはありません。
-

handleStartFeed()

-

フィードで妥当な先頭部分が検出されるとただちに呼ばれます; これはあなたのコードにそのフィードが他の種類のドキュメントではなく実際のフィードであるように見えることを知らせてくれます。

-

 

-
 void handleStartFeed(
-   in nsIFeedResult result
- );
-
-
パラメータ
-
-
- <tt>result</tt>
-
- フィードがパースされ始めた時点での状態を表す nsIFeedResult
-
-

reportError()

-

致命的な XML パースエラーが発生したときや、ドキュメントがフィードではなかったときにフィードプロセッサによって呼ばれます。

-
 void reportError(
-   in AString errorText,
-   in long lineNumber,
-   in boolean bozo
- );
-
-

それぞれのメソッドは少なくとも処理の時点での状態を表す nsIFeedResult を入力として受け取ります。

-

参照

-

nsIFeedResultListener

-

Interwiki link

-
-  
diff --git a/files/ja/mozilla/tech/xpcom/reference/xpcom_interface_reference/nsifeedresult/index.html b/files/ja/mozilla/tech/xpcom/reference/xpcom_interface_reference/nsifeedresult/index.html deleted file mode 100644 index cca291098e..0000000000 --- a/files/ja/mozilla/tech/xpcom/reference/xpcom_interface_reference/nsifeedresult/index.html +++ /dev/null @@ -1,105 +0,0 @@ ---- -title: nsIFeedResult -slug: Mozilla/Tech/XPCOM/Reference/XPCOM_Interface_Reference/nsIFeedResult -tags: - - Interfaces - - XPCOM - - XPCOM API Reference -translation_of: Mozilla/Tech/XPCOM/Reference/Interface/nsIFeedResult ---- -

nsIFeedResult インタフェースは HTTP へのアクセスと、フィードあるいはエントリのメタデータのパースを提供します。

- -


-

-
toolkit/components/feeds/public/nsIFeedResult.idlScriptable
- - -Please add a summary to this article. - - -
-  -最終更新: Gecko 1.8.1 (Firefox 2 / Thunderbird 2 / SeaMonkey 1.1)
-
- -

継承元: nsISupports

- -

メソッドの概要

- - - - - - - -
void registerExtensionPrefix(in AString namespace, in AString prefix);
- -

属性

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
属性説明
bozobooleanフィードが XML パース中に深刻なエラーを引き起こすと、フィードプロセッサは bozo ビットを設定します。エラーが発生する前にパースされたフィードのメタデータとエントリがあるかもしれません。
docnsIFeedContainerパースされたフィードあるいはエントリ。フィードでないものが処理された場合は null です。
headersnsIPropertiesフィードに伴って発生する HTTP レスポンスヘッダ。
stylesheetnsIURIフィードのソースを変換するために利用可能な XSLT スタイルシート。いくつかのフィードは処理命令 (processing instruction)にこの情報を含んでいます。それは一般に特定のフィードで動作するように設計されたクライアントで使うことが意図されています。
urinsIURI取り込んだフィードのアドレス。
versionAStringフィードのバージョン; フィードでないものが処理された場合は null です。値は以下のどれか一つになります: -
atom, rss2, rss09, rss091, rss091userland, rss092, rss1, atom03, atomEntry, rssItem
-
- -

メソッド

- -

registerExtensionPrefix()

- -

フィードあるいはエントリの【訳注: RSS また Atom の】拡張にアクセスするために使われる名前空間の接頭辞を登録する。

- -
警告: このメソッドは現時点では実装されていません。
- -
 void registerExtensionPrefix(
-   in AString namespace,
-   in AString prefix
- );
-
- -
パラメータ
- -
-
namespace
-
拡張の名前空間;prefix
-
拡張にアクセスするために使われる接頭辞
-
- -

参照

- -

nsISupports, nsIFeedContainer, nsIURI, nsIProperties

diff --git a/files/ja/mozilla/tech/xpcom/reference/xpcom_interface_reference/nsifeedresultlistener/index.html b/files/ja/mozilla/tech/xpcom/reference/xpcom_interface_reference/nsifeedresultlistener/index.html deleted file mode 100644 index 72dd667210..0000000000 --- a/files/ja/mozilla/tech/xpcom/reference/xpcom_interface_reference/nsifeedresultlistener/index.html +++ /dev/null @@ -1,50 +0,0 @@ ---- -title: nsIFeedResultListener -slug: Mozilla/Tech/XPCOM/Reference/XPCOM_Interface_Reference/nsIFeedResultListener -tags: - - Interfaces - - XPCOM - - XPCOM API Reference -translation_of: Mozilla/Tech/XPCOM/Reference/Interface/nsIFeedResultListener ---- -

nsIFeedResultListener インタフェースは、パース処理中のフィードパーサからイベントを受け取るためのプログラムによって実装されるべきです。

-


-

-
toolkit/components/feeds/public/nsIFeedListener.idlScriptable
- - -Please add a summary to this article. - - -
-  -最終更新: Gecko 1.8.1 (Firefox 2 / Thunderbird 2 / SeaMonkey 1.1)
-
-

継承元: nsISupports

-

メソッドの概要

- - - - - - -
void handleResult(in nsIFeedResult result);
-

メソッド

-

handleResult()

-

フィードの処理が完了したときに呼ばれます。処理中にエラーが発生しても、エラーが発生する前に処理された、フィードレベルのデータやエントリの妥当な (valid)データが利用できるかもしれません。進歩状況の表示などをしないなら、パースされたフィードを受け取るための実装に必要なものは、これがすべてです。

-
 void handleResult(
-   in nsIFeedResult result
- );
-
-
パラメータ
-
-
- <tt>result</tt>
-
- パースされたフィードを表す nsIFeedResult
-
-

参照

-

nsIFeedProgressListener, nsISupports

-

Interwiki link

-
-  
diff --git a/files/ja/mozilla/tech/xpcom/reference/xpcom_interface_reference/nsifeedtextconstruct/index.html b/files/ja/mozilla/tech/xpcom/reference/xpcom_interface_reference/nsifeedtextconstruct/index.html deleted file mode 100644 index 93ee41b0b8..0000000000 --- a/files/ja/mozilla/tech/xpcom/reference/xpcom_interface_reference/nsifeedtextconstruct/index.html +++ /dev/null @@ -1,94 +0,0 @@ ---- -title: nsIFeedTextConstruct -slug: Mozilla/Tech/XPCOM/Reference/XPCOM_Interface_Reference/nsIFeedTextConstruct -tags: - - Interfaces - - XPCOM - - XPCOM API Reference -translation_of: Mozilla/Tech/XPCOM/Reference/Interface/nsIFeedTextConstruct ---- -

nsIFeedTextConstruct インタフェースはプレーンテキストや HTML あるいは XHTML を含む RSS, Atom フィードのテキストフィールドを記述します。いくつかの拡張要素は "type" パラメータも含んでおり、このインタフェースはそれらも同様に記述します。

-


-

-
toolkit/components/feeds/public/nsIFeedTextConstruct.idlScriptable
- - -Please add a summary to this article. - - -
-  -最終更新: Gecko 1.8.1 (Firefox 2 / Thunderbird 2 / SeaMonkey 1.1)
-
-

継承元: nsISupports

-

実装元: @mozilla.org/feed-textconstruct;1。ユーザは通常、このインスタンスを直接作成する必要はありません。他の nsIFeednsIFeedEntry, nsIFeedContainer などのフィード関連のインタフェースは、nsIFeedTextConstruct を実装するオブジェクトを返す属性を持っています。

-

メソッドの概要

- - - - - - - - - -
nsIDOMDocumentFragment createDocumentFragment(in nsIDOMElement element);
AString plainText();
-

属性

- - - - - - - - - - - - - - - - - - - - - - - - - - - - -
属性説明
basensIURIテキスト構造物が HTML あるいは XHTML を含んでいた場合、コンテントの相対参照はこの base URI を使って解決されるべきです。
langAStringテキストの言語(アメリカ英語では "en-US")。
textAString実際のテキストコンテント。type が "html" か "xhtml" のどちらかではこの文字列はマークアップを含みます。
typeAString記述されているコンテントの種類; "text" か "html" あるいは "xhtml" のどれか一つ。
-

メソッド

-

createDocumentFragment()

-

与えられた DOM 要素の上に新しい document fragment を作ります。それはテキストと(もしテキストが HTML あるいは XHTML を構成しているなら)マークアップを含みます。

-
 nsIDOMDocumentFragment createDocumentFragment(
-   in nsIDOMElement element
- );
-
-
パラメータ
-
-
- <tt>element</tt>
-
- 新しい document fragment を作る要素。
-
-
戻り値
-

nsIDocumentFragment はテキストとマークアップを含みます。

-

plainText()

-

テキストを全てのマークアップを取り除き全てのエンティティをデコードしてプレーンテキストとして返します。

-
 AString plainText();
-
-
戻り値
-

テキスト構造物のコンテントのプレーンテキスト版。もし type 属性が "text" の場合、このメソッドは text 属性の変更されていない値を返します。

-

備考

-

もし ドキュメントの type が "html" あるいは "xhtml" の場合、"<" 文字はマークアップを意味します。その文字を表示するためには、"&lt;" のようなエスケープが使われなくてはなりません。type が "text" の場合、"<" 文字はそれ自身を表します。

-

参照

-

nsIDOMElement, nsIDocumentFragment

-

Interwiki link

-
-  
diff --git a/files/ja/mozilla/tech/xpcom/reference/xpcom_interface_reference/nsihttpactivitydistributor/index.html b/files/ja/mozilla/tech/xpcom/reference/xpcom_interface_reference/nsihttpactivitydistributor/index.html deleted file mode 100644 index dab28ff668..0000000000 --- a/files/ja/mozilla/tech/xpcom/reference/xpcom_interface_reference/nsihttpactivitydistributor/index.html +++ /dev/null @@ -1,68 +0,0 @@ ---- -title: nsIHttpActivityDistributor -slug: >- - Mozilla/Tech/XPCOM/Reference/XPCOM_Interface_Reference/nsIHttpActivityDistributor -translation_of: Mozilla/Tech/XPCOM/Reference/Interface/nsIHttpActivityDistributor ---- -

nsIHttpActivityDistributor インターフェースはHTTPの転送アクティビティを観察するクライアントを登録、あるいは登録解除するために使用されます。これは、特にデバッガーやトラフィックをモニタする目的に便利です。

-
-
netwerk/protocol/http/public/nsIHttpActivityObserver.idlScriptable
- - -Please add a summary to this article. - - -
-  -最終更新: Gecko 1.9.2 (Firefox 3.6 / Thunderbird 3.1 / Fennec 1.0)
-
-

継承元: nsIHttpActivityObserver

-

実装: @mozilla.org/network/http-activity-distributor;1. サービスにアクセスするには以下のようにします:

-
var httpDistrib = Components.classes["@mozilla.org/network/http-activity-distributor;1"]
-                            .getService(Components.interfaces.nsIHttpActivityDistributor);
-
-

メソッドの概要

- - - - - - - - - -
void addObserver(in nsIHttpActivityObserver aObserver);
void removeObserver(in nsIHttpActivityObserver aObserver);
-

メソッド

-

addObserver()

-

HTTPの転送アクティビティの通知を開始する。

-
void addObserver(
-  in nsIHttpActivityObserver aObserver
-);
-
-
-
-
- aObserver
-
- HTTPの転送アクティビティの通知を受ける nsIHttpActivityObserver  。 このオブジェクトの{ifmethod("nsIHttpActivityObserver", "observeActivity")}} メソッドが活動が起こる度に呼び出されます。
-
-

removeObserver()

-

HTTPの転送アクティビティの通知を停止する。

-
void removeObserver(
-  in nsIHttpActivityObserver aObserver
-);
-
-
-
-
- aObserver
-
- HTTPの転送アクティビティの通知を中止する nsIHttpActivityObserver
-
-  
-
-

参照

- diff --git a/files/ja/mozilla/tech/xpcom/reference/xpcom_interface_reference/nsihttpactivityobserver/index.html b/files/ja/mozilla/tech/xpcom/reference/xpcom_interface_reference/nsihttpactivityobserver/index.html deleted file mode 100644 index 782caa9682..0000000000 --- a/files/ja/mozilla/tech/xpcom/reference/xpcom_interface_reference/nsihttpactivityobserver/index.html +++ /dev/null @@ -1,172 +0,0 @@ ---- -title: nsIHttpActivityObserver -slug: Mozilla/Tech/XPCOM/Reference/XPCOM_Interface_Reference/nsIHttpActivityObserver -translation_of: Mozilla/Tech/XPCOM/Reference/Interface/nsIHttpActivityObserver ---- -

nsIHttpActivityObserver はデバッガーやトラフィックモニターのようなHTTPの転送アクティビティの通知を要求するクライアントにより実装されるインターフェースです。

-
-
netwerk/protocol/http/public/nsIHttpActivityObserver.idlScriptable
- - -Please add a summary to this article. - - -
-  -最終更新: Gecko 1.9.2 (Firefox 3.6 / Thunderbird 3.1 / Fennec 1.0)
-
-

継承元: nsISupports

-

メソッドの概要

- - - - - - -
void observeActivity(in nsISupports aHttpChannel, in PRUint32 aActivityType, in PRUint32 aActivitySubtype,
-                      in PRTime aTimestamp, in PRUint64 aExtraSizeData, in ACString aExtraStringSize);
-

 属性

- - - - - - - - - - - - - -
AttributeTypeDescription
isActiveboolean -

インターフェースがアクティブで、HTTPの活動を通知されたい場合は true、 それ以外の場合は false。 もし false の場合, observeActivity() メソッドは呼び出されない。

-
- 注意: この属性は互換性のためだけに存在するもので、使用されるべきではありません。
-
-

アクティビティタイプ定数

- - - - - - - - - - - - - - - - - - -
定数説明
ACTIVITY_TYPE_SOCKET_TRANSPORT0x0001Socket の転送活動が発生した。
ACTIVITY_TYPE_HTTP_TRANSPORT0x0002HTTP の転送活動が発生した。
-

アクティビティサブタイプ定数

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
定数説明
ACTIVITY_SUBTYPE_REQUEST_HEADER0x5001 -

HTTP リクエストが送信キューにキューイングされた。Observer は aExtraStringData からリクエストヘッダを参照できる。

-
ACTIVITY_SUBTYPE_REQUEST_BODY_SENT0x5002HTTP リクエストのボディが送信された。
ACTIVITY_SUBTYPE_RESPONSE_START0x5003HTTP レスポンスを受信し始めた。
ACTIVITY_SUBTYPE_RESPONSE_HEADER0x5004HTTPのレスポンスヘッダを受信した。
ACTIVITY_SUBTYPE_RESPONSE_COMPLETE0x5005HTTPのレスポンスを完全に受信し終えた。
ACTIVITY_SUBTYPE_TRANSACTION_CLOSE0x5006HTTPのトランザクションが閉じられた。
-

メソッド

-

observeActivity()

-

HTTPの転送アクティビティが発生した際に呼び出されます。HTTPの活動が発生した際に行うべき処理はこのメソッドに定義します。

-
void observeActivity(
-  in nsISupports aHttpChannel,
-  in PRUint32 aActivityType,
-  in PRUint32 aActivitySubtype,
-  in PRTime aTimestamp,
-  in PRUint64 aExtraSizeData,
-  in ACString aExtraStringData
-);
-
-
-
-
- aHttpChannel
-
- 活動が発生した HTTP チャンネル
-
- aActivityType
-
- 発生したアクティビティのタイプ; アクティビティタイプ定数で定義された値のうちの1つ。
-
- aActivitySubtype
-
- 発生したアクティビティのタイプをさらに細かく分類したサブタイプ。アクティビティのタイプが ACTIVITY_TYPE_SOCKET_TRANSPORT の場合、 この値は nsISocketTransport で定義された STATUS_* 定数のどれかになります。もしアクティビティのタイプが ACTIVITY_TYPE_HTTP_TRANSACTION の場合、この値は前述のアクティビティサブタイプ定数で定義された定数のどれかになります。
-
- aTimestamp
-
- 活動が発生した時刻です。1970年1月1日午前零時を基準とした経過時刻がマイクロ秒で表されます。
-
- aExtraSizeData
-
- 追加のサイズデータが利用できる場合にその値が渡されます。後述のアクティビティデータを扱うもご覧ください。
-
- aExtraStringData
-
- 追加の文字列データが利用できる場合にその値が渡されます。後述のアクティビティデータを扱うもご覧ください。
-
-

アクティビティデータを扱う

-

aActivityType および aActivitySubtype フィールドの値によって, aExtraSizeDataaExtraStringData パラメータは違う意味を持ちます。

-

ソケット転送アクティビティ

-

もしアクティビティのタイプが ACTIVITY_TYPE_SOCKET_TRANSPORT かつサブタイプが STATUS_SENDING_TO であれば、 aExtraSizeData パラメータは送信されたバイト数を含むことになります。1つの HTTP トランザクションは分割されたソケットの書き出しによって、複数のチャンクから構成される事があるため、それぞれのソケットアクティビティで通知されるのはそのチャンクで転送されたバイト数のみとなります。

-

HTTP トランザクションアクティビティ

-

通知されたアクティビティのタイプが ACTIVITY_TYPE_HTTP_TRANSACTION の場合、 追加のデータを含むものは3種類あります:

-
-
- ACTIVITY_SUBTYPE_REQUEST_HEADER
-
- aExtraStringData はヘッダの文字列を含みます。
-
- ACTIVITY_SUBTYPE_RESPONSE_HEADER
-
- aExtraStringData はレスポンスヘッダの文字列を含みます。
-
- ACTIVITY_SUBTYPE_RESPONSE_COMPLETE
-
- aExtraSizeData はトータルで受信したバイト数を含みます。
-
-

参照

- diff --git a/files/ja/mozilla/tech/xpcom/reference/xpcom_interface_reference/nsihttpchannel/index.html b/files/ja/mozilla/tech/xpcom/reference/xpcom_interface_reference/nsihttpchannel/index.html deleted file mode 100644 index 6a67b2c570..0000000000 --- a/files/ja/mozilla/tech/xpcom/reference/xpcom_interface_reference/nsihttpchannel/index.html +++ /dev/null @@ -1,569 +0,0 @@ ---- -title: nsIHttpChannel -slug: Mozilla/Tech/XPCOM/Reference/XPCOM_Interface_Reference/nsIHttpChannel -translation_of: Mozilla/Tech/XPCOM/Reference/Interface/nsIHttpChannel ---- -
-
netwerk/protocol/http/nsIHttpChannel.idlScriptable
- - -このインターフェイスでは、HTTPリクエストパラメータの変更、および結果として得られるHTTPレスポンスステータスとヘッダーが使用可能になった時点での検査が可能です。 - - -
-継承元: nsIChannel -最終更新: Gecko 1.3
-
- -

To create an HTTP channel, use nsIIOService with a HTTP URI, for example:

- -
var ios = Components.classes["@mozilla.org/network/io-service;1"]
-                    .getService(Components.interfaces.nsIIOService);
-var ch = ios.newChannel("https://www.example.com/", null, null);
-
- -

メソッド概要

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void getOriginalResponseHeader(in ACString aHeader, in nsIHttpHeaderVisitor aVisitor);
ACString getRequestHeader(in ACString aHeader);
ACString getResponseHeader(in ACString header);
boolean isNoCacheResponse();
boolean isNoStoreResponse();
void redirectTo(in nsIURI aNewURI);
void setEmptyRequestHeader(in ACString aHeader);
void setReferrerWithPolicy(in nsIURI referrer, in unsigned long referrerPolicy);
void setRequestHeader(in ACString aHeader, in ACString aValue, in boolean aMerge);
void setResponseHeader(in ACString header, in ACString value, in boolean merge);
void visitOriginalResponseHeaders(in nsIHttpHeaderVisitor aVisitor);
void visitRequestHeaders(in nsIHttpHeaderVisitor aVisitor);
void visitResponseHeaders(in nsIHttpHeaderVisitor aVisitor);
- -

Constants

- - - - - - - - - - - - - - - - - - - - - - - - - - - - -
ConstantDescription
REFERRER_POLICY_NO_REFERRER_WHEN_DOWNGRADEDefault; indicates not to pass on the referrer when downgrading from https to http
REFERRER_POLICY_NO_REFERRERIndicates no referrer will be sent
REFERRER_POLICY_ORIGINOnly send the origin of the referring URI
REFERRER_POLICY_ORIGIN_WHEN_XORIGINSame as the default; Only send the origin of the referring URI for cross-origin requests
REFERRER_POLICY_UNSAFE_URLAlways send the referrer, even when downgrading from https to http
- -

Attributes

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
AttributeTypeDescription
allowPipeliningboolean -

This attribute is a hint to the channel to indicate whether or not the underlying HTTP transaction should be allowed to be pipelined with other transactions. This should be set to false, for example, if the application knows that the corresponding document is likely to be very large.

- -

This attribute is true by default, though other factors may prevent pipelining.

- This attribute may only be set before the channel is opened. - -

Exceptions thrown

- -
-
NS_ERROR_FAILURE
-
If set after the channel has been opened.
-
-
redirectionLimitunsigned long -

This attribute specifies the number of redirects this channel is allowed to make. If zero, the channel will fail to redirect and will generate a NS_ERROR_REDIRECT_LOOP failure status.

- -
-

Note: An HTTP redirect results in a new channel being created. If the new channel supports nsIHttpChannel, then it will be assigned a value to its redirectionLimit attribute one less than the value of the redirected channel's redirectionLimit attribute. The initial value for this attribute may be a configurable preference (depending on the implementation).

-
-
referrernsIURI -

Get or set the URI of the HTTP Referer: header. This is the address (URI) of the resource from which this channel's URI was obtained (see RFC2616 section 14.36).

- -

This attribute may only be set before the channel is opened.

- -
-

Note: The channel may silently refuse to set the Referer: header if the URI does not pass certain security checks (e.g., a "https://" URL will never be sent as the referrer for a plaintext HTTP request). The implementation is not required to throw an exception when the referrer URI is rejected.

-
- -

Exceptions thrown

- -
-
NS_ERROR_IN_PROGRESS
-
If set after the channel has been opened.
-
NS_ERROR_FAILURE
-
If used for setting referrer during visitRequestHeaders(). Getting the value will not throw.
-
-
requestMethodACString -

Set or get the HTTP request method (default is "GET"). Setter is case insensitive; getter returns an uppercase string.

- -

This attribute may only be set before the channel is opened.

- -
-

Note: The data for a "POST" or "PUT" request can be configured via nsIUploadChannel. However, after setting the upload data, it may be necessary to set the request method explicitly. The documentation for nsIUploadChannel has further details.

-
- -

Exceptions thrown

- -
-
NS_ERROR_IN_PROGRESS
-
If set after the channel has been opened.
-
-
requestSucceededboolean -

Returns true if the HTTP response code indicates success. The value of nsIRequest.status() will be NS_OK even when processing a 404 File Not Found response because such a response may include a message body that (in some cases) should be shown to the user. Use this attribute to distinguish server error pages from normal pages, instead of comparing the response status manually against the set of valid response codes, if that is required by your application. Read only.

- -

Exceptions thrown

- -
-
NS_ERROR_NOT_AVAILABLE
-
If called before the response has been received (before onStartRequest()).
-
-
responseStatusunsigned longGet the HTTP response code (For example 200). Read only. -

Exceptions thrown

- -
-
NS_ERROR_NOT_AVAILABLE
-
If called before the response has been received (before onStartRequest()).
-
-
responseStatusTextACString -

Get the HTTP response status text (For example "OK").

- -
-

Note: This returns the raw (possibly 8-bit) text from the server. There are no assumptions made about the charset of the returned text. You have been warned!

-
- -

Read only.

- -

Exceptions thrown

- -
-
NS_ERROR_NOT_AVAILABLE
-
If called before the response has been received (before onStartRequest()).
-
-
referrerPolicy 読取専用 unsigned longThe referrer policy in use for this channel, indicated by one of the constants listed above
- -

Methods

- -

getOriginalResponseHeader()

- -

Get the value of a particular original response header, that is, in the same form as it came from the network. I.e. empty headers will have an empty string as value and multiple headers will not be merged as opposed to getResponseHeader().

- -
void getOriginalResponseHeader(
-  in ACString aHeader,
-  in nsIHttpHeaderVisitor aVisitor
-);
- -

Parameters

- -
-
aHeader
-
The case-insensitive name of the response header to query (For example "Set-Cookie").
-
- -
-
aVisitor
-
An nsIHttpHeaderVisitor instance allowing to visit all equally named response headers.
-
- -

Exceptions thrown

- -
-
NS_ERROR_NOT_AVAILABLE
-
If called before the response has been received (before onStartRequest()) or if no header with that name is set in the response.
-
- -

getRequestHeader()

- -

Get the value of a particular request header.

- -
ACString getRequestHeader(
-  in ACString aHeader
-);
-
- -

Parameters

- -
-
aHeader
-
The case-insensitive name of the request header to query (For example "Cache-Control").
-
- -

Return value

- -

The value of the request header.

- -

Exceptions thrown

- -
-
NS_ERROR_NOT_AVAILABLE
-
If the header is not set.
-
- -

getResponseHeader()

- -

Get the value of a particular response header.

- -
ACString getResponseHeader(
-  in ACString header
-);
-
- -

Parameters

- -
-
header
-
The case-insensitive name of the response header to query (For example "Set-Cookie").
-
- -

Return value

- -

The value of the response header.

- -

Exceptions thrown

- -
-
NS_ERROR_NOT_AVAILABLE
-
If called before the response has been received (before onStartRequest()) or if the header is not set in the response.
-
- -

isNoCacheResponse()

- -

Returns true if the server sent the equivalent of a "Cache-control: no-cache" response header. Equivalent response headers include: "Pragma: no-cache", "Expires: 0", and "Expires" with a date value in the past relative to the value of the "Date" header.

- -
boolean isNoCacheResponse();
-
- -

Parameters

- -

None.

- -

Return value

- -

Returns true if the server sent the equivalent of a "Cache-control: no-cache" response header, otherwise false.

- -

Exceptions thrown

- -
-
NS_ERROR_NOT_AVAILABLE
-
If called before the response has been received (before onStartRequest()).
-
- -

isNoStoreResponse()

- -
boolean isNoStoreResponse();
-
- -

Parameters

- -

None.

- -

Return value

- -

true if the server sent a "Cache-Control: no-store" response header.

- -

Exceptions thrown

- -
-
NS_ERROR_NOT_AVAILABLE
-
If called before the response has been received (before onStartRequest()).
-
- -

redirectTo()

- -

Instructs the channel to immediately redirect to a new destination. Can only be called on channels not yet opened.

- -

This method provides no explicit conflict resolution. The last caller to call it wins.

- -
void redirectTo(
-  in nsIURI aNewURI
-);
-
- -

Parameters

- -
-
aNewURI
-
The new URI to which we should redirect.
-
- -

Exceptions thrown

- -
-
NS_ERROR_ALREADY_OPENED
-
If called after the channel has been opened.
-
- -

setEmptyRequestHeader()

- -

This method is called to set an empty value for a particular request header. This should be used with caution in the cases where the behavior of setRequestHeader() ignoring empty header values is undesirable. This method may only be called before the channel is opened.

- -
void setEmptyRequestHeader(
-  in ACString aHeader
-);
-
- -

Parameters

- -
-
aHeader
-
The case-insensitive name of the request header to set (For example "Cookie").
-
- -

Exceptions thrown

- -
-
NS_ERROR_IN_PROGRESS
-
If called after the channel has been opened.
-
NS_ERROR_FAILURE
-
If called during visitRequestHeaders().
-
- -

setReferrerWithPolicy()

- -

Call this method to set the channel's referrer using the referrer policy indicated with one of the predefined constants.

- -
void setReferrerWithPolicy(
-  in nsIURI aReferrer,
-  in unsigned long aReferrerPolicy
-);
- -

Parameters

- -
-
aReferrer
-
The URI to base the referrer on.
-
aReferrerPolicy
-
The referrer policy to use when determining the referrer to use.
-
- -

Exceptions thrown

- -
-
NS_ERROR_FAILURE
-
If called during visitRequestHeaders().
-
- -

setRequestHeader()

- -

This method is called to set the value of a particular request header. This method allows, for example, the cookies module to add "Cookie" headers to the outgoing HTTP request. This method may only be called before the channel is opened. If aValue is empty and aMerge is false, the header will be cleared.

- -
void setRequestHeader(
-  in ACString aHeader,
-  in ACString aValue,
-  in boolean aMerge
-);
-
- -

Parameters

- -
-
aHeader
-
The case-insensitive name of the request header to query (For example "Cookie").
-
aValue
-
The request header value to set (For example "X=1").
-
aMerge
-
If true, the new header value will be merged with any existing values for the specified header. This flag is ignored if the specified header does not support merging (For example the "Content-Type" header can only have one value). The list of headers for which this flag is ignored is an implementation detail. If this flag is false, then the header value will be replaced with the contents of aValue.
-
- -

Exceptions thrown

- -
-
NS_ERROR_IN_PROGRESS
-
If called after the channel has been opened.
-
NS_ERROR_FAILURE
-
If called during visitRequestHeaders().
-
- -

setResponseHeader()

- -

Set the value of a particular response header. This method allows, for example, the HTML content sink to inform the HTTP channel about HTTP-EQUIV headers found in HTML <META> tags. If value is empty and merge is false, the header will be cleared.

- -
void setResponseHeader(
-  in ACString header,
-  in ACString value,
-  in boolean merge
-);
-
- -

Parameters

- -
-
header
-
The case-insensitive name of the response header to set(For example "Cache-Cookie").
-
value
-
The response header value to set (For example "no-cache").
-
merge
-
If true, the new header value will be merged with any existing values for the specified header. This flag is ignored if the specified header does not support merging (For example the "Content-Type" header can only have one value). The list of headers for which this flag is ignored is an implementation detail. If this flag is false, then the header value will be replaced with the contents of value.
-
- -

Exceptions thrown

- -
-
NS_ERROR_NOT_AVAILABLE
-
If called before the response has been received (before onStartRequest()).
-
NS_ERROR_ILLEGAL_VALUE
-
If changing the value of this response header is not allowed.
-
NS_ERROR_FAILURE
-
If called during visitResponseHeaders(), visitOriginalResponseHeaders() or getOriginalResponseHeader().
-
- -

visitOriginalResponseHeaders()

- -

Call this method to visit all original response headers, that is, in the same form as they came from the network. I.e. empty headers will be have an empty string as value and multiple headers will not be merged as opposed to visitResponseHeaders().

- -
-

Warning: Calling setResponseHeader() while visiting response headers will return a NS_ERROR_FAILURE.

-
- -
void visitOriginalResponseHeaders(
-  in nsIHttpHeaderVisitor aVisitor
-);
-
- -

Parameters

- -
-
aVisitor
-
An nsIHttpHeaderVisitor instance allowing to visit all original response headers.
-
- -

visitRequestHeaders()

- -

Call this method to visit all request headers.

- -
-

Warning: Calling setRequestHeader()setReferrerWithPolicy() or setEmptyRequestHeader() while visiting request headers has undefined behavior until Gecko 47 (Firefox 47.0 / Thunderbird 47.0 / SeaMonkey 2.44). Starting from Gecko 48 (Firefox 48.0 / Thunderbird 48.0 / SeaMonkey 2.45) they will return a NS_ERROR_FAILURE.

-
- -
void visitRequestHeaders(
-  in nsIHttpHeaderVisitor aVisitor
-);
-
- -

Parameters

- -
-
aVisitor
-
The header visitor instance.
-
- -

visitResponseHeaders()

- -

Call this method to visit all response headers.

- -
-

Warning: Calling setResponseHeader() while visiting response headers has undefined behavior until Gecko 48 (Firefox 48.0 / Thunderbird 48.0 / SeaMonkey 2.45). Starting from Gecko 49 (Firefox 49.0 / Thunderbird 49.0 / SeaMonkey 2.46) it will return a NS_ERROR_FAILURE.

-
- -
void visitResponseHeaders(
-  in nsIHttpHeaderVisitor aVisitor
-);
-
- -

Parameters

- -
-
aVisitor
-
The header visitor instance.
-
- -

Exceptions thrown

- -
-
NS_ERROR_NOT_AVAILABLE
-
If called before the response has been received (before onStartRequest()).
-
- -
-

Note: Starting from Firefox 49, empty headers will be returned in case the preference network.http.keep_empty_response_headers_as_empty_string is set to true. Since Firefox 50 the preference defaults to true.

-
diff --git a/files/ja/mozilla/tech/xpcom/reference/xpcom_interface_reference/nsiidleservice/index.html b/files/ja/mozilla/tech/xpcom/reference/xpcom_interface_reference/nsiidleservice/index.html deleted file mode 100644 index 5118321489..0000000000 --- a/files/ja/mozilla/tech/xpcom/reference/xpcom_interface_reference/nsiidleservice/index.html +++ /dev/null @@ -1,135 +0,0 @@ ---- -title: nsIIdleService -slug: Mozilla/Tech/XPCOM/Reference/XPCOM_Interface_Reference/nsIIdleService -tags: - - Interfaces - - MDC Project - - NeedsContent - - XPCOM - - XPCOM API Reference -translation_of: Mozilla/Tech/XPCOM/Reference/Interface/nsIIdleService ---- -

« XPCOM API Reference

-
-
widget/public/nsIIdleService.idlScriptable
- - -Please add a summary to this article. - - -
-  -最終更新: Gecko 1.9a
-
-

概要

-

アイドルサービスは、ユーザがどのくらいの時間「アイドル状態」であるか、つまり、マウスやキーボードなどを使っていない時間を監視できるようにするサービスです。アイドル時間を直接取得することも可能ですが、所定の間隔でオブザーバを登録する使い方が一般的でしょう。

-

現在のところ、nsIIdleService の実装は、Windows、Mac OS X、Linux (XScreenSaver を通じて) に対応しています。

-

実装は @mozilla.org/widget/idleservice;1 で行われています。インスタンスを作成するには、以下のように記述します。

-
var idleService = Components.classes["@mozilla.org/widget/idleservice;1"]
-                            .getService(Components.interfaces.nsIIdleService)
-
-

メソッドの概要

- - - - - - - - - -
void addIdleObserver(in nsIObserver observer, in unsigned long time)
void removeIdleObserver(in nsIObserver observer, in unsigned long time)
-

属性

- - - - - - - - - - - - - -
属性説明
idleTimelongユーザが最後に操作を行ってから経過したミリ秒単位での時間。 - - 読み取り専用 -
-

メソッド

-

addIdleObserver()

-

ユーザの操作が一定時間アイドル状態になった場合や、アイドル状態から復帰した際に通知を受けるオブザーバを追加します。

-
void addIdleObserver(
-  in nsIObserver observer,
-  in unsigned long time
-)
-
-
パラメータ
-
-
- <tt>observer</tt>
-
- 通知を受ける オブザーバ
-
-
-
- <tt>time</tt>
-
- オブザーバに通知が行われるまでのユーザのアイドル時間 (秒)
-
-
備考
- - - -

removeIdleObserver()

-

addIdleObserver で登録されたオブザーバを削除します。

-
void removeIdleObserver(
-  in nsIObserver observer,
-  in unsigned long time
-)
-
-
パラメータ
-
-
- <tt>observer</tt>
-
- 削除する オブザーバ
-
-
-
- <tt>time</tt>
-
- オブザーバに通知が行われるまでのユーザのアイドル時間 (秒)
-
-
備考
-

オブザーバの削除は、指定したアイドル時間のオブザーバについて 1 回だけ行われます。オブザーバを複数追加した場合は、個別に削除する必要があります。

-

サンプルコード

-

例 1:

-
var idleService = Components.classes["@mozilla.org/widget/idleservice;1"]
-                            .getService(Components.interfaces.nsIIdleService)
-setTimeout(function() { alert(idleService.idleTime) }, 1000)
-// このコードを追加した後、マウスやキーボードを操作しないと、
-// 1000 前後の数字が警告ダイアログで表示されます。
-
-

例 2:

-
var idleService = Components.classes["@mozilla.org/widget/idleservice;1"]
-                            .getService(Components.interfaces.nsIIdleService)
-var idleObserver = {
-  observe: function(subject, topic, data) {
-    alert("topic: " + topic + "\ndata: " + data);
-  }
-};
-idleService.addIdleObserver(idleObserver, 60); // 1 分
-// ...
-// removeIdleObserver を使ってオブザーバを削除するのを忘れずに!
-idleService.removeIdleObserver(idleObserver, 60);
-
-
-  
diff --git a/files/ja/mozilla/tech/xpcom/reference/xpcom_interface_reference/nsiinputstream/index.html b/files/ja/mozilla/tech/xpcom/reference/xpcom_interface_reference/nsiinputstream/index.html deleted file mode 100644 index 46174421ec..0000000000 --- a/files/ja/mozilla/tech/xpcom/reference/xpcom_interface_reference/nsiinputstream/index.html +++ /dev/null @@ -1,65 +0,0 @@ ---- -title: nsIInputStream -slug: Mozilla/Tech/XPCOM/Reference/XPCOM_Interface_Reference/nsIInputStream -tags: - - Interfaces - - 'Interfaces:Frozen' - - 'Interfaces:Scriptable' - - XPCOM - - XPCOM API Reference -translation_of: Mozilla/Tech/XPCOM/Reference/Interface/nsIInputStream ---- -

« XPCOM API Reference

-

概要

-

nsIInputStream インターフェースは、読み込み可能なデータソースを表します。

-
  #include "nsIInputStream.h"
-
-  [scriptable, uuid=(fa9c7f6c-61b3-11d4-9877-00c04fa0cf4a)]
-  interface nsIInputStream : nsISupports { ... };
-
-
-
xpcom/io/nsIInputStream.idlScriptable
- - -Please add a summary to this article. - - -
-  -最終更新: Gecko 1.0
-
-

メソッド

-
-
- close
-
- このメソッドは、入力ストリームを閉じます。
-
-
-
- available
-
- このメソッドは、現在ストリームから読み込み可能なバイトサイズを返します。
-
-
-
- read
-
- このメソッドは、データをストリームからバッファにコピーします。scriptable ではありません。
-
-
-
- readSegments
-
- このメソッドは、ストリームの内部バッファへのダイレクトアクセスを提供します。scriptable ではありません。
-
-
-
- isNonBlocking
-
- このメソッドは、ストリームが非ブロッキングならtrueを返します。
-
-

履歴

-

このインターフェースは Mozilla 1.0で凍結されました。詳細は バグ 124465 を見てください。

-
-  
diff --git a/files/ja/mozilla/tech/xpcom/reference/xpcom_interface_reference/nsiioservice/index.html b/files/ja/mozilla/tech/xpcom/reference/xpcom_interface_reference/nsiioservice/index.html deleted file mode 100644 index ef8ffd9671..0000000000 --- a/files/ja/mozilla/tech/xpcom/reference/xpcom_interface_reference/nsiioservice/index.html +++ /dev/null @@ -1,456 +0,0 @@ ---- -title: nsIIOService -slug: Mozilla/Tech/XPCOM/Reference/XPCOM_Interface_Reference/nsIIOService -tags: - - XPCOM -translation_of: Mozilla/Tech/XPCOM/Reference/Interface/nsIIOService ---- -
-
netwerk/base/public/nsIIOService.idlScriptable
- - -This interface provides a set of URL parsing utility functions. These are provided as a convenience to the programmer and in some cases to improve performance by eliminating intermediate data structures and interfaces. - - -
-継承元: nsISupports -最終更新: Gecko 1.2
-
- -

This interface duplicates many of the nsIProtocolHandler methods in a protocol handler independent way (For example newURI() inspects the scheme in order to delegate creation of the new URI to the appropriate protocol handler).

- -
註: nsIIOService may only be used from the main thread.
- -

Implemented by @mozilla.org/network/io-service;1 as a service:

- -
var iOService = Components.classes["@mozilla.org/network/io-service;1"]
-                .getService(Components.interfaces.nsIIOService);
-
- -

メソッドの概要

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
boolean allowPort(in long aPort, in string aScheme);
ACString extractScheme(in AUTF8String urlString);
unsigned long getProtocolFlags(in string aScheme);
nsIProtocolHandler getProtocolHandler(in string aScheme);
nsIChannel newChannel(in AUTF8String aSpec, in string aOriginCharset, in nsIURI aBaseURI); Gecko 48 で廃止
nsIChannel newChannel2(in AUTF8String aSpec, in string aOriginCharset, in nsIURI aBaseURI, in nsIDOMNode aLoadingNode, in nsIPrincipal aLoadingPrincipal, in nsIPrincipal aTriggeringPrincipal, in uint32_t aSecurityFlags, in uint32_t aContentPolicyType);
nsIChannel newChannelFromURI(in nsIURI aURI); Gecko 48 で廃止
nsIChannel newChannelFromURI2(in nsIURI aURI, in nsIDOMNode aLoadingNode, in nsIPrincipal aLoadingPrincipal, in nsIPrincipal aTriggeringPrincipal, in unsigned long aSecurityFlags, in unsigned long aContentPolicyType);
nsIChannel newChannelFromURIWithLoadInfo(in nsIURI aURI, in nsILoadInfo aLoadInfo);
nsIChannel newChannelFromURIWithProxyFlags2(in nsIURI aURI, in nsIURI aProxyURI, in uint32_t aProxyFlags,in nsIDOMNode aLoadingNode, in nsIPrincipal aLoadingPrincipal, in nsIPrincipal aTriggeringPrincipal, in uint32_t aSecurityFlags, in uint32_t aContentPolicyType);
nsIURI newFileURI(in nsIFile aFile);
nsIURI newURI(in AUTF8String aSpec, in string aOriginCharset, in nsIURI aBaseURI);
- -

属性

- - - - - - - - - - - - - - -
AttributeTypeDescription
offlinebooleanReturns true if networking is in "offline" mode. When in offline mode, attempts to access the network will fail (although this does not necessarily correlate with whether there is actually a network available -- that's hard to detect without causing the dialer to come up). Observers will be notified of changes to this attribute.
- -

メソッド

- -

allowPort()

- -

Checks if a port number is banned. This involves consulting a list of unsafe ports, corresponding to network services that may be easily exploitable. If the given port is considered unsafe, then the protocol handler (corresponding to aScheme) will be asked whether it wishes to override the IO service's decision to block the port. This gives the protocol handler ultimate control over its own security policy while ensuring reasonable, default protection.

- -

Is similar to nsIProtocolHandler.allowPort().

- -
boolean allowPort(
-  in long aPort,
-  in string aScheme
-);
-
- -
Parameters
- -
-
aPort
-
The port to check
-
aScheme
-
The scheme for the protocol handler that could override the IOService's decision.
-
- -
Return value
- -

true if the port is allowed, false otherwise.

- -

extractScheme()

- -

Utility to extract the scheme from a URL string, consistently and according to spec (see RFC 3986).

- -
註:  Most URL parsing is done via nsIURI, and in fact the scheme can also be extracted from a URL string via nsIURI. This method is provided purely as an optimization.
- -
ACString extractScheme(
-  in AUTF8String urlString
-);
-
- -
Parameters
- -
-
urlString
-
The string for the URL to extract the scheme from.
-
- -
Return value
- -

A string corresponding to the scheme.

- -
Exceptions thrown
- -
-
NS_ERROR_MALFORMED_URI
-
If URL string is not of the right form.
-
- -

getProtocolFlags()

- -

Returns the protocol flags for a given scheme.

- -
unsigned long getProtocolFlags(
-  in string aScheme
-);
-
- -
Parameters
- -
-
aScheme
-
The scheme for which to get the protocol flags.
-
- -
Return value
- -

The value of the protocolFlags attribute for the corresponding nsIProtocolHandler.

- -

getProtocolHandler()

- -

Returns a protocol handler for a given URI scheme.

- -
nsIProtocolHandler getProtocolHandler(
-  in string aScheme
-);
-
- -
Parameters
- -
-
aScheme
-
The URI scheme for which to get a protocol handler.
-
- -
Return value
- -

An nsIProtocolHandler for the scheme.

- -

newChannel()

- -

Gecko 48 で廃止
- newURI()newChannelFromURI() の重複した呼び出しを避けるショートカットメソッドです。

- -
nsIChannel newChannel(
-  in AUTF8String aSpec,
-  in string aOriginCharset,
-  in nsIURI aBaseURI
-);
-
- -
Parameters
- -
-
aSpec
-
希望するuriのためのスペックです。
-
aOriginCharset
-
uriのためのキャラクタセットです。たぶんnullになるでしょう。
-
aBaseURI
-
スペックのためベースURLです。たぶんnullになるでしょう。もしaSpecが相対パスだった時このパラメーターは無視されます。
-
- -
Return value
- -

Returns an nsIChannel based on aSpec and aBaseURI.

- -

newChannel2()

- -

newURI()newChannelFromURI()の再呼び出しを避けるためのショートカットメソッドです。

- -
nsIChannel newChannel2(
-   in AUTF8String aSpec,
-   in string aOriginCharset,
-   in nsIURI aBaseURI,
-   in nsIDOMNode aLoadingNode,
-   in nsIPrincipal aLoadingPrincipal,
-   in nsIPrincipal aTriggeringPrincipal,
-   in uint32_t aSecurityFlags,
-   in uint32_t aContentPolicyType,
-
-);
-
- -
Parameters
- -
-
aSpec
-
-

希望するuriのためのスペックです。

-
-
aOriginCharset
-
uriのためのキャラクタセットです。たぶんnullになるでしょう。
-
aBaseURI
-
スペックのためベースURLです。たぶんnullになるでしょう。もしaSpecが相対パスだった時このパラメーターは無視されます。
-
aLoadingNode
-
チャンネルのloadingDocumentです。この要素やドキュメントがリクエストの結果として使われるでしょう。これはこのリクエストへの結果としてアクセスされる要素やドキュメントです。例として画像をロードする場合、これはイメージがロードされるドキュメントになります。そしてCSSの場合、 レンダリングがこのスタイルシートに影響を与えられるキュメントになります。もし可能なら、ロードが実行される要素を渡します。しかしもしロードが XMLHttpRequestなどのJS API やforなどで複数の要素に渡って合体される場合は代わりにDocumentノードに渡します。ロードがアドオンや内部のブラウザ機能から来るようにロードがどんなドキュメントにも関連していない場合、nullを使います。
-
aLoadingPrincipal
-
チャンネルにロードするもののPrincipalです。 リクエストの結果としてこのドキュメントのprincipalが使用されます。 この値のデフォルトは aLoadingNode のprincipalです。そのため、もし aLoadingNode が渡された場合は、nullとして残すことができます。 しかし、aLoadingNode が null としてロードされている場合は、値を渡す必要があります。 例としてWebWorkerからロードする場合を考えてみます。この場合はworkerのprincipalを渡します。アドオンやブラウザ内部からロードする場合は、 system principalを渡します。This principal should almost always be the system principal if aLoadingNode is null. The only exception to this is for loads from WebWorkers since they don't have any nodes to be passed as aLoadingNode. Please note, aLoadingPrincipal is *not* the principal of the resource being loaded. But rather the principal of the context where the resource will be used.
-
aTriggeringPrincipal
-
The triggeringPrincipal of the load. The triggeringPrincipal is the principal of the resource that caused this particular URL to be loaded. Most likely the triggeringPrincipal and the loadingPrincipal are identical, in which case the triggeringPrincipal can be left out. In some cases the loadingPrincipal and the triggeringPrincipal are different however, e.g. a stylesheet may import a subresource. In that case the principal of the stylesheet which contains the import command is the triggeringPrincipal, and the principal of the document whose rendering is affected is the loadingPrincipal.
-
aSecurityFlags
-
このchannelのsecurityFlagsです。すべてのsecurityFlagsはnsILoadInfoで定義されています。
-
aContentPolicyType
-
このchannelのcontentPolicyTypeです。すべてのcontentPolicytypeはnsIContentPolicyで定義されています。
-
【訳注: アドオン開発者が暫定的に使う場合はTYPE_OTHERを使う。firefox開発者はTYPE_OTHERを使うのは避けるべきです】
-
【訳注: nsIContentPolicyがincludeしている nsIContentPolicyBase.idl に書いてあるっぽいです】
-
- -
 
- -
Return value
- -

aSpecやaBaseURIに基づいた nsIChannel を返します

- -

newChannelFromURI()

- -

Gecko 48 で廃止

- -

与えられたURIのチャンネルを作成します

- -
nsIChannel newChannelFromURI(
-  in nsIURI aURI
-);
-
- -
Parameters
- -
-
aURI
-
An nsIURI from which to make a channel.
-
- -
Return value
- -

An nsIChannel for the uri.

- -

newChannelFromURI2()

- -

Creates a channel for a given URI.

- -
nsIChannel newChannelFromURI2(
-  in nsIURI aURI,
-  in nsIDOMNode aLoadingNode,
-  in nsIPrincipal aLoadingPrincipal,
-  in nsIPrincipal aTriggeringPrincipal,
-  in unsigned long aSecurityFlags,
-  in unsigned long aContentPolicyType
-);
- -

Please note, if you provide both a loadingNode and a loadingPrincipal, then loadingPrincipal must be equal to loadingNode->NodePrincipal(). But less error prone is to just supply a loadingNode.

- -

Keep in mind that URIs coming from a webpage should never use the systemPrincipal as the loadingPrincipal.

- -
Parameters
- -
-
aURI
-
An nsIURI from which to make a channel.
-
aLoadingNode
-
The loadingDocument of the channel.
- The element or document where the result of this request will be used. This is the document/element that will get access to the result of this request. For example for an image load, it's the document in which the image will be loaded. And for a CSS stylesheet it's the document whose rendering will be affected by the stylesheet. If possible, pass in the element which is performing the load. But if the load is coming from a JS API (such as XMLHttpRequest) or if the load might be coalesced across multiple elements (such as for <img>) then pass in the Document node instead.
-
- For loads that are not related to any document, such as loads coming from addons or internal browser features, use null here.
-
aLoadingPrincipal                                                     
-
The loadingPrincipal of the channel.
-
- The principal of the document where the result of this request will be used.
-
- This defaults to the principal of aLoadingNode, so when aLoadingNode is passed this can be left as null. However for loads where aLoadingNode is null this argument must be passed.  For example for loads from a WebWorker, pass the principal of that worker. For loads from an addon or from internal browser features, pass the system principal. This principal should almost always be the system principal if aLoadingNode is null. The only exception to this is for loads from WebWorkers since they don't have any nodes to be passed as aLoadingNode. Please note, aLoadingPrincipal is *not* the principal of the resource being loaded. But rather the principal of the context here the resource will be used.
-
aTriggeringPrincipal                                                  
-
The triggeringPrincipal of the load.
-
- The triggeringPrincipal is the principal of the resource that caused this particular URL to be loaded. Most likely the triggeringPrincipal and the loadingPrincipal are identical, in which case the triggeringPrincipal can be left out. In some cases the loadingPrincipal and the triggeringPrincipal are different however, e.g. a stylesheet may import a subresource. In that case the principal of the stylesheet which contains the import command is the triggeringPrincipal, and the principal of the document whose rendering is affected is the loadingPrincipal.
-
aSecurityFlags                                                        
-
The securityFlags of the channel. Any of the securityflags defined in nsILoadInfo.idl
-
aContentPolicyType                                                        
-
The contentPolicyType of the channel. Any of the content types defined in nsIContentPolicy.idl              
-
- -
Return value
- -

An nsIChannel for the uri.

- -

newChannelFromURIWithLoadInfo()

- -

Creates a channel for a given URI. Equivalent to newChannelFromURI2(aURI, aLoadingNode, ...)

- -
nsIChannel newChannelFromURIWithLoadInfo(
-  in nsIURI aURI,
-  in nsILoadInfo aLoadInfo
-);
- -
Parameters
- -
-
aURI
-
An nsIURI from which to make a channel.
-
aLoadInfo
-
A load info object.
-
- -
Return value
- -

An nsIChannel for the uri.

- -

newChannelFromURIWithProxyFlags2()

- -


- Creates a channel for a given URI. Equivalent to newChannelFromURI2(aURI, aLoadingNode, ...)

- -
nsIChannel newChannelFromURIWithProxyFlags2(
-  in nsIURI aURI,
-  in nsIURI aProxyURI,
-  in uint32_t aProxyFlags,
-  in nsIDOMNode aLoadingNode,
-  in nsIPrincipal aLoadingPrincipal,
-  in nsIPrincipal aTriggeringPrincipal,
-  in uint32_t aSecurityFlags,
-  in uint32_t aContentPolicyType
-);
- -
Parameters
- -
-
aURI
-
An nsIURI from which to make a channel.
-
aProxyURI
-
nsIURI to use for proxy resolution. Can be null in which case aURI is used.
-
aPorxyFlags
-
Flags from nsIProtocolProxyService to use when resolving proxies for this new channel.
-
aLoadingNode
-
The loadingDocument of the channel. The element or document where the result of this request will be used. This is the document/element that will get access to the result of this request. For example for an image load, it's the document in which the image will be loaded. And for a CSS stylesheet it's the document whose rendering will be affected by the stylesheet. If possible, pass in the element which is performing the load. But if the load is coming from a JS API (such as XMLHttpRequest) or if the load might be coalesced across multiple elements (such as for ) then pass in the Document node instead. For loads that are not related to any document, such as loads coming from addons or internal browser features, use null here.
-
aLoadingPrincipal
-
The loadingPrincipal of the channel. The principal of the document where the result of this request will be used. This defaults to the principal of aLoadingNode, so when aLoadingNode is passed this can be left as null. However for loads where aLoadingNode is null this argument must be passed. For example for loads from a WebWorker, pass the principal of that worker. For loads from an addon or from internal browser features, pass the system principal. This principal should almost always be the system principal if aLoadingNode is null. The only exception to this is for loads from WebWorkers since they don't have any nodes to be passed as aLoadingNode. Please note, aLoadingPrincipal is *not* the principal of the resource being loaded. But rather the principal of the context where the resource will be used.
-
aTriggeringPrincipal
-
The triggeringPrincipal of the load. The triggeringPrincipal is the principal of the resource that caused this particular URL to be loaded. Most likely the triggeringPrincipal and the loadingPrincipal are identical, in which case the triggeringPrincipal can be left out. In some cases the loadingPrincipal and the triggeringPrincipal are different however, e.g. a stylesheet may import a subresource. In that case the principal of the stylesheet which contains the import command is the triggeringPrincipal, and the principal of the document whose rendering is affected is the loadingPrincipal.
-
aSecurityFlags
-
The securityFlags of the channel. Any of the securityflags defined in nsILoadInfo.
-
aContentPolicyType
-
The contentPolicyType of the channel. Any of the content types defined in nsIContentPolicy.
-
- -
Return value
- -

An nsIChannel for the uri.

- -

newFileURI()

- -

This method constructs a new URI from a nsIFile.

- -
nsIURI newFileURI(
-  in nsIFile aFile
-);
-
- -
Parameters
- -
-
aFile
-
The nsIFile whose URI is desired.
-
- -
Return value
- -

An nsIURI corresponding to the file.

- -

newURI()

- -

This method constructs a new URI by determining the scheme of the URI spec, and then delegating the construction of the URI to the protocol handler for that scheme. QueryInterface can be used on the resulting URI object to obtain a more specific type of URI.

- -
nsIURI newURI(
-  in AUTF8String aSpec,
-  in string aOriginCharset,
-  in nsIURI aBaseURI
-);
-
- -
Parameters
- -
-
aSpec
-
The spec for the desired uri.
-
aOriginCharset
-
The charset for the uri. May be null.
-
aBaseURI
-
The base URI for the spec. May be null. If aSpec is an absolute URL, this parameter is ignored.
-
- -
Return value
- -

An nsIURI object corresponding to aSpec and aBaseURI.

- -
Exceptions thrown
- -
-
NS_ERROR_MALFORMED_URI
-
If URI does not begin with a valid scheme (as defined by RFC 3986) followed by a colon.
-
- -

備考

- -
註:  The proper way to create a new nsIURI is with newURI() method defined above. Do NOT create a new nsIURI with createInstance().
- -

This was a frozen interface see バグ 157131 for details. From Gecko 2.0 interfaces are no longer frozen.

- -

関連項目

- - diff --git a/files/ja/mozilla/tech/xpcom/reference/xpcom_interface_reference/nsijscid/index.html b/files/ja/mozilla/tech/xpcom/reference/xpcom_interface_reference/nsijscid/index.html deleted file mode 100644 index 0b472eba03..0000000000 --- a/files/ja/mozilla/tech/xpcom/reference/xpcom_interface_reference/nsijscid/index.html +++ /dev/null @@ -1,24 +0,0 @@ ---- -title: nsIJSCID -slug: Mozilla/Tech/XPCOM/Reference/XPCOM_Interface_Reference/nsIJSCID -tags: - - Interfaces - - XPCOM - - XPCOM API Reference -translation_of: Mozilla/Tech/XPCOM/Reference/Interface/nsIJSCID ---- -

« XPCOM API Reference

-

概要

-

コンポーネントのインスタンス化とサービスコンポーネントの利用を可能にするための機能を、nsIJSCIDインターフェイスは提供します。

-
[scriptable, uuid(e3a24a60-d651-11d2-9843-006008962422)]
-interface nsIJSCID : nsIJSID { ... };
-
-

メソッド

-

createInstance

-
nsISupports createInstance();
-
-

getService

-
nsISupports getService();
-
-

関連項目

-

createInstance()メソッドとgetService()メソッドの使い方は、Components.classesを参照してください。

diff --git a/files/ja/mozilla/tech/xpcom/reference/xpcom_interface_reference/nsijson/index.html b/files/ja/mozilla/tech/xpcom/reference/xpcom_interface_reference/nsijson/index.html deleted file mode 100644 index 2e8d1beca3..0000000000 --- a/files/ja/mozilla/tech/xpcom/reference/xpcom_interface_reference/nsijson/index.html +++ /dev/null @@ -1,165 +0,0 @@ ---- -title: nsIJSON -slug: Mozilla/Tech/XPCOM/Reference/XPCOM_Interface_Reference/nsIJSON -tags: - - Interfaces - - XPCOM - - XPCOM API Reference -translation_of: Mozilla/Tech/XPCOM/Reference/Interface/nsIJSON ---- -

-

草案
- このページは完成していません。

- -
nsIJSON インタフェースは、JavaScript コードから JSON 文字列をエンコード、デコードする便利な方法を提供します。 -
- 注: このインタフェースは JavaScript コードからのみ利用されます。
-


-

-
dom/public/idl/json/nsIJSON.idlScriptable
- - -Please add a summary to this article. - - -
-  -最終更新: Gecko 1.9 (Firefox 3)
-
-

継承元: nsISupports

-

実装: @mozilla.org/dom/json;1 インスタンスを作成するには、以下のように記述します。

-
var nativeJSON = Components.classes["@mozilla.org/dom/json;1"]
-                 .createInstance(Components.interfaces.nsIJSON);
-
-

メソッドの概要

-
註: IDL ファイルには、コメントアウトされた IDL が一部含まれています。これは、その部分が IDL で適切に記述できないことを表現しているのが原因です。ただし、この記事の目的に照らし合わせて、実在するかのように説明し、この問題を意図的に無視しています。
- - - - - - - - - - - - - - - -
JSObject decode(in AString str, [optional] in JSObject whitelist);
JSObject decodeFromStream(in nsIInputStream stream, in long contentLength, [optional] in JSObject optFilter);
AString encode(in JSObject value, [optional] in JSObject whitelist);
void encodeToStream(in nsIOutputStream stream, in string charset, in boolean writeBOM, in JSObject value, [optional] in JSObject optFilter);
-

メソッド

-

decode()

-

JSON 文字列をデコードします。JavaScript オブジェクトが存在する場合はそのオブジェクトを返します。

-
 JSObject decode(
-   in AString str,
-   [optional] in JSObject whitelist
- );
-
-
引数
-
-
- <tt>str</tt>
-
- デコードする JSON 文字列。
-
- <tt>whitelist</tt>
-
-  ?
-
-
戻り値
-

JSON 文字列から再構築された、元の JavaScript オブジェクト。

-

decodeFromStream()

-

入力ストリームから読み出した JSON 文字列をデコードします。JavaScript オブジェクトが存在する場合はそのオブジェクトを返します。

-
 JSObject decodeFromStream(
-   in nsIInputStream stream,
-   in long contentLength,
-   [optional] in JSObject optFilter
- );
-
-
引数
-
-
- <tt>stream</tt>
-
- JSON 文字列を読み出す nsIInputStream
-
- <tt>contentLength</tt>
-
- 読み出す JSON 文字列の長さ。
-
- <tt>optFilter</tt>
-
-  ?
-
-
戻り値
-

JSON 文字列から再構築された、元の JavaScript オブジェクトを表す JSObject

-

encode()

-

JavaScript オブジェクトを JSON 文字列へエンコードします。

-
 AString encode(
-   in JSObject value,
-   [optional] in JSObject whitelist
- );
-
-
引数
-
-
- <tt>value</tt>
-
- エンコードする JavaScript オブジェクト。
-
- <tt>whitelist</tt>
-
-  ?
-
-
戻り値
-

オブジェクトを表す JSON 文字列。

-

encodeToStream()

-

JavaScript オブジェクトを JSON 文字列へエンコードし、ストリームに書き込みます。

-
 void encodeToStream(
-   in nsIOutputStream stream,
-   in string charset,
-   in boolean writeBOM
-   in JSObject value,
-   [optional] in JSObject optFilter
- );
-
-
引数
-
-
- <tt>stream</tt>
-
- JSON 文字列を書き込む nsIOutputStream
-
- <tt>charset</tt>
-
- 使用する文字エンコーディング。「UTF-8」「UTF-16LE」「UTF-16BE」など。
-
- <tt>writeBOM</tt>
-
- ストリームにバイトオーダーマーク (BOM) を書き込む場合は true、書き込まない場合は false を指定します。
-
- <tt>value</tt>
-
- エンコードする JavaScript オブジェクト。
-
- <tt>optFilter</tt>
-
- ?
-
-

-

オブジェクトをエンコードする

-
var myObj = {"foo":"bar"};
-
-var myJSONString = nativeJSON.encode(myObj);
-
-

返される文字列は「{"foo":"bar"}」になります。

-

JSON 文字列をデコードする

-

上記の文字列は、decode() に渡して、元のオブジェクトに戻すことができます。

-
var myObj2 = nativeJSON.decode(myJSONString);
-
-

関連記事

- diff --git a/files/ja/mozilla/tech/xpcom/reference/xpcom_interface_reference/nsilogininfo/index.html b/files/ja/mozilla/tech/xpcom/reference/xpcom_interface_reference/nsilogininfo/index.html deleted file mode 100644 index 9efe8fb32d..0000000000 --- a/files/ja/mozilla/tech/xpcom/reference/xpcom_interface_reference/nsilogininfo/index.html +++ /dev/null @@ -1,147 +0,0 @@ ---- -title: nsILoginInfo -slug: Mozilla/Tech/XPCOM/Reference/XPCOM_Interface_Reference/nsILoginInfo -tags: - - Firefox 3 - - MDC Project - - NeedsEditorialReview -translation_of: Mozilla/Tech/XPCOM/Reference/Interface/nsILoginInfo ---- -

-nsILoginInfoはFirefox 3のログインマネージャにて格納されるログインのための情報を保持するオブジェクトです。 -

ログインを作成し、管理するにはnsILoginManagerを使用する必要があります。Using nsILoginManagerの例をご覧ください。 -


-

-
toolkit/components/passwordmgr/public/nsILoginInfo.idlScriptable
- - -Please add a summary to this article. - - -
-  -最終更新: Gecko 1.9 (Firefox 3)
-
-

Inherits from: nsISupports -

Implemented by: @mozilla.org/login-manager/loginInfo;1. インスタンスを作成するためには次の例を使用してください。 -

-
var myLoginInfo = Components.classes["@mozilla.org/login-manager/loginInfo;1"]
-                   .createInstance(Components.interfaces.nsILoginInfo);
-
-

メソッドの概要

- - - - - - -
void init(in AString aHostname, in AString aFormSubmitURL, in AString aHttpRealm, in AString aUsername, in AString aPassword, in AString aUsernameField, in AString aPasswordField); -
boolean equals(in nsILoginInfo aLoginInfo); -
boolean equalsIgnorePassword(in nsILoginInfo aLoginInfo); -
-

属性

- - - - - - - - - - - - - - - -
属性 -型 -記述 -
hostname -AString - ログインが実行されるホストの名前。URLとしてフォーマットされます。(例として、"http://www.wite.com")。ポート番号(":123")が追加されることもあるでしょう。 -
formSubmitURL -AString - フォームベースのログインがサブミットされるURL。HTMLフォームから獲得されるログイン向けにはこのフィールドはform要素のaction属性になり、パスは削除されます(例として、"http://www.site.com")。action属性のないフォームはデフォルトとしてフォームの元のURLにサブミットされます。そのためにそれはここに格納されます。このフィールドはログインがプロトコル認証から得られた場合にはNULLです。 -
httpRealm -AString - ログインが要求されたHTTP Realm。HTTPサーバが401の結果を返した時、WWW-Authenticateヘッダは"保護空間"を特定するRealmを含みます。RFC 2617を参照してください。結果に realm が含まれていなかった場合、あるいは空白だった場合は、代わりにホスト名が使われます。HTMLフォームから獲得されたログインに関してはこのフィールドはNULLです。 -
username -AString - ログインのユーザ名 -
usernameField -AString - フォーム内のユーザ名入力フィールドのname属性。フォームを利用しないログインでは、空白の文字列 ("") を指定する必要があります。 -
password -AString - ログインのパスワード。 -
passwordField -AString - パスワード入力フィールドのname属性。プロトコル認証から獲得されたログインではこのフィールドはNULLになります。 -
-

メソッド

-

init()

-

新しく作成されたnsILoginInfoオブジェクトを初期化します。 -

-
 void init(in AString aHostname,
-   in AString aFormSubmitURL,
-   in AString aHttpRealm,
-   in AString aUsername,
-   in AString aPassword,
-   in AString aUsernameField,
-   in AString aPasswordField
- );
-
-
引数
-
<tt>aHostname</tt> -
hostnameフィールドに割り当てられる値 -
<tt>aFormSubmitURL</tt> -
formSubmitURLフィールドに割り当てられる値 -
<tt>aHttpRealm</tt> -
httpRealmフィールドに割り当てられる値 -
<tt>aUsername</tt> -
usernameフィールドに割り当てられる値 -
<tt>aPassword</tt> -
passwordフィールドに割り当てられる値 -
<tt>aUsernameField</tt> -
usernameFieldフィールドに割り当てられる値 -
<tt>aPasswordField</tt> -
passwordFieldフィールドに割り当てられる値 -
-

equals()

-

このログインが別のnsILoginInfoオブジェクトと完全に等しいかどうか確定する -

-
 boolean equals(
-   in nsILoginInfo aLoginInfo
- );
-
-
引数
-
<tt>aLoginInfo</tt> -
等しさを比較するログイン -
-
戻り値
-

もし二つのログインが完全に等しければtrue、そうでなければfalse。 -

-

matches()

-

このログインが他の nsILoginInfo オブジェクトとほぼ等しいかどうかを判別するテストを行います。passwordFieldusernameField の値は無視され、password の値も任意で無視できます。このログインの formSubmitURL が空白の文字列である (かつ null でない) 場合は、ワイルドカードと同等に扱われます。 -

-
 boolean matches(
-   in nsILoginInfo aLoginInfo,
-   in boolean      ignorePassword
- );
-
-
引数
-
<tt>aLoginInfo</tt> -
等しさを比較するログイン -
-
<tt>ignorePassword</tt> -
true の場合、判別時にパスワードの値を検査しません。 -
-
戻り値
-

2つのログインが同等ならばtrue、等しくなければfalse。 -

-

参照

-

See also

-

nsILoginManager, Using nsILoginManager -

diff --git a/files/ja/mozilla/tech/xpcom/reference/xpcom_interface_reference/nsiloginmanager/index.html b/files/ja/mozilla/tech/xpcom/reference/xpcom_interface_reference/nsiloginmanager/index.html deleted file mode 100644 index ca03e05897..0000000000 --- a/files/ja/mozilla/tech/xpcom/reference/xpcom_interface_reference/nsiloginmanager/index.html +++ /dev/null @@ -1,306 +0,0 @@ ---- -title: nsILoginManager -slug: Mozilla/Tech/XPCOM/Reference/XPCOM_Interface_Reference/nsILoginManager -tags: - - Firefox 3 - - Interfaces - - XPCOM - - XPCOM API Reference -translation_of: Mozilla/Tech/XPCOM/Reference/Interface/nsILoginManager ---- -

nsIPasswordManager に替わり Firefox 3 では nsILoginManager がパスワードマネージャーのインターフェイスとして使われます。

- -

使用例については Using nsILoginManager をご覧ください。

- -


-

-
toolkit/components/passwordmgr/public/nsILoginManager.idlScriptable
- - -Please add a summary to this article. - - -
-  -最終更新: Gecko 1.9 (Firefox 3)
-
- -

Inherits from: nsILoginManager

- -

Implemented by: @mozilla.org/login-manager;1. To create an instance, use:

- -
var loginManager = Components.classes["@mozilla.org/login-manager;1"]
-                   .getService(Components.interfaces.nsILoginManager);
-
- -

Method overview

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void addLogin(in nsILoginInfo aLogin);
void removeLogin(in nsILoginInfo aLogin);
void modifyLogin(in nsILoginInfo oldLogin, in nsILoginInfo newLogin);
void removeAllLogins();
void getAllLogins(out unsigned long count, [retval, array, size_is(count)] out nsILoginInfo logins);
void getAllDisabledHosts(out unsigned long count, [retval, array, size_is(count)] out wstring hostnames);
boolean getLoginSavingEnabled(in AString aHost);
void setLoginSavingEnabled(in AString aHost, in boolean isEnabled);
void findLogins(out unsigned long count, in AString aHostname, in AString aActionURL, in AString aHttpRealm, [retval, array, size_is(count)] out nsILoginInfo logins);
unsigned long countLogins(in AString aHostName, in AString aActionURL, in AString aHttpRealm,);
nsIAutoCompleteResult autoCompleteSearch(in AString aSearchString, in nsIAutoCompleteResult aPreviousResult, in nsIDOMHTMLInputElement aElement);
- -

メソッド

- -

addLogin()

- -

新しいログイン情報をログインマネージャーに保存します。

- -
 void addLogin(
-   in nsILoginInfo aLogin
- );
-
- -
Parameters
- -
-
aLogin
-
The login to store.
-
- -

removeLogin()

- -

ログインマネージャーからログイン情報を削除します。

- -
 void removeLogin(
-   in nsILoginInfo aLogin
- );
-
- -
Parameters
- -
-
aLogin
-
The login to remove from the Login Manager.
-
- -

modifyLogin()

- -

既存のログイン情報を修正し上書きします。

- -
 void modifyLogin(
-   in nsILoginInfo oldLogin,
-   in nsILoginInfo newLogin
- );
-
- -
Parameters
- -
-
oldLogin
-
The login to be updated.
-
newLogin
-
The login information to replace the oldLogin with.
-
- -

removeAllLogins()

- -

ログインマネージャーに保存されているすべてのログイン情報を削除します。この動作はマスターパスワードによる保護を無視します。

- -
 void removeAllLogins();
-
- -
Parameters
- -

None.

- -

getAllLogins()

- -

ログインマネージャーに保存されているすべてのログイン情報を配列として返します。

- -
 void getAllLogins(
-   out unsigned long count,
-   [retval, array, size_is(count)] out nsILoginInfo logins
- );
-
- -
Parameters
- -
-
count
-
The number of elements in the returned array. JavaScript callers can simply use the array's length property and supply a dummy argument for this parameter.
-
logins
-
An array of nsILoginInfo objects containing all the logins the Login Manager has on record.
-
- -
Remarks
- -

このメソッドは JavaScript から次のように呼ぶことができます:

- -
 var logins = myLoginMgr.getAllLogins({});
-
- -

logins にはログイン情報が配列形式で戻されます。

- -

getAllDisabledHosts()

- -

ログイン情報の保存が無効に設定されているホストの一覧を返します。

- -
 void getAllDisabledHosts(
-   out unsigned long count,
-   [retval, array, size_is(count)] out wstring hostnames
- );
-
- -
Parameters
- -
-
count
-
The number of elements in the returned array. JavaScript callers can simply use the array's length property and supply a dummy argument for this parameter.
-
hostnames
-
An array of hostname strings in URL format without a pathname. For example: "https://www.site.com".
-
- -
Remarks
- -

You can call this method from JavaScript like this:

- -
 var disabledHosts = myLoginMgr.getAllDisabledHosts({});
-
- -

getLoginSavingEnabled()

- -

指定されたホストでログイン情報を保存可能かどうかを返します。

- -
 boolean getLoginSavingEnabled(
-   in AString aHost
- );
-
- -
Parameters
- -
-
aHost
-
The hostname to check. This argument should be in the origin URL format, with no pathname. For example: "https://www.site.com".
-
- -
戻り値
- -

ホストがログイン情報を保存できる場合は treu を、そうでない場合は false を返します。

- -

setLoginSavingEnabled()

- -

Enables or disables storing logins for a specified host. When login storing is disabled, the Login Manager won't prompt the user to store logins for that host. Existing logins are not affected.

- -
 void setLoginSavingEnabled(
-   in AString aHost,
-   in boolean isEnabled
- );
-
- -
Parameters
- -
-
aHost
-
The hostname to adjust the setting for. This argument should be in the origin URL format, with no pathname. For example: "https://www.site.com".
-
isEnabled
-
If true, login saving is enabled for the specified host. If false, login saving is disabled.
-
- -

findLogins()

- -

Searches for logins matching the specified criteria. Called when looking for logins that might be applicable to a given form or authentication request.

- -
 void findLogins(
-   out unsigned long count,
-   in AString aHostname,
-   in AString aActionURL,
-   in AString aHttpRealm,
-   [retval, array, size_is(count)] out nsILoginInfo logins
- );
-
- -
Parameters
- -
-
count
-
The number of elements in the returned array. JavaScript callers can simply use the array's length property and supply a dummy argument for this parameter.
-
aHostname
-
The hostname to which to restrict searches. When looking for form logins, this argument should be in origin HTML format, with no pathname. For protocol logins, such as http or ftp, it should be the hostname with the port number appended, such as "www.bar.com:443".
-
aActionURL
-
For form logins, this parameter should specify the URL to which the form will be submitted. For protocol logins, specify null.
-
aHttpRealm
-
For protocol logins, specify the HTTP Realm for which the login applies; this is obtained from the WWW-Authenticate header (see RFC 2617). For form logins, this parameter should be null.
-
logins
-
An array of nsILoginInfo objects.
-
- -
Remarks
- -

This method can be called from JavaScript like this:

- -
 var logins = myLoginMgr.findLogins({}, hostname, ...);
-
- -

countLogins()

- -

Returns the number of logins matching the specified criteria. Called when only the number of logins is needed, and not the actual logins (which avoids prompting the user for a Master Password, as the logins don't need to be decrypted).

- -
 unsigned login countLogins(
-   in AString aHostname,
-   in AString aActionURL,
-   in AString aHttpRealm,
- );
-
- -
Parameters
- -
-
aHostname
-
The hostname to which to restrict searches. When looking for form logins, this argument should be in origin HTML format, with no pathname. For protocol logins, such as http or ftp, it should be the hostname with the port number appended, such as "www.bar.com:443".
-
aActionURL
-
For form logins, this parameter should specify the URL to which the form will be submitted. To match any form login, specify "" (empty string). To not match any form logins (eg, when interested in protocol logins only), specify null.
-
aHttpRealm
-
For protocol logins, specify the HTTP Realm for which the login applies; this is obtained from the WWW-Authenticate header (see RFC 2617). To match any protocol login, specify "" (empty string). To not match any protocol logins (eg, when interested in form logins only), specify null.
-
- -

 

- -

autoCompleteSearch()

- -

Generates results for a user field autocomplete menu.

- -
-

This method is provided for use only by the FormFillController, which calls it directly. It should not be used for any other purpose, so no specific usage documentation is provided here.

-
- -

Remarks

- -

Fill this out.

- -

See also

- -

nsILoginInfo, Using nsILoginManager

diff --git a/files/ja/mozilla/tech/xpcom/reference/xpcom_interface_reference/nsiobserver/index.html b/files/ja/mozilla/tech/xpcom/reference/xpcom_interface_reference/nsiobserver/index.html deleted file mode 100644 index 2c50f02fa8..0000000000 --- a/files/ja/mozilla/tech/xpcom/reference/xpcom_interface_reference/nsiobserver/index.html +++ /dev/null @@ -1,65 +0,0 @@ ---- -title: nsIObserver -slug: Mozilla/Tech/XPCOM/Reference/XPCOM_Interface_Reference/nsIObserver -tags: - - Interfaces - - 'Interfaces:Frozen' - - 'Interfaces:Scriptable' - - XPCOM - - XPCOM API Reference -translation_of: Mozilla/Tech/XPCOM/Reference/Interface/nsIObserver ---- -

« XPCOM API Reference

-

概要

-

nsIObserver は、オブジェクトが通知を監視するために使われます。 これらの通知は、いつもではなく時々、nsIObserverServiceを通してブロードキャストされます。

-
-
xpcom/ds/nsIObserver.idlScriptable
- - -Please add a summary to this article. - - -
-  -最終更新: Gecko 0.9.6
-
-

インターフェース・コード

-
[scriptable, uuid(DB242E01-E4D9-11d2-9DDE-000064657374)]
-interface nsIObserver : nsISupports {
-    void observe( in nsISupports aSubject,
-                  in string      aTopic,
-                  in wstring     aData );
-};
-
-

メソッド

-

observe

-
    void observe( in nsISupports aSubject,
-                  in string      aTopic,
-                  in wstring     aData );
-
-

observe will be called when there is a notification for the topic that the observer has been registered for.

-

In general, aSubject reflects the object whose change or action is being observed, aTopic indicates the specific change or action, and aData is an optional parameter or other auxiliary data further describing the change or action.

-

The specific values and meanings of the parameters provided varies widely, though, according to where the observer was registered, and what topic is being observed.

-

A single nsIObserver implementation can observe multiple types of notification, and is responsible for dispatching its own behaviour on the basis of the parameters for a given callback. In general, aTopic is the primary criterion for such dispatch; nsIObserver implementations should take care that they can handle being called with unknown values for aTopic.

-

While some observer-registration systems may make this safe in specific contexts, it is generally recommended that observe implementations not add or remove observers while they are being notified.

-

関連インターフェース

-

nsIObserverService

-

サンプルコード

-

The following is an implementation of nsIObserver that can be registered with the preference service to be notified of changes in preferences (see Using preferences on MozillaZine for a complete example and for more information about the preference system in general).

-
var prefObserver = {
-  // nsIObserver
-  observe: function (aSubject, aTopic, aData) {
-    if (aTopic == "nsPref:changed") { // observe preference changes
-      // aData contains the name of the changed preference
-      dump(aData+" changed!");
-    }
-  },
-
-  QueryInterface: function(aIID) {
-    if(!aIID.equals(CI.nsISupports) && !aIID.equals(CI.nsIObserver))
-      throw CR.NS_ERROR_NO_INTERFACE;
-    return this;
-  }
-};
-
-

See also Using observers.

diff --git a/files/ja/mozilla/tech/xpcom/reference/xpcom_interface_reference/nsiobserverservice/index.html b/files/ja/mozilla/tech/xpcom/reference/xpcom_interface_reference/nsiobserverservice/index.html deleted file mode 100644 index ffd3a4649d..0000000000 --- a/files/ja/mozilla/tech/xpcom/reference/xpcom_interface_reference/nsiobserverservice/index.html +++ /dev/null @@ -1,186 +0,0 @@ ---- -title: nsIObserverService -slug: Mozilla/Tech/XPCOM/Reference/XPCOM_Interface_Reference/nsIObserverService -tags: - - Interfaces - - 'Interfaces:Frozen' - - 'Interfaces:Scriptable' - - XPCOM - - XPCOM API Reference -translation_of: Mozilla/Tech/XPCOM/Reference/Interface/nsIObserverService ---- -
« XPCOM API Reference
- -

概要

- -

nsIObserverService インタフェースは、様々な通知を受けるオブザーバを追加、削除、通知、列挙するためのメソッドを提供します。

-
xpcom/ds/nsIObserverService.idlScriptable
- - -Please add a summary to this article. - - -
-  -最終更新: Gecko 0.9.6
-
詳しくは バグ 99163 をご覧ください - -
 #include "nsIObserverService.h"
- [scriptable, uuid=(D07F5192-E3D1-11d2-8ACD-00105A1B8860)]
- interface nsIObserverService : nsISupports { ... };
-
- -

XPCOM の nsObserverService はこのインタフェースを実装して、様々なサブシステムのためのグローバル通知を提供しています。

- -

メソッドの概要

- - - - - - - - - - - - - - - - -
void addObserver(in nsIObserver anObserver, in string aTopic, in boolean ownsWeak);
void removeObserver( in nsIObserver anObserver, in string aTopic );
void notifyObservers( in nsISupports aSubject, in string aTopic, in wstring someData );
nsISimpleEnumerator enumerateObservers( in string aTopic );
- -

メソッド

- -

addObserver()

- -

特定のトピックに関する通知を受けるために指定したリスナーの登録を行います。

- -
 void addObserver( in nsIObserver anObserver,
-                   in string aTopic,
-                   in boolean ownsWeak);
-
- -
引数
- -
-
anObserver
-
通知を受けるインタフェースポインタ。
-
aTopic
-
通知のトピックまたはサブジェクト。
-
ownsWeak
-
false に設定した場合、nsIObserverServiceanObserver に対する強力な参照を保持します。true に設定し、なおかつ anObservernsIWeakReference インタフェースをサポートしている場合、弱い参照が保持されます。そうでない場合、エラーが返されます。
-
- -

removeObserver()

- -

特定のトピックに関する通知を受けるために指定したリスナーの登録を解除します。

- -
 void removeObserver( in nsIObserver anObserver,
-                      in string aTopic );
-
- -
引数
- -
-
anObserver
-
通知を受けるのを停止するインタフェースポインタ。
-
aTopic
-
通知のトピックまたはサブジェクト。
-
- -

notifyObservers()

- -

指定されたトピックについて登録されたすべてのリスナーに通知を行います。

- -
 void notifyObservers( in nsISupports aSubject,
-                       in string aTopic,
-                       in wstring someData );
-
- -
引数
- -
-
aSubject
-
通知固有のインタフェースポインタ。
-
aTopic
-
通知のトピックまたはサブジェクト。
-
someData
-
通知固有のワイド文字列。
-
- -

enumerateObservers()

- -

登録されたすべてのリスナの列挙を返します。

- -
 nsISimpleEnumerator enumerateObservers( in string aTopic );
-
- -
引数
- -
-
aTopic
-
通知のトピックまたはサブジェクト。
-
- -
戻り値
- -

登録されたすべてのリスナの列挙を返します。

- -

notifyObservers()

- -

This method is called to notify all observers for a particular topic. See Example.

- -
void notifyObservers(
-  in nsISupports aSubject,
-  in string aTopic,
-  in wstring someData
-);
-
- -
Parameters
- -
-
aSubject
-
A notification specific interface pointer. This usually corresponds to the source of the notification, but could be defined differently depending on the notification topic and may even be null.
-
aTopic
-
The notification topic. This string-valued key uniquely identifies the notification. This parameter must not be null.
-
someData
-
A notification specific string value. The meaning of this parameter is dependent on the topic. It may be null.
-
- -

removeObserver()

- -

This method is called to unregister an observer for a particular topic.

- -
void removeObserver(
-  in nsIObserver anObserver,
-  in string aTopic
-);
-
- -
Parameters
- -
-
anObserver
-
The nsIObserver instance to remove.
-
aTopic
-
The notification topic or subject. This string-valued key uniquely identifies the notification. This parameter must not be null.
-
- -

Example

- -

This notifies all nsIObservers watching the "myTopicID" topic with an additional data parameter.

- -
Components.classes["@mozilla.org/observer-service;1"]
-          .getService(Components.interfaces.nsIObserverService)
-          .notifyObservers(null, "myTopicID", "someAdditionalInformationPassedAs'Data'Parameter");
-
- -

関連記事

- - diff --git a/files/ja/mozilla/tech/xpcom/reference/xpcom_interface_reference/nsioutputstream/index.html b/files/ja/mozilla/tech/xpcom/reference/xpcom_interface_reference/nsioutputstream/index.html deleted file mode 100644 index 5af2c8425f..0000000000 --- a/files/ja/mozilla/tech/xpcom/reference/xpcom_interface_reference/nsioutputstream/index.html +++ /dev/null @@ -1,60 +0,0 @@ ---- -title: nsIOutputStream -slug: Mozilla/Tech/XPCOM/Reference/XPCOM_Interface_Reference/nsIOutputStream -tags: - - Interfaces - - 'Interfaces:Frozen' - - 'Interfaces:Scriptable' - - XPCOM - - XPCOM API Reference -translation_of: Mozilla/Tech/XPCOM/Reference/Interface/nsIOutputStream ---- -

« XPCOM API Reference

-

概要

-

nsIOutputStream インターフェースは書き込み可能なデータシンクを表します。

-
  #include "nsIOutputStream.h"
-
-  [scriptable, uuid=(0d0acd2a-61b4-11d4-9877-00c04fa0cf4a)]
-  interface nsIOutputStream : nsISupports { ... };
-
-

メソッド

-
-
- close
-
- このメソッドは、出力ストリームをクローズする。
-
-
-
- flush
-
- このメソッドは、出力ストリームをフラッシュする。
-
-
-
- write
-
- このメソッドは、バッファからストリームにデータをコピーする。
-
-
-
- writeSegments
-
- このメソッドは、ストリームの内部バッファへの書き込むためのダイレクトアクセスを提供します。
-
-
-
- writeFrom
-
- このメソッドは、nsIInputStreamからこのnsIOutputStreamにデータをコピーします。
-
-
-
- isNonBlocking
-
- このメソッドは、ストリームが非ブロッキングならtrueを返す。
-
-

履歴

-

このインターフェースはMozilla 1.0で凍結されています。詳細は バグ 124465 を見てください。

-
-  
diff --git a/files/ja/mozilla/tech/xpcom/reference/xpcom_interface_reference/nsiparentalcontrolsservice/index.html b/files/ja/mozilla/tech/xpcom/reference/xpcom_interface_reference/nsiparentalcontrolsservice/index.html deleted file mode 100644 index 61a4dbcca2..0000000000 --- a/files/ja/mozilla/tech/xpcom/reference/xpcom_interface_reference/nsiparentalcontrolsservice/index.html +++ /dev/null @@ -1,172 +0,0 @@ ---- -title: nsIParentalControlsService -slug: >- - Mozilla/Tech/XPCOM/Reference/XPCOM_Interface_Reference/nsIParentalControlsService -tags: - - Firefox 3 - - Gecko 1.9 - - Interfaces - - Parental Controls - - XPCOM - - XPCOM API Reference - - XPCOM Interface Reference -translation_of: Mozilla/Tech/XPCOM/Reference/Interface/nsIParentalControlsService ---- -

nsIParentalControlsServiceインターフェースはOSの保護者による制限(以下、ペアレンタルコントロールと記述)へのアクセスを提供します。これにより、ペアレンタルコントロール機能が使えるかどうかの検出、制限を迂回しての上書き要求がコード上から行えます。

-
註: 現在、このインターフェイスはMicrosoft Windows Vista.のみでサポートされています。
-


-

-
toolkit/components/parentalcontrols/public/nsIParentalControlsService.idlScriptable
- - -Please add a summary to this article. - - -
-  -最終更新: Gecko 1.9 (Firefox 3)
-
-

継承元: nsISupports

-

実装: @mozilla.org/parental-controls-service;1. インスタンスを作成する場合には次のように記述します。

-
var parentalControls = Components.classes["@mozilla.org/parental-controls-service;1"]
-                                 .createInstance(Components.interfaces.nsIParentalControlsService);
-
-

メソッド概要

- - - - - - - - - - - - -
void log(in short aEntryType, in boolean aFlag, in nsIURI aSource, [optional] in nsIFile aTarget);
boolean requestURIOverride(in nsIURI aTarget, [optional] in nsIInterfaceRequestor aWindowContext);
boolean requestURIOverrides(in nsIArray aTargets, [optional] in nsIInterfaceRequestor aWindowContext);
-

属性

- - - - - - - - - - - - - - - - - - - - - - - -
属性説明
blockFileDownloadsEnabledboolean -

現在のユーザアカウントのペアレンタルコントロールの現在の設定が全てのファイルダウンロードの禁止を含む場合にはtrue。リードオンリー

-
loggingEnabledboolean -

現在のユーザアカウントがペアレンタルコントロールのログ機能をオンにしている場合にはtrue
- trueの場合、アプリケーションはlog()メソッドを使い、関係するイベントを記録する必要がある。

-
parentalControlsEnabledboolean -

現在のユーザアカウントがペアレンタルコントロール機能をオンにしている場合にはtrueリードオンリー

-
-

定数

- - - - - - - - - - - - - - - - - - -
定数説明
ePCLog_URIVisit1Webコンテンツへのアクセス
ePCLog_FileDownload2ファイルのダウンロード
-

メソッド

-

log()

-

アプリケーション固有のペアレンタルコントロールイベントを記録します。

-
 void log(
-   in short aEntryType,
-   in boolean aFlag,
-   in nsIURI aSource,
-   [optional] in nsIFile aTarget
- );
-
-
引数
-
-
- aEntryType
-
- 記録するイベントの型。ページ上方の定数の項目を参照。
-
- aFlag
-
- イベントをブロックする場合にはtrue、許可する場合にはfalseを設定します。
-
- aSource
-
- subject context の URI
-
- aTarget
-
- コンテンツをブロックしない場合のコンテンツの保存場所。
-
-

requestURIOverride()

-

ペアレンタルコントロールでブロックされているURIを許可状態にするよう要求します。

-
 boolean requestURIOverride(
-   in nsIURI aTarget,
-   [optional] in nsIInterfaceRequestor aWindowContext
- );
-
-
引数
-
-
- aTarget
-
- 上書きされるURI
-
- aWindowContext
-
- イベントを発生させるウィンドウ
-
-
戻り値
-

ブロックが正常に上書きされればtrueが、そうでなければfalseが返ります。

-
注意書き
-

ブロックに対する上書き要求を操作するためのユーザインターフェース(「管理者パスワードを入力してください」と表示されるダイアログボックスなど)をOSが表示している間は、このメソッドはペアレンタルコントロールによるブロックを継続します。

-

requestURIOverrides()

-

一連のURIをペアレンタルコントロールで許可されるよう要求します。

-
 boolean requestURIOverrides(
-   in nsIArray aTargets,
-   [optional] in nsIInterfaceRequestor aWindowContext
- );
-
-

引数

-
-
- aTargets
-
- 上書きを希望するURIを表すnsIURIオブジェクトの配列
-
- aWindowContext
-
- イベントを発生させるウィンドウ
-
-
戻り値
-

ブロックが正常に上書きされればtrueが、そうでなければfalseが返る。

-
注意書き
-

ブロックに対する上書き要求を操作するためのユーザインターフェース(「管理者パスワードを入力してください」と表示されるダイアログボックスなど)をOSが表示している間は、このメソッドはペアレンタルコントロールによるブロックを継続します。

diff --git a/files/ja/mozilla/tech/xpcom/reference/xpcom_interface_reference/nsiparserutils/index.html b/files/ja/mozilla/tech/xpcom/reference/xpcom_interface_reference/nsiparserutils/index.html deleted file mode 100644 index a90cbe4208..0000000000 --- a/files/ja/mozilla/tech/xpcom/reference/xpcom_interface_reference/nsiparserutils/index.html +++ /dev/null @@ -1,205 +0,0 @@ ---- -title: nsIParserUtils -slug: Mozilla/Tech/XPCOM/Reference/XPCOM_Interface_Reference/nsIParserUtils -translation_of: Mozilla/Tech/XPCOM/Reference/Interface/nsIParserUtils ---- -
-
parser/html/nsIParserUtils.idlScriptable
- - -Provides non-Web HTML parsing functionality to Firefox extensions and XULRunner applications. - - -
- -
1.0
- -
66
- -
- -
- -
Introduced
-
Gecko 13.0
- -
- -
- -
-継承元: nsISupports -最終更新: Gecko 14.0 (Firefox 14.0 / Thunderbird 14.0 / SeaMonkey 2.11)
-
- -
警告: Geckoの中からこれを使用しないでください。代わりにnsContentUtilsnsTreeSanitizerなどを直接使用してください。
- -

Implemented by: @mozilla.org/parserutils;1 as a service:

- -
var parserUtils = Components.classes["@mozilla.org/parserutils;1"]
-                  .getService(Components.interfaces.nsIParserUtils);
-
- -

メソッド概要

- - - - - - - - - - - - - -
AString convertToPlainText(in AString src, in unsigned long flags, in unsigned long wrapCol);
nsIDOMDocumentFragment parseFragment(in AString fragment, in unsigned long flags, in boolean isXML, in nsIURI baseURI, in nsIDOMElement element);
AString sanitize(in AString src, in unsigned long flags);
- -

定数

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
ConstantValueDescription
SanitizerAllowComments(1 << 0)Flag for sanitizer: Allow comment nodes.
SanitizerAllowStyle(1 << 1) -

Flag for sanitizer: Allow <style> elements and style attributes (with contents sanitized in case of -moz-binding).

- -
Note: If -moz-binding is absent, properties that might be XSS risks in other Web engines are preserved!
-
SanitizerCidEmbedsOnly(1 << 2) -

Flag for sanitizer: Only allow cid: URLs for embedded content.

- -

At present, sanitizing CSS backgrounds, and so on., is not supported, so setting this together with SanitizerAllowStyle doesn't make sense.

- At present, sanitizing CSS syntax in SVG presentational attributes is not supported, so this option flattens out SVG.
SanitizerDropNonCSSPresentation(1 << 3)Flag for sanitizer: Drops non-CSS presentational HTML elements and attributes, such as <font>, <center>, and the bgcolor attribute.
SanitizerDropForms(1 << 4)Flag for sanitizer: Drops forms and form controls (excluding <fieldset> and <legend>.
SanitizerDropMedia(1 << 5)Flag for sanitizer: Drops <img>, <video>, <audio>, and <source>, and flattens out SVG.
SanitizerLogRemovals(1 << 6)Flag for sanitizer: Log messages to the console for everything that gets sanitized.
- -

メソッド

- -

convertToPlainText()

- -

Converts HTML to plain text.

- -
AString convertToPlainText(
-  in AString src,
-  in unsigned long flags,
-  in unsigned long wrapCol
-);
-
- -
Parameters
- -
-
src
-
The HTML source to parse (C++ callers are allowed but not required to use the same string for the return value.)
-
flags
-
Conversion option flags defined in nsIDocumentEncoder.
-
wrapCol
-
Number of characters per line; 0 for no auto-wrapping.
-
- -
Return value
- -

The plain text conversion of the HTML specified in src.

- -

parseFragment()

- -

Parses markup into a sanitized document fragment.

- -
nsIDOMDocumentFragment parseFragment(
-  in AString fragment,
-  in unsigned long flags,
-  in boolean isXML,
-  in nsIURI baseURI,
-  in nsIDOMElement element
-);
-
- -
Parameters
- -
-
fragment
-
The input markup.
-
flags
-
Sanitization option flags defined above.
-
isXML
-
true if |fragment| is XML and false if HTML.
-
baseURI
-
The base URL for this fragment.
-
element
-
The context node for the fragment parsing algorithm.
-
- -
Return value
- -

An nsIDOMDocumentFragment object for the resulting sanitized document fragment.

- -

sanitize()

- -

Parses a string into an HTML document, sanitizes the document, and returns the result serialized to a string.

- -

The sanitizer is designed to protect against XSS when sanitized content is inserted into a different-origin context without an iframe-equivalent sandboxing mechanism.

- -

By default, the sanitizer doesn't try to avoid leaking information that the content was viewed to third parties. That is, by default, for example <img> with a source pointing to an HTTP server potentially controlled by a third party is not removed. To avoid ambient information leakage upon loading the sanitized content, use the SanitizerInternalEmbedsOnly flag. In that case, <a> links (and similar) to other content are preserved, so an explicit user action (following a link) after the content has been loaded can still leak information.

- -

By default, non-dangerous non-CSS presentational HTML elements and attributes or forms are not removed. To remove these, use SanitizerDropNonCSSPresentation and/or SanitizerDropForms.

- -

By default, comments and CSS is removed. To preserve comments, use SanitizerAllowComments. To preserve <style> elements and style attributes on other elements, use SanitizerAllowStyle. -moz-binding is removed from <style> elements and style attributes if present. In this case, properties that Gecko doesn't recognize can get removed as a side effect.

- -
Note: If -moz-binding is not present, <style> elements and style attributes, and if SanitizerAllowStyle is specified, the sanitized content may still be XSS dangerous if loaded into a non-Gecko Web engine!
- -
AString sanitize(
-  in AString src,
-  in unsigned long flags
-);
-
- -
Parameters
- -
-
src
-
The HTML source to parse (C++ callers are allowed but not required to use the same string for the return value).
-
flags
-
Sanitization option flags defined above.
-
- -
Return value
- -

The resulting text.

diff --git a/files/ja/mozilla/tech/xpcom/reference/xpcom_interface_reference/nsipassword/index.html b/files/ja/mozilla/tech/xpcom/reference/xpcom_interface_reference/nsipassword/index.html deleted file mode 100644 index 8f94e59a9f..0000000000 --- a/files/ja/mozilla/tech/xpcom/reference/xpcom_interface_reference/nsipassword/index.html +++ /dev/null @@ -1,12 +0,0 @@ ---- -title: nsIPassword -slug: Mozilla/Tech/XPCOM/Reference/XPCOM_Interface_Reference/nsIPassword -tags: - - Interfaces - - MDC Project - - NeedsContent - - XPCOM - - XPCOM API Reference -translation_of: Mozilla/Tech/XPCOM/Reference/Interface/nsIPassword ---- -

nsIPassword を使ったサンプルは Using nsIPasswordManager を見てください。

diff --git a/files/ja/mozilla/tech/xpcom/reference/xpcom_interface_reference/nsipasswordmanager/index.html b/files/ja/mozilla/tech/xpcom/reference/xpcom_interface_reference/nsipasswordmanager/index.html deleted file mode 100644 index 0464fcd2ac..0000000000 --- a/files/ja/mozilla/tech/xpcom/reference/xpcom_interface_reference/nsipasswordmanager/index.html +++ /dev/null @@ -1,16 +0,0 @@ ---- -title: nsIPasswordManager -slug: Mozilla/Tech/XPCOM/Reference/XPCOM_Interface_Reference/nsIPasswordManager -tags: - - Interfaces - - 'Interfaces:Scriptable' - - MDC Project - - NeedsContent - - XPCOM - - XPCOM API Reference -translation_of: Mozilla/Tech/XPCOM/Reference/Interface/nsIPasswordManager ---- -

Using nsIPasswordManager に使用例があります。

-
-  
-

n

diff --git a/files/ja/mozilla/tech/xpcom/reference/xpcom_interface_reference/nsiplacesview/index.html b/files/ja/mozilla/tech/xpcom/reference/xpcom_interface_reference/nsiplacesview/index.html deleted file mode 100644 index 209b11d0dd..0000000000 --- a/files/ja/mozilla/tech/xpcom/reference/xpcom_interface_reference/nsiplacesview/index.html +++ /dev/null @@ -1,128 +0,0 @@ ---- -title: nsIPlacesView -slug: Mozilla/Tech/XPCOM/Reference/XPCOM_Interface_Reference/NsIPlacesView -tags: - - Developing Mozilla - - Extensions - - Interfaces - - Places -translation_of: Mozilla/Tech/XPCOM/Reference/Interface/nsIPlacesView ---- -

nsIPlacesViewインターフェイスは、ビューにとらわれずに、Placesビューについての情報にアクセスするための
- 手段を提供します。

-

例えば、ツリー、リスト、またはその他の類似のリストでは、選択された表現の形式が違います。コントローラーは、こういった違いに注意を払うべきではありません。生成したビューの種類に依存した、選択された表現の形式を把握するために、コントローラコードが必要とされるべきではありません。むしろ、それぞれのビューにおいて、選択した表現の形式をコントローラーが理解できる形に変換する必要があります。nsIPlacesViewインターフェイスを実装することにより、ビューは以上の作業などを行います。

-
-

nsIPlacesView は現在IDLが存在しません。現在、組み込みのPlacesビューの各々に直接実装されています。

-
-

メソッド一覧

- - - - - - - - - - - - - - - - - - - - - -
nsINavHistoryResultNode[] getDragableSelection();
nsINavHistoryResultNode[][] getRemovableSelectionRanges();
nsINavHistoryResult getResult();
nsINavHistoryContainerResultNode getResultNode();
nsINavHistoryResultNode[] getSelectionNodes();
void selectAll();
-

属性

- - - - - - - - - - - - - - - - - - - - - - - - - - - - -
属性詳細
hasSelectionbooleanアイテムが選択されているかどうか。  読み取り専用。
insertionPointInsertionPoint -

新規アイテムの、ドロップ、貼り付け、または作成の際に挿入される位置(InsertionPoint型)。読み取り専用。

-
placestring -

ビューに表示されているルートPlaceのURI(文字列型)。これはビューの更新により、動的に変更される可能性があります。Displaying Places information using viewsの例を参照してください。

-
selectedNodensINavHistoryResultNodeビュー中で選択されているノード。選択されているノードが複数ある場合、この値はnullとなります。読み取り専用。
-

 

-

メソッド

-

getDragableSelection()

-

ビューからドラッグ可能である、選択されているnsINavHistoryResultNodeオブジェクトの配列を返します。

-
nsINavHistoryResultNode[] getDragableSelection();
-
-
パラメータ
-

無し。

-
戻り値
-

nsINavHistoryResultNodeオブジェクトの配列。

-

getRemovableSelectionRanges()

-

ビューから削除可能なnsINavHistoryResultNode オブジェクトの配列の配列を返します。内包されているそれぞれの配列は、削除されうる連続的なノードの範囲を示します。

-
nsINavHistoryResultNode[][] getRemovableSelectionRanges();
-
-
パラメータ
-

無し。

-
戻り値
-

nsINavHistoryResultNodeオブジェクトの配列の配列。

-

getResult()

-

ビューに表示されているnsINavHistoryResultオブジェクトを返します。

-
nsINavHistoryResult getResult();
-
-
パラメータ
-

無し。

-
戻り値
-

ビューに表示されているnsINavHistoryResultオブジェクト。

-

getResultNode()

-

ビューの結果の、nsINavHistoryContainerResultNodeオブジェクトのルートノードを返します。

-
nsINavHistoryContainerResultNode getResultNode();
-
-
パラメータ
-

無し。

-
戻り値
-

ビューの結果の、nsINavHistoryContainerResultNode のルート。

-

getSelectionNodes()

-

ビューで現在選択されている全てのnsINavHistoryResultNodeオブジェクトの配列を返します。モデル中での現象によっては、同様のオーダー、または同様のコンテナ、同様のプロバイダであっても、ノードは必ずしも返されるというわけではありません。

-
nsINavHistoryResultNode[] getSelectionNodes();
-
-
パラメータ
-

無し。

-
戻り値
-

選択されているnsINavHistoryResultNodeオブジェクトの配列。

-

selectAll()

-

ビューで表示されているノードを全て選択する。

-
void selectAll();
-
-
パラメータ
-

無し。

-

参照

-
- 編集部分
- diff --git a/files/ja/mozilla/tech/xpcom/reference/xpcom_interface_reference/nsiprefbranch/index.html b/files/ja/mozilla/tech/xpcom/reference/xpcom_interface_reference/nsiprefbranch/index.html deleted file mode 100644 index 8333329cce..0000000000 --- a/files/ja/mozilla/tech/xpcom/reference/xpcom_interface_reference/nsiprefbranch/index.html +++ /dev/null @@ -1,494 +0,0 @@ ---- -title: nsIPrefBranch -slug: Mozilla/Tech/XPCOM/Reference/XPCOM_Interface_Reference/nsIPrefBranch -translation_of: Mozilla/Tech/XPCOM/Reference/Interface/nsIPrefBranch ---- -
-
modules/libpref/public/nsIPrefBranch.idlScriptable
- - -このインターフェースは preferences dataを操作するために使われます。対応するオブジェクトはpreferences service (nsIPrefService) から取得することができ、デフォルト値やアプリケーションのuser preferencesを参照したり変更したりするために使うことができます。 - - -
-継承元: nsISupports -最終更新: Gecko 13 (Firefox 13 / Thunderbird 13 / SeaMonkey 2.10)
-
-

このオブジェクトは自身が指し示す"branch"の起点となるpreference木の"root"値を伴って生成されます。各preferencesにはこのrootに続く最後の部分のみを使ってアクセスすることができます。 例えばオブジェクトが"browser.startup."をrootとして生成された場合、"browser.startup.page"、"browser.startup.homepage"、"browser.startup.homepage_override"などに対してGet/Setを行う際には"page"、"homepage"、"homepage_override"と指定することができます。

-

Method overview

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void addObserver(in string aDomain, in nsIObserver aObserver, in boolean aHoldWeak);
void clearUserPref(in string aPrefName);
void deleteBranch(in string aStartingAt);
boolean getBoolPref(in string aPrefName);
string getCharPref(in string aPrefName);
void getChildList(in string aStartingAt, [optional] out unsigned long aCount, [array, size_is(aCount), retval] out string aChildArray);
void getComplexValue(in string aPrefName, in nsIIDRef aType, [iid_is(aType), retval] out nsQIResult aValue);
long getIntPref(in string aPrefName);
long getPrefType(in string aPrefName);
void lockPref(in string aPrefName);
boolean prefHasUserValue(in string aPrefName);
boolean prefIsLocked(in string aPrefName);
void removeObserver(in string aDomain, in nsIObserver aObserver);
void resetBranch(in string aStartingAt);
void setBoolPref(in string aPrefName, in long aValue);
void setCharPref(in string aPrefName, in string aValue);
void setComplexValue(in string aPrefName, in nsIIDRef aType, in nsISupports aValue);
void setIntPref(in string aPrefName, in long aValue);
void unlockPref(in string aPrefName);
-

Attributes

- - - - - - - - - - - - - -
AttributeTypeDescription
rootstringCalled to get the root on which this branch is based, such as "browser.startup." Read only.
-

Constants

- - - - - - - - - - - - - - - - - - - - - - - - - - - - -
ConstantValueDescription
PREF_INVALID0long
PREF_STRING32long data type.
PREF_INT64long data type.
PREF_BOOL128long data type.
-

Methods

-

addObserver()

-

preference change observerを追加します。preferenceに変化があると以下の引数がnsIObserver.observe()に渡されます:

-

aSubject - nsIPrefBranch オブジェクト (this)。

-

aTopicNS_PREFBRANCH_PREFCHANGE_TOPIC_ID で定義される文字列。

-

aData - 変更があったpreferenceの名前(aSubjectの"root"に対する相対値)

-

aSubject.get*Pref(aData) で変更後の新しい値を得ることができます。例えば observer がaddObserver("bar.", ...)で"foo."を起点とするbranchに対して登録を行った場合、"foo.bar.baz"に対する変更がそのobserverを起こします。その時のaDataは"bar.baz"になります。

-
void addObserver(
-  in string aDomain,
-  in nsIObserver aObserver,
-  in boolean aHoldWeak
-);
-
-
Parameters
-
-
- aDomain
-
- 変更を監視したい preference 。完全なbranchを指定することもできます。 例えば "root" prefbranch から addObserver("foo.bar.", ...) を呼ぶと foo.bar.baz と foo.bar.bzipを監視できます
-
- aObserver
-
- preference の変更通知を受け取るオブジェクト。
-
- aHoldWeak
-
- true を指定すると aObserver の weak reference を保持します。この場合オブジェクトは nsISupportsWeakReference インターフェースを実装する必要があり、実装されていない場合は失敗します。false を指定すると strong reference を保持します。
-
-

clearUserPref()

-

Called to clear a user set value from a specific preference. This will, in effect, reset the value to the default value. If no default value exists the preference will cease to exist.

-
註: This method does nothing if the prefbranch it is called on is a default branch.
-
void clearUserPref(
-  in string aPrefName
-);
-
-
Parameters
-
-
- aPrefName
-
- The preference to be cleared.
-
-
Remarks
-
-
-Gecko 6.0 note -
(Firefox 6.0 / Thunderbird 6.0 / SeaMonkey 2.3)
-
-

Prior to Gecko 6.0 (Firefox 6.0 / Thunderbird 6.0 / SeaMonkey 2.3), this method would throw an exception if there was no user value set for the specified preference. Now, this method never throws. Instead, it simply does nothing.

-
-

deleteBranch()

-

Called to remove all of the preferences referenced by this branch.

-
註: This method can be called on either a default or user branch but, in effect, always operates on both.
-
void deleteBranch(
-  in string aStartingAt
-);
-
-
Parameters
-
-
- aStartingAt
-
- The point on the branch at which to start the deleting preferences. Pass in "" to remove all preferences referenced by this branch.
-
-

getBoolPref()

-

Called to get the state of an individual boolean preference.

-
boolean getBoolPref(
-  in string aPrefName
-);
-
-
Parameters
-
-
- aPrefName
-
- The boolean preference to get the state of.
-
-
Return value
-

The value of the requested boolean preference.

-

getCharPref()

-

Called to get the state of an individual string preference.

-
string getCharPref(
-  in string aPrefName
-);
-
-
Parameters
-
-
- aPrefName
-
- The string preference to retrieve.
-
-
Return value
-

Returns string - The value of the requested string preference.

-

getChildList()

-

Returns an array of strings representing the child preferences of the root of this branch.

-
註: This method can be called on either a default or user branch but, in effect, always operates on both.
-

(To call from javascript use children = nsIPrefBranch.getChildList("",obj), which will fill in obj.value with the count and return an array of keys! (It is not void in javascript)

-
void getChildList(
-  in string aStartingAt,
-  out unsigned long aCount,
-  [array, size_is(aCount), retval] out string aChildArray
-);
-
-
Parameters
-
-
- aStartingAt
-
- The point on the branch at which to start enumerating the child preferences. Pass in "" to enumerate all preferences referenced by this branch.
-
- aCount Optional from Gecko 2.0
-
- Receives the number of elements in the array.
-
- aChildArray
-
- Receives the array of child preferences.
-
-

getComplexValue()

-

Called to get the state of an individual complex preference. A complex preference is a preference which represents an XPCOM object that can not be easily represented using a standard boolean, integer or string value.

-
void getComplexValue(
-  in string aPrefName,
-  in nsIIDRef aType,
-  [iid_is(aType), retval] out nsQIResult aValue
-);
-
-
Parameters
-
-
- aPrefName
-
- The complex preference to get the value of.
-
- aType
-
- The XPCOM interface that this complex preference represents. Interfaces currently supported are: - -
-
- aValue
-
- The XPCOM object into which to the complex preference value should be retrieved.
-
-

getIntPref()

-

Called to get the state of an individual integer preference.

-
long getIntPref(
-  in string aPrefName
-);
-
-
Parameters
-
-
- aPrefName
-
- The integer preference to get the value of.
-
-
Return value
-

Returns long - The value of the requested integer preference.

-

getPrefType()

-

Called to determine the type of a specific preference.

-
long getPrefType(
-  in string aPrefName
-);
-
-
Parameters
-
-
- aPrefName
-
- The preference to get the type of.
-
-
Return value
-

Returns long - A value representing the type of the preference. This value will be PREF_STRING, PREF_INT, PREF_BOOL, or PREF_INVALID.

-

lockPref()

-

Called to lock a specific preference. Locking a preference will cause the preference service to always return the default value regardless of whether there is a user set value or not.

-
註: This method can be called on either a default or user branch but, in effect, always operates on the default branch.
-
void lockPref(
-  in string aPrefName
-);
-
-
Parameters
-
-
- aPrefName
-
- The preference to be locked.
-
-

prefHasUserValue()

-

Called to check if a specific preference has a user value associated to it.

-
註: This method can be called on either a default or user branch but, in effect, always operates on the user branch.
-
註: If a preference was manually set to a value that equals the default value, then the preference no longer has a user set value, i.e. it is considered reset to its default value. In particular, this method will return false for such a preference and the preference will not be saved to a file by nsIPrefService.savePrefFile().
-
boolean prefHasUserValue(
-  in string aPrefName
-);
-
-
Parameters
-
-
- aPrefName
-
- The preference to be tested.
-
-
Return value
-

Returns boolean - true The preference has a user set value. false The preference only has a default value.

-

prefIsLocked()

-

Called to check if a specific preference is locked. If a preference is locked calling its Get method will always return the default value.

-
註: This method can be called on either a default or user branch but, in effect, always operates on the default branch.
-
boolean prefIsLocked(
-  in string aPrefName
-);
-
-
Parameters
-
-
- aPrefName
-
- The preference to be tested.
-
-
Return value
-

Returns boolean - true The preference is locked. false The preference is not locked.

-

removeObserver()

-

Remove a preference change observer.

-
註: You must call removeObserver method on the same nsIPrefBranch instance on which you called addObserver method in order to remove aObserver; otherwise, the observer will not be removed.
-
  void removeObserver(
-     in string aDomain,
-     in nsIObserver aObserver
-  );
-
-
Parameters
-
-
- aDomain
-
- The preference which is being observed for changes.
-
- aObserver
-
- An observer previously registered with addObserver.
-
-

resetBranch()

-

Called to reset all of the preferences referenced by this branch to their default values.

-
註: This method can be called on either a default or user branch but, in effect, always operates on the user branch.
-
註: As of Firefox 3.0, this function has not yet been implemented.
-
void resetBranch(
-  in string aStartingAt
-);
-
-
Parameters
-
-
- aStartingAt
-
- The point on the branch at which to start the resetting preferences to their default values. Pass in "" to reset all preferences referenced by this branch.
-
-

setBoolPref()

-

Called to set the state of an individual boolean preference.

-
void setBoolPref(
-  in string aPrefName,
-  in long aValue
-);
-
-
Parameters
-
-
- aPrefName
-
- The boolean preference to set the state of.
-
- aValue
-
- The boolean value to set the preference to.
-
-

setCharPref()

-

Called to set the state of an individual string preference.

-
- Note: preferences システムは大量のデータを保持するようには設計されていません。全ての preferences は単一のファイルに保存されアプリケーションが立ち上がる際に読み込まれます。文字列のpreferenceが最大どれだけのデータが保存できるだろうかと疑問に思った場合は、flat file や sqlite database など別の方法で保存することを検討してください。
-
void setCharPref(
-  in string aPrefName,
-  in string aValue
-);
-
-
Parameters
-
-
- aPrefName
-
- The string preference to set.
-
- aValue
-
- The string value to set the preference to.
-
-

setComplexValue()

-

Called to set the state of an individual complex preference. A complex preference is a preference which represents an XPCOM object that can not be easily represented using a standard boolean, integer or string value.

-
void setComplexValue(
-  in string aPrefName,
-  in nsIIDRef aType,
-  in nsISupports aValue
-);
-
-
Parameters
-
-
- aPrefName
-
- The complex preference to set the value of.
-
- aType
-
- The XPCOM interface that this complex preference represents. Interfaces currently supported are: - -
-
- aValue
-
- The XPCOM object from which to set the complex preference value.
-
-

setIntPref()

-

Called to set the state of an individual integer preference.

-
void setIntPref(
-  in string aPrefName,
-  in long aValue
-);
-
-
Parameters
-
-
- aPrefName
-
- The integer preference to set the value of.
-
- aValue
-
- The integer value to set the preference to.
-
-

unlockPref()

-

Called to unlock a specific preference. Unlocking a previously locked preference allows the preference service to once again return the user set value of the preference.

-
註: This method can be called on either a default or user branch but, in effect, always operates on the default branch.
-
void unlockPref(
-  in string aPrefName
-);
-
-
Parameters
-
-
- aPrefName
-
- The preference to be unlocked.
-
-

Remarks

-

Registering as a preference observer can open an object to potential cyclical references which will cause memory leaks. These cycles generally occur because an object both registers itself as an observer (causing the branch to hold a reference to the observer) and holds a reference to the branch object for the purpose of getting/setting preference values. There are 3 approaches which have been implemented in an attempt to avoid these situations:

-
    -
  1. The nsPrefBranch object supports nsISupportsWeakReference. Any consumer may hold a weak reference to it instead of a strong one.
  2. -
  3. The nsPrefBranch object listens for xpcom-shutdown and frees all of the objects currently in its observer list. This ensures that long lived objects (services for example) will be freed correctly.
  4. -
  5. The observer can request to be held as a weak reference when it is registered. This insures that shorter lived objects (say one tied to an open window) will not fall into the cyclical reference trap.
  6. -
-

The list of registered observers may be changed during the dispatch of nsPref:changed notification. However, the observers are not guaranteed to be notified in any particular order, so you can't be sure whether the added/removed observer will be called during the notification when it is added/removed. 

-

It is possible to change preferences during the notification.

-

It is not safe to change observers during this callback in releases before Gecko 1.9. If you want a safe way to remove a preference observer, please use an nsITimer.

diff --git a/files/ja/mozilla/tech/xpcom/reference/xpcom_interface_reference/nsiscriptableunescapehtml/index.html b/files/ja/mozilla/tech/xpcom/reference/xpcom_interface_reference/nsiscriptableunescapehtml/index.html deleted file mode 100644 index 52e2dc8677..0000000000 --- a/files/ja/mozilla/tech/xpcom/reference/xpcom_interface_reference/nsiscriptableunescapehtml/index.html +++ /dev/null @@ -1,104 +0,0 @@ ---- -title: nsIScriptableUnescapeHTML -slug: >- - Mozilla/Tech/XPCOM/Reference/XPCOM_Interface_Reference/nsIScriptableUnescapeHTML -tags: - - Interfaces - - XPCOM - - XPCOM API Reference -translation_of: Mozilla/Tech/XPCOM/Reference/Interface/nsIScriptableUnescapeHTML ---- -

nsIScriptableUnescapeHTML インタフェースは HTML 文字列をアンエスケープするユーティリティ・インタフェースです。

-


-

-
toolkit/components/feeds/public/nsIScriptableUnescapeHTML.idlScriptable
- - -Please add a summary to this article. - - -
-  -最終更新: Gecko 1.8.1 (Firefox 2 / Thunderbird 2 / SeaMonkey 1.1)
-
-

継承元: nsISupports

-

サービスとして @mozilla.org/feed-unescapehtml;1 による実装:

-
var gUnescapeHTML = Components.classes["@mozilla.org/feed-unescapehtml;1"]
-                              .getService(Components.interfaces.nsIScriptableUnescapeHTML);
-
-

メソッドの概要

- - - - - - - - - -
AString unescape(in AString src);
nsIDOMDocumentFragment parseFragment(in AString fragment, in PRBool isXML, in nsIURI baseURI, in nsIDOMElement element);
-

メソッド

-

unescape()

-

文字列の全てのエンティティを Unicode 文字に変換します。

-
 AString unescape(
-   in AString src
- );
-
-
パラメータ
-
-
- <tt>src</tt>
-
- アンエスケープする HTML 文字列のポインタ。
-
-
戻り値
-

アンエスケープされた文字列。

-
投げられる例外
-
-
- NS_ERROR_FAILURE
-
- 文字列をアンエスケープできない。
-
-

parseFragment()

-

指定された文字列を既存の DOM 要素に追加する。これは nsContentUtils::CreateContextualFragment のフィード特有なバージョンです。

-
 nsIDOMDocumentFragment parseFragment(
-   in AString fragment,
-   in PRBool isXML,
-   in nsIURI baseURI,
-   in nsIDOMElement element
- );
-
-
パラメータ
-
-
- <tt>fragment</tt>
-
- <tt>element</tt> に追加する文字列へのポインタ。
-
- <tt>isXML</tt>
-
- もし <tt>fragment</tt> が XML 文字列であればこれを true に設定してください。そうでなければ、false に設定してください。
-
- <tt>baseURI</tt>
-
- その断片に含まれる URI を解決するための base URI へのポインタ。このパラメータは isXMLfalse の時は無視されます。
-
- <tt>element</tt>
-
- その断片を追加する nsIDOMElement へのポインタ。
-
-
戻り値
-

新しいテキストが追加された要素の nsIDOMDocumentFragment

-
投げられる例外
-
-
- NS_ERROR_FAILURE
-
- 要素にテキストを追加できない。
-
-

参照

-

nsIDOMDocumentFragment, nsIURI, nsIDOMElement

-

Interwiki link

-
-  
diff --git a/files/ja/mozilla/tech/xpcom/reference/xpcom_interface_reference/nsiscriptableunicodeconverter/index.html b/files/ja/mozilla/tech/xpcom/reference/xpcom_interface_reference/nsiscriptableunicodeconverter/index.html deleted file mode 100644 index 512346dbed..0000000000 --- a/files/ja/mozilla/tech/xpcom/reference/xpcom_interface_reference/nsiscriptableunicodeconverter/index.html +++ /dev/null @@ -1,142 +0,0 @@ ---- -title: nsIScriptableUnicodeConverter -slug: >- - Mozilla/Tech/XPCOM/Reference/XPCOM_Interface_Reference/nsIScriptableUnicodeConverter -tags: - - Interfaces - - 'Interfaces:Scriptable' - - Unicode - - XPCOM - - XPCOM Interface Reference -translation_of: Mozilla/Tech/XPCOM/Reference/Interface/nsIScriptableUnicodeConverter ---- -
-
intl/uconv/idl/nsIScriptableUConv.idlScriptable
- - -このインターフェイスは、スクリプトで使用するための Unicode エンコーダーです。 - - -
-継承元: nsISupports -最終更新: Gecko 1.8 (Firefox 1.5 / Thunderbird 1.5 / SeaMonkey 1.0)
-
- -

Implemented by: @mozilla.org/intl/scriptableunicodeconverter. To create an instance, use:

- -
var converter = Components.classes["@mozilla.org/intl/scriptableunicodeconverter"]
-                .createInstance(Components.interfaces.nsIScriptableUnicodeConverter);
-
- -

メソッドの概要

- - - - - - - - - - - - - - - - - - - - - - -
ACString ConvertFromUnicode(in AString aSrc);
ACString Finish();
AString ConvertToUnicode(in ACString aSrc);
AString convertFromByteArray([const,array,size_is(aCount)] in octet aData, in unsigned long aCount);
void convertToByteArray(in AString aString,[optional] out unsigned long aLen,[array, size_is(aLen),retval] out octet aData);
nsIInputStream convertToInputStream(in AString aString);
- -

属性

- - - - - - - - - - - - - - -
属性名概要
charsetstring現在の文字セット。要求された文字セットがサポートされていない場合、 NS_ERROR_UCONV_NOCONV がスローされる。
- -

メソッド

- -

ConvertFromUnicode()

- -

Converts the data from Unicode to one Charset. Returns the converted string. After converting, Finish should be called and its return value appended to this return value.

- -
ACString ConvertFromUnicode(
-  in AString aSrc
-);
-
- -

Finish()

- -

Returns the terminator string. Should be called after ConvertFromUnicode() and appended to that function's return value.

- -
ACString Finish();
-
- -

ConvertToUnicode()

- -

Converts the data from one Charset to Unicode.

- -
AString ConvertToUnicode(
-  in ACString aSrc
-);
-
- -

convertFromByteArray()

- -

Converts an array of bytes to a unicode string.

- -
AString convertFromByteArray(
-  [const,array,size_is(aCount)] in octet aData,
-  in unsigned long aCount
-);
-
- -

convertToByteArray()

- -

Convert a unicode string to an array of bytes. Finish does not need to be called.

- -
void convertToByteArray(in AString aString,
-  out unsigned long aLen, Optional
-  [array, size_is(aLen),retval] out octet aData
-);
-
- -

convertToInputStream()

- -

Converts a Unicode string to an input stream. The bytes in the stream are encoded according to the charset attribute. The returned stream is non-blocking.

- -
nsIInputStream convertToInputStream(
-  in AString aString
-);
-
- -
引数
- -
-
aString
-
The text to encode to the stream. The text is encoded into the character set specified by the charset attribute.
-
- -
戻り値
- -

An nsIInputStream that will present the text specified in aString as its data.

- -

- -

See Reading textual data and Writing textual data for examples.

diff --git a/files/ja/mozilla/tech/xpcom/reference/xpcom_interface_reference/nsisessionstore/index.html b/files/ja/mozilla/tech/xpcom/reference/xpcom_interface_reference/nsisessionstore/index.html deleted file mode 100644 index b77b282637..0000000000 --- a/files/ja/mozilla/tech/xpcom/reference/xpcom_interface_reference/nsisessionstore/index.html +++ /dev/null @@ -1,419 +0,0 @@ ---- -title: nsISessionStore -slug: Mozilla/Tech/XPCOM/Reference/XPCOM_Interface_Reference/nsISessionStore -tags: - - Interfaces - - 'Interfaces:Scriptable' - - XPCOM - - XPCOM API Reference -translation_of: Mozilla/Tech/XPCOM/Reference/Interface/nsISessionStore ---- -

nsISessionStore インタフェースは、ブラウザのセッション、タブやウィンドウと関連付けてデータを保存する手段を拡張機能やコードへ提供します。 Session store API も参照してください。

-

この API は最上位の browser.xul ウィンドウに対して機能します。詳細については #Note on windows を参照してください。

-

APIの呼び出しを成功させるためには、ユーザ設定値 browser.sessionstore.enabled は true でなければなりません。 を参照してください。

-


-

-
browser/components/sessionstore/nsISessionStore.idlScriptable
- - -Please add a summary to this article. - - -
-  -最終更新: Gecko 1.8.1 (Firefox 2 / Thunderbird 2 / SeaMonkey 1.1)
-
-

継承元: nsISupports

-

メソッドの概要

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void deleteTabValue(in nsIDOMNode aTab, in AString aKey);
void deleteWindowValue(in nsIDOMWindow aWindow, in AString aKey);
nsIDOMNode duplicateTab(in nsIDOMWindow aWindow, in nsIDOMNode aTab);
AString getBrowserState();
unsigned long getClosedTabCount(in nsIDOMWindow aWindow);
AString getClosedTabData(in nsIDOMWindow aWindow);
AString getTabState(in nsIDOMNode aTab);
AString getTabValue(in nsIDOMNode aTab, in AString aKey);
AString getWindowState(in nsIDOMWindow aWindow);
AString getWindowValue(in nsIDOMWindow aWindow, in AString aKey);
void init(in nsIDOMWindow aWindow);
void persistTabAttribute(in AString aName);
void setBrowserState(in AString aState);
void setTabState(in nsIDOMNode aTab, in AString aState);
void setTabValue(in nsIDOMNode aTab, in AString aKey, in AString aStringValue);
void setWindowState(in nsIDOMWindow aWindow, in AString aState, in boolean aOverwrite);
void setWindowValue(in nsIDOMWindow aWindow, in AString aKey, in AString aStringValue);
void undoCloseTab(in nsIDOMWindow aWindow, in unsigned long aIndex);
-

メソッド

-

deleteTabValue()

-

指定されたウィンドウ【訳注: 「タブ」の誤り?】から値を削除する。

-
 void deleteTabValue(
-   in nsIDOMNode aTab,
-   in AString aKey
- );
-
-
引数
-
-
- <tt>aTab</tt>
-
- どのタブから値を削除するか。
-
- <tt>aKey</tt>
-
- どのキーに対する値を削除するか。
-
-

deleteWindowValue()

-

指定されたウィンドウから値を削除する。

-
 void deleteWindowValue(
-   in nsIDOMWindow aWindow,
-   in AString aKey
- );
-
-
引数
-
-
- <tt>aWindow</tt>
-
- どのウィンドウから値を削除するか。
-
- <tt>aKey</tt>
-
- どのキーに対する値を削除するか。
-
-

duplicateTab()

-
-

Firefox 3 における注記

-

このメソッドは Firefox 3 にて導入されました。

-
指定されたタブをできるだけ完全な形で複製する。 -
 nsIDOMNode duplicateTab(
-   in nsIDOMWindow aWindow,
-   in nsIDOMNode aTab
- );
-
-
引数
-
-
- <tt>aWindow</tt>
-
- 複製するタブが属するウィンドウ。
-
- <tt>aTab</tt>
-
- 複製するタブ。
-
-
戻り値
-

新しいタブを表す nsIDOMNode で、その内容は <tt>aTab</tt> の複製である。

-

getBrowserState()

-

すべてのウィンドウとそのすべてのタブを含む、ブラウザ全体の現在の状態を返す。

-
 AString getBrowserState();
-
-
戻り値
-

ブラウザ上のすべてのウィンドウについて、現在の状態を表す JSON 文字列。

-

getClosedTabCount()

-

引数で渡されたウィンドウについて、何個のタブを復元できるかを返す。

-
 unsigned long getClosedTabCount(
-   in nsIDOMWindow aWindow
- );
-
-
引数
-
-
- <tt>aWindow</tt>
-
- どのウィンドウから復元可能なタブの個数を取得するか。
-
-
戻り値
-

そのウィンドウの復元可能なタブの個数。

-

getClosedTabData()

-

指定されたウィンドウについて、閉じたタブのリストを返す。

-
 AString getClosedTabData(
-   in nsIDOMWindow aWindow
- );
-
-
引数
-
-
- <tt>aWindow</tt>
-
- どのウィンドウからタブのリストを取得するか。
-
-
戻り値
-

<tt>aWindow</tt> で指定したウィンドウについての閉じたタブのリストを表す JSON 文字列。リストは Last In / First Out (LIFO) の順序であり、リストの先頭のアイテムは最後に閉じられたタブである。

-

getTabState()

-
-

Firefox 3 における注記

-

このメソッドは Firefox 3 にて導入されました。

-
指定されたタブの状態を返す。 -
 AString getTabState(
-   in nsIDOMNode aTab
- );
-
-
引数
-
-
- <tt>aTab</tt>
-
- どのタブの状態を返すか。
-
-
戻り値
-

指定されたタブの状態を表す JSON 文字列。

-
註: 戻り値の文字列は Cookie を含みません。もし Cookie も取得したいのであれば、代わりに getWindowState() を使う必要があります。
-

getTabValue()

-

引数で渡されたウィンドウについて、キーに対応する値を返す。

-
 AString getTabValue(
-   in nsIDOMNode aTab,
-   in AString aKey
- );
-
-
引数
-
-
- <tt>aTab</tt>
-
- どのタブから値を取得するか。
-
- <tt>aKey</tt>
-
- どのキーに対応する値を取得するか。
-
-
戻り値
-

setTabValue() によって以前に <tt>aKey</tt> に対して割り当てられた文字列の値。

-

getWindowState()

-

ブラウザ上の指定されたひとつのウィンドウについて、現在の状態を返す。

-
 AString getWindowState(
-   in nsIDOMWindow aWindow
- );
-
-
引数
-
-
- <tt>aWindow</tt>
-
- どのウィンドウの状態から状態を取得するか。 #Note on windows を参照。
-
-
戻り値
-

<tt>aWindow</tt> によって指定されたウィンドウのみを含む、セッション状態を表す JSON 文字列。

-

browser.sessionstate.enabled が false の場合にこのメソッドを呼び出すと、 "aWindows[i] has no properties" というメッセージの例外が発生する。

-

getWindowValue()

-

あるウィンドウについて、引数で指定されたキーと関連付けられた値を返す。

-
 AString getWindowValue(
-   in nsIDOMWindow aWindow,
-   in AString aKey
- );
-
-
引数
-
-
- <tt>aWindow</tt>
-
- どのウィンドウから値を取得するか。
-
- <tt>aKey</tt>
-
- どのキーに対応する値を取得するか。
-
-
戻り値
-

指定されたキーに対して以前保存された文字列の値。もしキーに対する値がセットされていなければ、空の文字列を返す。

-

init()

-

セッションストアサービスを初期化する。

-
- 注意: この関数はブラウザのみから利用されることを意図しており、拡張機能はこれを呼び出すべきではありません。
-
 void init(
-   in nsIDOMWindow aWindow
- );
-
-
引数
-
-
- <tt>aWindow</tt>
-
- どのウィンドウに対してサービスを初期化するか。
-
-

setBrowserState()

-

現在のブラウザの状態をセットする。

-
 void setBrowserState(
-   in AString aState
- );
-
-
引数
-
-
- <tt>aState</tt>
-
- 使用するセッション状態を表す JSON 文字列。
-
-
- 注意: setBrowserState() を呼び出すと、現在のセッションが直ちに置き換わり、引数 <tt>aState</tt> で渡したアプリケーション全体の状態が復元されます。
-

persistTabAttribute()

-

すべての XUL のタブに対して、保存と復元を行う tab 要素の属性名をセットする。

-
 void persistTabAttribute(
-   in AString aName
- );
-
-
- 注意: 今のところ、どのタブに対して永続化する属性をセットするかを選択する手段はありません。このメソッドはすべてのタブに対して区別無く影響します。
-
引数
-
-
- <tt>aName</tt>
-
- すべてのタブに対して、保存復元する属性の名前。
-
-

setTabState()

-
-

Firefox 3 における注記

-

このメソッドは Firefox 3 にて導入されました。

-
指定されたタブに対して、状態をセットする。 -
 void setTabState(
-   in nsIDOMNode aTab,
-   in AString aState
- );
-
-
引数
-
-
- <tt>aTab</tt>
-
- どのタブへ状態をセットするか。
-
- <tt>aState</tt>
-
- タブへセットする、タブの状態を表す JSON 文字列。例えば getTabState() によって取得したもの。
-
-

setTabValue()

-

タブに対して指定されたキーに対する値をセットする。

-
 void setTabValue(
-   in nsIDOMNode aTab,
-   in AString aKey,
-   in AString aStringValue
- );
-
-
引数
-
-
- <tt>aTab</tt>
-
- どのタブに対して値をセットするか。
-
- <tt>aKey</tt>
-
- どのキーに対する値をセットするか。
-
- <tt>aStringValue</tt>
-
- キー <tt>aKey</tt> に対する値としてセットする文字列。 JavaScript のオブジェクトについては toSource() メソッドを利用することができる。また、 eval() 関数を使うことによって、より複雑なデータ(あるいはオブジェクト全体までも)が値として割り当てることができる。
-
-

setWindowState()

-

保存された状態を引数として渡し、ひとつのウィンドウへ状態をセットする。

-
 void setWindowState(
-   in nsIDOMWindow aWindow,
-   in AString aState,
-   in boolean aOverwrite
- );
-
-
引数
-
-
- <tt>aWindow</tt>
-
- <tt>aState</tt> で示した状態をどの ブラウザウィンドウ に対してセットするか。
-
- <tt>aState</tt>
-
- 指定したウィンドウに対して適用する、保存された状態。
-
- <tt>aOverwrite</tt>
-
- もしこの引数が true であるなら、現在開かれているすべてのタブは削除され、状態 <tt>aState</tt> のタブへと置き換わります。もし false であれば、ウィンドウにすでにあるタブに <tt>aState</tt> のタブが追加されます。
-
-

setWindowValue()

-

指定したウィンドウに対し、引数で渡したキーに対応する値をセットする。

-
 void setWindowValue(
-   in nsIDOMWindow aWindow,
-   in AString aKey,
-   in AString aStringValue
- );
-
-
引数
-
-
- <tt>aWindow</tt>
-
- どのウィンドウに対して値をセットするか。
-
- <tt>aKey</tt>
-
- どのキーに対する値をセットするか。
-
- <tt>aStringValue</tt>
-
- キー <tt>aKey</tt> に対する値としてセットする文字列。 JavaScript のオブジェクトについては toSource() メソッドを利用することができる。また、 eval() 関数を使うことによって、より複雑なデータ(あるいはオブジェクト全体までも)が値として割り当てることができる。
-
-

undoCloseTab()

-

指定したウィンドウにて、閉じたタブを開きなおす。

-
 void undoCloseTab(
-   in nsIDOMWindow aWindow,
-   in unsigned long aIndex
- );
-
-
引数
-
-
- <tt>aWindow</tt>
-
- どのウィンドウで閉じたタブを開きなおすか。
-
- <tt>aIndex</tt>
-
- 閉じたタブのうち、どのインデックス番号のタブを復元するか。この値は、0よりも大きく、 getClosedTabCount() で返される値よりも小さくなければならない。閉じたタブのリストは Last In / First Out (LIFO) の順序で保存されており、インデックス番号が0のタブは最後に閉じたタブである。
-
-

Note on windows

-

The nsISessionStore API stores state information for certain windows inside the web brower. These windows are nsIDOMWindow objects that contain the tabbrowser that users see as tabs; the document in these windows is browser.xul.

-

For many extensions, those that overlay browser.xul, the appropriate window object for nsISessionStore is the global object 'window'.

-

For Javascript running in windows other than the one you want to use in nsISessionStore, you need a nsIDOMWindow object containing browser.xul. This will be the outermost or root nsIDOMWindow in a nsIXULWindow (the window seen by users as a moveable frame on the display). This kind of DOMWindow object can be obtained from other nsIDOMWindow objects (like the sidebar window object) by applying the 'mainWindow' statement from Working_with_windows_in_chrome_code. This outermost or root window can also be obtained from the list returned by nsIWindowMediator; see example #3 in Working_with_windows_in_chrome_code. It can also be obtained from an nsIXULWindow using

-
if (xul_win.docShell instanceof nsIInterfaceRequestor)  {
-   var win = xul_win.docShell.getInterface(nsIDOMWindow);
-   ...
-
-

参考

-

nsISupports

diff --git a/files/ja/mozilla/tech/xpcom/reference/xpcom_interface_reference/nsisupports_proxies/index.html b/files/ja/mozilla/tech/xpcom/reference/xpcom_interface_reference/nsisupports_proxies/index.html deleted file mode 100644 index 05589a89d5..0000000000 --- a/files/ja/mozilla/tech/xpcom/reference/xpcom_interface_reference/nsisupports_proxies/index.html +++ /dev/null @@ -1,89 +0,0 @@ ---- -title: nsISupports proxies -slug: Mozilla/Tech/XPCOM/Reference/XPCOM_Interface_Reference/nsISupports_proxies -tags: - - MDC Project - - NeedsUpdate - - XPCOM -translation_of: Mozilla/Tech/XPCOM/Reference/Interface/nsISupports_proxies ---- -

この文脈において、「プロキシ」とは、nsISupports から派生していてタイプライブラリを持つ任意のクラスのメソッドが、任意のプロセス中のスレッドにおいて呼び出しを行えるようにするスタブオブジェクトのことです。

-

nsISupports プロキシが必要な主な理由は、JavaScript と UI が一つのスレッド上にあることです。ひとつのスレッドがビジーの場合、他のスレッドはブロックされます。このことの良い例が XPInstall です。そのインストールスクリプトは、小さくかつ速く走る、多くの JavaScript とは異なっています。XPInstall インストールスクリプトは、しばしばとても複雑であり、また、解凍のためやネイティブなファイルシステムの動作のために、長い実行時間を要求します。もし XPInstall が UI スレッドの上で動作するのであれば、製品はスクリプトが完了するまで動作できなくなるでしょう。これは、あきらかにまずいです。このため、XPInstall は、それ自身のスレッドに移動します。現在 XPInstall は、製品が動作している時に、インストールを実行できます。しかし、現在 XPInstall はプログレスメーターや確認ダイアログのようなUI要素にアクセスできません。分離した非 UI スレッドが UI スレッド上で動作しているかのように見せるにはどうしたらよいでしょう。ここで、nsISupports プロキシのユーティリティを使います。

-

Seamonkey にかかわっている他の人々も同様の解決策を望んでいると思います。このドキュメントでは、nsISupports プロキシの使い方を説明しようと思います。また、 もご参照ください。

-

どうやって使うか?

-
-

Mozilla 1.9 で API に変更が行われましたが、以下のコードは更新されていません。更新後のインターフェースとドキュメントは xpcom/proxy/public/nsIProxyObjectManager.idl をご覧ください。 もご参照ください。

-
-

ユーザの視点からいうと、nsIProxyObjectManager を調べるだけです。これには、二つの入口点があります。

-
NS_IMETHOD GetProxyForObject(nsIEventQueue *destQueue,
-                             const nsIID & iid,
-                             nsISupports *object,
-                             PRInt32 proxyType,
-                             void * *result);
-
-NS_IMETHOD GetProxy(nsIEventQueue *destQueue,
-                    const nsIID & cid,
-                    nsISupports *aOuter,
-                    const nsIID & iid,
-                    PRInt32 proxyType,
-                    void * *result);
-
-

2 つの API は基本的に同じです。違いは、最初の方はすでに作成した object オブジェクトを受け入れるのに対し、後の方は中でオブジェクトを作成することです。この生成は、目的のイベントキューで起きます。例えば、もしオブジェクトをリモートで使うだけでなく、リモートで作成したい場合、2 番目の API を使う必要があります。

-

要求した IID はタイプライブラリの中に存在しなければ - - なりません - 。このことは、それに対する IDL とタイプライブラリを作成しておかなければならないことを意味します。もしそうしない場合や私が何を言っているのか理解できない場合は、 http://www.mozilla-japan.org/scriptable/ を見てください

-

proxyType パラメータは、2 つのフラグのどちらかをとります。PROXY_SYNC または PROXY_ASYNC です。これら 2 つのフラグは、どちらも PROXY_ALWAYS と OR をとることができます。

-

PROXY_ALWAYS は、現在のスレッドがなんであれ、プロキシオブジェクトがいつも作られることを保証します。もしこのフラグがセットされていなければ、プロキシオブジェクトマネージャは、現在のスレッド上のイベントキューと渡されてきたイベントキューを比較します。もしこれらが一致したら、 - - プロキシ化されていない - 、そのままのオブジェクトを返します。ほとんどの場合は、あなたはこのフラグをセットしたいでしょう。

-

PROXY_SYNC は、メソッドが目的のスレッド上で実行されるまで、呼び出しているスレッドをブロックするため、単なる関数呼び出しを行っているように振舞います。これが通常でかつデフォルトの場合です。

-

一方、PROXY_ASYNC は、「飛んでいって (戻るのを) 忘れてしまう」メソッド呼び出しです。このフラグで作成されたオブジェクトでの呼び出しは、直ちに復帰し、復帰情報は失われます。NS_OK が (復帰値として) 返ってきます。

-
- PROXY_ASYNC についての警告: -

このフラグを使う際には、よく気をつける必要があります。呼び出しているスレッドが終了した時、呼び出し側のスタックにアクセスしているすべてのメソッドが失敗します。例えば:

-
 myFoo->bar(&x)
-
- ... スレッドが終了してしまう ...
-
- bar(PRInt32 *x)
- {
-     ...
-     *x = 0;   <-----  ここで失敗します
- }
-
-
-

そのため、メソッドを実行するためのイベントキュー、そして作成された nsISupports オブジェクトや CID そしてフラグが渡されて、新しい nsISupports プロキシオブジェクトが返ってきます。一旦プロキシオブジェクトを手にすると、それをあたかも「本当の」オブジェクトであるかのように扱うことができます。「本当の」オブジェクトでのすべてのメソッドに対して、プロキシオブジェクトがスタブの役目を果たします。プロキシオブジェクトの使用が終わったら NS_RELEASE を呼び出すべきです。これにより、自分自身と同様に「本当の」オブジェクトの解放も行います。自分でオブジェクトを作ってから、プロキシを作ったのであれば、少なくとも参照カウントが 2 でなければならないことに注意してください。(ひとつがプロキシのため、もうひとつは GetProxyObject の呼び出しで渡して作成したオブジェクトのためです。それに、その他の参照カウントが足されます。)

-

ここでは、GetProxyObject に対してどのようにイベントキューを提供するかということを取り上げます。二つの可能性があります。ひとつは、興味を持っているイベントキューを知っている場合です。この場合、単にそれを使ってください。ほとんどの場合では、メイン UI スレッド (一種の基本的なスレッド) が必要でしょう。もしその場合、イベントキューとして、単に nsnull を渡すことができます。xpcom/threads/nsIEventQueueService.h#44 にある定義済のフラグも使うことができます。

-

呼び出し元が目的のスレッドにいるかどうかを決定するロジックもあります。これが真であれば、プロキシ経由では呼び出されずに、最適化のためにメソッド (最適化) を直接呼び出します。この検知は、PROXY_SYNC フラグで作成されたプロキシを使うときだけに使われます。

-

使用例

-
nsresult rv = NS_OK;
-
-NS_WITH_SERVICE( nsIProxyObjectManager, pIProxyObjectManager, kProxyObjectManagerCID, &rv);
-if(NS_FAILED(rv)) return rv;
-
-rv = pIProxyObjectManager->GetProxyForObject( NS_UI_THREAD_EVENTQ,
-                                                  nsITestProxy::GetIID(),
-                                                  createdTestObject,
-                                                  PROXY_SYNC | PROXY_ALWAYS,
-                                                  (void**)proxyToTestObject);
-
-    // もう本当のオブジェクトについては、気にしない。すなわち、GetProxyObjectが
-    // 参照カウントを行っている。
-NS_RELEASE(createdTestObject);
-
-proxyToTestObject->Test1(x,y,z);
-
-NS_RELEASE(proxyToTestObject);
-
-
-

原文書の情報

- -
-
-  
diff --git a/files/ja/mozilla/tech/xpcom/reference/xpcom_interface_reference/nsitaggingservice/index.html b/files/ja/mozilla/tech/xpcom/reference/xpcom_interface_reference/nsitaggingservice/index.html deleted file mode 100644 index 67867b4076..0000000000 --- a/files/ja/mozilla/tech/xpcom/reference/xpcom_interface_reference/nsitaggingservice/index.html +++ /dev/null @@ -1,180 +0,0 @@ ---- -title: nsITaggingService -slug: Mozilla/Tech/XPCOM/Reference/XPCOM_Interface_Reference/nsITaggingService -tags: - - Interfaces - - 'Interfaces:Scriptable' - - Places - - XPCOM - - XPCOM API Reference - - XPCOM Interface Reference -translation_of: Mozilla/Tech/XPCOM/Reference/Interface/nsITaggingService ---- -
-
toolkit/components/places/public/nsITaggingService.idlScriptable
- - ->インタフェースはあるURIに対するタグの付与とその除去を行う機能、与えられたタグからURIを取り出す機能、およびあるURIに関連付けられた全てのタグを取得するメソッドを提供します。 - - -
- -
1.0
- -
66
- -
- -
- -
Introduced
-
Gecko 1.9
- -
- -
- -
-継承元: nsISupports -最終更新: Gecko 2.0 (Firefox 4 / Thunderbird 3.3 / SeaMonkey 2.1)
-
- -

実装: @mozilla.org/browser/tagging-service;1 このサービスを使うには以下のものを使用して下さい。

- -
var taggingSvc = Components.classes["@mozilla.org/browser/tagging-service;1"]
-                           .getService(Components.interfaces.nsITaggingService);
-
- -

メソッドの概要

- - - - - - - - - - - - - - - - -
void tagURI(in nsIURI aURI, in nsIVariant aTags);
void untagURI(in nsIURI aURI, in nsIVariant aTags);
nsIVariant getURIsForTag(in AString aTag);
nsIVariant getTagsForURI(in nsIURI aURI, [任意] out unsigned long length, [retval, array, size_is(length)] out wstring aTags);
- -

属性

- - - - - - - - - - - - - - - - - - - -
属性説明
allTagsnsIVariantデータベース内で URI に付与したタグの全てを(名前順で)受け取ります。
tagContainerIconSpecAUTF8Stringタグコンテナアイコンの URL 仕様を受け取ります
- -

メソッド

- -

tagURI()

- -

与えられたタグのセットをある URI に付与します。 URI が持つ現在のタグのセットはそのまま残ります。 aTags に含まれるタグのうち、既に与えられた URI にセットされているものがあればそれは無視されます。

- -
 void tagURI(
-  in nsIURI aURI,
-  in nsIVariant aTags
-);
-
- -
引数
- -
-
aURI
-
タグ付けする URI です。
-
aTags
-
与えられた URI に対して付与するタグの配列です。
-
- -

untagURI()

- -

ある URI からタグを取り除きます。 aTags に含まれるタグのうち、与えられた URI に設定されていないものは無視されます。

- -
 void untagURI(
-  in nsIURI aURI,
-  in nsIVariant aTags
-);
-
- -
引数
- -
-
aURI
-
タグ付けを解除する URI です。
-
aTags
-
URI から取り除くタグの配列です。NULL を渡すと与えられた URI から全てのタグを取り除きます。
-
- -

getURIsForTag()

- -

このメソッドは、与えられたタグが付与されている全ての URI を取得します。

- -
 nsIVariant getURIsForTag(
-  in AString aTag
-);
-
- -
引数
- -
-
aTag
-
タグ名です。
-
- -
返値
- -

aTag で指定されたタグが付与された全ての URI の配列

- -

getTagsForURI()

- -

与えられたURIに付与されている全てのタグを取得します。

- -
nsIVariant getTagsForURI(
-  in nsIURI aURI,
-  [任意] out unsigned long length,
-  [retval, array, size_is(length)] out wstring aTags
-);
-
- -
引数
- -
-
aURI
-
タグを返す URI です。
-
length Optional
-
戻る際に aTags に返されたタグの数が入ります。任意ですが、 Gecko 2.0 より前は必須の引数でした。
-
aTags
-
戻る際に URI に付与されたタグの配列が入ります。
-
- -
返値
- -

タグの配列(名前順)です。

- -

関連情報

- - diff --git a/files/ja/mozilla/tech/xpcom/reference/xpcom_interface_reference/nsithread/index.html b/files/ja/mozilla/tech/xpcom/reference/xpcom_interface_reference/nsithread/index.html deleted file mode 100644 index 7f8e9a8940..0000000000 --- a/files/ja/mozilla/tech/xpcom/reference/xpcom_interface_reference/nsithread/index.html +++ /dev/null @@ -1,119 +0,0 @@ ---- -title: nsIThread -slug: Mozilla/Tech/XPCOM/Reference/XPCOM_Interface_Reference/nsIThread -tags: - - Firefox 3 - - Interfaces - - Threads - - XPCOM - - XPCOM API Reference -translation_of: Mozilla/Tech/XPCOM/Reference/Interface/nsIThread ---- -

nsIThread インタフェースは、オペレーティングシステム (OS) のスレッドに対する高レベルの抽象化を提供します。スレッドには組み込みのキューが含まれており、スレッドは、そのスレッド上で処理される nsIRunnable オブジェクト (イベント) を取得できるイベントターゲットと言えます。

-

スレッドを作成するには、nsIThreadManager インタフェースを使います。

-

継承元: nsIEventTarget

-


-

-
xpcom/threads/nsIThread.idlScriptable
- - -Please add a summary to this article. - - -
-  -最終更新: Gecko 1.9 (Firefox 3)
-
-

メソッドの概要

- - - - - - - - - - - - -
void shutdown()
boolean hasPendingEvents()
boolean processNextEvent(in boolean mayWait)
-

属性

- - - - - - - - - - - - - -
属性説明
PRThreadPRThreadnsIThread に相当する NSPR スレッドオブジェクト。読み取り専用。
-

メソッド

-

shutdown()

-

スレッドを停止します。これは、そのスレッドに割り当てられているイベントを中止し、スレッドが現在のスレッドに加わる前に、待機中のイベントがある場合はそれらを実行して完了させます (詳しくは PR_JoinThread() を参照してください)。このメソッド呼び出しの実行中、現在のスレッドに割り当てられたイベントは処理が継続されます。

-
- 警告: このメソッドは、スレッド自体から呼び出すことができません。その代わり、他のスレッド (通常、呼び出したいスレッドの作成元であるスレッド、もしくはメインのアプリケーションスレッド) から呼び出す必要があります。この関数が返されると、スレッドは停止され、以後イベントを受け付けることはできなくなります。
-
void shutdown()
-
-
引数
-

なし。

-
投げられる例外
-
-
- NS_ERROR_UNEXPECTED
-
- shutdown() が、スレッド自体から誤って呼び出された場合。そのスレッドがスレッドマネージャの newThread() メソッドを使って作成されたものではない場合。あるいはスレッドがすでに停止処理中である場合。
-
-

hasPendingEvents()

-

処理待機中のイベントがそのスレッドに存在するかどうかを判別します。

-
註: このメソッドは、他のスレッドからではなく、スレッド自体から呼び出す必要があります。
-
boolean hasPendingEvents()
-
-
引数
-

なし。

-
戻り値
-

関数が呼び出された時点で待機中のイベントが存在する場合は true。なお、false が返ってきた場合でも、現在のスレッドに他のスレッドがイベントを追加できるため、このメソッドが返るまでにイベントキューが空ではなくなる可能性があります。

-
投げられる例外
-
-
- NS_ERROR_UNEXPECTED
-
- このスレッドが現在のスレッドではないときにこのメソッドが呼び出された場合。
-
-

processNextEvent()

-

次に待機中のイベントを処理します。待機中のイベントが存在しない場合、mayWait 引数の値によっては、新しいイベントがスレッドに割り当てられるまで待機状態となります。

-

このメソッドは再入可能ですが、このスレッドが現在のスレッドである場合のみ呼び出されます。

-
boolean processNextEvent(
-  in boolean mayWait
-)
-
-
引数
-
-
- mayWait
-
- true の場合、イベントキューが空であるときは、新しいイベントが処理可能になるまで待機します。false の場合、イベントキューが空であるときは即座に返ります。
-
-
戻り値
-

イベントが処理中であった場合は true、待機中のイベントが存在しない場合は false

-
投げられる例外
-
-
- NS_ERROR_UNEXPECTED
-
- このスレッドが現在のスレッドではないときにこのメソッドが呼び出された場合。
-
-

関連記事

- diff --git a/files/ja/mozilla/tech/xpcom/reference/xpcom_interface_reference/nsithreadeventfilter/index.html b/files/ja/mozilla/tech/xpcom/reference/xpcom_interface_reference/nsithreadeventfilter/index.html deleted file mode 100644 index 49f64ad777..0000000000 --- a/files/ja/mozilla/tech/xpcom/reference/xpcom_interface_reference/nsithreadeventfilter/index.html +++ /dev/null @@ -1,61 +0,0 @@ ---- -title: nsIThreadEventFilter -slug: Mozilla/Tech/XPCOM/Reference/XPCOM_Interface_Reference/nsIThreadEventFilter -tags: - - Firefox 3 - - Interfaces - - Threads - - XPCOM - - XPCOM API Reference -translation_of: Mozilla/Tech/XPCOM/Reference/Interface/nsIThreadEventFilter ---- -

nsIThreadEventFilter インタフェースを実装すると、あるイベントが入れ子になったイベントキューに受け付けられるかどうかを判別することができます。詳細は nsIThreadInternalpushEventQueue() メソッドを参照してください。

-

このインタフェースと acceptEvent() メソッドを実装してから、それをフィルタとして実装したオブジェクトを渡すべきです。

-

継承元: nsISupports

-


-

-
xpcom/threads/nsIThreadInternal.idlScriptable
- - -Please add a summary to this article. - - -
-  -最終更新: Gecko 1.9 (Firefox 3)
-
-

メソッドの概要

- - - - - - -
[notxpcom] boolean acceptEvent(in nsIRunnable event);
-

メソッド

-

acceptEvent()

-

このメソッドは、あるイベントが入れ子になったイベントキューに受け付けられるかどうかを判別するために呼び出されます。

-
- 警告: このメソッドはスレッドオブジェクト上では呼び出しを行ってはいけません。
-
[notxpcom] boolean acceptEvent(
-  in nsIRunnable event
-)
-
-
引数
-
-
- <tt>event</tt>
-
- 割り当てを行うイベント。
-
-
戻り値
-

イベントが受け入れられる場合は true、受け入れられない場合は false

-

関連記事

- diff --git a/files/ja/mozilla/tech/xpcom/reference/xpcom_interface_reference/nsithreadinternal/index.html b/files/ja/mozilla/tech/xpcom/reference/xpcom_interface_reference/nsithreadinternal/index.html deleted file mode 100644 index c363c03792..0000000000 --- a/files/ja/mozilla/tech/xpcom/reference/xpcom_interface_reference/nsithreadinternal/index.html +++ /dev/null @@ -1,82 +0,0 @@ ---- -title: nsIThreadInternal -slug: Mozilla/Tech/XPCOM/Reference/XPCOM_Interface_Reference/nsIThreadInternal -tags: - - Firefox 3 - - Interfaces - - Threads - - XPCOM - - XPCOM API Reference -translation_of: Mozilla/Tech/XPCOM/Reference/Interface/nsIThreadInternal ---- -

nsIThreadInternal インタフェースは、スレッド上に割り当てられたアクティビティを監視するために、XPCOM スレッドオブジェクトによって実装されています。

-

継承元: nsIThread

-


-

-
xpcom/threads/nsIThreadInternal.idlScriptable
- - -Please add a summary to this article. - - -
-  -最終更新: Gecko 1.9 (Firefox 3)
-
-

メソッドの概要

- - - - - - - - - -
void pushEventQueue(in nsIThreadEventFilter filter);
void popEventQueue();
-

属性

- - - - - - - - - - - - - -
属性説明
observernsIThreadObserver現在のスレッドオブザーバを取得、設定します。監視を無効化する場合は null を設定します。この属性はどのスレッドからも読み取り可能ですが、設定は、このスレッドオブジェクトに対応したスレッド上で行わなくてはなりません。
-

メソッド

-

pushEventQueue()

-

現在スレッド上で待機しているすべてのイベントを、popEventQueue() が呼び出されるまで中止します。さらに、新たにスレッドに割り当てられたイベントは、指定されたフィルタによって許可された場合のみ処理されます。

-

フィルタが null の場合、新しいイベントはすべて許可されます。

-

pushEventQueue() の呼び出しは入れ子にすることができますが、スレッドを元の状態に戻すには、対応する popEventQueue() の呼び出しとそれぞれ対にする必要があります。

-
void pushEventQueue(
-  in nsIThreadEventFilter filter
-)
-
-
引数
-
-
- <tt>filter</tt>
-
- 割り当てられたイベントに適用する nsIThreadEventFilter。割り当てられているイベントをすべて許可する場合は null
-
-

popEventQueue()

-

pushEventQueue() の呼び出しを取り消します。イベントキューが再開されると、キューに残っているイベントはすべて、より上のキューに追加されます。

-
void popEventQueue()
-
-
引数
-

なし。

-

関連記事

- diff --git a/files/ja/mozilla/tech/xpcom/reference/xpcom_interface_reference/nsithreadmanager/index.html b/files/ja/mozilla/tech/xpcom/reference/xpcom_interface_reference/nsithreadmanager/index.html deleted file mode 100644 index bb797c4d5c..0000000000 --- a/files/ja/mozilla/tech/xpcom/reference/xpcom_interface_reference/nsithreadmanager/index.html +++ /dev/null @@ -1,112 +0,0 @@ ---- -title: nsIThreadManager -slug: Mozilla/Tech/XPCOM/Reference/XPCOM_Interface_Reference/nsIThreadManager -tags: - - Firefox 3 - - Interfaces - - Threads - - XPCOM - - XPCOM API Reference -translation_of: Mozilla/Tech/XPCOM/Reference/Interface/nsIThreadManager ---- -

nsIThreadManager インタフェースは、アプリケーションや拡張機能がスレッドを作成、管理できるようにするもので、それぞれ nsIThread で表されています。

-


-

-
xpcom/threads/nsIThreadManager.idlScriptable
- - -Please add a summary to this article. - - -
-  -最終更新: Gecko 1.9 (Firefox 3)
-
-

継承元: nsISupports

-

メソッドの概要

- - - - - - - - - -
nsIThread newThread(in unsigned long creationFlags)
[noscript] nsIThread getThreadFromPRThread(in PRThread prthread)
-

属性

- - - - - - - - - - - - - - - - - - - - - - - -
属性説明
mainThreadnsIThreadメインスレッド。 - - 読み取り専用。 -
currentThreadnsIThread現在実行中のスレッド。呼び出されたスレッドが、それと関連付けられた nsIThread をまだ持っていない場合、スレッドが新たに作成され、現在の PRThread と関連付けられます。 - - 読み取り専用。 -
isMainThreadboolean現在実行中のスレッドがメインスレッドの場合に true を返します。 - - 読み取り専用。 -
-

メソッド

-

newThread()

-

新しいスレッドを作成します。内部的には、これはグローバルユーザの PRThread です。

-
nsIThread newThread(
-  in unsigned long creationFlags
-)
-
-
引数
-
-
- <tt>creationFlags</tt>
-
- 将来の使用のために確保されています。0 を渡します。
-
-
戻り値
-

新たに作成された nsIThread

-

getThreadFromPRThread()

-

このメソッドは、PRThread を与えられて、対応する nsIThread を返します。対応する nsIThread が存在しない場合は null を返します。

-
註: このメソッドはネイティブコードからのみ呼び出されるでしょう。
-
[noscript] nsIThread getThreadFromPRThread(
-  in PRThread prthread
-)
-
-
引数
-
-
- <tt>prthread</tt>
-
- 対応する nsIThread を取得するための PRThread
-
-
戻り値
-

指定された PRThread に一致する nsIThread を返します。一致する nsIThread が存在しない場合は null を返します。

-

関連記事

- diff --git a/files/ja/mozilla/tech/xpcom/reference/xpcom_interface_reference/nsithreadobserver/index.html b/files/ja/mozilla/tech/xpcom/reference/xpcom_interface_reference/nsithreadobserver/index.html deleted file mode 100644 index 5a058d0797..0000000000 --- a/files/ja/mozilla/tech/xpcom/reference/xpcom_interface_reference/nsithreadobserver/index.html +++ /dev/null @@ -1,125 +0,0 @@ ---- -title: nsIThreadObserver -slug: Mozilla/Tech/XPCOM/Reference/XPCOM_Interface_Reference/nsIThreadObserver -tags: - - Firefox 3 - - Interfaces - - Threads - - XPCOM - - XPCOM API Reference -translation_of: Mozilla/Tech/XPCOM/Reference/Interface/nsIThreadObserver ---- -

nsIThreadObserver インタフェースを実装すると、オブザーバが階層化されたイベントキューを実装できます。

-

例えば、以下のようにして、GUI ツールキットのために処理中のイベントを、あるスレッドのイベントの上に重ね合わせることができます。

-
var NativeQueue;
-Observer = {
-  onDispatchedEvent(thread) {
-    NativeQueue.signal();
-  }
-  onProcessNextEvent(thread, mayWait, recursionDepth) {
-    if (NativeQueue.hasNextEvent()) {
-      NativeQueue.processNextEvent();
-    }
-    while (mayWait && !thread.hasPendingEvent()) {
-      NativeQueue.wait();
-      NativeQueue.processNextEvent();
-    }
-  }
-};
-
-
- 警告: このインタフェースの実装はスレッドセーフでなければなりません。
-

継承元: nsISupports

-


-

-
xpcom/threads/nsIThreadInternal.idlScriptable
- - -Please add a summary to this article. - - -
-  -最終更新: Gecko 1.9 (Firefox 3)
-
-

メソッドの概要

- - - - - - - - - - - - -
void onDispatchedEvent(in nsIThreadInternal thread);
void onProcessNextEvent(in nsIThreadInternal thread, in boolean mayWait, in unsigned long recursionDepth);
void afterProcessNextEvent(in nsIThreadInternal thread, in unsigned long recursionDepth);
-

メソッド

-

onDispatchedEvent()

-

イベントがスレッドに割り当てられた後に呼び出されます。このメソッドはどのスレッドからも呼び出すことができます。

-
註: このメソッドの呼び出し中にスレッドのオブザーバを変更することは有効です。
-
void onDispatchedEvent(
-  in nsIThreadInternal thread
-)
-
-
引数
-
-
- <tt>thread</tt>
-
- イベントが割り当てられた nsIThread
-
-

onProcessNextEvent()

-

イベントが処理される前に、nsIThreadprocessNextEvent() メソッドによって呼び出されます。このメソッドはターゲットのスレッド上でのみ呼び出すことができます。

-
註: このメソッドの呼び出し中にスレッドのオブザーバを変更することは有効です。
-
void onProcessNextEvent(
-  in nsIThreadInternal thread,
-  in boolean mayWait,
-  in unsigned long recursionDepth
-
-

);

-
引数
-
-
- <tt>thread</tt>
-
- イベントの処理が行われている nsIThread
-
- <tt>mayWait</tt>
-
- スレッドの呼び出しをブロックすることをメソッドに許可する場合は true。この引数は、例えばスレッド停止中などは false になります。
-
- <tt>recursionDepth</tt>
-
- 現在の呼び出しに加えて、呼び出しスタック上での ProcessNextEvent() の呼び出し回数。
-
-

afterProcessNextEvent()

-

イベントが処理された後に、nsIThreadprocessNextEvent() メソッドによって呼び出されます。このメソッドはターゲットのスレッド上でのみ呼び出すことができます。

-
註: このメソッドの呼び出し中にスレッドのオブザーバを変更することは有効です。
-
void afterProcessNextEvent(
-  in nsIThreadInternal thread,
-  in unsigned long recursionDepth
-)
-
-
引数
-
-
- <tt>thread</tt>
-
- イベントの処理が行われた nsIThread
-
- <tt>recursionDepth</tt>
-
- 現在の呼び出しに加えて、呼び出しスタック上での ProcessNextEvent() の呼び出し回数。
-
-

関連記事

- diff --git a/files/ja/mozilla/tech/xpcom/reference/xpcom_interface_reference/nsithreadpool/index.html b/files/ja/mozilla/tech/xpcom/reference/xpcom_interface_reference/nsithreadpool/index.html deleted file mode 100644 index 703ee3c9a3..0000000000 --- a/files/ja/mozilla/tech/xpcom/reference/xpcom_interface_reference/nsithreadpool/index.html +++ /dev/null @@ -1,78 +0,0 @@ ---- -title: nsIThreadPool -slug: Mozilla/Tech/XPCOM/Reference/XPCOM_Interface_Reference/nsIThreadPool -tags: - - Firefox 3 - - Interfaces - - Threads - - XPCOM - - XPCOM API Reference -translation_of: Mozilla/Tech/XPCOM/Reference/Interface/nsIThreadPool ---- -

nsIThreadPool インタフェースはスレッドプールのサポートを提供します。

-

スレッドプールは、限られた数の無名のワーカースレッドを作成できます。イベントがスレッドプールに割り当てられると、プールは、次に利用可能なワーカースレッド上でそのイベントを実行します。

-

継承元: nsIEventTarget

-


-

-
xpcom/threads/nsIThreadPool.idlScriptable
- - -Please add a summary to this article. - - -
-  -最終更新: Gecko 1.9 (Firefox 3)
-
-

メソッドの概要

- - - - - - -
void shutdown()
-

属性

- - - - - - - - - - - - - - - - - - - - - - - -
属性説明
threadLimitunsigned longプールに一度に存在できるスレッドの最大数。この属性を変更することで、最大数を変更することができます。
idleThreadLimitunsigned long存続している待機スレッドの最大数を取得、設定します。待機中のワーカースレッドがこの最大数を超えると、待機スレッドは順次破棄されます。
idleThreadTimeoutunsigned longスレッドが破棄可能になるまで待機する時間をミリ秒で取得、設定します。
-

メソッド

-

shutdown()

-

スレッドプールを停止します。

-
- 警告: このメソッドをスレッドプール内のスレッドから呼び出してはいけません。代わりに、他のスレッド (通常、そのスレッドプールを作成したスレッド) から呼び出してください。
-

このメソッドが返ると、スレッドプールと、そのすべてのスレッドは停止され、以後そのスレッドプールにイベントを割り当てることはできなくなります。

-
void shutdown()
-
-
引数
-

なし。

-

関連記事

- diff --git a/files/ja/mozilla/tech/xpcom/reference/xpcom_interface_reference/nsiwebprogresslistener/index.html b/files/ja/mozilla/tech/xpcom/reference/xpcom_interface_reference/nsiwebprogresslistener/index.html deleted file mode 100644 index 4dccfef795..0000000000 --- a/files/ja/mozilla/tech/xpcom/reference/xpcom_interface_reference/nsiwebprogresslistener/index.html +++ /dev/null @@ -1,392 +0,0 @@ ---- -title: nsIWebProgressListener -slug: Mozilla/Tech/XPCOM/Reference/XPCOM_Interface_Reference/nsIWebProgressListener -tags: - - Interfaces - - 'Interfaces:Scriptable' - - XPCOM - - XPCOM API Reference - - XPCOM Interface Reference -translation_of: Mozilla/Tech/XPCOM/Reference/Interface/nsIWebProgressListener ---- -
-
uriloader/base/nsIWebProgressListener.idlScriptable
-このインターフェースは、nsIWebProgress インスタンスのコンテクストだけではなく、すべての子 nsIWebProgress インスタンスの、非同期リクエストの読み込みに関連する進捗を監視しようとするクライアントによって実装されています。 - -
-継承元: nsISupports -最終更新: Gecko 15 (Firefox 15 / Thunderbird 15 / SeaMonkey 2.12)
-
-

 

-

メソッド概要

- - - - - - - - - - - - - - - - - - -
void onLocationChange(in nsIWebProgress aWebProgress, in nsIRequest aRequest, in nsIURI aLocation);
void onProgressChange(in nsIWebProgress aWebProgress, in nsIRequest aRequest, in long aCurSelfProgress, in long aMaxSelfProgress, in long aCurTotalProgress, in long aMaxTotalProgress);
void onSecurityChange(in nsIWebProgress aWebProgress, in nsIRequest aRequest, in unsigned long aState);
void onStateChange(in nsIWebProgress aWebProgress, in nsIRequest aRequest, in unsigned long aStateFlags, in nsresult aStatus);
void onStatusChange(in nsIWebProgress aWebProgress, in nsIRequest aRequest, in nsresult aStatus, in wstring aMessage);
-

定数

-

遷移状態フラグ(State Transition Flags)

-

これらのフラグは、リクエストがロードされ、遷移しているさまざまな状態を表します。これらのフラグは排他的です。

-

リクエストが与えられる度、onStateChange() が呼び出されます。 STATE_START を伴って一回、STATE_TRANSFERRING フラグを伴ってゼロまたは数回、STATE_REDIRECTING と一回、最終的にSTATE_STOP を伴って一回、onStateChange() は呼び出されます。

-
- 註:ドキュメントのリクエストにおいて、2つ目の STATE_STOP が生成されます。(詳しくは STATE_IS_WINDOW の詳細を参照してください)
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
定数詳細
STATE_START0x00000001このフラグはリクエストが開始されたことを表します。このフラグはリクエストが初期化された際に設定されます。開始されたリクエストは、STATE_STOP フラグを伴ってonStateChange() が呼び出された時に完了します。
STATE_REDIRECTING0x00000002このフラグはリクエストがリダイレクトされていることを表します。onStateChange() に通されたリクエストはリダイレクトされたものです。リダイレクトが発生したとき、その過程において自動的に新規リクエストが生成されます。新しいリクエストでも同様に STATE_START のイベントが発生し、リダイレクトされたリクエストは STATE_STOP を迎えると予想されます。
STATE_TRANSFERRING0x00000004このフラグは、リクエストしたデータがこちらへと転送されている状態にあることを表します。このフラグは、リクエストがつながり、ユーザーがリクエストに対応するコンテンツを見始めるようになることも意味します。
STATE_NEGOTIATING0x00000008このフラグは使用されません。
STATE_STOP0x00000010このフラグはリクエストが完了したことを表します。onStateChange() の aStatus パラメータは、リクエストの最終ステータスを表します。
-

状態種類フラグ(State Type Flags)

-

これらのフラグは、発生しているトランザクションの状態についての実態をより詳しく説明します。これらのフラグは排他的ではありません( onStateChange() イベントはこれらのフラグが組み合わさっていることを示すかもしれません。)

- - - - - - - - - - - - - - - - - - - - - - - - - - - - -
定数詳細
STATE_IS_REQUEST0x00010000このフラグは、ドキュメントに限らないリクエストの遷移状態を表します。(下記のドキュメントのリクエストの詳細も参照してください) (例えば画像やスタイルシートといった)インラインコンテンツのような、他の種類のリクエストはの通常のリクエストとして見做されています。
STATE_IS_DOCUMENT0x00020000 -

このフラグは、ドキュメントリクエストの遷移状態を表します。このフラグは STATE_IS_REQUEST を追加で設定します。ドキュメントリクエストは、 nsIChannel のサポートと、nsIChannel::LOAD_DOCUMENT_URI を含む、リクエストの loadFlags 属性を含んでいます。

-

ドキュメントに対応した読み込みに関連するリクエストの全てが完了するまで、ドキュメントリクエストは完了しません。これには、(たとえば HTML <iframe> 要素といった)他のドキュメントリクエストも含まれます。ドキュメントリクエストに対応しているドキュメントは、onStateChange() の aWebProgress パラメータの DOMWindow 属性を経由して取得できます。

-
STATE_IS_NETWORK0x00040000 -

このフラグは、nsIWebProgress インスタンスによって表わされる活動の開始または停止に対応する遷移状態を表します。このフラグには、STATE_START または STATE_STOP の一方及びその他の状態種類フラグが付随しています。

-

STATE_IS_WINDOW とは異なり、このフラグは nsIWebProgress インスタンスのアクティビティが開始または停止していると通知された時にのみ設定されます。アクティビティが子 nsIWebProgress インスタンス でのみ発生した場合、そのアクテビティの開始または停止を示すためにこのフラグが設定されるでしょう。

-

例えば、HTML フレームセットの単体フレームのナビゲーションの場合、フレームセットウィンドウの nsIWebProgress に加えられた nsIWebProgressListener インスタンスは、ナビゲーションの開始と中止を設定された STATE_IS_NETWORK フラグとともに onStateChange() の呼び出しを受けます。言い換えれば、アクテビティが子ウィンドウに束縛された際には、外部ウィンドウのオブザーバーは開始または中止を 定義できるということです。

-
STATE_IS_WINDOW0x00080000 -

このフラグは、nsIWebProgress インスタンスが示すアクティビティの開始と停止に対応する遷移状態を表します。このフラグは、STATE_START または STATE_STOP 、およびその他の状態種類フラグを伴います。

-

このフラグは、STATE_IS_DOCUMENT に類似しています。しかしながら、ドキュメントのリクエストが完了された時、生成された STATE_STOP と共に onStateChange() が2回呼び出されます。ドキュメントのリクエストはそれぞれの呼び出しの際に aRequest を渡します。最初の呼び出しでは STATE_IS_REQUEST および STATE_IS_DOCUMENT が設定され、2回目の呼び出しでは STATE_IS_WINDOW が設定されます。(加えて、可能であれば STATE_IS_NETWORK が設定されます。STATE_IS_NETWORK が設定される場合の詳細については上記の詳細を参照してください) この2つの STATE_STOP イベントは、ドキュメントのリクエストが完了した際に発生した作業を分別するのに有効とされます。

-
-

状態変更フラグ(State Modifier Flags)

-

これらのフラグは、発生しているトランザクションの状態についての実態をより詳しく説明します。これらのフラグは排他的ではありません( onStateChange() イベントはこれらのフラグが組み合わさっていることを示すかもしれません。)

- - - - - - - - - - - - - -
定数詳細
STATE_RESTORING0x01000000このフラグは、以前レンダリングされた表示結果の復元作業の開始または停止に相当する遷移状態を表します。このリクエストに関連するネットワーク・アクティビティはなく、読み込まれたオリジナルのドキュメントや表示に加えられた変更それ自体は、依然として存在しています。
-

セキュリティ状態フラグ(State Security Flags)

-

これらのフラグは onSecurityChange() が呼び出されることによって 報告されるセキュリティの状態について説明します。これらのフラグは排他的です。

- - - - - - - - - - - - - - - - - - - - - - - -
定数詳細
STATE_IS_INSECURE0x00000004このフラグは、リクエストに対応するデータが安全ではないチャンネルを経由して受信されたことを表します。
STATE_IS_BROKEN0x00000001このフラグは未知のセキュリティの状態であることを表します。これは、ページ中の一部のコンテンツのリクエストが、安全ではないチャンネルを経由して読み込まれていることを意味するかもしれません。
STATE_IS_SECURE0x00000002このフラグは、リクエストに対応するデータが安全なチャンネルを経由して受信されたことを表します。セキュリティの程度については、STATE_SECURE_HIGHSTATE_SECURE_MED、または STATE_SECURE_LOW によって表現されます。
-

セキュリティ強度フラグ(Security Strength Flags)

-

これらのフラグは、セキュリティの強度と、onSecurityChange() メソッドの呼び出しに伴う STATE_IS_SECURE について説明します。これらのフラグは排他的です。

-

これらのフラグは、データ転送のセキュリティについて厳密な詳細を提供することを意味しません。これらは代わりに、セキュリティ通知の色区分や、その他ユーザー向けの基本的なデータ転送のフィードバックなどのような、簡易的なインジケータで使用されることを意図しています。

- - - - - - - - - - - - - - - - - - - - - - - -
定数詳細
STATE_SECURE_HIGH0x00040000このフラグは高レベルのセキュリティにあることを示します。
STATE_SECURE_MED0x00010000このフラグは中レベルのセキュリティにあることを示します。
STATE_SECURE_LOW0x00020000このフラグは低レベルのセキュリティにあることを示します。
-

アイデンティティ状態フラグ(State identity flags)

-

これらのフラグは、onSecurityChange() メソッドの呼び出しにおける、身元検証のレベルについて説明します。

- - - - - - - - - - - - - -
定数詳細
STATE_IDENTITY_EV_TOPLEVEL0x00100000 -

ステータスビットにおける EV とは Extended Validation すなわち High Assurance であり、高く保証されていることを意味します。

-

最高位のドキュメントには EV 証明書が使用されています。

-
-

ロケーション変更状態フラグ (Location Change flags)

- - - - - - - - - - - - - -
定数詳細
LOCATION_CHANGE_SAME_DOCUMENT0x00000001このフラグは、aWebProgress が新たにドキュメントを読み込まなかったときのものです。例としては、アンカーによるスクロールや pushState/popState/replaceState によるロケーションの変更が挙げられます。
-

メソッド

-

onLocationChange()

-

変更を監視されているウィンドウのロケーションが変更された際に呼び出されます。読み込みがリクエストされたときではなく、与えられたウィンドウにおいて読み込みが発生しようとしているの一度確認された際に呼び出されます。たとえば、ウィンドウに於いて開始した読み込みが、新しいサイトに向けてプログレスとステータスメッセージを送信していたとしても、新たなページが読み込まれていると私たちが確認するまでは、onLocationChange は呼び出されないでしょう。別の例として、ブラウザの中でドキュメントが読み込まれているのではなく、サードパーティのツールへとドキュメントが渡された場合、PDFやフラッシュの読み込みでは onLocationChange は呼び出されないでしょう。

-
void onLocationChange(
-  in nsIWebProgress aWebProgress,
-  in nsIRequest aRequest,
-  in nsIURI aLocation
-  [optional] in unsigned long aFlags
-);
-
-
引数
-
-
- aWebProgress
-
- 通知が発生した nsIWebProgress インスタンス。
-
- aRequest
-
- 関連する nsIRequest 。いくつかの場合では、この値は null かもしれません。
-
- aLocation
-
- 読み込まれているロケーションの URI 。
-
- aFlags
-
- オプション:この値は、ロケーションが変更された状況や理由について表します。 Optional from Gecko 10
-
-

onProgressChange()

-

aWebProgress に関連するリクエストのひとつの変更されたプログレスを通知します。(STATE_STOPSTATE_IS_WINDOW フラグを含む aStateFlags を伴って呼び出された onStateChange() に対応する) aWebProgress の全てのリクエストが完了したとき、プログレス全体はゼロへとリセットされます。

-
- 註:プログレスの値が未知である、または長整数型の最大値を上回る場合、プログレスの値は -1 によって置き換えられます。
-
- 註:オブジェクトが nsIWebProgressListener2 を実装しており、尚且つ呼び出し側がそのインターフェースを知っている場合、この関数は呼び出されません。その場合、代わりに nsIWebProgressListener2.onProgressChange64() が呼び出されます。
-
void onProgressChange(
-  in nsIWebProgress aWebProgress,
-  in nsIRequest aRequest,
-  in long aCurSelfProgress,
-  in long aMaxSelfProgress,
-  in long aCurTotalProgress,
-  in long aMaxTotalProgress
-);
-
-
引数
-
-
- aWebProgress
-
- 通知が発生した nsIWebProgress インスタンス。
-
- aRequest
-
- 新しいプログレスを持つ nsIRequest
-
- aCurSelfProgress
-
- リクエストの現在のプログレス。
-
- aMaxSelfProgress
-
- リクエストの最大のプログレス。
-
- aCurTotalProgress
-
- aWebProgress に関連する全てのリクエストにおける、現在のプログレス。
-
- aMaxTotalProgress
-
- aWebProgress に関連する全てのリクエストにおける、全体のプログレス。
-
-

onSecurityChange()

-

セキュリティプログレスを通知します。このメソッドは (例えば HTTP -> HTTPS または HTTP, FOO -> HTTPS といった)セキュリティの遷移に応じて、およびドキュメントの読み込みの完了と共に呼び出されます。ネットワーク読み込みの間にエラーが発生した場合でも、同様に呼び出されます。

-
- 註:セキュリティパッケージを導入している場合、これらの通知は一度しか発生しません。
-
void onSecurityChange(
-  in nsIWebProgress aWebProgress,
-  in nsIRequest aRequest,
-  in unsigned long aState
-);
-
-
引数
-
-
- aWebProgress
-
- 通知が発生した nsIWebProgress インスタンス。
-
- aRequest
-
- 新しいセキュリティ状態の nsIRequest
-
- aState
-
- 上述のセキュリティ状態フラグセキュリティ強度フラグによって構成された値。将来的には未定義なビット列を受け取ることになるかもしれません。
-
-

onStateChange()

-

aWebProgress に関連するリクエストのいずれかの状態が変更されたことを通知します。

-
void onStateChange(
-  in nsIWebProgress aWebProgress,
-  in nsIRequest aRequest,
-  in unsigned long aStateFlags,
-  in nsresult aStatus
-);
-
-
引数
-
-
- aWebProgress
-
- 通知が発生した nsIWebProgress インスタンス。
-
- aRequest
-
- 状態が変更した nsIRequest 。この引数は null である場合があります。
-
- aStateFlags
-
- 新しい状態のフラグを表します。この値は、上述した遷移状態フラグのひとつと、状態種類フラグのひとつ、または複数によって構成されています。将来的には未定義なビット列を受け取ることになるかもしれません。
-
- aStatus
-
-

状態の変更に関連するエラーステータスコードです。この引数は aStateFlag が STATE_STOP ビットを含まない限りは無視されます。ステータスコードは状態の変更に関連するリクエストの成功または失敗を示します。

-
- 註:HTTP 404 File Not Found エラーのようなサーバー側で発生したエラーに対しても、成功したとのコードを示すかもしれません。こうした場合において、リクエスト自体のエラー情報については、(HTTPリクエストについては nsIHttpChannel を参照するなど)拡張されたエラー情報を問い合わせるべきです。
-
-
-

onStatusChange()

-

リクエストのステータスが変更されたことを通知します。ステータスメッセージは、ブラウザのステータスバーなどといった、ユーザーへの表示を意図されています。

-
void onStatusChange(
-  in nsIWebProgress aWebProgress,
-  in nsIRequest aRequest,
-  in nsresult aStatus,
-  in wstring aMessage
-);
-
-
引数
-
-
- aWebProgress
-
- 通知が発火した nsIWebProgress
-
- aRequest
-
- 新たなステータスを持つ nsIRequest
-
- aStatus
-
-

この値はエラーコードではありません。その代わり、現在のリクエストのステータスを示す数値になります。このインターフェースはステータスコードの設定が可能なようには定義されていません。

-
- 註:いくつかのステータス値は、nsITransport および nsISocketTransportで定義されています
-
-
- aMessage
-
- aStatus に対応するローカライズされたテキスト。
-
-

-

タブごとへの nsIWebProgressListener:

- -

gBrowser.mProgressListeners (上で述べたようにタブ毎の nsIWebProgressListener によって起動される):

- -

 

diff --git a/files/ja/mozilla/tech/xpcom/reference/xpcom_interface_reference/nsiwindowmediator/index.html b/files/ja/mozilla/tech/xpcom/reference/xpcom_interface_reference/nsiwindowmediator/index.html deleted file mode 100644 index 7a0b9ccaaa..0000000000 --- a/files/ja/mozilla/tech/xpcom/reference/xpcom_interface_reference/nsiwindowmediator/index.html +++ /dev/null @@ -1,60 +0,0 @@ ---- -title: nsIWindowMediator -slug: Mozilla/Tech/XPCOM/Reference/XPCOM_Interface_Reference/nsIWindowMediator -tags: - - Interfaces - - 'Interfaces:Scriptable' - - MDC Project - - NeedsEditorialReview - - XPCOM - - XPCOM API Reference -translation_of: Mozilla/Tech/XPCOM/Reference/Interface/nsIWindowMediator ---- -

 

-

ウィンドウメディエータは開いているウィンドウを監視する Mozilla コンポーネントです。 nsIWindowMediator インターフェイスを通じてアクセスできます。 nsIWindowMediator の最も一般的な二つの用途は次のようなものです。

-
    -
  1. 最前面にある (most recent)、もしくは任意の、指定された型のウィンドウを取得する。
  2. -
  3. 指定された型の全てのウィンドウを列挙する。
  4. -
-
-
xpfe/appshell/public/nsIWindowMediator.idlScriptable
- - -Please add a summary to this article. - - -
-  -最終更新: Gecko 1.6
-
-


- 下記の例で、type は検索したいウィンドウの型を示しています。ウィンドウに型を指定するには、<window><dialog> のようなトップレベルの要素に windowtype 属性を付加します。

-

ブラウザウィンドウは navigator:browser というウィンドウの型を持っています。ウィンドウの型に関わらず全てのウィンドウを検索するには、空文字列 "" を渡して下さい。

-

-

最前面にあるウィンドウを取得する

-

次のコードは、指定した型のウィンドウのいずれかを取得したい時や、ある型のウィンドウ (例えばあなたの拡張機能の設定ダイアログ) がすでに開かれているかどうかを調べたい時に役立ちます。

-

getMostRecentWindow は、 ChromeWindow オブジェクト、もしくは指定された型のウィンドウが開かれていなければ、 null を返します。

-
var wm = Components.classes["@mozilla.org/appshell/window-mediator;1"]
-                   .getService(Components.interfaces.nsIWindowMediator);
-var win = wm.getMostRecentWindow(type);
-
-

-

ウィンドウを列挙する

-

次のコードは、特定の型の開かれているウィンドウのそれぞれに何かをしなければならない時に使えます。例えば、設定ダイアログの "OK" ハンドラで、開かれているブラウザウィンドウのそれぞれに新しい設定を適用する時などです。

-
var wm = Components.classes["@mozilla.org/appshell/window-mediator;1"]
-                   .getService(Components.interfaces.nsIWindowMediator);
-var enumerator = wm.getEnumerator(type);
-while(enumerator.hasMoreElements()) {
-  var win = enumerator.getNext();
-  // |win| は [Object ChromeWindow] である(|window| と同等)。これに何かをする
-}
-
-

このコードでは特定の型のウィンドウ全てに対して反復処理を行っており、type で指定するのはウィンドウの型です。例えば、全てのブラウザウィンドウを列挙したければ、"navigator:browser" を指定します。型に関わらず全てのウィンドウを列挙したければ、null を指定します。

-
- 注意: nsIWindowMediator のリファレンスページでは、 getMostRecentWindow の戻り値の型と、列挙された要素の型は、 nsIDOMWindow/nsIDOMWindowInternal とされています。実際には、JavaScript のコードから呼ばれる時には、これらのメソッドは普通 (常に?) ChromeWindow オブジェクトを返し、これは上記の両方と他の幾つかのインターフェイスを実装しています。あなたが恐らく慣れ親しんでいるであろう、グローバルオブジェクトの windowChromeWindow 型です。
-

-

参考

- -

Interwiki Languages Links

diff --git a/files/ja/mozilla/tech/xpcom/reference/xpcom_interface_reference/nsixmlhttprequest/index.html b/files/ja/mozilla/tech/xpcom/reference/xpcom_interface_reference/nsixmlhttprequest/index.html deleted file mode 100644 index 1f24082b00..0000000000 --- a/files/ja/mozilla/tech/xpcom/reference/xpcom_interface_reference/nsixmlhttprequest/index.html +++ /dev/null @@ -1,84 +0,0 @@ ---- -title: nsIXMLHttpRequest -slug: Mozilla/Tech/XPCOM/Reference/XPCOM_Interface_Reference/nsIXMLHttpRequest -translation_of: Mozilla/Tech/XPCOM/Reference/Interface/nsIXMLHttpRequest ---- -

Gecko 60 で廃止 (Firefox 60 / Thunderbird 60 / SeaMonkey 2.57)
この機能は廃止されました。まだいくつかのブラウザーで動作するかもしれませんが、いつ削除されてもおかしくないので、使わないようにしましょう。

- -

nsIXMLHttpRequest along with nsIJSXMLHttpRequest and nsIXMLHttpRequestEventTarget are Mozilla's implementation details of the DOM XMLHttpRequest object.

- -
Note: If you're a web developer or a Mozilla add-on developer, please refer to the XMLHttpRequest documentation instead.
- -

This page contains documentation, specific to Mozilla application and add-on developers.

- -

The interface definition: https://dxr.mozilla.org/mozilla-central/source/dom/xhr/nsIXMLHttpRequest.idl

- -

Elevated Privileges

- -

As mentioned in the "Non-Standard Properties" the property of channel was read-only. When using the XPCOM interface, as seen below in Example 2, we can get access to this. The most obvious benefit is that we can set nsiRequest - Constants in the xhr.channel.loadFlags. For instance, as done in Example 2, the flag of LOAD_ANONYMOUS is added, this strips all user data (cookies, tokens, etc).

- -

Using event handlers from native code

- -

(Not sure if it's up-to-date)

- -

From native code, the way to set up onload and onerror handlers is a bit different. Here is a comment from Johnny Stenback <jst@netscape.com>:

- -
The mozilla implementation of nsIXMLHttpRequest implements the interface nsIDOMEventTarget and that's how you're supported to add event listeners. Try something like this: nsCOMPtr<nsIDOMEventTarget> target(do_QueryInterface(myxmlhttpreq)); target->AddEventListener(NS_LITERAL_STRING("load"), mylistener, PR_FALSE) where mylistener is your event listener object that implements the interface nsIDOMEventListener. The 'onload', 'onerror', and 'onreadystatechange' attributes moved to nsIJSXMLHttpRequest, but if you're coding in C++ you should avoid using those.
- -

Though actually, if you use addEventListener from C++ weird things will happen too, since the result will depend on what JS happens to be on the stack when you do it....

- -

Conclusion: Do not use event listeners on XMLHttpRequest from C++, unless you're aware of all the security implications. And then think twice about it.

- -

サンプルコード

- -

This is a simple example code for opening a simple HTTP request from a xul application (like a Mozilla extension) without using observers:

- -
 var req = Components.classes["@mozilla.org/xmlextras/xmlhttprequest;1"].createInstance();
- req.open('POST', "http://www.foo.bar:8080/nietzsche.do", true);
- req.send('your=data&and=more&stuff=here');
-
- -

Example 2

- -
var {Cu: utils, Cc: classes, Ci: instances} = Components;
-Cu.import('resource://gre/modules/Services.jsm');
-function xhr(url, cb) {
-    let xhr = Cc["@mozilla.org/xmlextras/xmlhttprequest;1"].createInstance(Ci.nsIXMLHttpRequest);
-
-    let handler = ev => {
-        evf(m => xhr.removeEventListener(m, handler, !1));
-        switch (ev.type) {
-            case 'load':
-                if (xhr.status == 200) {
-                    cb(xhr.response);
-                    break;
-                }
-            default:
-                Services.prompt.alert(null, 'XHR Error', 'Error Fetching Package: ' + xhr.statusText + ' [' + ev.type + ':' + xhr.status + ']');
-                break;
-        }
-    };
-
-    let evf = f => ['load', 'error', 'abort'].forEach(f);
-    evf(m => xhr.addEventListener(m, handler, false));
-
-    xhr.mozBackgroundRequest = true;
-    xhr.open('GET', url, true);
-    xhr.channel.loadFlags |= Ci.nsIRequest.LOAD_ANONYMOUS | Ci.nsIRequest.LOAD_BYPASS_CACHE | Ci.nsIRequest.INHIBIT_PERSISTENT_CACHING;
-    xhr.responseType = "arraybuffer"; //dont set it, so it returns string, you dont want arraybuffer. you only want this if your url is to a zip file or some file you want to download and make a nsIArrayBufferInputStream out of it or something
-    xhr.send(null);
-}
-
-xhr('https://www.gravatar.com/avatar/eb9895ade1bd6627e054429d1e18b576?s=24&d=identicon&r=PG&f=1', data => {
-    Services.prompt.alert(null, 'XHR Success', data);
-    var file = OS.Path.join(OS.Constants.Path.desktopDir, "test.png");
-    var promised = OS.File.writeAtomic(file, new UInt8Array(data));
-    promised.then(
-        function() {
-            alert('succesfully saved image to desktop')
-        },
-        function(ex) {
-             alert('FAILED in saving image to desktop')
-        }
-    );
-});
diff --git a/files/ja/mozilla/tech/xpcom/reference/xpcom_interface_reference/nsizipentry/index.html b/files/ja/mozilla/tech/xpcom/reference/xpcom_interface_reference/nsizipentry/index.html deleted file mode 100644 index 7892efac9a..0000000000 --- a/files/ja/mozilla/tech/xpcom/reference/xpcom_interface_reference/nsizipentry/index.html +++ /dev/null @@ -1,60 +0,0 @@ ---- -title: nsIZipEntry -slug: Mozilla/Tech/XPCOM/Reference/XPCOM_Interface_Reference/nsIZipEntry -tags: - - Interfaces - - XPCOM - - XPCOM API Reference -translation_of: Mozilla/Tech/XPCOM/Reference/Interface/nsIZipEntry ---- -

 

-

メソッドの概要

- -
-

属性

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
属性説明
compressionreadonly attribute unsigned shortアイテムに使用される圧縮の種類。取り得る値とそれらの意味は http://www.pkware.com/business_and_d...loper/appnote/ にある ZIP ファイルの仕様書に定義されています。
sizereadonly attribute unsigned longアイテムに含まれるデータの圧縮済みサイズ。
realSizereadonly attribute unsigned longアイテムに含まれるデータの非圧縮サイズ。
CRC32readonly attribute unsigned longエントリに含まれるファイルの CRC-32 ハッシュ値。
isDirectoryreadonly attribute booleanエントリの名前が「/」で終わる場合は true、そうでなければ false。
lastModifiedTimereadonly attribute PRTimeアイテムの最終更新日時。
isSyntheticreadonly attribute booleanこの属性は、アイテムが本当の ZIP エントリであるか、実際のエントリのパスの一部のために合成されたエントリであるかを判別するために使用します。合成エントリは、ZIP ファイル内部で対応するエントリを持たないディレクトリを表します。例えば、ZIP ファイル内のディレクトリ foo/ のためのエントリが、foo/bar.txt のためのエントリをひとつだけ含む場合、それは合成エントリとなります。その ZIP ファイルにディレクトリの実際のエントリが含まれる場合、そのディレクトリの nsIZipEntry に関しては、この属性は false となります。ファイルが合成エントリになることはできません。
-

関連記事

-

nsIZipReader

diff --git a/files/ja/mozilla/tech/xpcom/reference/xpcom_interface_reference/nsizipreader/index.html b/files/ja/mozilla/tech/xpcom/reference/xpcom_interface_reference/nsizipreader/index.html deleted file mode 100644 index 67615221ee..0000000000 --- a/files/ja/mozilla/tech/xpcom/reference/xpcom_interface_reference/nsizipreader/index.html +++ /dev/null @@ -1,185 +0,0 @@ ---- -title: nsIZipReader -slug: Mozilla/Tech/XPCOM/Reference/XPCOM_Interface_Reference/nsIZipReader -tags: - - Interfaces - - XPCOM - - XPCOM API Reference -translation_of: Mozilla/Tech/XPCOM/Reference/Interface/nsIZipReader ---- -

 

-
-
modules/libjar/nsIZipReader.idlScriptable
- - -Please add a summary to this article. - - -
-  -最終更新: Gecko 1.9 (Firefox 3)
-
-

継承元: nsISupports

-

実装: @mozilla.org/libjar/zip-reader;1。インスタンスを作成するには、以下のように記述します。

-
var zReader = Components.classes["@mozilla.org/libjar/zip-reader;1"]
-                        .createInstance(Components.interfaces.nsIZipReader);
-
-

メソッドの概要

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void open(in nsIFile zipFile)
void close()
void test(in string aEntryName)
void extract(in string zipEntry, in nsIFile outFile)
nsIZipEntry getEntry(in string zipEntry)
boolean hasEntry(in AUTF8String zipEntry)
nsIUTF8StringEnumerator findEntries(in string aPattern)
nsIInputStream getInputStream(in string zipEntry)
nsIInputStream getInputStreamWithSpec(in AUTF8String aJarSpec, in string zipEntry)
-

属性

- - - - - - - - - - - - - -
属性説明
filereadonly attribute nsIFileこの ZIP ファイルリーダーが初期化された ZIP を表すファイル。
-

メソッド

-

open()

-

ZIP ファイルを開いてい読み取れるようにします。他のファイルを開くこともできますが、まず close() で閉じる必要があります。

-
void open(in nsIFile zipFile)
-
-
引数
-
-
- zipFile
-
- 開く ZIP ファイル。
-
-

close()

-

ZIP ファイルを閉じます。以後、ファイルを展開しようとしたり、その入力ストリームから読み取りを行おうとするとエラーになります。

-
void close()
-
-

test()

-

各アイテムをメモリに展開する際に CRC チェックを実行して、アーカイブの完全性を検証します。エントリが指定された場合、そのアイテムの完全性のみが検証されます。NULL が渡された場合、アーカイブ内のすべてのアイテムの完全性が検証されます。

-
void test(in string aEntryName)
-
-
引数
-
-
- aEntryName
-
- 検証を行う単独のエントリ、あるいは、アーカイブ内のすべてのエントリを検証する場合は NULL
-
-

extract()

-

ZIP エントリを、outFile で指定されたローカルファイルに展開します。展開を正常に完了するには、このエントリは非圧縮あるいはでデフレート圧縮形式で ZIP 内に保存されていなければなりません。エントリがディレクトリの場合、そのディレクトリが非再帰的に展開されます。

-
void extract(in string zipEntry, in nsIFile outFile)
-
-
引数
-
-
- zipEntry
-
- 展開する ZIP エントリ。
-
-
-
- outFile
-
- ZIP ファイルの展開先に使用するローカルファイル
-
-

getEntry()

-

指定された ZIP エントリに相当する nsIZipEntry を返します。

-
nsIZipEntry getEntry(in string zipEntry)
-
-
引数
-
-
- zipEntry
-
- ZIP エントリ。
-
-
戻り値
-

指定された ZIP エントリに相当する nsIZipEntry

-

hasEntry()

-

ZIP ファイルに entryName で指定されたエントリが含まれているかどうかを確認します。

-
boolean hasEntry(in AUTF8String zipEntry)
-
-
引数
-
戻り値
-

真偽値。該当する ZIP エントリが存在する場合は true、存在しない場合は false

-

findEntries()

-

一致するエントリ名を含む文字列の列挙 (enumerator) を返します。

-
nsIUTF8StringEnumerator findEntries(in string aPattern)
-
-
引数
-
-
- aPattern
-
- ZIP ファイル内でエントリを検索するために使用する正規表現。すべてのエントリを取得するには、この引数を null に設定します。そうでない場合、以下の構文を使ってください。
-
-
投げられる例外
-
-
- NS_ERROR_ILLEGAL_VALUE
-
- 多くの、ただしすべてではない不正な aPattern の値が確認された場合。
-
-
戻り値
-

一致したエントリ名が含まれる nsIUTF8StringEnumerator

-

getInputStream()

-

指定された ZIP エントリの内容が含まれる入力ストリームを返します。

-
nsIInputStream getInputStream(in string zipEntry)
-
-
引数
-
-
- zipEntry
-
- ストリームを開くエントリの名前。
-
-
戻り値
-

指定された ZIP エントリの内容が含まれる nsIInputStream

-

getInputStreamWithSpec()

-

指定された ZIP エントリの内容が含まれる入力ストリームを返します。エントリが (「/」で終わる) ディレクトリを参照している場合、ディレクトリストリームが開かれます。そうでない場合はファイルエントリの内容が返されます。

-
nsIInputStream getInputStreamWithSpec(in AUTF8String aJarSpec, in string zipEntry)
-
-
引数
-
-
- aJarSpec
-
- JAR に使われている URI の Spec (利用されるのはディレクトリストリームの場合のみです)。
-
-
戻り値
-

指定された ZIP エントリの内容が含まれる nsIInputStream

-

See also

-

nsIZipEntry

diff --git a/files/ja/mozilla/tech/xpcom/reference/xpcom_interface_reference/nsizipwriter/index.html b/files/ja/mozilla/tech/xpcom/reference/xpcom_interface_reference/nsizipwriter/index.html deleted file mode 100644 index 5113ed3323..0000000000 --- a/files/ja/mozilla/tech/xpcom/reference/xpcom_interface_reference/nsizipwriter/index.html +++ /dev/null @@ -1,496 +0,0 @@ ---- -title: nsIZipWriter -slug: Mozilla/Tech/XPCOM/Reference/XPCOM_Interface_Reference/nsIZipWriter -tags: - - Firefox 3 - - Interfaces - - XPCOM - - XPCOM API Reference -translation_of: Mozilla/Tech/XPCOM/Reference/Interface/nsIZipWriter ---- -

nsIZipWriter インタフェースは、スクリプトを使ってデータを Zip ファイル形式にアーカイブできる簡単な方法を提供します。アーカイブに対する操作はひとつずつ実行することも、キューに入れておいて後で実行することもできます。

-

実行したい操作をすべてキューに追加したら、processQueue() を呼び出せば、キューに追加した順番通りに操作が実行されます。キューの途中で実行された操作は、オブザーバの対象外で発生したエラーもすべて例外として投げます。

-

バックグラウンドでキューを実行中に、インタフェースに対して同時に操作を行おうとした場合、NS_ERROR_IN_PROGRESS という例外が投げられます。

-

ファイル名やディレクトリ名の区切り記号には必ずスラッシュ ("/") を使い、また 1 文字目がスラッシュで始まっていてはいけません。

-
註: ディレクトリ内のファイルエントリを追加するために、そのディレクトリのエントリを追加しておく必要はありませんが、一部の Zip ユーティリティでは問題が生じる可能性がありますので、あらかじめディレクトリエントリを明示的に追加しておいた方が良いでしょう。
-


-

-
modules/libjar/zipwriter/public/nsIZipWriter.idlScriptable
- - -Please add a summary to this article. - - -
-  -最終更新: Gecko 1.9 (Firefox 3)
-
-

継承元: nsISupports

-

実装: @mozilla.org/zipwriter;1. インスタンスを作成するには、以下のように記述します。

-
var zipWriter = Components.classes["@mozilla.org/zipwriter;1"]
-                          .createInstance(Components.interfaces.nsIZipWriter);
-
-

メソッドの概要

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void addEntryDirectory(in AUTF8String aZipEntry, in PRTime aModTime, in boolean aQueue);
void addEntryChannel(in AUTF8SZtring aZipEntry, in PRTime aModTime, in PRInt32 aCompression, in nsIChannel aChannel, in boolean aQueue)
void addEntryFile(in AUTF8SZtring aZipEntry, in PRInt32 aCompression, in nsIFile aFile, in boolean aQueue)
void addEntryStream(in AUTF8SZtring aZipEntry, in PRTime aModTime, in PRInt32 aCompression, in nsIInputStream aStream, in boolean aQueue)
void close()
nsIZipEntry getEntry(in AUTF8String aZipEntry);
boolean hasEntry(in AUTF8String aZipEntry);
void open(in nsIFile aFile, in PRInt32 aIoFlags);
void processQueue(in nsIRequestObserver aObserver, in nsISupports aContext)
void removeEntry(in AUTF8String aZipEntry, in boolean aQueue)
-

属性

- - - - - - - - - - - - - - - - - - - - - - - -
属性説明
commentACString開かれている Zip ファイルに関連付けられているコメントを取得あるいは設定します。開かれている Zip ファイルがない場合は、例外 NS_ERROR_NOT_INITIALIZED が投げられます。
inQueuebooleanバックグラウンドのキューで操作が実行中の場合は true、バックグラウンド操作が実行中でない場合は false読み取り専用。
filensIFile書き込みを行う Zip ファイル。読み取り専用。
-

定数

- - - - - - - - - - - - - - - - - - - - - - - - - - - - -
定数説明
COMPRESSION_NONE0ファイルを圧縮しない。
COMPRESSION_FASTEST1ファイルをアーカイブに追加する際、最速の圧縮方法を使用します。
COMPRESSION_DEFAULT6ファイルをアーカイブに追加する際、標準の圧縮方法を使用します。
COMPRESSION_BEST9ファイルをアーカイブに追加する際、最も圧縮率の高い圧縮方法を使用します。
-

メソッド

-

addEntryDirectory()

-

Zip ファイルに新しいディレクトリエントリを追加します。

-
註: ディレクトリ内のファイルエントリを追加するために、そのディレクトリのエントリを追加しておく必要はありませんが、一部の Zip ユーティリティでは問題が生じる可能性がありますので、あらかじめディレクトリエントリを明示的に追加しておいた方が良いでしょう。
-
 void addEntryDirectory(
-   in AUTF8String aZipEntry,
-   in PRTime aModTime,
-   in boolean aQueue
- );
-
-
引数
-
-
- aZipEntry
-
- Zip ファイルに追加するディレクトリエントリのパス。
-
- aModTime
-
- エントリの変更日時。ミリ秒単位。
-
- aQueue
-
- 操作をキューに追加して後で実行する場合は true、操作を即座に実行する場合は false
-
-
投げられる例外
-
-
- NS_ERROR_NOT_INITIALIZED
-
- 開かれている Zip ファイルがありません。
-
- NS_ERROR_FILE_ALREADY_EXISTS
-
- 指定されたパスは既に Zip ファイルの中に存在します。
-
- NS_ERROR_IN_PROGRESS
-
- Zip Writer は他の操作を実行中です。
-
-

addEntryChannel()

-

チャンネルから Zip ファイルにデータを追加します。

-
 void addEntryChannel(
-   in AUTF8String aZipEntry,
-   in PRTime aModTime,
-   in PRInt32 aCompression,
-   in nsIChannel aChannel,
-   in boolean aQueue
- );
-
-
引数
-
-
- aZipEntry
-
- Zip ファイルに追加するファイルエントリのパス。これは Zip ファイル内に配置されるパスになります。
-
- aModTime
-
- エントリの変更日時。ミリ秒単位。
-
- aCompression
-
- 使用する圧縮方法を表す 圧縮定数 のいずれか。
-
- aChannel
-
- データを取得するチャンネル。
-
- aQueue
-
- 操作をキューに追加して後で実行する場合は true、操作を即座に実行する場合は false
-
-
投げられる例外
-
-
- NS_ERROR_NOT_INITIALIZED
-
- 開かれている Zip ファイルがありません。
-
- NS_ERROR_FILE_ALREADY_EXISTS
-
- 指定されたパスは既に Zip ファイルの中に存在します。
-
- NS_ERROR_IN_PROGRESS
-
- Zip Writer は他の操作を実行中です。
-
-

addEntryFile()

-

新しいファイルもしくはディレクトリを Zip ファイルに追加します。指定されたファイルがディレクトリの場合、この呼び出しは以下と同じことになります。

-
 addEntryDirectory(aZipEntry, aFile.lastModifiedTime, aQueue);
-
-
 void addEntryFile(
-   in AUTF8String aZipEntry,
-   in PRInt32 aCompression,
-   in nsIFile aFile,
-   in boolean aQueue
- );
-
-
引数
-
-
- aZipEntry
-
- Zip ファイルに追加するファイルエントリのパス。これは Zip ファイル内に配置されるパスになります。
-
- aCompression
-
- 使用する圧縮方法を表す 圧縮定数 のいずれか。
-
- aFile
-
- データと変更日時を取得するファイル。
-
- aQueue
-
- 操作をキューに追加して後で実行する場合は true、操作を即座に実行する場合は false
-
-
投げられる例外
-
-
- NS_ERROR_NOT_INITIALIZED
-
- 開かれている Zip ファイルがありません。
-
- NS_ERROR_FILE_ALREADY_EXISTS
-
- 指定されたパスは既に Zip ファイルの中に存在します。
-
- NS_ERROR_IN_PROGRESS
-
- Zip Writer は他の操作を実行中です。
-
-

addEntryStream()

-

入力ストリームから Zip ファイルにデータを追加します。

-
 void addEntryStream(
-   in AUTF8String aZipEntry,
-   in PRTime aModTime,
-   in PRInt32 aCompression,
-   in nsIInputStream aStream,
-   in boolean aQueue
- );
-
-
引数
-
-
- aZipEntry
-
- Zip ファイルに追加するファイルエントリのパス。これは Zip ファイル内に配置されるパスになります。
-
- aModTime
-
- エントリの変更日時。ミリ秒単位。
-
- aCompression
-
- 使用する圧縮方法を表す 圧縮定数 のいずれか。
-
- aStream
-
- データを取得する入力ストリーム。
-
- aQueue
-
- 操作をキューに追加して後で実行する場合は true、操作を即座に実行する場合は false
-
-
投げられる例外
-
-
- NS_ERROR_NOT_INITIALIZED
-
- 開かれている Zip ファイルがありません。
-
- NS_ERROR_FILE_ALREADY_EXISTS
-
- 指定されたパスは既に Zip ファイルの中に存在します。
-
- NS_ERROR_IN_PROGRESS
-
- Zip Writer は他の操作を実行中です。
-
-

close()

-

Zip ファイルを閉じます。

-
 void close();
-
-
引数
-

なし。

-
投げられる例外
-
-
- NS_ERROR_NOT_INITIALIZED
-
- 開かれている Zip ファイルがありません。
-
- NS_ERROR_IN_PROGRESS
-
- Zip Writer は他の操作を実行中です。
-
-

Zip ファイルの仕上げが失敗した場合、他の例外が投げられる場合もあります。

-

getEntry()

-

開かれている Zip ファイルから特定のエントリを取得します。

-
 nsIZipEntry getEntry(
-   in AUTF8String aZipEntry,
- );
-
-
引数
-
-
- aZipEntry
-
- 取得するファイルエントリのパス。
-
-
戻り値
-

指定したエントリについて説明した nsIZipEntry オブジェクト。あるいは、該当するエントリが存在しなかった場合 null

-

hasEntry()

-

特定のエントリが Zip ファイル内に存在するかどうかを判別します。

-
 boolean hasEntry(
-   in AUTF8String aZipEntry,
- );
-
-
引数
-
-
- aZipEntry
-
- 確認を行うファイルエントリのパス。
-
-
戻り値
-

指定されたパスのエントリが Zip ファイル内に存在する場合は true、存在しない場合は false を返します。

-

open()

-

指定された Zip ファイルを開きます。

-
 void open(
-   in nsIFile aFile,
-   in PRInt32 aIoFlags
- );
-
-
引数
-
-
- aFile
-
- 開く Zip ファイル。
-
- aIoFlags
-
- prio.h で指定された、Zip ファイルのオープンフラグ。
-
-
投げられる例外
-
-
- NS_ERROR_ALREADY_INITIALIZED
-
- Zip ファイルは既に開かれています。
-
- NS_ERROR_INVALID_ARG
-
- aFile 引数が null です。
-
- NS_ERROR_FILE_NOT_FOUND
-
- 指定されたファイルが見つからず、フラグでそのファイルの作成が許可されていません。または、指定されたファイルを含むディレクトリが存在しません。
-
- NS_ERROR_FILE_CORRUPTED
-
- 指定されたファイルは識別可能な Zip ファイルではありません。
-
-

ファイルが破損していた場合やサポートされていない形式だった場合など、ファイルを開くのに失敗すると、他の例外が投げられる場合もあります。

-

processQueue()

-

キュー全体の処理が完了するかエラーが発生するまで、キューに追加されたすべての項目を処理します。最初の操作が開始されたときと、最後の操作が完了したときに、オブザーバに通知が行われます。

-

エラーが発生した場合はすべてオブザーバに通知されます。

-

キューが完了するか、エラーが起きて途中までのキューの処理が中止されるまで、Zip Writer はビジー状態になります。途中までの処理に失敗した場合、残りの項目はキューに留まります。再度 processQueue() を呼び出すと、操作が中断されたところから再開されます。

-
 void processQueue(
-   in nsIRequestObserver aObserver,
-   in nsISupports aContext
- );
-
-
引数
-
-
- aObserver
-
- キューから通知を受け取るオブザーバ。
-
- aContext
-
- オブザーバに渡すコンテキスト。
-
-
投げられる例外
-
-
- NS_ERROR_NOT_INITIALIZED
-
- 開かれている Zip ファイルがありません。
-
- NS_ERROR_IN_PROGRESS
-
- キューの処理は既に実行中です。
-
-

removeEntry()

-

Zip ファイルからエントリを削除します。

-
 void removeEntry(
-   in AUTF8String aZipEntry,
-   in boolean aQueue
- );
-
-
引数
-
-
- aZipEntry
-
- Zip ファイルから削除するエントリのパス。
-
- aQueue
-
- 削除の操作をキューに追加する場合は true。即座に実行する場合は false
-
-
投げられる例外
-
-
- NS_ERROR_NOT_INITIALIZED
-
- 開かれている Zip ファイルがありません。
-
- NS_ERROR_IN_PROGRESS
-
- キューの処理は既に実行中です。
-
- NS_ERROR_FILE_NOT_FOUND
-
- 指定されたパスにエントリが存在しません。
-
-

Zip ファイルの更新に失敗した場合、他の例外が投げられる場合もあります。

-

-

コメントを Zip ファイルに追加する

-
var zipWriter = Components.Constructor("@mozilla.org/zipwriter;1", "nsIZipWriter");
-var zipW = new zipWriter();
-
-zipW.open(myZipFilePath, PR_RDWR | PR_CREATE_FILE | PR_TRUNCATE);
-zipW.comment = "This is a comment.";
-zipW.close();
-
-

PR_RDWR とそれに続くオプションは、どのインタフェースにも含まれていない定数です (Bug 433295 参照)。このため、上記のコードを実際に動作させるには、以下のようなコードを追加する必要があります。

-
const PR_RDONLY      = 0x01;
-const PR_WRONLY      = 0x02;
-const PR_RDWR        = 0x04;
-const PR_CREATE_FILE = 0x08;
-const PR_APPEND      = 0x10;
-const PR_TRUNCATE    = 0x20;
-const PR_SYNC        = 0x40;
-const PR_EXCL        = 0x80;
-
-

I/O Snippets も参照してください。

-

ファイルを Zip アーカイブに追加する

-

このコードは、nsIFile theFile で指定されたファイルを、Zip アーカイブへ同期的に追加するものです。

-
var zipWriter = Components.Constructor("@mozilla.org/zipwriter;1", "nsIZipWriter");
-var zipW = new zipWriter();
-
-zipW.open(myZipFilePath, PR_RDWR | PR_CREATE_FILE | PR_TRUNCATE);
-zipW.addEntryFile("Path/For/This/File/In/Zip Archive", Components.interfaces.nsIZipWriter.COMPRESSION_DEFAULT, theFile, false);
-zipW.close();
-
-

引数のうち nyZipFilePath は、実際にはパスではなく、新しい Zip ファイルの場所を指定する nsIFile インスタンスのことを指しています。ファイルそのものは存在していなくても構いませんが、そのファイルを含むディレクトリ (つまり nsIFile.parent) は必ず存在している必要があります。

-

その他の例

-

他の例については、ソースツリー内のユニットテストを参照してください。

- -

関連記事

- diff --git a/files/ja/mozilla/tech/xpcom/reference/xpcom_interface_reference_group/index.html b/files/ja/mozilla/tech/xpcom/reference/xpcom_interface_reference_group/index.html deleted file mode 100644 index 16538d388e..0000000000 --- a/files/ja/mozilla/tech/xpcom/reference/xpcom_interface_reference_group/index.html +++ /dev/null @@ -1,976 +0,0 @@ ---- -title: XPCOM Interface Reference group -slug: Mozilla/Tech/XPCOM/Reference/XPCOM_Interface_Reference_group -translation_of: Mozilla/Tech/XPCOM/Reference/Reference_by_grouping ---- -

Using this guide

- -

このページには2010年12月1日現在の Mozilla インターフェースが一覧となっています。the XPCOM interface Reference の一覧はアルファベット順に並べられていますが、このページではそれらを機能ごとにグループ化するという試みがなされています。グループ化とカテゴリの名称は著者【訳注: 英語版のこのページの著者】による独断が多少入り混じっています。(これについては涙を流す結末になりうる重大な論点であるとは認識しています。ですが、どうやら私がこの編集を行った最初の人物であるようなので、最初の編集者としての権利を得たものとします。)

-

主要セクションの定義:

- -
-
-

Browser

- -
- - -
-

Future

- -
-
-

Obsolete

- -
- -
-

System

- -
- - -
-

XPC

diff --git a/files/ja/mozilla/tech/xpcom/setting_http_request_headers/index.html b/files/ja/mozilla/tech/xpcom/setting_http_request_headers/index.html deleted file mode 100644 index 394e0fc521..0000000000 --- a/files/ja/mozilla/tech/xpcom/setting_http_request_headers/index.html +++ /dev/null @@ -1,273 +0,0 @@ ---- -title: Setting HTTP request headers -slug: Mozilla/Tech/XPCOM/Setting_HTTP_request_headers -tags: - - Add-ons - - Extensions - - HTTP - - XUL - - XULRunner - - 要更新 -translation_of: Mozilla/Tech/XPCOM/Setting_HTTP_request_headers ---- -

HTTP は Web の中核を成す技術の一つです。実際のコンテンツに加え、HTTP ヘッダによっていくつかの重要な情報が HTTP リクエストとレスポンスの両方で渡されます。

- -

アプリケーションが作成するどんなリクエストに対しても、独自の HTTP ヘッダを加える事ができます。そのリクエストがあなたのコードで明示的に HTTP チャンネルを開くことによって開始されたリクエストであっても、また XMLHttpRequest の活動や、コンテンツ内の <img> タグ、さらに例え CSS からのものであったとしても、それは可能です。

- - - - - - - - - - - -

HTTP チャンネル

-

HTTP リクエストとレスポンスを扱う時には、大抵は nsIHttpChannel を扱います。nsIHttpChannel インタフェースにはたくさんのプロパティやメソッドがありますが、ここで重要なメソッドは setRequestHeader です。このメソッドを使って HTTP リクエストヘッダを設定する事ができます。

-

下は HTTP ヘッダを設定するコードの例です。

-
// リクエストに "X-Hello: World" ヘッダを加える
-httpChannel.setRequestHeader("X-Hello", "World", false);
-
- - -

このコードの httpChannel という変数は、nsIHttpChannel を実装したオブジェクトを示しています。(変数名はどんなものでも結構です。)

-

setRequestHeader メソッドは 3 つのパラメータを取ります。1 つめは HTTP リクエストヘッダの名前で、2 つめは HTTP リクエストヘッダのです。3 つめのパラメータに関しては今のところ無視して、常に false にしておきます。

-

このサンプルコードでは X-Hello という名前の HTTP リクエストヘッダが追加され、この HTTP リクエストヘッダのWorld となっています。

-
-

: 独自の HTTP ヘッダを作成する場合には、名前の前に X- を付けなければなりません。(上のサンプルコードでもちゃんと名前の前に X- を追加しているため、作成した HTTP ヘッダは Hello ではなく X-Hello となっています。)

-
- - - - - - -

通知

-

ここでおそらく、HTTP リクエストが開始された時にどうやって nsIHttpChannel を取得するのかという疑問が出てくるでしょう。

-

あなたのコードによってリクエストが開始された場合には、おそらく既に取得できているでしょう。その他のリクエストを捕捉するには、通知 を使います。これは他の言語やフレームワークではイベントシグナル と呼ばれるものと同じようなものです。

-

具体的に言えば、HTTP リクエストが作られる直前に nsIHttpChannel を取得するには "http-on-modify-request" トピックを監視 (observe) する必要があります。("http-on-modify-request" は文字列です。)

-
-

: 通知を受けられるトピックは "http-on-modify-request" の他にもたくさんあります。例えば "http-on-examine-response""xpcom-shutdown" などです。また、独自のトピックを作り出したり、自分で通知を送る事も可能です。

-

通知のフレームワークや一般的な通知トピックのリストについてのより詳しい情報を得るには Observer Notifications を参照して下さい。

-
- - - - - - -

オブザーバ

-

あるトピック ("http-on-modify-request" など) についての通知を得るには、オブザーバ (observer) を作成しなければなりません。オブザーバは nsIObserver インタフェースを実装したコンポーネントです。あるトピックに対してオブザーバが登録されると、オブザーバは observe メソッドが呼ばれる事によってそのトピックについての通知を受けます。

-

下のコードは http-on-modify-request の通知によって渡されたチャンネルに "X-Hello" という独自のヘッダを追加するオブザーバの例です。

-
var httpRequestObserver =
-{
-  observe: function(subject, topic, data)
-  {
-    if (topic == "http-on-modify-request") {
-      var httpChannel = subject.QueryInterface(Components.interfaces.nsIHttpChannel);
-      httpChannel.setRequestHeader("X-Hello", "World", false);
-    }
-  }
-};
-
-

div class="note"> Doesn't seem very suitable for this article; readers should are typically assumed to be familiar with JS. Nickolay '''NOTE''': Often people expect JavaScript to be just like Java. And while superficially, they look very similar, there are some important differences between the two. For example, while Java is an <em>object-oriented programming language</em>, JavaScript is not. JavaScript is <em>prototype-based programming language</em> and as such while it has <em>objects</em> it does not have <em>classes</em>. (Which is why, if you are not well versed with JavaScript, the object creation in the sample code above may look strange.) </div

-

observe メソッドが取るパラメータの数が重要です。このメソッドは (上のサンプルコードにあるように) 3 つのパラメータを取ります。"http-on-modify-request" トピックに対しては、1 つめのパラメータ (上のコードでは subject) は nsIHttpChannel になります。ただしこれは nsISupports として渡されます。なので nsISupports から nsIHttpChannel変換しなければならず、QueryInterface を呼び出すことによってこれを行っています。

-

if ブロックの 2 行目のコードは既にご存知でしょう。この記事の最初の方で HTTP リクエストヘッダを追加するのに使ったコードと同じものです。

-

このオブジェクトの名前 (httpRequestObserver) は重要ではありません。好きな名前を付けて結構です。

- - - - - -

登録する

-

オブザーバを作成したら、それを登録する必要があります。今回の場合は、オブザーバを "http-on-modify-request" トピックに対して登録しようとしています。これは以下のコードによって可能です。

-
var observerService = Components.classes["@mozilla.org/observer-service;1"]
-                                .getService(Components.interfaces.nsIObserverService);
-observerService.addObserver(httpRequestObserver, "http-on-modify-request", false);
-
-

1 つめの文で、通知を受けたいトピックにオブザーバを登録するためのオブジェクトを取得しています。

-

2 つめの文では実際に登録を行っています。 "http-on-modify-request" トピック (それぞれの HTTP リクエストの直前に起こる) が発生したときに、httpRequestObserver が (observe メソッドが呼び出されることによって) 通知を受けられるようにしています。

- - - - - - -

登録を解除する

-

アプリケーションの終了時にはオブザーバの登録を解除するべきです。これを怠るとメモリリークが引き起こされる可能性があります。オブザーバの登録を解除するには、次のように nsIObserverService.removeObserver を使ってください。

- -
observerService.removeObserver(httpRequestObserver, "http-on-modify-request");
-
- - - - - - -

XPCOM コンポーネント

-

http-on-modify-request オブザーバは、アプリケーションごとに 1 つしか登録する必要はありません (ウィンドウごとに 1 つではありません)。つまり、オブザーバの実装はオーバーレイではなく XPCOM コンポーネントに置くべきです。

- - - - - -

まとめ

- -

基本的には大体こんな感じです。しかし、あなたに役立つように、httpRequestObserver オブジェクトの少し違ったバージョンも示しておきます。

- -

前に示したバージョンは学習のためには有効ですが、実際のアプリケーションでは次のようなコードにしたほうがいいでしょう。

- - -
var httpRequestObserver =
-{
-  observe: function(subject, topic, data)
-  {
-    if (topic == "http-on-modify-request") {
-      var httpChannel = subject.QueryInterface(Components.interfaces.nsIHttpChannel);
-      httpChannel.setRequestHeader("X-Hello", "World", false);
-    }
-  },
-
-  get observerService() {
-    return Components.classes["@mozilla.org/observer-service;1"]
-                     .getService(Components.interfaces.nsIObserverService);
-  },
-
-  register: function()
-  {
-    this.observerService.addObserver(this, "http-on-modify-request", false);
-  },
-
-  unregister: function()
-  {
-    this.observerService.removeObserver(this, "http-on-modify-request");
-  }
-};
-
- -

このオブジェクトには register()unregister() という便利なメソッドがあり、下のように呼び出すだけでオブザーバを有効にする事が出来ます。

- -
httpRequestObserver.register();
-
- -

また、終了時にはオブザーバの登録を解除するのも忘れないでください。

- -
httpRequestObserver.unregister();
-
- -

以上です。

- -

We need downloadable XPCOM component for this

- - - - - - -

サンプルコード

-
var headerName  = "X-hello";
-var headerValue = "world";
-
-function LOG(text)
-{
-    //    var consoleService = Components.classes["@mozilla.org/consoleservice;1"].getService(Components.interfaces.nsIConsoleService);
-    //    consoleService.logStringMessage(text);
-}
-
-function myHTTPListener() { }
-
-myHTTPListener.prototype = {
-
-  observe: function(subject, topic, data)
-  {
-      if (topic == "http-on-modify-request") {
-
-          LOG("----------------------------> (" + subject + ") mod request");
-
-          var httpChannel = subject.QueryInterface(Components.interfaces.nsIHttpChannel);
-          httpChannel.setRequestHeader(headerName, headerValue, false);
-          return;
-      }
-
-
-      if (topic == "app-startup") {
-
-          LOG("----------------------------> app-startup");
-
-          var os = Components.classes["@mozilla.org/observer-service;1"]
-                             .getService(Components.interfaces.nsIObserverService);
-
-          os.addObserver(this, "http-on-modify-request", false);
-          return;
-      }
-  },
-
-  QueryInterface: function (iid) {
-        if (iid.equals(Components.interfaces.nsIObserver) ||
-            iid.equals(Components.interfaces.nsISupports))
-            return this;
-
-        Components.returnCode = Components.results.NS_ERROR_NO_INTERFACE;
-        return null;
-    },
-};
-
-var myModule = {
-    registerSelf: function (compMgr, fileSpec, location, type) {
-
-        var compMgr = compMgr.QueryInterface(Components.interfaces.nsIComponentRegistrar);
-        compMgr.registerFactoryLocation(this.myCID,
-                                        this.myName,
-                                        this.myProgID,
-                                        fileSpec,
-                                        location,
-                                        type);
-
-
-          LOG("----------------------------> registerSelf");
-
-        var catMgr = Components.classes["@mozilla.org/categorymanager;1"].getService(Components.interfaces.nsICategoryManager);
-        catMgr.addCategoryEntry("app-startup", this.myName, this.myProgID, true, true);
-    },
-
-
-    getClassObject: function (compMgr, cid, iid) {
-
-          LOG("----------------------------> getClassObject");
-
-        return this.myFactory;
-    },
-
-    myCID: Components.ID("{9cf5f3df-2505-42dd-9094-c1631bd1be1c}"),
-
-    myProgID: "@dougt/myHTTPListener;1",
-
-    myName:   "Simple HTTP Listener",
-
-    myFactory: {
-        QueryInterface: function (aIID) {
-            if (!aIID.equals(Components.interfaces.nsISupports) &&
-                !aIID.equals(Components.interfaces.nsIFactory))
-                throw Components.results.NS_ERROR_NO_INTERFACE;
-            return this;
-        },
-
-        createInstance: function (outer, iid) {
-
-          LOG("----------------------------> createInstance");
-
-          return new myHTTPListener();
-        }
-    },
-
-    canUnload: function(compMgr) {
-        return true;
-    }
-};
-
-function NSGetModule(compMgr, fileSpec) {
-    return myModule;
-}
-
diff --git a/files/ja/mozilla/tech/xpcom/storage/index.html b/files/ja/mozilla/tech/xpcom/storage/index.html deleted file mode 100644 index 7abeb7a36e..0000000000 --- a/files/ja/mozilla/tech/xpcom/storage/index.html +++ /dev/null @@ -1,378 +0,0 @@ ---- -title: Storage -slug: Mozilla/Tech/XPCOM/Storage -tags: - - Interfaces - - Storage - - Toolkit API - - 要更新 -translation_of: Mozilla/Tech/XPCOM/Storage ---- -

Storage is a SQLite database API. It is available to trusted callers, meaning extensions and Firefox components only.

- -

The API is currently "unfrozen", which means it is subject to change at any time; in fact, it has changed somewhat with each release of Firefox since it was introduced, and will likely continue to do so for a while.

- -
注記: Storage is not the same as the DOM:Storage feature which can be used by web pages to store persistent data or the Session store API (an XPCOM storage utility for use by extensions).
- -

Getting started

- -

This document covers the Storage API and some peculiarities of SQLite. It does not cover SQL or "regular" SQLite. You can find some very useful links in the See also section however. For Storage API help, you can post to mozilla.dev.apps.platform on the news server news.mozilla.org. To report bugs, use Bugzilla.

- -

The overall procedure for use is:

- -
    -
  1. Get the Storage service - mozIStorageService.
  2. -
  3. Open a connection to the database of your choice - mozIStorageConnection.
  4. -
  5. Create statements to execute on the connection - mozIStorageStatement.
  6. -
  7. Bind parameters to a statement as necessary.
  8. -
  9. Execute the statement.
  10. -
  11. Check for errors.
  12. -
  13. Reset the statement.
  14. -
- -

Opening a connection

- -

JavaScript example of opening my_db_file_name.sqlite in the profile directory:

- -
Components.utils.import("resource://gre/modules/Services.jsm");
-Components.utils.import("resource://gre/modules/FileUtils.jsm");
-
-let file = FileUtils.getFile("ProfD", ["my_db_file_name.sqlite"]);
-let mDBConn = Services.storage.openDatabase(file); // Will also create the file if it does not exist
-
- -

Likewise, the C++ would look like this:

- -
nsCOMPtr<nsIFile> dbFile;
-rv = NS_GetSpecialDirectory(NS_APP_USER_PROFILE_50_DIR,
-                            getter_AddRefs(dbFile));
-NS_ENSURE_SUCCESS(rv, rv);
-rv = dbFile->Append(NS_LITERAL_STRING("my_db_file_name.sqlite"));
-NS_ENSURE_SUCCESS(rv, rv);
-nsCOMPtr<mozIStorageService> dbService =
-  do_GetService(MOZ_STORAGE_SERVICE_CONTRACTID, &rv);
-NS_ENSURE_SUCCESS(rv, rv);
-
-nsCOMPtr<mozIStorageConnection> dbConn;
-rv = dbService->OpenDatabase(dbFile, getter_AddRefs(dbConn));
-NS_ENSURE_SUCCESS(rv, rv);
-
- -
Note: MOZ_STORAGE_SERVICE_CONTRACTID is defined in storage/build/mozStorageCID.h.
- -
-

警告: It may be tempting to give your database a name ending in '.sdb' for sqlite database, but this is not recommended. This extension is treated specially by Windows as a known extension for an 'Application Compatibility Database' and changes are backed up by the system automatically as part of system restore functionality. This can result in significantly higher overhead file operation.

-
- -

Closing a connection

- -

To close a connection on which only synchronous transactions were performed, use the mozIStorageConnection.close() method. If you performed any asynchronous transactions, you should instead use the mozIStorageConnection.asyncClose() method. The latter will allow all ongoing transactions to complete before closing the connection, and will optionally notify you via callback when the connection is closed.

- -

Statements

- -

This section demonstrates how you can execute SQL statements on your database. For a complete reference see mozIStorageStatement.

- -

Creating a Statement

- -

There are actually two ways to execute a statement. You should choose the right one based on your needs.

- -

No Results to be Returned

- -

 

- -

If you do not need to get any results back, you can use mozIStorageConnection.executeSimpleSQL() API like this in JavaScript:

- -
dbConn.executeSimpleSQL("CREATE TEMP TABLE table_name (column_name INTEGER)");
-
- -

Similarly, the C++ looks like this:

- -
rv = mDBConn->ExecuteSimpleSQL(NS_LITERAL_CSTRING("CREATE TEMP TABLE table_name (column_name INTEGER)"));
-NS_ENSURE_SUCCESS(rv, rv);
- -

Results to be Returned

- -

However, if you need to get results back, you should create the statement with the mozIStorageConnection.createStatement() API like this in JavaScript:

- -
var statement = dbConn.createStatement("SELECT * FROM table_name WHERE column_name = :parameter");
-
- -

This example uses a named placeholder called "parameter" to be bound later (described in Binding Parameters). Similarly, the C++ looks like this:

- -
nsCOMPtr<mozIStorageStatement> statement;
-rv = dbConn->CreateStatement(NS_LITERAL_CSTRING("SELECT * FROM table_name WHERE column_name = ?1"),
-                             getter_AddRefs(statement));
-NS_ENSURE_SUCCESS(rv, rv);
-
- -

This example uses the numbered placeholder indexed by zero for a parameter to be bound later (described in Binding Parameters).

- -
註: Numerical indexes for parameters are always one less than the number you write in the SQL. The use of numerical indexes for parameters is strongly discouraged in JavaScript where named parameters are much easier to use.
- -
註: If you need to execute a statement multiple times, caching the result of createStatement will give you a noticeable performance improvement because the SQL query does not need to be parsed each time.
- -

Binding Parameters

- -

In order to effectively use the statements that you create, you have to bind values to the parameters you placed in the statement. A given placeholder can appear multiple times in the same statement, and all instances of it will be replaced with the bound value. If you neglect to bind a value to a parameter, it will be interpreted as NULL.

- -
You should never try to construct SQL statements on the fly with values inserted in them. By binding the parameters, you prevent possible SQL injection attacks since a bound parameter can never be executed as SQL.
- -

Binding One Set of Parameters

- -

If you only have one row to insert, or are using the synchronous API you'll need to use this method. In JavaScript, there is a useful helper object (mozIStorageStatementParams) available () that makes binding parameters much easier:

- -
var statement = dbConn.createStatement("SELECT * FROM table_name WHERE id = :row_id");
-statement.params.row_id = 1234;
-
- -

You can still use this helper object by manually creating the statement wrapper, mozIStorageStatementWrapper, which is provided in Gecko 1.9.1 and later.

- -

Using named parameters in C++ is a lot more difficult, so it's generally accepted to use numerical placeholders instead. The example below uses mozIStorageStatement.bindInt32Parameter(). The full list of binding functions can be found with the mozIStorageStatement documentation.

- -

C++ example:

- -
nsCOMPtr<mozIStorageStatement> statement;
-rv = mDBConn->CreateStatement(NS_LITERAL_CSTRING("SELECT * FROM table_name WHERE id = ?1"),
-                              getter_AddRefs(statement));
-NS_ENSURE_SUCCESS(rv, rv);
-
-rv = statement->BindInt32Parameter(0, 1234);
-NS_ENSURE_SUCCESS(rv, rv);
-
- -
註: Numerical indexes for parameters are always one less than the number you write in the SQL. The use of numerical indexes for parameters is strongly discouraged in JavaScript where named parameters are much easier to use.
- -

Binding Multiple Sets of Parameters

- -
- -

Starting in Gecko 1.9.2 (Firefox 3.6), there's a new, more convenient way to bind multiple sets of parameters at once prior to executing your statement asynchronously. This API is only available for asynchronous execution.

- -
let stmt = dbConn.createStatement("INSERT INTO table_name (value) VALUES(:value)");
-let params = stmt.newBindingParamsArray();
-for (let i = 0; i < 10; i++) {
-  let bp = params.newBindingParams();
-  bp.bindByName("value", i);
-  params.addParams(bp);
-}
-stmt.bindParameters(params);
-
- -

You can attach multiple sets of bindings to a statement by adding multiple mozIStorageBindingParams objects to the array of parameter lists, adding each one through calls to the mozIStorageBindingParamsArray.addParams(). Once all the parameters are set up, a single call to mozIStorageStatement.bindParameters() will ensure that the parameters are bound before execution. You can then execute the statement asynchronously, and the statement will get each set of bindings bound to it before execution asynchronously.

- -

Executing a Statement

- -

You may execute statements either synchronously (which is supported in Firefox Gecko 1.8 and 1.9) or asynchronously (starting in Gecko 1.9.1). If your code needs to work with applications based on Gecko 1.8 or 1.9, you should the technique covered in the section Synchronously below. Otherwise, it's strongly recommended that you use asynchronous execution, for performance reasons.

- -

Asynchronously

- -
- -

Gecko 1.9.1 introduced support for asynchronous execution of a statement by calling mozIStorageStatement.executeAsync() on the statement. Multiple statements can be executed in a transaction by calling mozIStorageConnection.executeAsync() on the connection and passing in an array of statements. Both of these methods have similar signatures that accept an object as input that receives notifications the execution of the statement(s). A C++ example is omitted here because it would be verbose, but real-world code can be found in the Mozilla source tree (MXR ID で mozIStorageStatementCallback).

- -

After you create and bind a statement, your JavaScript should look something like this to execute a statement asynchronously:

- -
statement.executeAsync({
-  handleResult: function(aResultSet) {
-    for (let row = aResultSet.getNextRow();
-         row;
-         row = aResultSet.getNextRow()) {
-
-      let value = row.getResultByName("column_name");
-    }
-  },
-
-  handleError: function(aError) {
-    print("Error: " + aError.message);
-  },
-
-  handleCompletion: function(aReason) {
-    if (aReason != Components.interfaces.mozIStorageStatementCallback.REASON_FINISHED)
-      print("Query canceled or aborted!");
-  }
-});
-
- -

The call to executeAsync takes an object that implements mozIStorageStatementCallback. See its documentation for more details on each method. The callback is optional, however, so if you do not want to receive feedback, you can pass nothing.

- -

Synchronously

- -

If you are OK with the possibility of locking up your user interface, or if you are running on a background thread, you can use mozIStorageStatement.executeStep(). This function allows you to enumerate all the results produced by the statement.

- -

As you step through each row, you can obtain each parameter by name through a helper object (mozIStorageStatementRow) in JavaScript ( ) like so:

- -
while (statement.executeStep()) {
-  let value = statement.row.column_name;
-}
-
- -

You can create this helper object yourself if it's not available in your version of Gecko. See mozIStorageStatementWrapper for details.

- -

In C++, the code would look something like this:

- -
bool hasMoreData;
-while (NS_SUCCEEDED(statement->ExecuteStep(&hasMoreData)) && hasMoreData) {
-  PRInt32 value;
-  rv = statement->GetInt32(0, &value);
-  NS_ENSURE_SUCCESS(rv, rv);
-}
-
- -

You can obtain other types of data by using the various methods available on mozIStorageValueArray.

- -

Alternatively, if you do not expect any results but still need to execute a bound statement, you can simply call mozIStorageStatement.execute(). This is equivalent to calling mozIStorageStatement.executeStep() and then mozIStorageStatement.reset().

- -

Resetting a Statement

- -

When you execute a statement synchronously, it is important to make sure you reset your statement. You can accomplish this by calling mozIStorageStatement.reset() on the statement. If you end up finalizing the statement (see mozIStorageStatement.finalize()) you do not need to worry about calling mozIStorageStatement.reset(). You should do this before you reuse the statement.

- -
-

警告: If you fail to reset a write statement, it will continue to hold a lock on the database preventing future writes or reads. Additionally, if you fail to reset a read statement, it will prevent any future writes to the database.

-
- -

In JavaScript, the language makes it pretty easy to ensure that you always reset a statement. Be aware that you should always reset even if an exception is thrown, so your code should look something like this:

- -
var statement = dbConn.createStatement("SELECT * FROM table_name");
-try {
-  while (statement.step()) {
-    // Use the results...
-  }
-}
-finally {
-  statement.reset();
-}
-
- -

In C++, Storage provides a helper object in storage/public/mozStorageHelper.h, mozStorageStatementScoper, which ensures that the statement object is reset when the object falls out of scope. Of course, if your statement is local only to the function, you do not have to worry about calling reset since the object will be destroyed.

- -
nsresult
-myClass::myFunction()
-{
-  // mSpecialStatement is a member variable of the class that contains a statement.
-  mozStorageStatementScoper scoper(mSpecialStatement);
-  // You can use mSpecialStatement without concern now.
-
-  nsCOMPtr<mozIStorageStatement> statement;
-  // mDBConn is a database connection that is stored a member variable of the class.
-  nsresult rv = mDBConn->CreateStatement(NS_LITERAL_CSTRING("DELETE FROM table_name"),
-                                         getter_AddRefs(statement));
-  NS_ENSURE_SUCCESS(rv, rv);
-  return statement->Execute();
-  // Once this function returns, mSpecialStatement will be reset, and statement will
-  // be destroyed.
-}
-
- -
註: Calling reset is not an expensive operation, and nothing bad happens if you call reset more than once.
- -

Transactions

- -

Transactions can be used to either improve performance, or group statements together as an atomic operation. In both cases, you execute more than one statement inside of a transaction.

- -

In JavaScript, managing transactions can be difficult when you are using the same connection on different threads, or are using a combination of asynchronous and synchronous statement execution. The best way to deal with this is to only execute your statements asynchronously using mozIStorageConnection.executeAsync(). This method will manage the transactions for you, so you don't have to worry about them.

- -
註: The database engine does not support nested transactions, so attempting to start a transaction when one is already active will throw an exception.
- -

Transactions can be started with mozIStorageConnection.beginTransaction() or mozIStorageConnection.beginTransactionAs(). The latter takes one of three constants to describe the type of transaction:

- - - -

mozIStorageConnection.beginTransaction() is equivalent to calling mozIStorageConnection.beginTransactionAs() and passing mozIStorageConnection.TRANSACTION_DEFERRED. In general, this is the method you want to use.

- -

Once you start a transaction, you can either commit the changes by calling mozIStorageConnection.commitTransaction(), or rollback the changes by calling mozIStorageConnection.rollbackTransaction().

- -

In C++ code, there is a helper class defined in storage/public/mozStorageHelper.h, mozStorageTransaction, that will attempt to get a transaction for you, and handle it appropriately when it falls out of scope. If a transaction is already in progress, no transaction is obtained. If your function returns without calling Commit on the helper object, the transaction will be rolled back.

- -
nsresult
-myClass::myFunction()
-{
-  // mDBConn is a member variable of our mozIStorageConnection.
-  mozStorageTransaction transaction(mDBConn);
-
-  // Execute some statements.  If we encounter an error, the transaction will
-  // be rolled back.
-
-  return transaction.Commit();
-}
-
- -

Collation (sorting)

- -

SQLite provides several collation methods (BINARY, NOCASE, and RTRIM), but these are all very simple and have no support for various text encodings or the user's locale.

- -
- -

Gecko 1.9.2 added support for several new collation methods:

- -
-
locale
-
Case- and accent-insensitive collation.
-
locale_case_sensitive
-
Case-sensitive, accent-insensitive collation.
-
locale_accent_sensitive
-
Case-insensitive, accent-sensitive collation.
-
locale_case_accent_sensitive
-
Case- and accent-sensitive collation.
-
- -

You can use them quite simply in your SELECT queries, like this:

- -
var stmt = aConn.createStatement("SELECT * FROM foo ORDER BY name COLLATE locale ASC");
-var results = [];
-
-while (stmt.executeStep()) {
-  results.push(stmt.row.t);
-}
-stmt.finalize();
-
- -

How to Corrupt a Database

- -

SQLite is very good about maintaining database integrity, but there are a few things you can do that can lead to database corruption. You can find out more by reading SQLite's documentation on this. There are a few simple things you can do to help make sure this doesn't happen:

- - - - - - - - - -

Thread Safety

- -

mozIStorageService and mozIStorageConnection are thread safe. However, no other interface or method is, so do not use them on different threads at the same time!

- -

If you want to use concurrency to work on your database, you should use the asynchronous APIs provided by Storage.

- -

関連情報

- - - - diff --git a/files/ja/mozilla/tech/xpcom/the_thread_manager/index.html b/files/ja/mozilla/tech/xpcom/the_thread_manager/index.html deleted file mode 100644 index 76856f2327..0000000000 --- a/files/ja/mozilla/tech/xpcom/the_thread_manager/index.html +++ /dev/null @@ -1,130 +0,0 @@ ---- -title: The Thread Manager -slug: Mozilla/Tech/XPCOM/The_Thread_Manager -tags: - - Firefox 3 - - Threads -translation_of: Mozilla/Tech/XPCOM/The_Thread_Manager ---- -

-

Firefox 3 で導入されたスレッドマネージャは、スレッドを作成して、処理を行うイベントをそのスレッドに割り当てる便利な方法を提供します。 -

-

-

インタフェース

-

スレッドのサポートを提供するインタフェースは、以下のようにいくつか存在します。 -

-
nsIThreadManager -
スレッドを作成できるようにするスレッドマネージャそのもの。 -
nsIThread -
この nsIThread インタフェースは、オペレーティングシステムのスレッドをカプセル化したもので、コードからマルチスレッドに対する簡易なクロスプラットフォームアクセスを提供します。 -
nsIThreadPool -
スレッドプールは、限られた一連のワーカースレッドを提供します。イベントをプールに割り当てる際、プールは、そのイベントを処理するために利用可能なワーカースレッドを選択する役割を果たします。 -
nsIThreadInternal -
nsIThread のサブクラスで、XPCOM のスレッドオブジェクトによって実装されており、スレッドへのアクティビティ割り当て監視サポートを提供します。 -
nsIThreadObserver -
スレッドを監視する機能を提供します。スレッドにイベントが割り当てられた際や、それらのイベントの処理が完了した際に、通知を受け取ることができます。 -
nsIThreadEventFilter -
このインタフェースは nsIThreadInternal 内の pushEventQueue() メソッドで使われており、イベントのフィルタリングを可能にします。 -
-

-

-

スレッドマネージャの使い方

-

スレッドマネージャを使用するには、各スレッドのワーキングコードを nsIRunnable XPCOM オブジェクトにカプセル化しなければなりません。このオブジェクトは全体を JavaScript で書くことができ、それほど難しくありません。 -

註: DOM はスレッドセーフではないので、バックグラウンドスレッドから DOM や ユーザーインタフェースにアクセスしてはいけません。クラッシュの原因となります。
-

このセクションでは簡単な例を見ていきます。 -

-

-

バックグラウンドスレッド

-

まず、バックグラウンドスレッドで行われる処理を扱う XPCOM オブジェクトが必要になります。 -

-
var workingThread = function(threadID, number) {
-  this.threadID = threadID;
-  this.number = number;
-  this.result = 0;
-};
-
-workingThread.prototype = {
-  run: function() {
-    try {
-      // ここでワーキングスレッドが処理を行う
-
-      for (var i = 0; i<= this.number; i++) {
-        this.result += i;
-      }
-
-      // 処理が終了したら、終了を知らせるためにメインスレッドにコールバックする
-
-      main.dispatch(new mainThread(this.threadID, this.result),
-        background.DISPATCH_NORMAL);
-    } catch(err) {
-      Components.utils.reportError(err);
-    }
-  },
-
-  QueryInterface: function(iid) {
-    if (iid.equals(Components.interfaces.nsIRunnable) ||
-        iid.equals(Components.interfaces.nsISupports)) {
-            return this;
-    }
-    throw Components.results.NS_ERROR_NO_INTERFACE;
-  }
-};
-
-

このスレッドのコンストラクタでは、スレッドの ID と 数値をローカル変数に保存し、result 変数を 0 に設定しています。 これらの変数はスレッドの実行時に使用されます。 -

このオブジェクトにはコンストラクタのほかに 2 つのメソッドがあります: -

-
run() -
run() メソッドは nsIThread インタフェースの dispatch() メソッドが呼び出されたときに呼び出されます。これはバックグラウンドスレッドで実際の作業を行うルーチンです。 この例では、0 から <tt>this.number</tt> までのすべての数の合計を計算しています。 計算が終了すると、 mainThread オブジェクトを使ってメインスレッドにアクセスし、計算結果を共有するためにコールバックをメインスレッドにディスパッチします。 -
QueryInterface() -
スレッドの XPCOM オブジェクトは nsIRunnable インタフェースを扱う必要があるため、オブジェクトが nsIRunnable インタフェースを扱っているかを尋ねるためにこのメソッドが呼び出されたときに、正しい反応を返さなければなりません。 -
-

-

-

メインスレッド

-

メインスレッドを扱う XPCOM オブジェクトはバックグラウンドタスクからのコールバックとして使用されます。このオブジェクトの run() メソッドは、バックグラウンドスレッドが計算結果をユーザーに知らせようとしたときに呼び出されます。バックグラウンドスレッドはユーザーインタフェースに触れることができず、メインスレッドに依頼しなければならないため、このオブジェクトが必要になります。 -

-
var mainThread = function(threadID, result) {
-  this.threadID = threadID;
-  this.result = result;
-};
-
-mainThread.prototype = {
-  run: function() {
-    try {
-      // ここでワーキングスレッドの完了に対して反応を返す
-      alert('Thread ' + this.threadID + ' finished with result: ' + this.result);
-    } catch(err) {
-      Components.utils.reportError(err);
-    }
-  },
-
-  QueryInterface: function(iid) {
-    if (iid.equals(Components.interfaces.nsIRunnable) ||
-        iid.equals(Components.interfaces.nsISupports)) {
-            return this;
-    }
-    throw Components.results.NS_ERROR_NO_INTERFACE;
-  }
-};
-
-

この例では run() メソッドは単純に警告ボックスを使ってユーザーに出力を表示します。 -

-

-

仕上げ

-

実際にスレッドマネージャを使ってバックグラウンドでこれらの計算を行うには、まず <tt>workingThread</tt> のタスクを実行する nsIThread オブジェクトを作成する必要があります: -

-
var background = Components.classes["@mozilla.org/thread-manager;1"].getService().newThread(0);
-
-

それに加えて、メインスレッドの nsIThread の参照を得る必要があります: -

-
var main = Components.classes["@mozilla.org/thread-manager;1"].getService().mainThread;
-
-

この情報を得たら、タスクをバックグラウンドスレッドに割り当てることができます。 -

-
background.dispatch(new workingThread(1, 5000000), background.DISPATCH_NORMAL);
-
-

これによりバックグラウンドスレッドの実行が開始され、0 と 5,000,000 の間のすべての数の合計が計算されます。作業が終了すると、メインスレッドの run() メソッドが呼び出され、結果をユーザーと共有します。それまでの間、メインスレッドはユーザーの操作に反応するなどの自分の作業を続けることができます。 -


-

-
-
diff --git a/files/ja/mozilla/tech/xpcom/using_nscomptr/frequently_asked_questions/index.html b/files/ja/mozilla/tech/xpcom/using_nscomptr/frequently_asked_questions/index.html deleted file mode 100644 index 1edb362717..0000000000 --- a/files/ja/mozilla/tech/xpcom/using_nscomptr/frequently_asked_questions/index.html +++ /dev/null @@ -1,91 +0,0 @@ ---- -title: Frequently Asked Questions -slug: Mozilla/Tech/XPCOM/Using_nsCOMPtr/Frequently_Asked_Questions -tags: - - XPCOM -translation_of: Mozilla/Tech/XPCOM/Using_nsCOMPtr/Frequently_Asked_Questions ---- -

-

このセクションは、もしあなたが壊れたビルドを直したり、即答できる明らかな疑問を持っていたり、あるいは リファレンスマニュアル を読む時間がない場合に役に立つでしょう。この FAQ は、通常は適切な答えへ直接的に参照するだけです。もしあなたが単に nsCOMPtr について学ぶことを期待しているのであれば、スタートガイド にもっと良い紹介があります。 -

FAQ は、探しているものを早く見つけやすくするために複数のセクションに分かれています。 ほとんどの場合、答えは上記のリファレンスマニュアルを参照しているだけです。 同じことを 2 度説明する必要はありません :-) -

-

ビルド時のエラー

-

ビルドが壊れました。エラーがあなた自身のコードでもなく、あなたのプラットフォームのコードでもなく、nsCOMPtrの 中で起こっており、そしてあなたはそれを疑っています。あなたは正しい場所を見ています。 -

-

nsCOMPtr と生の [XP]COM インタフェースポインタを比較しています

-

nsCOMPtr を後に宣言しているクラスに対して宣言しています

-

XPCOM とリンクしていません

-

nsCOMPtr.h をインクルードしていません

-

NSCAP_FEATURE_DEBUG_PTR_TYPES の設定が違います

-

実行時のエラー

-

NS_ASSERTION "QueryInterface needed"

-

NS_PRECONDITION "You can't dereference a NULL nsCOMPtr with operator->()"

-

NS_PRECONDITION "You can't dereference a NULL nsCOMPtr with operator*()"

-

どうやって...

-

nsCOMPtr を初期化するのですか?

-

nsCOMPtr がスコープを抜ける前にそれを Release するのですか?

-

それに 0 を代入してください。nsCOMPtr が新しい値を取る時は、古い値があれば、いつもそれを Release します。値 0 を割り当てるということは、NULL の生のポインタを割り当てるのと同じようなことです。古い対象は、Release されます。(より詳しくは、初期化と代入 を見てください。) -

ただし、これには小さなパフォーマンス上のペナルティがあることに注意してください。nsCOMPtr は、デストラクタの処理の中で、その時持つ値を Release しようとします。最良の解決法は、nsCOMPtr の生存期間をその参照を保持したい期間だけに調整することです。例えば、この例ではブロックを使っています。 -

- - -
-
// 最も効率的な枠組は、|nsCOMPtr| がちょうどその参照を
-// 保持する必要のある期間だけのスコープを設定することです。
-
-nsresult
-SomeLongFunction( nsIBar* aBar )
-  {
-    nsresult rv;
-    // ...
-
-    {
-      // |nsIFoo| インタフェースは、短期間だけ必要です。
-      // そのため、その生存期間をブロック文の中で
-      // 宣言して、制御します。
-
-      nsCOMPtr<nsIFoo> foo( do_QueryInterface(aBar, &rv) );
-      if ( foo )
-        foo->DoSomeFooThing();
-
-      // |foo| がスコープをはずれました。そのため、ここで |Release| が実行されます。
-    }
-
-    // ...ここには |nsIFoo| を必要としない多くの事柄があります。
-
-    return rv;
-  }
-
-
-

編集者注: この議論を 効率性のセクションへ移動し、ここからリンクを張ります。 -

-

nsCOMPtr のリークを作るのでしょうか (デバッグテストのため) ?

-

生の [XP]COM インタフェースポインタを「入出力」パラメタとして使う getter を呼べばよいのでしょうか?

-

nsIFoo*& パラメタで設定する getter を呼べばよいのでしょうか?

-

その結果を AddRef しない getter を呼べばよいのでしょうか?

-

インタフェースポインタを返すどの {{ mediawiki.external('XP') }}COM 関数 (getter) も、そのポインタに対して AddRef をすでに呼び出していなければいけません。 もしそれが行われないのであれば、おそらくそれをバグとして報告すべきでしょう。 この問題を解決するのに使うどのコードパターンに対しても、このようにコメントすべきです。 例えば、// 警告: この getter は 結果を AddRef() していません。 もし getter が新しいポインタを関数の復帰値として返すのであれば、心配いりません。 -

-

一般

-

nsCOMPtr は、コードを膨張させますか?

-

nsCOMPtr は速いですか? タイトなループの中でも使えますか?

-

参考文献一覧

-

Web リソース

- -

書籍

- -

人々

- -
-
-{{ languages( { "en": "en/Using_nsCOMPtr/Frequently_Asked_Questions" } ) }} diff --git a/files/ja/mozilla/tech/xpcom/using_nscomptr/getting_started_guide/index.html b/files/ja/mozilla/tech/xpcom/using_nscomptr/getting_started_guide/index.html deleted file mode 100644 index 826f85c35a..0000000000 --- a/files/ja/mozilla/tech/xpcom/using_nscomptr/getting_started_guide/index.html +++ /dev/null @@ -1,294 +0,0 @@ ---- -title: Getting Started Guide -slug: Mozilla/Tech/XPCOM/Using_nsCOMPtr/Getting_Started_Guide -tags: - - XPCOM -translation_of: Mozilla/Tech/XPCOM/Using_nsCOMPtr/Getting_Started_Guide ---- -

 

-

もしあなたが nsCOMPtr を前に使ったことがないのであれば、このセクションは、あなたにピッタリです。もしあなたがすでに nsCOMPtr に慣れ親しんでいるのであれば、リファレンスマニュアル あるいは FAQ まで読み飛ばしたいかもしれません。心配しないでください。スタートガイドは短いです。

-

はじめに

-

nsCOMPtrとは何ですか?

-

nsCOMPtrはリークを防ぐのを助けるツールです。

-

nsCOMPtr は「スマートポインタ」です。これは、文法的には通常の C や C++ の通常のポインタのように振舞うテンプレートクラスです。つまり、*-> を使って、それが指すものを取り出すことができます。nsCOMPtr は、XPCOM オブジェクトを指す生の C++ ポインタとは違い、AddRefReleaseQueryInterface をあなたのために管理してくれるという点でスマートです。nsCOMPtr は、以下のソースファイルで定義されています。

- -

...ただ、まだそこを見たくはないは思わないでしょうけど。

-

nsCOMPtr を使うことで、生の XPCOM インタフェースポインタを使うよりも、短く、きれいで、明確で、安全なコードを書くことができます。

-

[XP]COM の基本: 所有権と参照カウント

-

これは、 XPCOM の基本的な事項に関する軽い記事です。あなたはすでに(XPCOM について)知っている必要がありますし、この短いセクションにざっと目を通せるようにすべきです。もしあまり馴染みのない事が書いてあるのであれば、あなたはまだ nsCOMPtr を読む準備ができていません。COM の背後の基本的ルールと論証については、以下の情報が有用です。Essential COM (Don Box 著)。Don Box は、COM について、より詳細なこと、わな、落とし穴について、Effective COM で述べています。あなたは C++ についての適切な知識も持っているべきです。おそらくこのトピックについてとても助けになる 3 冊の本は、Bjarne Stroustrup の The C Programming Language、Scott Meyers の Effective CMore Effective C です。

-

すべての XPCOM オブジェクトは、ヒープに割り当てられます。クライアントは、そのようなオブジェクトの実装について多くを知ることはできません。クライアントは「インタフェース」へのポインタを通じてのみ、それを参照します。すなわち、ポインタの静的な型は抽象基底クラスへのポインタであり、指されている実際のオブジェクトは、抽象基底クラスから派生しているクラスです。その XPCOM オブジェクトは、「インタフェースを実装する」と言われます。クライアントのオブジェクトへの参照は、一般的に「インタフェースポインタ」と呼ばれています。

-

オブジェクトは、たくさんのインタフェースを実装するかもしれません。それぞれのインタフェースについて、(少なくとも概念的には) 別々に、「参照のカウント」が行われます。つまり、インタフェースはそれを参照しているクライアントの数を保持しているということです。カウントが 0 になった時、インタフェースは自分自身を削除することができます。クライアントには、この参照カウントの厳密さを保つことが求められています。そのため、インタフェースへの参照が獲得された時は参照カウントのインクリメントを行い、またそれを使わなくなった時は参照カウントのデクリメントを行わなければなりません。これを容易にするため、すべてのインタフェースは、メンバ関数 AddRefRelease を提供する抽象基底クラスから継承しています。

-

XPCOM の一つの規則は、インタフェースポインタを作成するか、返すかするどの関数もそれに対して、すでに AddRef を実行していなければならないことです。呼び出し側は、参照をいつまでも保持することができ、いらなくなったら、Release を呼びます。インタフェースへの最後のポインタに対して、Release が呼ばれると、インタフェース (従って、通常は基となるオブジェクトも) は、自分自身を削除します。インタフェースに対する未解決の AddRef がある限り、オブジェクトは存在し続けます。Release を呼び忘れると、オブジェクトはリークし、すなわち、オブジェクトの記憶領域は決して取り戻されません。リークは、悪いことです。:-)

-

AddRefRelease の呼び出しを通じた参照を所有する参照と呼びます。それは、基となるオブジェクトに権利を持ちます。そのオブジェクトは、所有する参照がその権利を放棄するまで無くなりません。全ての参照が所有する参照である必要はありません。実際、もし二つのオブジェクトが何らかの形で (一時的にでも) お互いを所有しあうことになった場合、所有の輪を断ち切るなんらかの`例外的'メカニズムなしで、それらのオブジェクトを取り戻すのは、難しくなります。ドキュメント COM の所有のガイドライン は、所有権が必要になった時に、いくつかヒントを与えてくれます。以下のリストは、開始地点としていいですが、しかし決して完全ではありません。

-

所有する参照を使うのは、

- -

所有する参照を使わなくてもよいのは、

- -

これらにより、参照カウントをプログラマが手動で正しくするのは、大変であることが分かります。それは、簡単そうに見えますが、しかし実際には Release を適切な時に実行するのは忘れやすいのです。あるいは、 AddRef を多く呼びすぎたり、呼び出しが足りなかったりすることもあります。

-

nsCOMPtr は、どのように役に立つのか?

-

nsCOMPtr は、AddRefRelease、その他の煩わしい仕事をあなたのために管理します。nsCOMPtrは、見掛けも振舞いも C が許している生の XPCOM インタフェースポインタのようです。しかし、nsCOMPtr は、自分が指しているオブジェクトを所有していることを知っています。少し慣れる必要はありますが、しかし結果的に、タイピングが少なくて済み、きれいで、安全なコードを書くことができ、そしてリークが少なくなります。

-

例えば、ここに典型的な (とてもコンパクトな) コードの断片があります。これは、XPCOM インタフェースポインタをメンバ変数に代入しています。つまり、「setter」関数の本体です。生の XPCOM インタフェースポインタと nsCOMPtr を並べて使用しています。

-

 

- -
比較 1. メンバ変数を設定する
// 生の [XP]COM インタフェースポインタ...
-// 仮定: |nsIFoo* mFooPtr;|
-
-/*    もし |NULL| でなく新しい値なら、|AddRef| し    それを代入します。もし古い値があれば、    |Release| します (そうやってリークを防ぎます)。    この割り当て順序は特別で、特定の所有者バグを防ぐために   使われなくてはなりません。  */
-
-NS_IF_ADDREF(aFooPtr); nsIFoo* temp = mFooPtr;
-mFooPtr = aFooPtr;
-NS_IF_RELEASE(temp);
-
// |nsCOMPtr|...
-// 仮定: |nsCOMPtr<nsIFoo> mFooPtr;|
-
-/*    この代入は、|mFooPtr| に古い値が    あれば自動的にそれを |Release| し、    新しい値に対して、先ほど触れた所有者バグを    防ぐために適切な順序で |AddRef| を    呼び出します。  */
-
-
-
-
-
-mFooPtr = aFooPtr;
-
-
-

付け加えると、生の XPCOM インタフェースポインタを使うクラスは、mFooPtrRelease するためのデストラクタを必要とします。そして、mFooPtrNULL (または何らかの正当な値) で初期化されることを保証するコンストラクタを必要とします。

-

nsCOMPtrは、あなたが生の XPCOM インタフェースポインタを使うよりリークへの耐性があり、例外に対して安全で、だらだらとしないコードを書くのに役立ちます。nsCOMPtr を使う時は、AddRefQueryInterface を手動で呼ぶ必要はないでしょう。

-

それでもなお、 XPCOM を理解する必要があります。また、どの関数がAddRefされたインタフェースポインタを返し、どの関数がそうでないものを返すのかを知っていなければなりません。また、あなたのプログラムロジックが循環参照によるゴミを作り出さないことを保障しなければなりません。nsCOMPtr は、万能薬ではありません。しかしながら、それは、役に立ち、簡単に使え、よくテストされ、そして洗練されています。関数の作者があなたと協調することを必要としません。またあなたがそれを使うことにより、他人にそれを使うよう強制することもありません。

-

nsCOMPtr を使う

-

基本

-

ほとんどの場合、あなたはnsCOMPtrを生の XPCOM インタフェースポインタと全く同じように使うでしょう。宣言時のわずかな違いに注意してください。

-

 

- -
比較 2. 類似性: nsCOMPtrは、文法的に生の XPCOM インタフェースポインタに似ている。
// 生の [XP]COM インタフェースポインタ...
-
-nsIFoo* fooPtr = 0;  // ...
-fooPtr->SomeFunction(x, y, z);
-AnotherFunction(fooPtr);
-
-if ( fooPtr )
-  // ...
-
-if ( fooPtr == foo2Ptr )
-  // ...
-
// |nsCOMPtr|...
-
-nsCOMPtr<nsIFoo> fooPtr;
-// ...
-fooPtr->SomeFunction(x, y, z);
-AnotherFunction(fooPtr);
-
-if ( fooPtr )
-  // ...
-
-if ( fooPtr == foo2Ptr )
-  // ...
-
-

二つの主な違いがあります。最初の違い: あなたはもはや AddRefRelease を呼ぶ必要がありません。また呼んでもいけません。

-

 

- -
Comparison 3. Differences: AddRef and Release are illegal for nsCOMPtrs.
// 生の [XP] COMインタフェースポインタ...
-// 仮定: |nsIFoo* mFooPtr;|
-
-  /*     注意: この順序はどっちみち生のポインタが     代入された正しい順序ではありません     (比較 1 を参照してください) しかし、     ここでは、この比較が必要です。   */
-
-NS_IF_RELEASE(mFooPtr);
-
-mFooPtr = aFooPtr;
-NS_IF_ADDREF(mFooPtr);
-
-
// |nsCOMPtr|...
-// 仮定: |nsCOMPtr<nsIFoo> mFooPtr;|
-
-  /*     もはや |AddRef| や |Release| を呼ぶ     必要もありませんし、コンパイラはそれを     エラーにします。   */
-
-
-
-NS_IF_RELEASE(mFooPtr);
-  // エラー: |Release| はプライベートです。
-mFooPtr = aFooPtr;
-NS_IF_ADDREF(mFooPtr);
-  // エラー: |AddRef| はプライベートです。
-
-

二番目の違い: あなたは、生の XPCOM インタフェースポインタのパラメタを通じて、結果を返すことを期待して、nsCOMPtr のアドレスを getter に渡すことができません。あなたは、getter_AddRefs 指示子で、nsCOMPtr を注釈する必要があります。

-

 

- -
比較 4.違い: nsCOMPtrを`出力パラメタ'として使う時に、getter_AddRefsを適用する。
// 生の [XP]COM インタフェースポインタ...
-
-nsIFoo* foo;
-
-GetFoo(&foo);
-
// |nsCOMPtr|s...
-
-nsCOMPtr<nsIFoo> foo;
-
-GetFoo(getter_AddRefs(foo));
-
-

これで終りです。あなたは、もうnsCOMPtrを使い始めるのに十分な知識を持っています。この他にnsCOMPtrをもっと複雑な状況で使う時にあなたが知りたいであろう、いくつかの詳細な事柄があります。でもあなたが学んだことは、あなたが使う状況の 90% をカバーしています。

-

いくつかの詳細

-

あなたが nsCOMPtr から最大限のことを引き出すのを手伝ういくつかの事があります。

-

しばしば、まず QueryInterface を呼ぶことで、あなたはインタフェースポインタを得ます。 QueryInterface は、他と同様に getter です。そして、上述したように getter_AddRefs ルールを適用して、それを呼び出す一つの方法をすでに知っています。

- -
nsCOMPtrQueryInterface する難しい方法
// |nsCOMPtr| に |QuertyInterface| するやり方 (最良のやり方ではないですが)...
-
-nsCOMPtr<nsIFoo> foo;
-
-nsresult rv = bar->QueryInterface(NS_GET_IID(nsIFoo), getter_AddRefs(foo));
-
-  // または、あなたが [XP]COM をよく知っているプログラマ
-  // ならば、タイプセーフ版を使ってください...
-nsresult rv = CallQueryInterface(bar, getter_AddRefs(foo));
-
-

QueryInterface はしばしば使われるので、nsCOMPtr には、それを呼び出すための特別に便利なものがあります。この便利なものは、タイプセーフで、これにより、nsCOMPtrQueryInterface の結果から直接構築されます。正しい値からの構築は、構築後に代入するよりも効率的です。 この便利なものは、do_QueryInterface 指示子です。do_QueryInterface を使うと、上記のサンプルはこのようになります。

- -
nsCOMPtr への QueryInterface の仕方
// |nsCOMPtr| へ |QueryInterface| するベストな方法...
-
-nsresult rv;
-nsCOMPtr<nsIFoo> foo( do_QueryInterface(bar, &rv) );
-
-  // または、もし |nsResult| について気にしないのであれば
-nsCOMPtr<nsIFoo> foo( do_QueryInterface(bar) );
-
-

nsCOMPtr は、嬉しいことに AddRefRelease を暗黙的に呼び出します。同じような方法は、QueryInterface には、拡張されませんnsCOMPtr は、代入において、do_QueryInterface 指示子を使った明示的な許可がなければ、QueryInterface を実行しません。あなたは、もう隠れた問い合わせについて心配する必要はありません。しかしながら、もしあなたが問い合わせをするべきなのに、しなかった場合に注意してください。例えば、生のポインタを代入する場合で、C が代入を許可しているが XPCOM は許可していない場合。nsCOMPtr は、実行時にアサートする でしょう。異なった型の XPCOM インタフェースに代入する時にはいつでも、do_QueryInterface を使ってください。たとえ、その型がたまたま nsCOMPtr の基底型から派生していてもです。

-

 

- -
比較 6. do_QueryInterfaceXPCOM の型のエラーを防ぐ。
-class nsIBar
-  : public nsIFoo ... { ... };
-
-nsIBar* p = ...;
-
-  // C は、すべての |nsIBar*| が
-  // |nsIFoo*| であるとみなします。そのため、C は
-  // これを許可します...
-nsCOMPtr<nsIFoo> foo = p;
-  //  ...たとえそれが [XP]COM の型の
-  //  エラーだとしてもそうです。
-
-class nsIBar
-  : public nsIFoo ... { ... };
-
-nsIBar* p = ...;
-
-
-
-  // ここでは、型のエラーはありません...
-nsCOMPtr<nsIFoo> foo( do_QueryInterface(p) );
-
-
-
-

覚えておいてください。C の型のシステムと XPCOM の型のシステムは、互いに独立しているものです。XPCOM インタフェースは、C の抽象基底クラスとして表現されているため、C に違いを処理させたり、あるいはインタフェースの型の間を取り持つために C のキャストを使ったりしたくなるかもしれません。これは、間違いです。XPCOM の型の間で許されているのは、QueryInterface を使うことだけです。上記の例では、C が p から引き出す nsIFoo*p->QueryInterface() が返すものと同一のものであると仮定する理由はありません。

-

dont_AddRef は、同じような指示子で、例えば、その関数の結果としてポインタを返す getter を呼んだなどの理由で、すでに AddRef を実行したポインタを代入する時に役に立ちます。

- -
dont_AddRef の使用
-nsCOMPtr<nsIFoo> foo( dont_AddRef(CreateFoo()) );
-  // |CreateFoo| は、すべての望ましい getter が行うように、その結果を |AddRef| します。 
-

nsCOMPtrしないこと

-

nsCOMPtr は、所有する参照として振舞うために必要なすべてのことを行います。しかしながら、与えられた nsCOMPtr は、他の所有ポインタを作ることには協力しません。どうやって nsCOMPtr代入される時に自動的にポインタを AddRef するかを学習した後、それが参照される時にも同じことをすると仮定するのは、自然です。この誤解を示すコード断片を載せます。

- -
// |nsCOMPtr| に関する間違った仮定...
-
-nsresult
-nsCacheRecord::GetFileSpec( nsIFileSpec** aFileSpecResult )
-    /*       ...呼び出し側の |nsFileSpec*| (呼び出し側がアドレスを設定します) に       私のメンバ変数の |mFileSpec| (|nsCOMPtr型|) のコピーが代入されます。       つまり、この関数は「getter」です。        覚えてください: 望ましい [XP]COM getter は、いつも結果に対して |AddRef| を実行します。     */
-  {
-    // ...
-    *aFileSpec = mFileSpec;
-      // |nsCOMPtr| は、参照カウントに気をつけるべきです。いいですか?
-    return NS_OK;
-  }
-
-

明らかに、作者は (いくつかの疑問を持ちながらかもしれませんが)、nsCOMPtr つまり mFileSpec は、*aFileSpec への代入される時、自動的に AddRef を呼ぶと信じています。この場合は違いますnsCOMPtr は、自分のため (だけ) に、自動的に AddRefRelease を呼び出します。その他のすべての状況において、それは、生の XPCOM ポインタを置き換えるスロットとして設計されています。nsCOMPtr が生のポインタが必要とされているところで使われていたら、nsCOMPtr は自動的にそれを提供します。

- -
// |nsCOMPtr| は、生のポインタが必要とされている場合は、それを提供します...
-
-nsCOMPtr<nsIFoo> foo = ...;
-
-  // 1.  生のポインタに代入
-nsIFoo* raw_foo = foo;
-
-  // 2.  別の |nsCOMPtr| に代入
-nsCOMPtr<nsIFoo> foo2 = foo;
-
-  // 3.  パラメタとして
-SetFoo(foo);
-
-  // 4.  |if| 式の中で値をテスト
-  // 5.  メンバ関数の呼び出し
-if ( foo )
-  foo->DoSomething();
-
-

これらすべての場合において、かなり正確に同じコードが実行されます (2 番目のケースは、少し違いますが、意図は同じです)。それぞれの場合において、あなたは本質的に自分の目的のために生のポインタの値を取り出しています。もし nsCOMPtr が値に対して、その都度 AddRef を実行すると、4 番目のケースと 5 番目のケースではあきらかにいつもリークを作り出してしまいます。ケース 3 の SetFoo は、場合によって、二つの異なった書き方で書かれる必要があります。それは、nsCOMPtr が与えられた場合は、値に対してすでに AddRef が実行されていることが分かり、そして生のポインタが与えられた場合、値に対して AddRef は実行されていないことがわかるためです。実際、矛盾はこれらよりもっと深くまで広がります。これらすべてのケースは、「出力」に対して自動的に AddRef を実行すると、nsCOMPtr と生のポインタがクライアントの視点から見て異なる振舞いをすることになるということを示しています。同じように振舞うようにさせるのが目的であり、そのため nsCOMPtr は、置き換えのスロットになりうるのです(自分の「所有権」について管理することを守らせることにより)。

-

あなたが今知ったことから、ルールは明らかです。上述したように、そうしないように指示しない限り、nsCOMPtr は、代入される時に AddRef を実行します。nsCOMPtr は、参照される時は何もしません。

-

どこでnsCOMPtrを使うべきでしょうか?

-

インタフェースポインタを所有する参照として使うところでは、どこでも nsCOMPtr を使うべきです。つまり、あなたがそれに対して AddRefRelease を呼び出す所です。setter を単純にする場合、そしてコンストラクタ、デストラクタ、代入演算子を除去する場合、nsCOMPtr をメンバ変数として使うべきです。QueryInterface の呼び出しをおおむね快適にし、エラー処理を避けるための複雑なロジックを除去する場合、nsCOMPtr をスタック上で使うべきです。

-

どこでnsCOMPtrを使うべきではないですか?

-

所有する参照を必要としないところでは、nsCOMPtrを使わないでください。COM の所有のガイドライン を見てください。nsCOMPtrXPCOM インタフェースとともに使われるように設計されています。そのため、以下 に示すように特定の例外を伴うインタフェースでないものと一緒には使わないでください。XPCOM の中で nsCOMPtr を使わないでください。それらをプレーンな古い C コード上で使わないでください。もちろん、nsCOMPtrは C だけの構築物です。nsCOMPtr を決して キャストしないで ください。それをすると、ほとんどリークが保証されたようなものです。

-

インタフェースでないクラスのための nsCOMPtr

-

適切にフォーマットした解答を追加する予定です。当面の間、詳細全体は この news 投稿 で利用可能です。

-

関数識別子内の nsCOMPtr

-

一般的に、XPCOM (つまり、「スクリプタブル」) 関数の識別子内で、nsCOMPtr を使いたいとは思わないでしょう。nsCOMPtr は現在 IDL により直接サポートはされていません。しかし、あなたは時々スクリプタブルでない関数内で nsCOMPtr を使いたくなるかもしれません。

-
nsCOMPtr<T> f() nsCOMPtr をリターン値として返さない
-

この方法は危険です。AddRef されたポインタを関数のリターン値として返すことは、ほとんどどの様な形で行なっても、リークや無効なポインタなどの、かなりひどい潜在的エラーに行きつきます。 nsCOMPtr をリターンすることは (クライアントがそれに所有権を与えたことをクライアントに教えるので) よい考えのように見えますが、これは無効なポインタを引き起こします。以下のコードを考えてみてください。

- -
// |nsCOMPtr|を返してはいけません...
-nsCOMPtr<nsIFoo> CreateFoo();
-// ...
-
-nsIFoo* myFoo = CreateFoo(); // おっと: |myFoo| はもう無効!
-  // |CreateFoo| は |nsCOMPtr| を返すけれど、
-  // |nsCOMPtr| はこの代入のあと正しく自動的に |Release| する
-  // 今 |myFoo| は削除されたオブジェクト
-  // を参照している。
-
-

already_AddRefed<T> をリターンすることにより、呼び出し側に、この危険なしにそれらに所有権を与えたことを通知できます (バグ 59212参照)。nsCOMPtr は、already_AddRefed された値は、AddRef すべきではない事を知るようになります。

- -
// 好ましい方法: もし、ポインタを返す必要があるなら、|already_AddRefed| を使うこと...
-already_AddRefed<nsIFoo> CreateFoo();
-// ...
-
-nsIFoo* myFoo1 = CreateFoo(); // 無効にならない
-nsCOMPtr<nsIFoo> myFoo2( CreateFoo() ); // リークしない
-nsCOMPtr<nsIFoo> myFoo3( dont_AddRef(CreateFoo()) ); // 冗長だが認められており正しい
-
-

これを、既に AddRef した生ポインタをリターンすることを原因とする、最も頻繁に起こりうるリークと比べてみてください。

- -
// 生のポインタを返さないでください、リークを誘発します...
-nsIFoo* CreateFoo(); // |AddRef| されたポインタを返してください
-// ...
-
-nsCOMPtr<nsIFoo> myFoo = CreateFoo(); // おっと: リークだ
-nsCOMPtr<nsIFoo> myFoo( dont_AddRef(CreateFoo()) );
-  // |CreateFoo| その結果を既に |AddRef| しているため、私たちは |nsCOMPtr|
-  // をそうしないように覚えておかなくてはなりません。それは忘れやすいことです。
-  // 関数の戻り値としてポインタを返さないか、さもなければ上記のように
-  // |already_AddRefed<T>| を返すかしてあらかじめ防いでください。
-
-

 

-
void f( nsCOMPtr<T> ) nsCOMPtrを値渡ししない
-

この方法は役に立たないどころか、実害があります。引き数は関数コールと同じ生存期間を保証されるので、引き数を AddRef する必要はありません。関数コールを超えて生き残る構造体のメンバに値を格納する時のみ、AddRef が必要になります。これは、関数の引き数ではなく、構造体の適切なメンバが nsCOMPtr であるべきことを意味します。更にこの書き方は、呼び出し側に、単に関数をコールするために nsCOMPtr が必要なのではないかと思わせ、混乱させます。

-
void f( const nsCOMPtr<T>& ) nsCOMPtrconst 参照渡ししない
-

上の書き方と全く同じで、この方法は役に立たないどころか、実害があります。もし呼び出し側が生ポインタを渡した場合には、nsCOMPtr を値渡しするのと同じ良く無いことが起こります。

-
void f( nsCOMPtr<T>* ) できれば nsCOMPtr のアドレス渡しは避ける
-

この方法は、呼び出し側に、それが nsCOMPtr を使用することと、ちょっとした余分な仕事を要求します。と言うのは、nsCOMPtroperator& は (キャストによるリーク を防ぐために: バグ 59414 参照) private だからです。この方法は、「入出力」引き数として宣言する事により、以下のように可能ですが、nsCOMPtr を参照渡しする方が好ましいでしょう。

- -
// |nsCOMPtr| のポインタ渡しは余計な仕事を増やすk...
-void f( nsCOMPtr<nsIFoo>* );
-// ...
-
-nsCOMPtr<nsIFoo> myFoo = ...;
-
-f( address_of(myFoo) );
-
-
void f( nsCOMPtr<T>& ) ちゃんとnsCOMPtrを「入出力」引き数として参照渡しする
-

これは「入出力」引き数を提供するために好ましい方法です。もし代りに生ポインタを使った場合、関数内部では、入力値として呼び出し側がどの所有する関係を持っているかが、分らなくなります。結果として、新しい値を代入する前に Release すべきかどうかが分らなくなります。引き数を nsCOMPtr&、として宣言する事により、関係が明確になります。

-

要約

-

nsCOMPtr は、所有する参照です。それが指すものはなんであれ AddRef され、nsCOMPtr をその「所有者」の一つとしてカウントします。nsCOMPtr は、nsCOMPtr が違うオブジェクトを指すために解放されるか、nsCOMPtr がスコープを抜けようとしているためかいずれにしろ、解放される前に必ず Release を呼び出します。新しい値が nsCOMPtr に割り当てられる時は、nsCOMPtr は、いつも自動的に、もし古い参照があれば、それを Release し、(そしてあなたがすでに実行済であると明示しなければ) 新しい方を AddRef します。

-

あなたはnsCOMPtrを厳密にほとんどすべての場合で生の XPCOM インタフェースポインタとして使うことができます [|比較 5 で示すようなコンパイラの問題にも、注意しなければいけないですが]。あなたは、それを通じて明示的に AddRefRelease を呼ばなくてよいです。また、コンパイラもそれを許しません。あなたが nsCOMPtr を変更しなければ使うところのできない唯一の場所は、生の XPCOM インタフェースポインタが`出力'引数である場所です。この場合、あなたは nsCOMPtrgetter_AddRefs でラップします [比較 4を見てください]。

-

nsCOMPtr に代入した時に、(生の XPCOM インタフェースポインタであっても nsCOMPtr であっても、) 通常は、追加の指示子なしに単にもう一つのポインタを渡すだけです [例えば、比較 1nsCOMPtr の方を見てください]。上述したように、指示子なしに、nsCOMPtr は、もし古い対象があれば、それに対して、Release を呼び出し、そして新しい方に対して、AddRef を呼び出します。このようにするのが適切なのは、新しい参照に対して責任をとるために、あなたが代入したものに対してまだ AddRef を実行していない時です。これは、あなたが取得する関数を呼び出したのではないポインタを代入する時によくある場合です。例えば、引き数として渡されたものや、構造体から抜きだしたものなどです。

-

あなたは、nsCOMPtr に、新しい値を dont_AddRef でラップすることにより、代入において新しい値を AddRef する必要がないことを伝えることができます。例えば、すべての望ましい XPCOM getter のように、あなたのためにすでに AddRef を呼び出している関数から新しい値を得た場合に、これを行ってください。

-

あなたは、ポインタを異なったインタフェース型に代入してはいけません。あなたは、まず正しい型に問い合わせる必要があります [例えば、比較 6 と周辺の議論を見てください]。nsCOMPtr は、決して QueryInterface を暗黙的に呼び出しません。つまり、あなたは自分でそれを呼ばなければいけません。あるいは、明示的に do_QueryInterface を使って、nsCOMPtr にそれを呼ぶように依頼しなければいけません。do_QueryInterface 指示子は、あなたが代入の一部として問い合わせをするのを許します。このよりよい便利な機構により、構築してから正しい値を後で代入するのではなく、(代入での) 右の値から nsCOMPtr を直接構築されます。構築に続いて代入するより、構築だけで済ませる方が効率的です。合理的である限り、代入と同時に構築する方を選んでください。AddRef したポインタを返す関数に対して、do_QueryInterface を適用しないように注意してください。[説明のために この短いセクション を見てください。]

-

より詳しいことについては、リファレンスマニュアル に続きます。

- -

 

diff --git a/files/ja/mozilla/tech/xpcom/using_nscomptr/index.html b/files/ja/mozilla/tech/xpcom/using_nscomptr/index.html deleted file mode 100644 index 5d821dfeca..0000000000 --- a/files/ja/mozilla/tech/xpcom/using_nscomptr/index.html +++ /dev/null @@ -1,24 +0,0 @@ ---- -title: Using nsCOMPtr -slug: Mozilla/Tech/XPCOM/Using_nsCOMPtr -tags: - - XPCOM -translation_of: Mozilla/Tech/XPCOM/Using_nsCOMPtr ---- -

このドキュメントは、nsCOMPtr について書かれたすべてを集めたものです。もしあなたが nsCOMPtr について疑問があり、このドキュメントでは分からないのであれば、 おそらくそれに答えられるドキュメントはないでしょう。XPCOM ニュースグループ、または他のベテランの nsCOMPtr ユーザに尋ねる、あるいは実験して答えを見つける、などの別の手段で答えを得るしかありません。

もしあなたがまだ nsCOMPtr 使ったことがないのであれば、ここは始めるのに適した場所です。そのまま読み進んでください。いつ止めるかは、あなた次第です。nsCOMPtr をしばらく使った後で、未知の領域に到達したり、コンパイルエラーになったりしたら、このドキュメントに戻ってきて、リファレンスマニュアル、あるいは FAQ から助けを得たいと思うでしょう。 -

-

目次

-
  1. 状況、最近の更新と計画 -
  2. スタートガイド -
  3. リファレンスマニュアル -
  4. よく聞かれる質問 -
-
-

原文書の情報

- -
-
-
diff --git a/files/ja/mozilla/tech/xpcom/using_nscomptr/reference_manual/index.html b/files/ja/mozilla/tech/xpcom/using_nscomptr/reference_manual/index.html deleted file mode 100644 index c5c82f9fdd..0000000000 --- a/files/ja/mozilla/tech/xpcom/using_nscomptr/reference_manual/index.html +++ /dev/null @@ -1,523 +0,0 @@ ---- -title: Reference Manual -slug: Mozilla/Tech/XPCOM/Using_nsCOMPtr/Reference_Manual -tags: - - XPCOM -translation_of: Mozilla/Tech/XPCOM/Using_nsCOMPtr/Reference_Manual ---- -

-

このセクションは、あなたが、すでに nsCOMPtr に慣れ親しんでいるけれども、もっと詳細な事柄を知りたい場合に役立つでしょう。もし、まだ nsCOMPtr を前に使っていないのであれば、まず スタートガイド を読みたいかもしれません。もし、壊れたビルドを直そうとしているのであれば、FAQ によって、もっと素早く答えを得られるかもしれません。 -

-

基本

-

設計

-

nsCOMPtr は、所有する参照として使われる所で、生の [XP]COM インタフェースポインタを完全に置き換えるように設計されました。生の [XP]COM インタフェースポインタを使うことができるところであれば、ほとんどの場合、nsCOMPtr を使うことができるはずです。nsCOMPtrは、生の [XP]COM インタフェースポインタと正確な同じ大きさと形です。それは、容量を食いすぎることもなく、メンバ変数として使うことができます。 -

所有する参照のほとんどの作業は、nsCOMPtr のコンストラクタ、デストラクタと代入演算子で行われます。あなたが(代入や初期化により) nsCOMPtr を異なる [XP]COM オブジェクトで「指す」場合、もし古い値があれば、それを Release しなければなりません。そして、新しい値を AddRef しなければなりません。自分のデストラクタ実行時には、同様に Release しなければなりません。nsCOMPtr は、もしあなたがいつも正しいことを覚えているのであれば、ちょうどあなたがしていた作業しかしません。 -

-

安全性の特徴

-
型の保護手段
-

元の型のための正しい [XP]COM インタフェースポインタを保持しているのは、nsCOMPtr の不変性です。例えば、nsCOMPtr<nsIFoo> は、[XP]COM オブジェクトに nsIFoo インタフェースを問い合わせる時に、code>QueryInterface</code> によって返されるポインタを常に保持しています。デバッグビルドでは、もし代入時に QueryInterface を呼ばずに、この不変性を覆すと、nsCOMPtr は、間違った代入として実行時にアサートするでしょう。 -

- - -
-
// 二つの無関係なインタフェース |nsIFoo| と |nsIBar| があるものとします...
-nsIBar* bar = ...;
-// ...
-
-nsCOMPtr<nsIFoo> foo = bar;
-  // NS_ASSERTION: "QueryInterface needed"
-
-  // ...あなたは、この行をコンパイルできるとみなすかもしれませんが
-  // (キャストでもそうです。なぜなら型が C に関係づけられているからです)
-
-
-

この不変性は、nsCOMPtr<nsISupports> では、緩められます。nsISupports*(あるいはvoid*)のように、人々は一般的にnsCOMPtr<nsISupports> を「任意の [XP]COM インタフェース」とみなして使います。もし実際の型を気にしないようなオブジェクトに対して、nsCOMPtr が [XP]COM として正しい nsISupportsQueryInterface することを強制するのであれば、煩わしいかもしれません。 -

-
NULL 間接参照の保護手段
-

もし中が空の時に間接参照しようとすると、nsCOMPtr は、実行時にアサートします。例えば、 -

- - -
-
nsCOMPtr<nsIFoo> foo;
-  // 注: デフォルトでは、|0| に初期化されます。
-
-foo->DoSomething();
-  // NS_PRECONDITION: "You can't dereference a NULL nsCOMPtr with operator->()"
-
-
-

同様の事前条件が operator* のために、介在します。 -

-
参照カウントの保護手段
-

nsCOMPtr から元の生のポインタを取り出すすべての操作に対して、安全な特徴を実装するための C の別のトリックを使います。返ってきたポインタに対して、AddRefReleasedeleteを実行することができません。 -

- - -
-
nsCOMPtr<nsIFoo> foo = ...;
-
-foo->AddRef();     // エラー: |AddRef| はプライベートです。
-delete foo.get();  // エラー: |operator delete| はプライベートです。
-NS_RELEASE(foo);   // エラー: |Release| はプライベートです。
-
-
-

もちろん、nsCOMPtr によって提供される安全性に関する最も重要な特徴は、それが適切な時期に自動的に AddRefRelease を実行することです。 -

-

キャスト

-

nsCOMPtr では、旧式の C のキャストを使わないでください。旧式のキャストは、たとえそれが正しくないとしても、コンパイルできることが保障されています。旧式のキャストは、もし変換が定義されていないのであれば、reinterpret_cast と同じものにしてしまいます。そのようなキャストは、nsCOMPtr の機構を容易にバイパスしてしまい、リークの発生、型の不一致、その他の不幸な出来事を招きます。 -

- - -
-
// 旧式の C のキャストが |nsCOMPtr| 機構をバイパスし、リークを発生させる...
-
-nsresult rv;
-nsCOMPtr<nsIFoo> foo = ...;
-
-// ...
-rv = GetFoo( (nsIFoo**)&foo );
-rv = GetFoo( &(nsIFoo*)foo );
-  // もちろん、これらはコンパイルできます。でもリークしてしまいます。
-
-
-

これを防ぐのを助けるために、上記のように operator&private にすることにより、最初の形を不法とすることを試みます。バグ 59414 を参照してまださい。 -

-

実装の詳細とデバッグ機構

-

nsCOMPtr はクラスですが、virtual なメソッドを持っていません。つまり、vtable または vptr を持っていません。キーとなるいくつかのルーチンが共通の非テンプレートの基底クラスに分解されるので、実際の元のポインタは、nsISupports* として保存されます (ただしデバッグビルドで NSCAP_FEATURE_DEBUG_PTR_TYPES がオンになっている場合は除きます)。それは、これらの分解されたルーチンのために、nsCOMPtr のユーザが XPCOM ライブラリとリンクしなければいけないからです。 -

NSCAP_FEATURE_DEBUG_PTR_TYPES がオンになっている時、nsISupports* 型の変数に元のポインタを保持する代わりに、nsCOMPtr は、元の型に適合するポインタに保持します。これにより、ソースレベルのデバッガがより簡単にポインタを「追跡」できるようになります。しかしながら、基底クラスに分解されるルーチンは、今やテンプレート特有のインラインコードとなります。分解される基底クラスはありません。これは、すべてのアプリケーションが NSCAP_FEATURE_DEBUG_PTR_TYPES について同じ設定でコンパイルされなければならないことを意味します。そうでないと、いくつかの部分では基底クラスを期待し、他の部分ではそうでないことを期待することになります。アプリケーションは、リンクできないでしょう。 -

-

ユニットテスト

-

nsCOMPtrのためのユニットテストは、このファイルにあります。 -

- -

初期化と代入

-

組み込み形式

-

nsCOMPtr への代入や初期化は、簡単に理解できます。nsCOMPtr は、その古い値がもしあれば Release し、そして新しい値を代入し、AddRef を呼び出し、および/または、あなたが直接「注釈」することによって dont_AddRef のような指示子で代入する QueryInterface を呼び出します。このセクションでは、それぞれ起こりうる場合を記述します。ただし、指示子については、より簡潔に以下の表で記述しています。 -

あなたは、nsCOMPtr を以下のものから構築するか、以下のものから代入することができます。 -

- -

最初の三つは、単純で明らかです。4 番目のもの (dont_QueryInterface 指示子の適用) は、同じ型の生の [XP]COM インタフェースポインタの代入と同じことです。残りの指示子は、特殊な状況において、いくつかの付加的な制御を提供するものです。さらに、nsCOMPtr を初期値なしで構築することができ、その場合は、0 で初期化されます。ちょうどプリミティブなポインタのように、値が0nsCOMPtr は、どのオブジェクトも指しません。そして、if (foo)if (!foo) のように式をテストすることができます。 -

上述した指示は、この表によりもっとはっきりするでしょう。 -

- - - - - - - -
表 1. nsCOMPtrに代入するオプション -
- QueryInterface しない - QueryInterface する -
AddRef する - -

T*,
dont_QueryInterface(T*)
-

-
-

do_QueryInterface(nsISupports*),
do_QueryInterface(nsISupports*, nsresult*)
do_QueryReferent(nsIWeakReference*),
do_QueryReferent(nsIWeakReference*, nsresult*)
-

-
AddRef しない - -

dont_AddRef(T*),
getter_AddRefs(T*)
-

-
-

n/a -

-
-

例えば、nsCOMPtr への代入において、(なんらかの理由ですでに AddRef を実行したために)代入するポインタに対して AddRef を実行したくない場合、「AddRefしない」と「QueryInterface しない」の交差する所にある dont_AddRef(T*) を使うのは一つの可能性です。以下に、dont_AddRefを使い、様々な位置にそれらの「注釈」が表れるサンプルを示します。 -

- - -
-
// |nsCOMPtr| への代入を管理する...
-
-  // コンストラクタにおいて...
-nsCOMPtr<nsIFoo> foo1( dont_AddRef(rawFoo1Ptr) );
-nsCOMPtr<nsIFoo> foo2 = dont_AddRef(rawFoo2Ptr);
-   // (直接の初期化と呼ばれる) 関数の形式と (コピーの初期化と呼ばれる)
-  //  コンストラクタの代入の形式は、微妙に異なる意味を
-  //  持つことに注意してください。直接の初期化の方が好ましい。
-
-nsCOMPtr<nsIFoo> foo3;
-
-  // 通常の代入において...
-foo3 = dont_AddRef(rawFoo3Ptr);
-
-   // 表で記述されている注釈をコンストラクタと
-  //  単純で古いタイプの代入に適用しています。
-
-
-

表に示されたどの注釈も dont_AddRef() を使って示されたすべての場所に出現可能です。続くセクションでそれぞれの可能性を記述します。 -

-
nsCOMPtr<T> = T*,
nsCOMPtr<T> = dont_QueryInterface( T* )
-

表で T* として示されるデフォルトの振舞いでは、新しい値に対して、AddRef を実行します。しかし、それに対して、QueryInterface は実行しません。「注釈」がない時に何が起きるかという例を示します。例えば、 -

- - -
-
nsCOMPtr<nsIFoo> foo( aFooPtr ); // もしくは
-foo = aFooPtr;
-  // ...|AddRef| は呼び出しますが、|QueryInterface| は呼び出しません。|
-
-  // 同じものをより明示的に表すと...
-nsCOMPtr<nsIFoo> foo( dont_QueryInterface(aFooPtr) ); // もしくは
-foo = dont_QueryInterface(aFooPtr);
- 
-
-
-

この形式を使うことにより、あなたが代入しているポインタがすでに、nsCOMPtr の元の型、この場合は、nsIFoo に適合している、[XP]COMとして正しいインタフェースへのポインタであることを約束していることになります。 -

-
nsCOMPtr<T> = do_QueryInterface( nsISupports* ),
nsCOMPtr<T> = do_QueryInterface( nsISupports*, nsresult* )
-

もし、上記の約束を果たせない時は、nsCOMPtr に対して、代入において QueryInterface を呼び出す必要があると、「注釈」をすることができます。例えば、 -

- - -
-
nsCOMPtr<nsIFoo> foo( do_QueryInterface(aBarPtr) ); // もしくは
-foo = do_QueryInterface(aBarPtr);
-   // ...|QueryInterface| が呼ばれる _でしょう_。(その結果 |AddRef| も呼ばれます)
-
-  // もちろん、|QueryInterface| を呼んでいるので、
-  //  エラー結果も必要になるでしょう...
-nsresult rv;
-nsCOMPtr<nsIFoo> foo( do_QueryInterface(aBarPtr, &rv) ); // もしくは
-foo = do_QueryInterface(aBarPtr, &rv);
- 
-
-
-
nsCOMPtr<T> = dont_AddRef( T* ),
nsCOMPtr<T> = getter_AddRefs( T* )
-

時々、すでに AddRef が実行されたポインタをたまたま持っていて、それを nsCOMPtr に代入したい場合があるでしょう。これは、しばしば、(nsresult を結果とするのではなく) AddRef が実行されたポインタを結果として返す getter を使った時に起きます。あるいは、効率性のための変形により起きる場合もあります。dont_AddRef は、このような場合の完璧な治療法です。 -

- - -
-
nsIFoo* temp;
-nsresult rv = GetFoo(&temp);
-nsCOMPtr<nsIFoo> foo( dont_AddRef(temp) );
-  // |temp| はすでに |AddRef| を実行済ですが、我々はこれを
-  //  |nsCOMPtr| で管理しようとしています。.
-
-nsCOMPtr<nsIFoo> foo( getter_AddRefs(CreateAFoo()) );
-  // |getter_AddRefs| は |dont_AddRef| の同意語です。
-  //  これは、|AddRef| が実行されたポインタを返す関数に適用する時に分かりやすくするものです。
-
-nsCOMPtr<nsIFoo> foo( dont_AddRef(CreateAFoo()) );
-  // あるいは、あなたはそれが好きではないかもしれません...
-
-
-
nsCOMPtr<T> = /* QueryInterface を呼び出しますが、AddRef は呼び出しません。 */
-

表のこの象限が「n/a (not applicable)」とマークされているのに気づくでしょう。「QueryInterface を呼び出すが、AddRef を行わないこと」を意味する明示的な指令はありません。このオプションは、間違った型のオブジェクトを返す getter を呼び出す状況に対応します。すでに AddRef を実行したオブジェクトを持っているので、もう AddRef を実行したくないが、違うインタフェースを得る必要がある場合です。それはできません。QueryInterface は、常に AddRef をその結果に対して実行します。そして、正しい型を得るための QueryInterface の呼び出しの代用品は存在しません。解決するには、2 段階のプロセスを実行します。 -

- - -
-
// ...
-
-  // getter は (間違った型の) すでに |AddRef| を実行したオブジェクトを返します...
-nsCOMPtr<nsIBar> bar( getter_AddRefs(CreateBar()) );
-  // ...(このオブジェクトに対して) 正しい型を問い合わせる必要があります。
-nsCOMPtr<nsIFoo> foo( do_QueryInterface(bar) );
-
-
-

この場合において、人々が陥る不運なワナは、getter 関数が結果を AddRef していることを忘れることです。こんな感じのコードをタイプしてしまいます: -

- - -
-
nsCOMPtr<nsIFoo> foo( do_QueryInterface(CreateBar()) );
-  // おっと! |CreateBar| によって返ってくるインタフェースがリークしてしまいます。
-  //  この場合、あなたは上に示した二つのステップの解決法で処理する_必要_があります。
-
-  // ありそうもないですか? こんな感じの形で見ることはあるでしょう。
-nsCOMPtr<nsIFoo> foo( do_QueryInterface(aList->ElementAt(i)) );
-  // すべての良い getter のように、|ElementAt| は、
-  // インタフェースからの必要性に応じて問い合わせを行なった後、
-  // 破棄されるかも知れない結果を |AddRef| します。
-
-
-

Bugzilla バグ 8221 は、この特定のリークの発見と修正に限定されたものです。 -

-

nsCOMPtr ヘルパー

-
nsCOMPtr<T> = do_QueryReferent( nsIWeakReference* ),
nsCOMPtr<T> = do_QueryReferent( nsIWeakReference*, nsresult* )
-

nsIWeakReference に基づく弱い参照を容易にする do_QueryReferent というのがあります。nsIWeakReference は、他のオブジェクトのプロキシとして振舞う [XP]COM オブジェクトです。nsIWeakReference と (上記の) 他のオブジェクトは、特別な関係にあります。それらは、お互いのことを知っています。しかし、どちらももう一方への所有する参照を保持していません。二つのオブジェクトは、もう一方へのダングリングポインタを持たないことを保障するように協調しています。nsIWeakReference オブジェクトにおいて所有する参照を保持することにより、この他のオブジェクトを必要な時に得ることができ、しかし、それ (他のオブジェクト) が生きていなくてもよいのです。そのオブジェクトを得るためには、nsIWeakReference オブジェクトに、あなたの代わりに QueryInterface するように依頼します。もしオブジェクトがまだ存在しており、要求されたインタフェースをサポートしているのであれば、あなたは (できれば、一時的に) それに対する所有する参照を持つことができます。 -

- - -
-
nsIWeakReference* weakPtr = ...;
-
-weakPtr->QueryReferent(
-
-
-

T* として nsCOMPtr<T> を使う

-

nsCOMPtrをポインタとして使う

-

「入力」パラメタ

-

「出力」パラメタ: getter_AddRefs

-

nsCOMPtr への代入は、とても理解しやすいです。nsCOMPtr は、古い値がもしあれば、それを Release します。そして、代入した新しい値を AddRef し、および/または上述した指令に示されたQueryInterface を呼び出します。これらの規則は、nsCOMPtr として宣言されたパラメタや関数の復帰値のコピーにおいて起こる「代入」でも同じく適用されます。もし nsCOMPtr を生の [XP]COM インタフェースポインタの実用的な代用品としたいのであれば、しかしながら、「出力」パラメタの問題に対処する必要があります。多くの [XP]COM 関数は、結果のインタフェースポインタをパラメタを通じて返します。例えば、 -

- - -
-
// Getter は、インタフェースポインタを「出力」パラメタを通じて返すことができます。...
-
-nsresult GetFoo( nsIFoo** );     // 標準的 getter
-nsresult GetFoo2( nsIFoo*& );    // 非標準的 getter
-nsresult GetSomething( void** ); // 「型無し」の getter
-  // 注: |QueryInterface| は、「型無し」の getter の例です。
-
-
-

我々は、「出力」パラメタを使うルーチンへポインタや参照によって nsCOMPtr を渡せなければいけません。問題は、getter 内部には、nsCOMPtr に対する情報がないことです。それは、生の [XP]COM インタフェースポインタへのポインタ (または参照) を得ていると考えます。nsCOMPtr のスマートな代入演算子は、呼ばれません。古い値があれば、リークしてしまいます。 -

ここで、getter_AddRefs( nsCOMPtr& )が役に立ちます。getter_AddRefs は、古い値があれば Release し、それをクリアします。そして、それに対するポインタを返し、getter は nsCOMPtrAddRef を実行した新しい値を設定します。我々は、これらの状況で、生の [XP]COM インタフェースポインタに適用していた & を置き換えるものとして、getter_AddRef を使用します。getter_AddRefs は、通常 nsCOMPtr のコンストラクタと代入演算子から得ていた魔法を詰めこんだものです。 -

- - -
-
// 生の [XP]COM インタフェースポインタ...
-
-nsIFoo* foo;
-
-GetFoo(&foo);
-GetFoo2(foo);
-GetSomething((void**)&foo);
-
-
-
// |nsCOMPtr|...
-
-nsCOMPtr<nsIFoo> foo;
-
-GetFoo(getter_AddRefs(foo));
-GetFoo2(*getter_AddRefs(foo));
-GetSomething(getter_AddRefs(foo));
-
-
-

これを実現するのに、なぜ単に operator& をオーバーロードしないのでしょうか? いくつかの理由: 他の状況では、nsCOMPtr のアドレスを取るのは、不便なことになります。「getter_AddRefs」という名前は、getter としてある一定の振舞いを強制します。そして、かつては、他の可能性がありました (あなたがまさに学ぼうとしているように)。 -

パラメタを通じて復帰値を返しますが、AddRef を実行していない getter のために、getter_doesnt_AddRef( nsCOMPtr& ) というのは、ありますか? いいえ、ありません。かつてありましたが、それは 3 つの理由でなくなりました: -

- - - -
-
// その結果に対して、|AddRef| を (違法に) 呼び出さない getter を呼び出します...
-
-nsIFoo* temp;
-nsresult rv = GetFoo_WithoutAddRef(&temp);
-   // 自分への注: |GetFoo_WithoutAddRef| をバグとして報告しなければならない。
-  // すべての getter は、 |AddRef| しなければならない。
-nsCOMPtr<nsIFoo> foo = temp;
-
-
-

「入出力」パラメタ

-

「入力/出力」パラメタについては、どうなんでしょう? -

-

効率性と正確性

-

nsCOMPtrのコスト

-

nsCOMPtr は、生の [XP]COM インタフェースポインタに対する実用的な置き換えとなるべく調整されています。所有する参照として使うのであれば、どの場所においてもです。nsCOMPtrs のパフォーマンスについては一般的に、スペース的には少し効率がよく、時間的には、ごくわずかに効率が悪いです。パフォーマンスに関することにより、nsCOMPtr を使わないのは良くありません。このセクションを通じて提示するパターンがnsCOMPtr からより多くのものを引き出すのを手伝ってくれるでしょう。 -

-
スペース
-

一般的に、nsCOMPtrは、生の [XP]COM ポインタを使うよりもスペース的には、効率がよくなる可能性があります。これは主にそのデストラクタの分解とより複雑なコンストラクタと代入演算子のためです。このセクションの最適化の tips に従うことで、生のポインタで使用するのよりもオブジェクトの生成するバイトがより少ないコードを書くことができるでしょう。これらの忠告に従わないとしても、nsCOMPtr のコードは、依然として、より小さくなり、あるいは最悪でも生のポインタ版よりもごくわずか増えるだけです。詳細については、Code Bloat [長文、要約が最初にあります] を見てください。もっとも、ここでは、そのドキュメントからの推奨事項を繰り返しています。 -

-
時間
-

[[もっと時間パフォーマンスの測定が必要です。]] -

二つ以上のサブルーチン、すなわち AddRefReleaseQueryInterface が必要な場所では、いくつかの nsCOMPtrル ーチンが分解され、そのためサブルーチンを呼び出しと対応する付加的な時間を必要とします。この時間は、特に QueryInterface により行われる作業や Release により行われるかもしれない作業にもかかわらず、極わずかです。 -

その他のすべての場合、nsCOMPtr は手で行われる作業をするだけです。nsCOMPtr が使用される作業の大部分は、operator-> での間接参照であり、原始的なポインタが行うものと同じです。この操作は、すべてのプラットフォームで、生の [XP]COM インタフェースポインタでの操作とちょうど同じコードを作り出し、そして同じ時間を消費します。デストラクタは、クライアントコードが生の [XP]COM インタフェースポインタに対して、Release を呼び出すのに対応しますが、処理が分解されているため、サブルーチンを呼び出すための余分な時間が必要となります。もっとも、これは、delete を実行するかもしれない Release の呼び出しと参照する方のデストラクタの両方の場合においてすでに存在するコストに対して、バランスが取れています。すべての nsCOMPtr のコンストラクタと代入演算子は、インラインです。単純なコンストラクタ、すなわち問い合わせをしないもの、は、あなたが手で書いたものと同じ作業だけを行います。AddRefReleaseQueryInterface の中の一つ以上の呼び出しを行うすべてのルーチンは、分解されており、そのため、サブルーチン呼び出しの余分なコストを含んでいます。 -

いくつかのルーチンが分解されているという事実により、余分なサブルーチン呼び出しのオーバーヘッドが生じます。そして、その事実および初期化がバイパスできないという事実によって、生の [XP]COM インタフェースポインタに対して、nsCOMPtr が余分な実行時間のコストを生じるのです。スペースと時間のトレードオフは、nsCOMPtr において見事にバランスが取れています。分解されたルーチンは、膨張に関する測定の直接的な結果です。 -

-

代入の好ましい構築

-

時間においてもスペースにおいても、nsCOMPtr への値の代入の最も効率的な方法は、構築時におけるものです。合理的である限り、代入しながら構築する方が好ましいです。nsCOMPtr のメンバをコンストラクタのメンバ初期化節で初期化すべきです。 -

- - -
-
// |nsCOMPtr| のメンバをコンストラクタの
-// メンバ初期化節で初期化する...
-
-class Bar
-  {
-    public:
-      Bar( nsIFoo* initial_fooPtr );
-      // ...
-    private:
-      nsCOMPtr<nsIFoo> mFooPtr;
-  };
-
-Bar::Bar( nsIFoo* initial_fooPtr )
-    : mFooPtr(initial_fooPtr) // _ここで_ 初期化します
-  {
-    // ここではありません。
-  }
-
-
-

付け加えておくと、代入の形式を構築の形式に変換する一時的オブジェクトを使う、最適化のパターンがあります。 -

- - -
-
// 後に代入が続くデフォルトの
-// 構築は非効率的です...
-
-nsCOMPtr<nsIFoo> foo;
-nsresult rv=GetFoo(getter_AddRefs(foo));
-
-
-
-
-
-
-
-
// ...構築だけをします。
-
-nsIFoo* temp;
-nsresult rv=GetFoo(&temp);
-nsCOMPtr<nsIFoo> foo=dont_AddRef(temp);
-
-  // この「生のポインタ、getter の呼び出し、
-  // |dont_AddRef| の代入」パターンを覚えて
-  // ください。それは、多くの効率に関する
-  // 議論で出てきたものです。
-
-
-

どちらの場合も、あなたは、正当な nsCOMPtr で、その値として GetFoo の結果が設定された foo というオブジェクト、および GetFoo により返された rv という状態を得ます。しかしながら、一時的変数を使う場合は、nsCOMPtr への値の設定をする構築を使っており、(ソース上では、少し複雑になっていますが)、代入に続くデフォルトの構築よりは、効率的になっています。そして、より簡単な例によって、このイベントの過程は理解されるでしょう。 -

-

代入における好ましい破壊

-

QueryInterface の呼び出しよりも do_QueryInterface の方が望ましいです。

-

繰り返し

-

これは、普通のポインタでデータ構造の繰り返しをする時の共通のイディオムです。例えば、 -

- - -
-
// [XP]COM オブジェクトでないものに対してポインタで繰り返しを行う...
-
-Node* p = ...;
-while ( p )
-  {
-    // ...
-    p = p->next;
-  }
-
-
-

同様に、このパターンが for ループとしても表現されるのをしばしば見かけます。しかしながら、これを生の [XP]COM インタフェースポインタに対して行うとどうなるか、考えてみてください。 -

- - -
-
// 生の [XP]COM インタフェースポインタで繰り返しを行います...
-
-nsIDOMNode* p = ...;
-while ( p )
-  {
-    // ...
-    p->GetNext(&p);
-      // 問題です! |p| を |Release| せずに上書きしてしまいました。
-  }
-
-
-

おっと! p に対して、新しいポインタを設定する前に、Release し損ねてしまいました。みんながこれを多く行うため、これが通常の [XP]COM コードのリークの大きな原因となってしまいました。では、代わりにこうすることはできるのでしょうか ? -

- - -
-
// 生の [XP]COM インタフェースポインタで繰り返しを行います...
-
-nsIDOMNode* p = ...;
-while ( p )
-  {
-    // ...
-    NS_RELEASE(p);
-    p->GetNext(&p);
-      // 問題です! ダングリングしているか |NULL| であるポインタの
-      // メンバ関数を呼ぼうとしています。
-  }
-
-
-

残念ながらダメです。Release した後、nsCOMPtr は、ダングリングしている状態になるかもしれません。実は、NS_RELEASE マクロを使うと、p は、GetNext を呼び出すまでは、NULL になるでしょう。 -

では、同じことを nsCOMPtr で書いてあると想像してみてください。 -

- - -
-
// |nsCOMPtr| で繰り返しを行います...
-
-nsCOMPtr<nsIDOMNode> p = ...;
-while ( p )
-  {
-    // ...
-    p->GetNext( getter_AddRefs(p) );
-      // 問題です! |NULL| ポインタを通じてメンバ関数を呼び出そうとしました。
-  }
-
-
-

ここでは、nsCOMPtr の使用は、生の [XP]COM インタフェースポインタの使用とほとんど同じです。getter_AddRefs は、 Release し、そしてそれに代入する前に p をクリアします。すなわち、GetNext が呼ばれる前にそれを行います。これは、GetNext の呼び出しを行う前に、NULL ポインタを通じて、呼び出そうとしてしまうことを意味します。生の [XP]COM インタフェースポインタと違い、nsCOMPtr は、盲目的に NULL ポインタを通じて GetNext を呼び出そうとする代わりに、assert を実行します。 -

これは問題です。では、解決法は、なんでしょうか。もしこれが生の [XP]COM インタフェースであれば、おそらく一時的変数を導入するでしょう。我々は、nsCOMPtrで同じことをすることができます。 -

- - -
-
// 生の [XP]COM インタフェースポインタ
-// での安全な繰り返し...
-
-nsIDOMNode* p = ...;
-while ( p )
-  {
-    // ...
-
-      // 一時的変数を導入することで、
-      // |p| で足踏みをすることもありません。
-    nsIDOMNode* temp = p;
-    temp->GetNext(&p);
-    NS_RELEASE(temp);
-  }
-
-
-
// |nsCOMPtr| での安全な繰り返し...
-
-
-nsCOMPtr<nsIDOMNode> p = ...;
-while ( p )
-  {
-    // ...
-
-      // 一時的変数を導入することで、
-      // |p| で足踏みをすることもありません。
-    nsCOMPtr<nsIDOMNode> temp = p;
-    temp->GetNext(getter_AddRefs(p));
-  }
-
-
-
-

nsCOMPtr をパラレルにするのは、容易に理解できますが、生のポインタの枠組に比べて、余分な AddRefRelease を一回ずつしなければなりません。少し変形することで、コードは見づらくなりますが、(おそらく、ごくわずかですが) より効率的になります。 -

- - -
-
// 安全で、効率的な、|nsCOMPtr| での繰り返し...
-
-nsCOMPtr<nsIDOMNode> p = ...;
-while ( p )
-  {
-    // ...
-    nsIDOMNode* next;
-    p->GetNext(&next);
-    p = dont_AddRef(next);
-  }
-
-  // 見てください! これはおなじみの「生のポインタ、getterの呼び出し、
-  // |dont_AddRef| の代入」パターンです。
-
-
-

getter を書く

-

コンパイラの悩みの種

-
-
diff --git a/files/ja/mozilla/tech/xpcom/using_nscomptr/status,_recent_changes,_and_plans/index.html b/files/ja/mozilla/tech/xpcom/using_nscomptr/status,_recent_changes,_and_plans/index.html deleted file mode 100644 index 590fcab98c..0000000000 --- a/files/ja/mozilla/tech/xpcom/using_nscomptr/status,_recent_changes,_and_plans/index.html +++ /dev/null @@ -1,36 +0,0 @@ ---- -title: 'Status, Recent Changes, and Plans' -slug: 'Mozilla/Tech/XPCOM/Using_nsCOMPtr/Status,_Recent_Changes,_and_Plans' -tags: - - XPCOM -translation_of: 'Mozilla/Tech/XPCOM/Using_nsCOMPtr/Status,_Recent_Changes,_and_Plans' ---- -

-

このセクションが、初めて読む人に邪魔になって申し訳ありません。 目次にとばしたり、直接 スタートガイドリファレンスマニュアルFAQ に行きたいかもしれません。 このセクションは、最近の更新をチェックするのが簡単になるようにトップに設けています。 -


-

-

nsCOMPtr に対する最近の更新

-

新しいものから順に -

- -

nsCOMPtr の計画

- -

最近のドキュメントの更新

- -
-
diff --git a/files/ja/mozilla/tech/xpcom/weak_reference/index.html b/files/ja/mozilla/tech/xpcom/weak_reference/index.html deleted file mode 100644 index 4a64488deb..0000000000 --- a/files/ja/mozilla/tech/xpcom/weak_reference/index.html +++ /dev/null @@ -1,153 +0,0 @@ ---- -title: Weak reference -slug: Mozilla/Tech/XPCOM/Weak_reference -tags: - - XPCOM -translation_of: Mozilla/Tech/XPCOM/Weak_reference ---- -

In XPCOM, a weak reference is a special object that contains a pointer to an XPCOM object, but does not keep that object alive. If the referent object is destroyed before the weak reference, the pointer inside the weak reference is set to nsnull. -

-

なぜこれを使う必要があるのでしょうか?

-

When you hold an owning reference on an object (i.e., you have AddRefed it), you are holding that object in existence for the duration of your reference. This isn't always appropriate, and can lead to trouble. If, for instance, this owning reference is part of a cycle of owning references (e.g., if the referenced object also holds a owning reference back to you), then none of the objects in the cycle can be reclaimed without taking special measures. -

There are less severe situations. A naive design for an observer/observable relationship would require the observable to hold a owning reference to the observer. After all, the observable must send messages to each observer, notifying it of the appropriate state changes. To do that, it will call a method on the observer, so it needs a pointer. And the call would fail if the pointer were allowed to dangle, therefore, the pointer should be a owning reference. This design, however, is flawed, as it holds the observer in existence longer than would otherwise be necessary. The observer may only need a short life compared to the thing being observed. It might go away after the first interesting event, even. But in this design, by hitching its life to the observable, it is kept on life-support long past any need or use. -

What is actually needed in this case, is either out-of-band signaling, where when the observer wants to go away, it unregisters itself from the observable, which then releases its owning reference, allowing the observer to die, or else a new kind of reference. This document describes an implementation of weak references. A weak reference does not hold its referent in existence, but also will not dangle. When the referent is destroyed, the weak reference automatically becomes nsnull. This technique can significantly simplify certain relationships, and you should consider it when an owning reference is inappropriate, but where a raw pointer might end up dangling. -

-

どのように使うのでしょうか?

-

サンプルをここに挙げます。新しい所と興味を引きそうな所は、強調して表現します。 -

-
#include "nsWeakPtr.h"
-
-// ...
-
-// 弱い参照を得るのは、簡単です...
-nsWeakPtr weakPtr = getter_AddRefs( NS_GetWeakReference(aFooPtr) );
-
-// ...
-
-{   // ...しかし、弱い参照を使うには、(短命の) 所有する参照を必要とします。
-  nsCOMPtr<nsIFoo> tempFooPtr = do_QueryReferent(weakPtr);
-  if ( tempFooPtr )
-    tempFooPtr->SomeFooMethod(...);
-  // そうでないと、「本当の」オブジェクトが無くなってしまいます。
-}
-
-

しかし、実際の例では、弱い参照はメンバー変数として保持される場合が多いでしょう。以下の例では、nsObservable は、イベントを報告するために、それぞれのオブザーバーへの参照を保持する必要があります。しかし、nsObservable は、ダングリングポインターを防ぐためだけにオブザーバーを保持するのは、望ましくありません。そのため、nsIObserver への所有する参照を保持する代わりに、弱い参照を保持します。弱い参照は、人為的にオブザーバーの生存期間を伸ばしたりしません。その上、ダングリングすることもしないのです。 -

以下では、渡されてくる nsIObservernsISupportsWeakReference も実装していると仮定しています。一つのオブザーバーの管理の仕方を参考にすれば、オブザーバーのリストの管理の仕方について推測することはできるでしょう。 -

-
class nsObservable
-  {
-    public:
-      // ...
-      nsresult AddObserver( nsIObserver* );
-      nsresult NotifyObservers( nsIMessage* );
-      // ...
-    private:
-      nsWeakPtr mObserver;
-  // ...あるいはここにオブザーバーのリストがあると想像してください
-  };
-
-// ...
-
-nsresult
-nsObservable::AddObserver( nsIObserver* aObserver )
-  {
-    mObserver = getter_AddRefs( NS_GetWeakReference(aObserver) );
-      // ...あるいはこれをオブザーバーのリストに追加してください
-    return NS_OK;
-  }
-
-nsresult
-nsObservable::NotifyObservers( nsIMessage* aMessage )
-  {
-    nsCOMPtr<nsIObserver> observer = do_QueryReferent(mObserver);
-    if ( observer )
-      observer->NoticeMessage(aMessage);
-    else
-      mObserver = 0;
-      // あるいはこのオブザーバーをリストから取り除くことで、それはなくなってしまうでしょう
-    return NS_OK;
-  }
-
-// ...
-
-

nsWeakPtrnsCOMPtr とちょうど同じインタフェースを持つことがキーになります。実は、nsWeakPtr はこのように定義されています。 -

-
typedef nsCOMPtr<nsIWeakReference> nsWeakPtr;
-
-

こりゃ最低だ!

-

この弱い参照の実装があなたが望むインタフェースを提供しないことに、おそらく今までに気づいたでしょう。 -

-

なぜ、弱い参照の上の私のインタフェースメソッドを直接呼べないのでしょうか?

-

あなたは、この弱い参照の仕組みを使って、あなたが実際に使いたいインタフェースを実装するポインターを得られることを望んでいるでしょう。例えば、 -

-
// 注: 実際にはこのような実装ではありません
-nsWeakPtr<nsIFoo> weakFooPtr = fooPtr;
-// ...
-if ( weakFooPtr )
-  status = weakFooPtr->SomeFooMethod(...);
-
-

これは、合理的な要求です。しかし、自動的に実装するのは、とても高くつくのです。継承でも、テンプレートでも、マクロでも自動的にすべてのメソッド呼び出しを実際のオブジェクトへ転送するのを支援してくれません。XPIDL は、(もし修正すれば) そのような実装を作成できるかもしれません。そうでなければ、上で議論したようなことを手で書くことができます。極わずかですが、その他のコストもあります。それは、間接呼び出しにより、呼び出しごとにかかる余分なコストです。そして単純な実装では、対象実装へのインタフェースごとに余分なポインターを追加します。 -

-

なぜペアの間で単に QueryInterface できないのでしょうか?

-

あなたが保持している nsIWeakReference は、本当に単に対象のオブジェクト上のインタフェースのように感じられるでしょう。二つの間で単に QueryInterface を実行したいのは、合理的なことです。なぜ余分な呼び出し GetWeakReferenceQueryReferent が必要なのでしょうか ? 弱い参照が実際に対象のオブジェクトに集約されていれば可能なように思えます。 -

ここでの問題は、QueryInterface です。QueryInterface は、COM が動作するのに必要な多くのことを満たす必要があります。これらの要求の元では、同じ (集約する) オブジェクトに対して同じインタフェースの QueryInterface を呼び出した場合は、同じ結果にならなければなりません。これは、どのインタフェースポインターを通じて呼び出そうとも、いつ呼び出そうとも要求されることです。我々の状況では、これは不可能です。なぜなら、それは、明らかに集約の部分を破壊可能であるという事実があるためです。後続の処理で、その部分へ到着しようとしても nsnull が返ります。時々、弱いポインターを通じた QueryInterface が「本当の」インタフェースを返すでしょう。そして時々 nsnull を返すのです。それは、単に COM を壊すことになります。 -

このように、弱い参照が対象オブジェクトへと集約されないのは明らかです。それため、それらの間を動くのに QueryInterface を使うことはできません。これは、より便利に感じられると思いますが、グローバルルーチンの NS_GetWeakReference を使うと、対象のオブジェクトから弱い参照を得ることができます。そして、nsIWeakReference::QueryReferent が、逆の方向に対して QueryInterface と同じ機能を提供します。付け加えると、現在、nsCOMPtr は、新しいキーの do_QueryReferent をサポートするようになり、人生をいくぶんシンプルにしてくれています。 -

-

クラスが弱い参照をサポートするようにするにはどうすればよいでしょうか?

-

単に nsSupportsWeakReference を継承するだけです。ミックスインクラスがすべての作業を行ってくれます。そして、あなたの QueryInterface を適宜変えてください。例えば、 -

-
//...
-#include "nsWeakReference.h"
-
-class nsFoo : public nsIFoo, ..., public nsSupportsWeakReference { ... };
-
-
-// ...if you used the table macros to implement |QueryInterface|, add an entry
-
-NS_INTERFACE_MAP_BEGIN(nsFoo)
-  // ...
-  NS_INTERFACE_MAP_ENTRY(nsISupportsWeakReference)
-  // ...
-NS_INTERFACE_MAP_END
-
-
-// ...if you used a |NS_IMPLE_QUERYINTERFACEn| macro, move up to the next higher one and add a term
-
-NS_IMPL_QUERYINTERFACEn+1( ...,nsISupportsWeakReference)
-
-
-// ...if you implemented |QueryInterface| by hand, add a clause
-
-NS_IMETHODIMP
-nsFoo::QueryInterface( REFNSIID aIID, void** aInstancePtr )
-  {
-    // ...
-    else if ( aIID.Equals(nsCOMTypeInfo<nsISupportsWeakReference>::GetIID()) )
-      *aInstancePr = NS_STATIC_CAST(nsISupportsWeakReference*, this);
-    // ...
-  }
-
-

代替手段

-

This technique is useful, but in situations where you need this, there are two alternatives which you may want to consider: -

- -

参考資料

- -
-

原文書の情報

- -
-
-
diff --git a/files/ja/mozilla/tech/xpcom/wrappedjsobject/index.html b/files/ja/mozilla/tech/xpcom/wrappedjsobject/index.html deleted file mode 100644 index a51dd2a630..0000000000 --- a/files/ja/mozilla/tech/xpcom/wrappedjsobject/index.html +++ /dev/null @@ -1,104 +0,0 @@ ---- -title: wrappedJSObject -slug: Mozilla/Tech/XPCOM/wrappedJSObject -tags: - - 'XPCOM:Language Bindings' - - XPConnect -translation_of: Mozilla/Tech/XPCOM/wrappedJSObject ---- -

wrappedJSObjectXPConnectラッパで利用できることがあるプロパティです。利用できる場合、それはあなたに、ラッパによって隠蔽されたJavaScriptオブジェクトへのアクセスを可能にします。 -

wrappedJSObjectプロパティをサポートするXPConnectラッパには2つの種類があります: -

- -

この項では後者、つまり、コンポーネントが持つプロパティやメソッドのうちxpidlによってサポート済みと宣言されたインターフェースには含まれていない物を隠蔽する種類のラッパについて解説しています。 -

以下、XPConnectラッパが何をするものなのかという事と、wrappedJSObjectがそれを迂回するためにどのように使われるのかについて紹介しましょう。 -

-

-

例となるコンポーネント

-

wrappedJSObjectプロパティがどのように働くのかを見るためには、JavaScriptによって実装されたXPCOMコンポーネントの例が必要です。コンポーネントの作成方法の詳細についてはJavaScriptでのXPCOMコンポーネントの作成方法を参照してください。 -

簡単のため、コンポーネントを登録するためのコードは省略します。以下のコンポーネントが@myself.com/my-component;1というコントラクトIDで登録されているものと仮定してください。 -

-
// コンストラクタ
-function HelloWorld() {
-};
-
-HelloWorld.prototype = {
-  hello: function() {
-    return "Hello World!";
-  },
-
-  QueryInterface: function(aIID)
-  {
-    if (!aIID.equals(Components.interfaces.nsISupports) &&
-        !aIID.equals(Components.interfaces.nsIHelloWorld))
-      throw Components.results.NS_ERROR_NO_INTERFACE;
-    return this;
-  }
-};
-
-

-

-

XPConnectによるラッピング

-

それでは上記のコンポーネントへの参照を取得してみましょう。この例では getServiceを使用していますが、XPCOMから参照を取得する限りにおいては、コンポーネントは常に、XPConnectによってこれと同様にラップされます: -

-
var comp = Components.classes["@myself.com/my-component;1"].getService();
-
-

コンポーネントの実装において定義したhello()メソッドを呼び出そうとした場合、このような結果が得られます: -

-
> comp.hello();
-TypeError on line 1: comp.hello is not a function
-
-

これは、前述した説明のとおり、compHelloWorldのインスタンスのJavaScriptオブジェクトそのものではなく、XPConnectラッパによって包まれた物であるために起こります: -

-
> dump(comp);
-[xpconnect wrapped nsISupports]
-
-

これらのラッパは、JavaScriptによって実装されたXPCOMコンポーネントを他のXPCOMコンポーネントと全く同じようにユーザに対して見せるようにするという発想に基づいています。これはそのコンポーネントの公開されたインターフェースを明確にし、コンポーネントの内部データを保護する役割も提供します。 -

このラッパに対してはQueryInterfaceメソッドの呼び出しが利用できますが、それはこのメソッドがnsISupportsインターフェースにおいて定義されており、ラッパ自身が、自分がラップしているオブジェクトがnsISupportsインターフェースを実装している事を知っているからです: -

-
> comp.QueryInterface(Components.interfaces.nsIHelloWorld);
-[xpconnect wrapped (nsISupports, nsIHelloWorld)]
-
-

この例に見られるように、QueryInterfaceの呼び出しは、そのラッパに対して、そのコンポーネントが他のインターフェースを実装している事を教えます。nsIHelloWorldインターフェースにおいてhelloメソッドが定義されていると仮定すると、それは以下のように呼び出せます: -

-
> comp.hello()
-Hello World!
-
-

この挙動は、そのコンポーネントに対してアクセスするために使われるべきインターフェースを明示的に定義し、コードの開発においてそれを使うよう強制する上で、良い仕組みと言えます。しかし、コンポーネントを試作する場合においてまでインターフェースの定義をいちいち書かなくてはならない(そしてそれを変更する度に再コンパイルしないといけない)のは不便です。 -

-

-

wrappedJSObjectの利用

-

XPConnectは、それによってラップされたオブジェクト自身が許可している場合、wrapper.wrappedJSObjectプロパティを用いて、ラッパを迂回してその中にあるJavaScriptオブジェクトに直接アクセスすることを許容します。 -

より具体的に言うと、XPConnectのソース中のコメントにあるとおり、comp.wrappedJSObjectは以下の3つの条件が満たされている場合に利用できます: -

- -

これは、コンポーネントを実装しているJavaScriptオブジェクトに直接アクセスできるようにするためにコンポーネントを修正する必要があるということです。例えば以下のようにします: -

-
function HelloWorld() {
-  this.wrappedJSObject = this;
-};
-
-

これで、コンポーネントを直接取得できるようになりました: -

-
var comp = Components.classes["@myself.com/my-component;1"]
-                     .getService().wrappedJSObject;
-
-

これは本物のJavaScriptオブジェクトです: -

-
> comp
-[object Object]
-
-

なので、あらゆるプロパティにアクセスすることができます: -

-
> comp.hello();
-Hello World!
-
-

この機能は、試作を手軽に行うために利用できるほか、型が不定なJavaScriptの値をコンポーネントに簡単に渡すためにも利用できます。(具体的には、完全なJavaScriptのデータを共有するなど。) -

-
-
diff --git a/files/ja/mozilla/tech/xpcom/xpcom_abi/index.html b/files/ja/mozilla/tech/xpcom/xpcom_abi/index.html deleted file mode 100644 index fe6136238f..0000000000 --- a/files/ja/mozilla/tech/xpcom/xpcom_abi/index.html +++ /dev/null @@ -1,54 +0,0 @@ ---- -title: XPCOM ABI -slug: Mozilla/Tech/XPCOM/XPCOM_ABI -tags: - - XPCOM -translation_of: Mozilla/Tech/XPCOM/XPCOM_ABI ---- -

XPCOM ABIは、XPCOMコンポーネントのバイナリインターフェースです。スクリプト言語(JavaScriptなど)によって書かれたXPCOMコンポーネントは、特に改変をしなくてもプラットフォーム(WindowsやOS Xなど)を越えて動作させられますが、コンパイルが必要な言語(C++など)で書かれたコンポーネントの場合、異なるプラットフォームで動かすためには再コンパイルが必要です。コンパイルされたXPCOMコンポーネントは多くの場合、「バイナリ」や「ネイティブ」などと呼ばれます。 -

一つのバイナリXPCOMコンポーネントは、すべてのプラットフォームで利用できる.xptファイルと、特定のプラットフォーム用で且つ特定のABIを持ったDLL(Windowsでは.dll、Linuxでは.so)から成ります。このABIを利用するアプリケーションだけが、このXPCOMコンポーネントを利用することができます。簡単に言えば、特定のABI用にビルドされたXPCOMコンポーネントは、同じABI用にビルドされたFirefox、Thunderbird、その他のXULRunnerアプリケーションに対してのみ互換性があります。 -

-

-

ABIのネーミング

-

各々のABIは、以下の形式の[TARGET_XPCOM_ABI]文字列によって名付けられています。: -

-
{CPU_ARCH}-{TARGET_COMPILER_ABI}
-
-

{CPU_ARCH}[Platforms]は、以下のいずれかのCPUのアーキテクチャを意味します: -

- -

{TARGET_COMPILER_ABI}[Platforms]は、以下のいずれかのコンパイラのABIを意味します: -

- -

例: -

- -

XPCOM ABI文字列は、nsIXULRuntimeを使うことによってプログラムから取得できます。あなたのFirefoxあるいはThunderbirdのABIを取得するには、エラーコンソールを開いて(ツール | エラーコンソールから開けます)以下のJavaScriptコードを実行してください: -

-
Components.classes["@mozilla.org/xre/app-info;1"]
-          .getService(Components.interfaces.nsIXULRuntime)
-          .XPCOMABI
-
-

もしCPUのアーキテクチャもしくはC++コンパイラのいずれかが未知の場合は、アプリケーションはXPCOM ABI文字列を持たず、それを取得しようと試みた際にはNS_ERROR_NOT_AVAILABLEというエラーを起こすでしょう。それは特徴的なABIだと思われますが、しかし私たちはそれに対して付ける名前を持っていません。 -

註: Platforms
これは利用可能なCPUアーキテクチャやコンパイラのABIの完全なリストではありません。最新の情報は常に、ビルドシステムの中を探索することで見つけられるでしょう。 -
註: TARGET_XPCOM_ABI
Mozillaのビルドシステムでは、XPCOM ABIを保持している変数はTARGET_XPCOM_ABIです。(これは内部の詳細情報で、拡張機能の開発者にとっては無関係です。) -

-

-

Extension Installation

-

アプリケーション(例:Firefox)がサポートするABIの名前は、ビルド時に埋め込まれます。その後、アプリケーションはサードパーティ製のバイナリXPCOMコンポーネントの互換性を調べるためにその値を使います。 -

互換性チェックとの共通点は、拡張機能のインストールの間にあります。もし、ある拡張機能がバイナリXPCOMを提供する場合、インストール定義においてそれらのXPCOM ABIが宣言されているべきです。拡張機能の作者は、XPCOMコンポーネントをサポートしているマシンすべてのためにそれぞれビルド(コンパイル)して、プラットフォームごとのサブディレクトリに入れ、すべてのビルドを一つのXPIの中にパッケージングすることができます。拡張機能がインストールされる時、アプリケーションはそれ自身のABIに最も適したコンポーネントのビルドを選択します。もし適合するビルドが見つからなければ、その拡張機能は互換性がないと見なされ、アプリケーションはインストールを中断するでしょう。 -

もし、(ABIのネーミングで説明しているとおり、CPUアーキテクチャかC++コンパイラのいずれかが不明であった結果として)そのアプリケーションがXPCOM ABI文字列を持っていない場合、あなたはインストール定義などに記述するプラットフォーム名としてOSの名前を(XPCOM ABIを付けずに)使うべきです。 -

diff --git a/files/ja/mozilla/tech/xpcom/xpcom_ownership_guidelines/index.html b/files/ja/mozilla/tech/xpcom/xpcom_ownership_guidelines/index.html deleted file mode 100644 index a1f4a717dc..0000000000 --- a/files/ja/mozilla/tech/xpcom/xpcom_ownership_guidelines/index.html +++ /dev/null @@ -1,37 +0,0 @@ ---- -title: XPCOM ownership guidelines -slug: Mozilla/Tech/XPCOM/XPCOM_ownership_guidelines -tags: - - XPCOM -translation_of: Mozilla/Tech/XPCOM/XPCOM_ownership_guidelines ---- -

もしあなたがそれを作ったのであれば、それを所有している

-

...自然なことです。もしあなたが一時的なオブジェクトを作ったのであれば、明らかにそれを破壊するのはあなたの責任です。それは確かに所有の徴候です。もしあなたがより長い生存期間を持つオブジェクトを作ったのであれば、あなたは所有権を失うまでそれを所有することになるでしょう。 -

すべての「factory」と「getter」関数は所有するポインターを作り出す。 -

そのような関数は、より長い生存期間を持つオブジェクトを作る絶好の例です。そして、(すでに AddRef を実行したポインターをつくり出すことで) 所有権を (この場合は呼び出し元に) 与えます。これはファクトリ関数にとってすばらしいことです。しかし単なる「getter」にとっては問題となりうるかもしれません。しばらくの間しかアクセスが必要ないのであれば、運が悪いということになります。後者の場合、ポインタをキャッシュした場合、あなたはデフォルトの所有者になります。これは、適切でないかも知れません。そして、問題のオブジェクトがあなたのクエリに対して作られのかどうかを知らずに修正するのは大変かもしれません。 -

-

それを必要としているかどうかは、それを所有していることの正当な理由にはならない

-

あなたオブジェクトを必要としているからと言って、そのオブジェクトを所有しているわけではありません。実際、しばしばオブジェクトあなたを必要としているために、そのオブジェクトを所有していることがあります。 -

-

もしあなたオブジェクトを所有しているのならば、それはあなたを所有すべきではない。

-

推移的な意味でもそのことが言えます。【訳注: A が B を所有し、B が C を所有する場合、C が A を所有してはいけない】 違う表現をすると: どんなシステムにおいても所有権のグラフは非循環的でなければなりません。所有権の循環が存在する場合、デストラクターによって自動的に処理されない場合があります。循環を断ち切るには、参加者が個別に解放する前に、特別なコードが提供されて呼ばれなければなりません。 -

-

オブジェクトの生存期間があなたより長いことが保証されているのであれば、そのオブジェクトを所有する必要はない

-

例えば、それがあなたを所有している時です。 -

-

親は自分の子を所有する (そして逆ではない)

-

親は自分の子を所有する必要はないかもしれませんが。例えば、ツリーはその中にあるすべてのノードを所有するかもしれません。ツリーのすべてのノードが、お互いを非所有的なポインターでポイントしているかもしれません。しかしながら、最も単純な枠組では、親は自分の子を所有的なポインターでポイントし、子は自分の親を非所有的なポインターで指し返します。 -

-

コンテナは、自分が含むものを所有する (そして逆ではない)

-

所有するポインターを実装するために、nsCOMPtr を使いなさい

-

それは、明示的で効果的、かつとても頑丈です。「getter」と「setter」を書くのは簡単です。そしてあなたはデストラクターに何も書く必要がありません。 -

-
-

原文書の情報

- -
-
-
diff --git a/files/ja/mozilla/tech/xpcom/xptcall_faq/index.html b/files/ja/mozilla/tech/xpcom/xptcall_faq/index.html deleted file mode 100644 index 340d8c6940..0000000000 --- a/files/ja/mozilla/tech/xpcom/xptcall_faq/index.html +++ /dev/null @@ -1,76 +0,0 @@ ---- -title: xptcall FAQ -slug: Mozilla/Tech/XPCOM/xptcall_FAQ -tags: - - XPCOM - - 'XPCOM:Language Bindings' - - XPConnect -translation_of: Mozilla/Tech/XPCOM/xptcall_FAQ ---- -

xptcall とは何ですか?

-

xptcall は、低レベルの XPCOM メソッド呼び出しのための小さなライブラリです。プラットフォーム固有の C/C++ とアセンブラ言語のコードを使って実装されています。異なる言語間の呼び出しと異なるスレッドへのメソッド呼び出しを容易にするためのものです。 Mozillaをあらゆるプラットフォーム上で動作させるためには、このコードを移植する必要があります。

- - - -

なぜ xptcall があるのですか?

-

xptcall があるのは、以下の二つの理由によります:

-
    -
  1. XPCOM インタフェースの任意のメソッドを実行できるようにするため。
  2. -
  3. 任意の XPCOM インタフェースを実装しているかのように、動的に振舞いを変えられるようにするため。
  4. -
-

どちらの仕組みも XPConnect にとって必要なものです。また、xpcom/proxy もこれらの仕組みを利用しています。将来的には、他のサブシステムでも使われるかもしれません。

-

xptcall のアプローチの方が、スタブコードの生成により、すべてのインタフェースの呼び出しと実装をサポートするアプローチよりも良いということで、選択されました。この xptcall のアプローチは、コアなプラットフォーム固有のコードを必要とします。しかし、メモリ使用量が最小で済み、そして任意の正当な XPCOM インタフェースとともに動作できるように拡張できます。しかも各プラットフォームごとに追加のコンパイル済みコードを付加する必要がないのです。

- - - -

xptcall は、実際には何をするのでしょうか?

-

これが、コアとなる invoke 関数の宣言です:

- -
XPTC_PUBLIC_API(nsresult)
-XPTC_InvokeByIndex(nsISupports* that,
-                   PRUint32 methodIndex,
-                   PRUint32 paramCount,
-                   nsXPTCVariant* params);
-
- -

nsXPTCVariant は、共用体のデータです。これは、目的の関数にパラメータとして渡される型で区別されます (型として void* も使えるので、任意のポインター型を表現することができます)。

-

正しいパラメータセットを与えることで、この関数を使って任意の XPCOM インタフェースの任意のメソッドを呼び出すことができます。 XPConnect は、タイプライブラリ ファイルの情報を使用して、任意の XPCOM インタフェースを JavaScript にマッピングし、XPTC_InvokeByIndex を使って JavaScript から XPCOM を呼び出すことができるようになります。タイプライブラリの情報を使うことで、 XPConnect は、関数のパラメータを変換でき、そしてこの呼び出しをするのに必要な nsXPTCVariant 型の配列を組み立てることができます。

-

xptcallスタブ (あるいは偽装) の仕組みにより、実行時に、任意の XPCOM インタフェースのふりをすることができるクラスを実装できるようになります。これは、xptcall が、関数の汎用的なスタブへのポインタが並べられた vtbl を提供することで実現されます。これらのスタブは、呼び出しを共通の関数に転送します。この共通の関数は、タイプライブラリの情報を使って、パラメータを取り出します。そして、プラットフォーム固有の呼び出し規約に従って、パラメータを保持するバリアント型の配列を組み立てます。その後、継承したメソッドを呼び出すことで、任意の処理を実行することができます。このコードは、呼び出しから戻る時に、プラットフォーム固有の後始末も行います。

-

これらはすべて動作しており、現在、様々なプラットフォーム 上の Mozilla で使われています。

- - - -

なぜ xptcall を、単に C や C++ で実装することができないのですか?

-

これらの二つの仕組みでは、完全にクロスプラットフォームにできないからです。あるいは、汎用的にすべて C や C++ で行うこともできないからです。それがどうしてなのかを、ひとつずつ見てみましょう。

-

invoke では、任意の呼び出しのフレームを組み立てて、それを実行できるコードが必要になります。C++ のコンパイラは、そのような呼び出しのフレームをいつも組み立てています。しかし、コンパイラは、呼び出し先の固有のシグネチャーのためにカスタマイズしたフレームを コンパイル時に 組み立てます。 xptcall は、任意の正当な XPCOM メソッドシグネチャーを呼び出せなければなりません。そしてシグネチャーは実行時に特定する必要があるのです。

-

stubs は、任意の XPCOM インタフェースのすべてのメソッド (祖先のメソッドも含む) の全ての vtbl を実装しているかのように振舞わなければなりません。これを行ういくつかの方法があります。実行時にコンパイラを動かして、スタブの動的に組み立てとロードを行うことができます。あるいは、プラットフォーム固有のコードを書いて、インタフェース固有の vtbl とメソッドのスタブを組み立てる方法もあります。私は、ひとつの巨大な vtbl と多くの小さな汎用のスタブを使う方法を選びました。これにより、プラットフォーム固有のコードは可能な限り小さくなるのです。もう一度言うと、これをすべて行うコードを C で書くことはできません。 varargs を使って一部実現することはできますが、それでは十分ではありません。

-

もし、何か確実な方法があって、クロスプラットフォームな方法で、かつ/またはアセンブラ言語のコードを使わずに必要な機能を実現することができるのであれば、教えてください。

- - - -

xptcall は、Mozilla のプラットフォームとして必要なものですか?

-

はい。Mozilla は、xptcall がきちんと移植されていないと、正しく動作しないでしょう。無機能のスタブコードがあるので、サポートされていないプラットフォーム上でも xptcall をビルドできるようになっています。しかし XPConnect に依存しているブラウザ機能は、すべて実行に失敗するでしょう。プラットフォーム上で xptcall が機能しないと、問題が起きるでしょう。 xptcall が、どこででも動作するように取り組んでいく必要があります!

- - - -

どのプラットフォームがサポートされていますか?

-

増加中のリストです:

- - - - -

他のリソースは、どこにあるでしょう?

-

コードは xpcom/reflect/xptcall にあります。

-

新しい移植のためのガイドは xpcom/reflect/xptcall/porting.html にあります。

-

実装前の提案が ここここ にあります。

- - -
-

原文書の情報

- -
diff --git a/files/ja/mozilla/tech/xpidl/generating_xpt_on_windows/index.html b/files/ja/mozilla/tech/xpidl/generating_xpt_on_windows/index.html deleted file mode 100644 index e89dc3bf46..0000000000 --- a/files/ja/mozilla/tech/xpidl/generating_xpt_on_windows/index.html +++ /dev/null @@ -1,13 +0,0 @@ ---- -title: Generating xpt on Windows -slug: Mozilla/Tech/XPIDL/Generating_xpt_on_Windows -tags: - - Embedding Mozilla - - Guide - - XULRunner -translation_of: Mozilla/Tech/XPIDL/Generating_xpt_on_Windows ---- -

Windows の Gecko \ XUL Runner SDK の最近のバージョンで .idl ファイルから .xpt ファイルを生成するには、 typelib.py スクリプトを使用する必要があります。 XULRunner SDK を <MOZSDKDIR> にインストールしたとすると、次の様なコマンドを実行する必要があります

- -
C:\working-dir> <MOZSDKDIR>\sdk\bin\typelib.py <InputFile.idl> -o <OutputFile.xpt> -I <MOZSDKDIR>\idl
-
diff --git a/files/ja/mozilla/tech/xpidl/index.html b/files/ja/mozilla/tech/xpidl/index.html deleted file mode 100644 index 475f27e8b3..0000000000 --- a/files/ja/mozilla/tech/xpidl/index.html +++ /dev/null @@ -1,560 +0,0 @@ ---- -title: XPIDL -slug: Mozilla/Tech/XPIDL -tags: - - Developing Mozilla - - Guide - - NeedsContent - - XPCOM - - xpidl -translation_of: Mozilla/Tech/XPIDL ---- -

XPIDLXPCOM インターフェースクラスを指定するためのインターフェース記述言語 (Interface Description Language) です。

- -
-

インターフェース記述言語 (IDL) は言語やマシンから独立したインターフェースの記述に使われます。IDL は言語に依存しないインターフェース定義をツールで自動生成するために利用されるような、インターフェースの記述を可能にします。 XPIDL は、将来的に WebIDL に収束する予定です。

- -
-

Note: Starting in {{Gecko("9.0")}}, the older xpidl utility, which was previously used to generate C++ header files, typelib information, and so forth has been replaced with pyxpidl in the Gecko SDK. pyxpidl has been used for some time now, but now the older tool has been fully retired.

-
- -

Writing XPIDL interface files

- -

XPIDL は OMG IDL によく似ており、 IID と追加の型を処理する拡張構文があります。いくつかの例は Mozilla tree の {{Source("xpcom/base")}} と {{Source("xpcom/ds")}} ディレクトリにあります。

- - - -

Explanation of IDL semantics

- -

A full guide to the syntax can be found at XPIDL:Syntax, which is written in an ABNF form.

- -

An xpidl file is essentially just a series of declarations. At the top level, we can define typedefs, native types, or interfaces. Interfaces may furthermore contain typedefs, natives, methods, constants, or attributes. Most declarations can have properties applied to them.

- -

Types

- -

There are three ways to make types: a typedef, a native, or an interface. In addition, there are a few built-in native types. The built-in native types are those listed under the type_spec production above. The following is the correspondence table:

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Table 1: Standard IDL types
IDLC++ in parameterC++ out parameterJS typeNotes
booleanboolbool *boolean
charcharchar *stringOnly chars in range \u0000-\u00ff permitted
doubledoubledouble *number
floatfloatfloat *number
longint32_tint32_t *number
long longint64_tint64_t *number
octetuint8_tuint8_t *number
shortint16_tint16_t *number
stringconst char *char **string -

Only chars in range \u0000-\u00ff permitted

- -

Most of the time you don't want to use this type but AUTF8String or ACString

-
unsigned longuint32_tuint32_t *number
unsigned long longuint64_tuint64_t *number
unsigned shortuint16_tuint16_t *number
wcharPRUnicharPRUnichar *stringFull Unicode set permitted
wstringconst PRUnichar *PRUnichar **string -

Full Unicode set permitted

- -

Most of the time you don't want to use this type but AString.

-
- -

In addition to this list, nearly every IDL file includes nsrootidl.idl in some fashion, which also defines the following types:

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Table 2: Types provided by nsrootidl.idl
IDL typedefC++ in parameterC++ out parameterJS typeNotes
PRTime(XPIDL unsigned long long typedef, 64 bits)numberPRTime is in microseconds, while JS date assumes time in milliseconds
nsresult(XPIDL unsigned long typedef, 32 bits)number
nsrefcnt(XPIDL unsigned long typedef, 32 bits)number
size_t(XPIDL unsigned long typedef, 32 bits)number
voidPtrvoid *void *not allowed
charPtrchar *char **not allowed
unicharPtrPRUnichar *PRUnichar **not allowed
nsIDRefconst nsID &nsID *?
nsIIDRefconst nsIID &nsIID *?
nsCIDRefconst nsCID &nsCID *?
nsIDPtrconst nsID *nsID **?
nsIIDPtrconst nsIID *nsIID **?
nsCIDPtrconst nsCID *nsCID **?
nsIIDconst nsIIDnsIID *?
nsIDconst nsIDnsID *?
nsCIDconst nsCIDnsCID *?
nsQIResultvoid *void **objectShould only be used with methods that act like QueryInterface
DOMStringconst nsAString &nsAString &stringFull Unicode set permitted
AUTF8Stringconst nsACString &nsACString &stringFull Unicode set permitted (translated to UTF-8)
ACStringconst nsACString &nsACString &stringOnly chars in range \u0000-\u00ff permitted
AStringconst nsAString &nsAString &stringFull Unicode set permitted
jsvalconst jsval &jsval *anything
jsidjsidjsid *not allowed
- -

Typedefs in IDL are basically as they are in C or C++: you define first the type that you want to refer to and then the name of the type. Types can of course be one of the fundamental types, or any other type declared via a typedef, interface, or a native type.

- -

Native types are types which correspond to a given C++ type. Most native types are not scriptable: if it is not present in the list above, then it is certainly not scriptable (some of the above, particularly jsid, are not scriptable).

- -

The contents of the parentheses of a native type declaration (although native declarations without parentheses are parsable, I do not trust that they are properly handled by the xpidl handlers) is a string equivalent to the C++ type. XPIDL itself does not interpret this string, it just literally pastes it anywhere the native type is used. The interpretation of the type can be modified by having properties on the native declaration:

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Table 3: Native type definitions
astringThis is an nsAString declaration. Overrides native string.
cstringThis is an nsACString declaration. Overrides native string.
domstringThis is an nsAString declaration. Overrides native string.
jsvalThis type gets const when an in type. Special in typelib.
nsidThis type gets const when an in type. Special in typelib.
ptrThe type is really (native str)*
refThe type is really (native str)&
utf8stringThis is an nsACString declaration whose text is UTF-8.
- -

As far as I can tell, these properties also apply to typedefs. Need to verify.

- -

Constants

- -

Constants are technically legal at the top level, but xpidl I forbids them from being placed there; instead, they must be in an interface. The only constants supported are those which become integer types when compiled to source code; string constants and floating point constants, though parseable, cannot be made into a header or xpt file.

- -

Constants are emitted in header files using anonymous enums, although there is an outstanding patch that combines adjacent constants into the same anonymous enums to quiet enum mismatch warnings.

- -

Interfaces

- -

Specifying interfaces is the primary purpose of using xpidl. Interfaces are basically a collection of constants, methods, and attributes; in Mozilla, these are the primary ways in which JavaScript code can interact with native C++ code. Furthermore, interfaces can also inherit from another interface. Every interface should inherit nsISupports in some fashion. However, it is generally not recommended to have a chain of interfaces inheriting from each other if you intend to have a chain of implementations for each interface, as it can cause problems in C++ code.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Table 4: Basic interface attributes
AttributeInterpretation
uuid(12345678-fedc-ba98-7654-0123456789ab)This is the internal way this interface is accessed; it must be unique, and the uuid must be generated when creating the interface. After that, it doesn't need to be changed any more. For instructions on how to generate an UUID see Generating GUIDs.
builtinclassJavaScript classes are forbidden from implementing this interface. All children must also be marked with this property.
functionThe JavaScript implementation of this interface may be a function that is invoked on property calls instead of an object with the given property
scriptableThis interface is usable by JavaScript classes. Must inherit from a scriptable interface.
deprecatedThis interface should no longer be used. The compiler will emit warnings if you attempt to use this.
- -

Methods and attributes

- -

Interfaces declare a series of attributes and methods. Attributes in IDL are akin to JavaScript properties, in that they are a getter and (optionally) a setter pair. In JavaScript contexts, attributes are exposed as a regular property access, while native code sees attributes as a Get and possibly a Set method.

- -

Attributes can be declared readonly, in which case setting causes an error to be thrown in script contexts and native contexts lack the Set method, by using the "readonly" keyword.

- -

To native code, on attribute declared 'attribute type foo;' is syntactic sugar for the declaration of two methods 'type getFoo();' and 'void setFoo(in type foo);'. If foo were declared readonly, the latter method would not be present. Attributes support all of the properties of methods with the exception of optional_argc, as this does not make sense for attributes.

- -

There are some special rules for attribute naming. As a result of vtable munging by the MSVC++ compiler, an attribute with the name `IID' is forbidden. In addition, any attribute whose name matches the regex /^[a-z]{2,3}I[A-Z][a-z]/ is emitted with a warning, as its name looks like an nsIInterface or a mozIInterface declaration. Also like methods, if the first character of an attribute is lowercase in IDL, it is made uppercase in native code only.

- -

Methods define a return type and a series of in and out parameters. When called from a JavaScript context, they invocation looks as it is declared for the most part; some parameter properties can adjust what the code looks like. The calls are more mangled in native contexts.

- -

An important attribute for methods and attributes is scriptability. A method or attribute is scriptable if it is declared in a scriptable interface and it lacks a noscript or notxpcom property. Any method that is not scriptable can only be accessed by native code. However, scriptable methods must contain parameters and a return type that can be translated to script: any native type, save those declared with an nsid, domstring, utf8string, cstring, astring, or jsval property, may not be used in a scriptable method or attribute. An exception to the above rule is if the parameter has the iid_is property (a special case for some QueryInterface-like operations). In general, this means that the only usable native types are those declared in nsrootidl.idl (see above).

- -

Methods and attributes are mangled on conversion to native code. If a method is declared notxpcom, the mangling of the return type is prevented, so it is called mostly as it looks. Otherwise, the return type of the native method is nsresult, and the return type acts as a final outparameter if it is not void. The name is translated so that the first character is unconditionally uppercase; subsequent characters are unaffected. However, the presence of the binaryname property allows the user to select another name to use in native code (to avoid conflicts with other functions). For example, the method '[binaryname(foo)] void bar();' becomes 'nsresult Foo()' in native code (note that capitalization is still applied). However, the capitalization is not applied when using binaryname with attributes; i.e., [binaryname(foo)] readonly attribute Quux bar; becomes Getfoo(Quux**) in native code. Attributes named 'IID' and methods named 'GetIID' are forbidden, although this is checked before binaryname conversion.

- -

The implicit_jscontext and optional_argc parameters are properties which help native code implementations determine how the call was made from script. If implicit_jscontext is present on a method, then an additional JSContext *cx parameter is added just after the regular list which receives the context of the caller. If optional_argc is present, then an additional uint8_t _argc method is added at the end which receives the number of optional arguments that were actually used (obviously, you need to have an optional argument in the first place). Note that if both properties are set, the JSContext *cx is added first, followed by the uint8_t _argc, and then ending with return value parameter. Finally, as an exception to everything already mentioned, for attribute getters and setters the JSContext *cx comes before any other arguments.

- -

In addition, methods and attributes can be both marked as deprecated with the deprecated property, which causes compilers to emit deprecation usage warnings. Note that this is only verified in native code and not script code.

- -

The final native-only property is nostdcall. Normally, declarations are made in the stdcall ABI on Windows to be ABI-compatible with COM interfaces. Any non-scriptable method or attribute with nostdcall instead uses the thiscall ABI convention. Methods without this property generally use NS_IMETHOD in their declarations and NS_IMETHODIMP in their definitions to automatically add in the stdcall declaration specifier on requisite compilers; those that use this method may use a plain `nsresult' instead.

- -

Source and Binary Compatibility

- -

Some consumers of IDL interfaces create binary plugins that expect the interfaces to be stored in a specific way in memory. In other words, some changes made to IDL interfaces require the author to modify the unique identifier (IID) in order to make it clear to plugins that utilize these interfaces that they have changed, and thus their plugin must be recompiled.

- -

Common changes to an interface, such as changes to a method signature, number of arguments, and number or type of attributes, automatically require an IID change. In addition, some changes to interface attributes require that an IID be changed, as well. When a change to an interface made by an XPIDL developer requires that third-party binary addons be recompiled, we say that it affects binary compatibility. When a change to an interface made by an XPIDL developer requires that third-party binary addons change their source code, we say that it affects source compatibility. In table 5, the columns on the far right indicate whether changes to a specific attribute affect source compatibility, binary compatibility, or both.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Table 5: Optional interface attributes
AttributeValid for methodsValid for attributesEffectChanges Source Compatibility?Changes Binary Compatibility?
binaryname(foo)YYResults in the C++ method being called "Foo"YN
deprecatedYYEmits a compiler warning if used in C++ codeNN
implicit_jscontextYYAdds an additional JSContext *cx parameter to the C++ implementationYY
noscriptYYProhibits the method/attribute from being accessible in JS codeNN
nostdcallYYThe C++ implementation uses virtual nsresult instead of NS_IMETHOD/NS_IMETHODIMPYY
notxpcomYYThe C++ implementation does not return nsresult (implies noscript)YY
optional_argcYNAdds an additional uint8_t _argc parameter to the C++ implementationYY
- -

Method parameters

- -

Each method parameter can be specified in one of three modes: in, out, or inout. An out parameter is essentially an auxiliary return value, although these are moderately cumbersome to use from script contexts and should therefore be avoided if reasonable. An inout parameter is an in parameter whose value may be changed as a result of the method; these parameters are rather annoying to use and should generally be avoided if at all possible.

- -

Out and inout parameters are reflected as objects having the .value property which contains the real value of the parameter; it is not initialized in the case of out parameters and is initialized to the passed-in-value for inout parameters. The script code would need to set this property to assign a value to the parameter. Regular in parameters are reflected more or less normally, with numeric types all representing numbers, booleans as true or false, the various strings (including AString et al) as a JavaScript string, and nsid types as a Components.ID instance. In addition, the jsval type is translated as the appropriate JavaScript value (since a jsval is the internal representation of all JavaScript values), and objects that are marked nsIVariant have their
- types automatically boxed and unboxed as appropriate.

- -

The equivalent representations of all IDL types in native code is given in the earlier tables; parameters of type inout follow their out form. Native code should pay particular attention to not passing in null values for out parameters (although some parts of the codebase are known to violate this, it is strictly enforced at the JS<->native barrier), and also ensuring that boolean types only receive values of 0 (false) or 1 (true).

- -

Representations of types additionally depend on some of the many types of properties they may have. The array property turns the parameter into an array; the parameter must also have a corresponding size_is property whose argument is the parameter that has the size of the array. In native code, the type gains another pointer indirection, and JavaScript arrays are used in script code. Script code callers can ignore the value of array parameter, but implementors must still set the values appropriately.

- -

The const and shared properties are special to native code. As its name implies, the const property makes its corresponding argument const. The shared property is only meaningful for out or inout parameters and it means that the pointer value should not be freed by the caller. Only the string, wstring, and native types having the nsid, domstring, utf8string, cstirng, astring, or jsval properties may be declared shared, and, even then, only if the parameter is not an array parameter. The shared property also makes its corresponding argument const.
-
- The retval property indicates that the parameter is actually acting as the return value, and it is only the need to assign properties to the parameter that is causing it to be specified as a parameter. It has no effect on native code, but script code uses it like a regular return value. Naturally, a method which contains a retval parameter must be declared void, and the parameter itself must be an out parameter and the last parameter.

- -

Other properties are the optional and iid_is property. The optional property indicates that script code may omit the property without problems; all subsequent parameters must either by optional themselves or the retval parameter. Note that optional out parameters still pass in a variable for the parameter, but its value will be ignored. The iid_is parameter indicates that the real IID of an nsQIResult parameter may be found in the corresponding parameter, to allow script code to automatically unbox the type.

- -

Not all type combinations are possible. Native types with the various string properties are all forbidden from being used as an inout parameter or as an array parameter. In addition, native types with the nsid property but lacking either a ptr or ref property are forbidden unless the method is notxpcom and it is used as an inparameter.

- -

For types that reference heap-allocated data (strings, arrays, interface pointers, etc), you must follow the XPIDL data ownership conventions in order to avoid memory corruption and security vulnerabilities:

- - - -

Resources (mostly outdated)

- - -
diff --git a/files/ja/mozilla/tech/xpidl/xpidl/index.html b/files/ja/mozilla/tech/xpidl/xpidl/index.html deleted file mode 100644 index 41f94f5e71..0000000000 --- a/files/ja/mozilla/tech/xpidl/xpidl/index.html +++ /dev/null @@ -1,57 +0,0 @@ ---- -title: xpidl -slug: Mozilla/Tech/XPIDL/xpidl -tags: - - Developing Mozilla - - 'Developing_Mozilla:Tools' - - Tools - - XPCOM - - xpidl -translation_of: Mozilla/Tech/XPIDL/xpidl ---- -

xpidl は XPIDL インタフェース記述ファイルに基づいた XPCOM インタフェース情報を生成するためのツールです。

- -

xpidl のビルド

-

xpidl は Gnome プロジェクト由来の idl コンパイラである libIDL idl コンパイラ をベースにしています。libIDL コンパイラは、やはり Gnome プロジェクト由来の glib をベースにしています。XPCOM コンポーネントに使われるヘッダを生成するために xpidl コンパイラを使うことができるため、現在 xpidl コンパイラはビルドプロセスの一部になっています。libIDL と glib の情報をビルド文書で確認してください。

-

UNIX: もし、あなたが xpidl をビルドしたいだけなら、ビルドするのにはわずかなディレクトリだけが必要です。Mozilla のソースを取得して、'configure'を実行したのち、以下のようにして dist/bin ディレクトリに xpidl をビルドすることができるでしょう。

-
make -C config
-make -C nsprpub
-make -C xpcom/typelib
-
-

Windows: 静的リンクされた xpidl.exe のビルドか VC 2005 Express でビルドをしたいなら、Windows で静的 xpidl をビルドするを参照してください。

-

xpidl を使う

-

Mozilla をビルドする手順に XPIDL ファイルをどのように加えるかについての説明のために xpidl ビルドページ を参照してください。xpidl は UNIX と Windows のコマンドラインからも利用可能です。

-
Usage: ./xpidl -m mode [-w] [-v] [-t version number]
-          [-I path] [-o basename | -e filename.ext] filename.idl
-       -a emit annotations to typelib
-       -w turn on warnings (recommended)
-       -v verbose mode (NYI)
-       -t create a typelib of a specific version number
-       -I add entry to start of include path for ``#include "nsIThing.idl"
-       -o use basename (e.g. ``/tmp/nsIThing) for output
-       -e use explicit output filename
-       -m specify output mode:
-          header        Generate C++ header            (.h)
-          typelib       Generate XPConnect typelib     (.xpt)
-          doc           Generate HTML documentation    (.html)
-          java          Generate Java interface        (.java)
-
-

リソース

- -

苦情は docs mike+mozilla@meer.net & mang@subcarrier.org まで (英語で)

-
-

Original Document Information

- -
-

{{ languages( { "en": "en/XPIDL/xpidl" } ) }}

diff --git a/files/ja/mozilla/tech/xslt_2.0/index.html b/files/ja/mozilla/tech/xslt_2.0/index.html deleted file mode 100644 index ad3898b988..0000000000 --- a/files/ja/mozilla/tech/xslt_2.0/index.html +++ /dev/null @@ -1,35 +0,0 @@ ---- -title: XSLT 2.0 -slug: Mozilla/Tech/XSLT_2.0 -tags: - - Java - - JavaScript - - XML - - XSLT - - XSLT 2.0 - - 拡張 -translation_of: Mozilla/Tech/XSLT_2.0 ---- -

Firefox では XSLT 2.0 がネイティブにサポートされていませんが、Saxon-B (Java) や最近では Saxon-CE (JavaScript) を使用して XSLT 2.0 を実行することは可能です。

- -

ユーザー向け

- -

Saxon-CE

- -

拡張は必要ありませんが、Saxon-CE JavaScript ライブラリにリンクする HTML ページがロードされると Saxon-CE が実行されます。

- -

Saxon-B

- -

XSL Results 拡張機能は、Java ベースの Saxon-B ライブラリに接続し、(Firefox 自身の XSLT 1.0 プロセッサでは処理されない) XSLT 処理命令 で適切なページを訪問したときに XSLT が自動的に実行されるようサポートするために (Mozilla 固有のコードの代わりにJava 1.6v12+によって処理される) LiveConnect の新バージョンを使用します。

- -

開発者向け

- -

Saxon-CE

- -

Web ページから XSLT 2.0 変換を開始するための JavaScript API が用意されています。Saxon-CE からのエラーと診断出力は、Firefox 開発者コンソールまたは Firebug で確認できます。

- -

Saxon-B

- -

この拡張機能は LiveConnect コードを使って Saxon-B ライブラリと通信する方法を示していますが、JavaScript コードモジュールのアプローチが拡張機能 XqUSEme の中でより再利用可能なアプローチとして使用されることがあります。

- -

このコードは Java のサポート (および LiveConnect のサポート) が遅れているため、Mac (Java 1.6 をサポートするサーバー版を除く) では現在動作しません。

-- cgit v1.2.3-54-g00ecf