aboutsummaryrefslogtreecommitdiff
path: root/files/ja/mozilla/tech/xpcom/reference/components
diff options
context:
space:
mode:
Diffstat (limited to 'files/ja/mozilla/tech/xpcom/reference/components')
-rw-r--r--files/ja/mozilla/tech/xpcom/reference/components/index.html18
-rw-r--r--files/ja/mozilla/tech/xpcom/reference/components/nscategorymanager/index.html30
-rw-r--r--files/ja/mozilla/tech/xpcom/reference/components/nsdirectoryservice/index.html71
-rw-r--r--files/ja/mozilla/tech/xpcom/reference/components/nslocalfile/index.html41
-rw-r--r--files/ja/mozilla/tech/xpcom/reference/components/nsobserverservice/index.html30
-rw-r--r--files/ja/mozilla/tech/xpcom/reference/components/nsscriptableinputstream/index.html66
6 files changed, 256 insertions, 0 deletions
diff --git a/files/ja/mozilla/tech/xpcom/reference/components/index.html b/files/ja/mozilla/tech/xpcom/reference/components/index.html
new file mode 100644
index 0000000000..930d831c1e
--- /dev/null
+++ b/files/ja/mozilla/tech/xpcom/reference/components/index.html
@@ -0,0 +1,18 @@
+---
+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
+---
+<p>There are a number of components provided in the standard implementation of XPCOM; these are as follows.</p>
+<div class="row topicpage-table">
+ <div class="section"><dl><dl><dt class="landingPageList"><a href="/ja/docs/nsCategoryManager">nsCategoryManager</a></dt><dd class="landingPageList">The XPCOM Category Manager.</dd><dt class="landingPageList"><a href="/ja/docs/nsDirectoryService">nsDirectoryService</a></dt><dd class="landingPageList">XPCOM ディレクトリサービス。このサービスは、OS 固有のマナーで "よく知られた" ディレクトリの場所を返します。例えば、システムの一時ディレクトリやデスクトップディレクトリ、現在の作業ディレクトリなどのパスを提供します。</dd><dt class="landingPageList"><a href="/ja/docs/nsLocalFile">nsLocalFile</a></dt><dd class="landingPageList"><code><a href="ja/NsILocalFile">nsILocalFile</a></code> を実装するコンポーネント。</dd></dl></dl></div>
+ <div class="section"><dl><dt class="landingPageList"><a href="/ja/docs/nsObserverService">nsObserverService</a></dt><dd class="landingPageList">XPCOM Observer サービス。</dd><dt class="landingPageList"><a href="/ja/docs/nsScriptableInputStream">nsScriptableInputStream</a></dt><dd class="landingPageList"><code><a href="ja/NsIScriptableInputStream">nsIScriptableInputStream</a></code> を実装するコンポーネント。</dd></dl></div>
+ </div>
diff --git a/files/ja/mozilla/tech/xpcom/reference/components/nscategorymanager/index.html b/files/ja/mozilla/tech/xpcom/reference/components/nscategorymanager/index.html
new file mode 100644
index 0000000000..06226a5d35
--- /dev/null
+++ b/files/ja/mozilla/tech/xpcom/reference/components/nscategorymanager/index.html
@@ -0,0 +1,30 @@
+---
+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
+---
+<p>« <a href="/ja/docs/XPCOM_API_Reference">XPCOM API Reference</a></p>
+
+<h3 id=".E8.A6.81.E7.B4.84" name=".E8.A6.81.E7.B4.84">要約</h3>
+
+<p>The XPCOM Category Manager.</p>
+
+<dl>
+ <dt>Class ID</dt>
+ <dd><code>16d222a6-1dd2-11b2-b693-f38b02c021b2</code></dd>
+ <dt>ContractID</dt>
+ <dd><code>@mozilla.org/categorymanager;1</code></dd>
+</dl>
+
+<h3 id=".E3.82.B5.E3.83.9D.E3.83.BC.E3.83.88.E3.81.95.E3.82.8C.E3.81.9F.E3.82.A4.E3.83.B3.E3.82.BF.E3.83.95.E3.82.A7.E3.83.BC.E3.82.B9" name=".E3.82.B5.E3.83.9D.E3.83.BC.E3.83.88.E3.81.95.E3.82.8C.E3.81.9F.E3.82.A4.E3.83.B3.E3.82.BF.E3.83.95.E3.82.A7.E3.83.BC.E3.82.B9">サポートされたインタフェース</h3>
+
+<p><code><a href="ja/NsICategoryManager">nsICategoryManager</a></code></p>
+
+<h3 id=".E3.82.B3.E3.83.A1.E3.83.B3.E3.83.88" name=".E3.82.B3.E3.83.A1.E3.83.B3.E3.83.88">コメント</h3>
+
+<p>このコンポーネントは、単独で使用するか、XPCOM サービスマネージャを通してアクセスします。</p>
diff --git a/files/ja/mozilla/tech/xpcom/reference/components/nsdirectoryservice/index.html b/files/ja/mozilla/tech/xpcom/reference/components/nsdirectoryservice/index.html
new file mode 100644
index 0000000000..dbec00fb06
--- /dev/null
+++ b/files/ja/mozilla/tech/xpcom/reference/components/nsdirectoryservice/index.html
@@ -0,0 +1,71 @@
+---
+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
+---
+<p>« <a href="/ja/docs/XPCOM_API_Reference">XPCOM API Reference</a></p>
+
+<h3 id=".E8.A6.81.E7.B4.84" name=".E8.A6.81.E7.B4.84">要約</h3>
+
+<p>XPCOM ディレクトリサービス。このサービスは、OS 固有のマナーで "よく知られた" ディレクトリの場所を返します。例えば、システムの一時ディレクトリやデスクトップディレクトリ、現在の作業ディレクトリなどのパスを提供します。</p>
+
+<dl>
+ <dt>Class ID</dt>
+ <dd><code>f00152d0-b40b-11d3-8c9c-000064657374</code></dd>
+ <dt>ContractID</dt>
+ <dd><code>@mozilla.org/file/directory_service;1</code></dd>
+</dl>
+
+<h3 id=".E3.82.B5.E3.83.9D.E3.83.BC.E3.83.88.E3.81.95.E3.82.8C.E3.81.9F.E3.82.A4.E3.83.B3.E3.82.BF.E3.83.95.E3.82.A7.E3.83.BC.E3.82.B9" name=".E3.82.B5.E3.83.9D.E3.83.BC.E3.83.88.E3.81.95.E3.82.8C.E3.81.9F.E3.82.A4.E3.83.B3.E3.82.BF.E3.83.95.E3.82.A7.E3.83.BC.E3.82.B9">サポートされたインタフェース</h3>
+
+<p><code><a href="ja/NsIProperties">nsIProperties</a></code>, <code><a href="ja/NsIDirectoryService">nsIDirectoryService</a> </code></p>
+
+<h3 id=".E3.82.B3.E3.83.A1.E3.83.B3.E3.83.88" name=".E3.82.B3.E3.83.A1.E3.83.B3.E3.83.88">コメント</h3>
+
+<p>このコンポーネントは、単独で使用するか、XPCOM サービスマネージャを通してアクセスします。</p>
+
+<h3 id=".E3.82.B3.E3.83.BC.E3.83.89.E4.BE.8B" name=".E3.82.B3.E3.83.BC.E3.83.89.E4.BE.8B">コード例</h3>
+
+<pre>#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&lt;nsIServiceManager&gt; svcMgr;
+ rv = NS_GetServiceManager(getter_AddRefs(svcMgr));
+ if (NS_FAILED(rv))
+ return rv;
+
+ nsCOMPtr&lt;nsIProperties&gt; directory;
+ rv = svcMgr-&gt;GetServiceByContractID("@mozilla.org/file/directory_service;1",
+ NS_GET_IID(nsIProperties),
+ getter_AddRefs(directory));
+ if (NS_FAILED(rv))
+ return rv;
+
+ rv = directory-&gt;Get(NS_OS_TEMP_DIR, NS_GET_IID(nsIFile), aResult);
+
+ return rv;
+}
+</pre>
+
+<p>NS_OS_TEMP_DIR は、他の多くの Directory Service キーと共に、<a class="external" href="http://lxr.mozilla.org/mozilla/source/xpcom/io/nsDirectoryServiceDefs.h">nsDirectoryServiceDefs.h</a> で定義されているので注意してください。</p>
+
+<h3 id=".E5.8F.82.E8.80.83" name=".E5.8F.82.E8.80.83">参考</h3>
+
+<p><a href="ja/Using_nsIDirectoryService">Using nsIDirectoryService</a>, <a href="ja/NsIProperties#get">nsIProperties::get</a>, <a href="ja/NsIDirectoryServiceProvider">nsIDirectoryServiceProvider</a></p>
+
+<div class="noinclude"> </div>
diff --git a/files/ja/mozilla/tech/xpcom/reference/components/nslocalfile/index.html b/files/ja/mozilla/tech/xpcom/reference/components/nslocalfile/index.html
new file mode 100644
index 0000000000..2b7872b2b8
--- /dev/null
+++ b/files/ja/mozilla/tech/xpcom/reference/components/nslocalfile/index.html
@@ -0,0 +1,41 @@
+---
+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
+---
+<p>« <a href="/ja/docs/XPCOM_API_Reference">XPCOM API Reference</a></p>
+
+<h3 id=".E8.A6.81.E7.B4.84" name=".E8.A6.81.E7.B4.84">要約</h3>
+
+<p><code><a href="ja/NsILocalFile">nsILocalFile</a></code> を実装するコンポーネント。</p>
+
+<dl>
+ <dt>Class ID</dt>
+ <dd><code>2e23e220-60be-11d3-8c4a-000064657374</code></dd>
+ <dt>ContractID</dt>
+ <dd><code>@mozilla.org/file/local;1</code></dd>
+</dl>
+
+<h3 id=".E3.82.B5.E3.83.9D.E3.83.BC.E3.83.88.E3.81.95.E3.82.8C.E3.81.9F.E3.82.A4.E3.83.B3.E3.82.BF.E3.83.95.E3.82.A7.E3.83.BC.E3.82.B9" name=".E3.82.B5.E3.83.9D.E3.83.BC.E3.83.88.E3.81.95.E3.82.8C.E3.81.9F.E3.82.A4.E3.83.B3.E3.82.BF.E3.83.95.E3.82.A7.E3.83.BC.E3.82.B9">サポートされたインタフェース</h3>
+
+<p><code><a href="ja/NsILocalFile">nsILocalFile</a></code>, <code><a href="ja/NsIFile">nsIFile</a></code></p>
+
+<h3 id=".E3.82.B3.E3.83.A1.E3.83.B3.E3.83.88" name=".E3.82.B3.E3.83.A1.E3.83.B3.E3.83.88">コメント</h3>
+
+<p>このコンポーネントは XPCOM コンポーネントマネージャを通してアクセスします。</p>
+
+<h3 id=".E3.82.B3.E3.83.BC.E3.83.89.E4.BE.8B" name=".E3.82.B3.E3.83.BC.E3.83.89.E4.BE.8B">コード例</h3>
+
+<pre>function getFileSize(path) {
+ var file =
+ Components.classes["@mozilla.org/file/local;1"].
+ createInstance(Components.interfaces.nsILocalFile);
+ file.initWithPath(path);
+ return file.fileSize;
+}
+</pre>
diff --git a/files/ja/mozilla/tech/xpcom/reference/components/nsobserverservice/index.html b/files/ja/mozilla/tech/xpcom/reference/components/nsobserverservice/index.html
new file mode 100644
index 0000000000..579189906f
--- /dev/null
+++ b/files/ja/mozilla/tech/xpcom/reference/components/nsobserverservice/index.html
@@ -0,0 +1,30 @@
+---
+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
+---
+<p>« <a href="/ja/docs/XPCOM_API_Reference">XPCOM API Reference</a></p>
+
+<h3 id=".E8.A6.81.E7.B4.84" name=".E8.A6.81.E7.B4.84">要約</h3>
+
+<p>XPCOM Observer サービス。</p>
+
+<dl>
+ <dt>Class ID</dt>
+ <dd><code>D07F5195-E3D1-11d2-8ACD-00105A1B8860</code></dd>
+ <dt>ContractID</dt>
+ <dd><code>@mozilla.org/observer-service;1</code></dd>
+</dl>
+
+<h3 id=".E3.82.B5.E3.83.9D.E3.83.BC.E3.83.88.E3.81.95.E3.82.8C.E3.81.9F.E3.82.A4.E3.83.B3.E3.82.BF.E3.83.95.E3.82.A7.E3.83.BC.E3.82.B9" name=".E3.82.B5.E3.83.9D.E3.83.BC.E3.83.88.E3.81.95.E3.82.8C.E3.81.9F.E3.82.A4.E3.83.B3.E3.82.BF.E3.83.95.E3.82.A7.E3.83.BC.E3.82.B9">サポートされたインタフェース</h3>
+
+<p><code><a href="ja/NsIObserverService">nsIObserverService</a></code></p>
+
+<h3 id=".E3.82.B3.E3.83.A1.E3.83.B3.E3.83.88" name=".E3.82.B3.E3.83.A1.E3.83.B3.E3.83.88">コメント</h3>
+
+<p>このコンポーネントは、単独で使用するか、XPCOM サービスマネージャを通してアクセスします。これはメインスレッドからのみ使用されるべきです。</p>
diff --git a/files/ja/mozilla/tech/xpcom/reference/components/nsscriptableinputstream/index.html b/files/ja/mozilla/tech/xpcom/reference/components/nsscriptableinputstream/index.html
new file mode 100644
index 0000000000..ce98722492
--- /dev/null
+++ b/files/ja/mozilla/tech/xpcom/reference/components/nsscriptableinputstream/index.html
@@ -0,0 +1,66 @@
+---
+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
+---
+<p>« <a href="/ja/docs/XPCOM_API_Reference">XPCOM API Reference</a></p>
+
+<h3 id=".E8.A6.81.E7.B4.84" name=".E8.A6.81.E7.B4.84">要約</h3>
+
+<p><code><a href="ja/NsIScriptableInputStream">nsIScriptableInputStream</a></code> を実装するコンポーネント。</p>
+
+<dl>
+ <dt>Class ID</dt>
+ <dd><code>7225c040-a9bf-11d3-a197-0050041caf44</code></dd>
+ <dt>ContractID</dt>
+ <dd><code>@mozilla.org/scriptableinputstream;1</code></dd>
+</dl>
+
+<h3 id=".E3.82.B5.E3.83.9D.E3.83.BC.E3.83.88.E3.81.95.E3.82.8C.E3.81.9F.E3.82.A4.E3.83.B3.E3.82.BF.E3.83.95.E3.82.A7.E3.83.BC.E3.82.B9" name=".E3.82.B5.E3.83.9D.E3.83.BC.E3.83.88.E3.81.95.E3.82.8C.E3.81.9F.E3.82.A4.E3.83.B3.E3.82.BF.E3.83.95.E3.82.A7.E3.83.BC.E3.82.B9">サポートされたインタフェース</h3>
+
+<p><code><a href="ja/NsIScriptableInputStream">nsIScriptableInputStream</a></code>, <code><a href="ja/NsIInputStream">nsIInputStream</a></code></p>
+
+<h3 id=".E3.82.B3.E3.83.A1.E3.83.B3.E3.83.88" name=".E3.82.B3.E3.83.A1.E3.83.B3.E3.83.88">コメント</h3>
+
+<p>このコンポーネントは XPCOM コンポーネントマネージャを通してアクセスします。</p>
+
+<h3 id=".E3.82.B3.E3.83.BC.E3.83.89.E4.BE.8B" name=".E3.82.B3.E3.83.BC.E3.83.89.E4.BE.8B">コード例</h3>
+
+<pre>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");
+ }
+}
+</pre>
+
+<h3 id=".E5.8F.82.E8.80.83" name=".E5.8F.82.E8.80.83">参考</h3>
+
+<p><a href="ja/NsIScriptableInputStream">nsIScriptableInputStream</a></p>
+
+<div class="noinclude"> </div>