创建_XPCOM_组件

  • 版本网址缩略名: 创建_XPCOM_组件
  • 版本标题: 创建 XPCOM 组件
  • 版本 id: 275054
  • 创建于:
  • 创建者: Secure alex
  • 是否是当前版本?
  • 评论 /* [[正在编辑创建 XPCOM 组件:Component Internals|Component Internals]] */

修订内容

{{template.Next("创建 XPCOM 组件:前言")}}

前言

谁该读这本书
本教程的组织
按照例子来学习
本书的体例
致谢

XPCOM 简介

XPCOM 解决方案
Gecko
组件
接口
接口与封装
nsISupports 基接口
XPCOM 的ID
CID
契约 ID
类厂
XPIDL 与类型库
XPCOM 服务
XPCOM 类型
方法类型
引用计数
状态码
变量映射
通用 XPCOM 错误码

使用 XPCOM 组件

组件的例子
Cookie 管理器
WebBrowserFind 组件
WebLock 组件
Mozilla 中使用的组件
查找 Mozilla 组件
在 Cpp 代码中使用 XPCOM 组件
XPConnect: 在脚本中使用 XPCOM 组件

Component Internals

Creating Components in Cpp
XPCOM Initialization
XPCOM Registry Manifests
Registration Methods in XPCOM
Autoregistration
The Shutdown Process
Three Parts of a XPCOM Component Library
XPCOM Glue
The Glue Library
XPCOM String Classes

Creating the Component Code

What We'll Be Working On
Component Registration
The regxpcom Program
Registration Alternatives
Overview of the WebLock Module Source
Digging In: Required Includes and Constants
Identifiers in XPCOM
Coding for the Registration Process
The Registration Methods
Creating an Instance of Your Component
webLock1.cpp

使用XPCOM工具类让事情变得简单

XPCOM 宏
通用XPCOM模块宏
基本实现宏
声明宏
webLock2.cpp
XPCOM中的字符串类
使用字符串
nsEmbedStringnsEmbedCString
聪明指针

开始WebLock

启动时被调用
注册到消息
访问Category Manager
提供WebLock访问
建立WebLock编程接口
在XPIDL中定义WebLock接口
XPIDL书写格式
脚本化接口
实现nsISupports
Web Locking 接口
实现WebLock
声明宏
在XPCOM中表达返回值
XPIDL代码生成
从客户端获取WebLock Service
实现iWebLock接口
The Directory Service
nsIFile改变路径
nsIFile操作文件
nsILocalFile读取数据
处理White List Data
iWebLock方法列举
Lock and Unlock
AddSite
RemoveSite
SetSites
GetNext
GetSites
HasMoreElements

Finishing the Component

Using Frozen Interfaces
Copying Interfaces Into Your Build Environment
Implementing the nsIContentPolicy Interface
Receiving Notifications
Implementing the nsIContentPolicy
Uniform Resource Locators
Checking the White List
Creating nsIURI Objects

Building the WebLock UI

User Interface Package List
Client Code Overview
XUL
The XUL Document
The Locking UI
Site Adding UI
weblock.xul
Overlaying New User Interface Into Mozilla
webLockOverlay.xul
Other Resources
weblock.css
Image Resources

打包 WebLock

组件安装预览
资源归档
WebLock 安装脚本
WebLock 跟踪脚本
分发你的组件

附录 A - 建立 Gecko SDK

下载和建立 SDK
编译一个 Microsoft Visual Cpp 工程
创建一个新的工程
把 Gecko SDK 添加到工程设置
Unix 下的一个 Makefile

附录B - 资源

WebLock 资源
Gecko 资源
XPCOM 资源
General Development 资源

{{template.Next("创建 XPCOM 组件:前言")}} {{template.CXCLicenseBlock()}}

{{ wiki.languages( { "en": "en/Creating_XPCOM_Components" } ) }}

修订版来源

<p>
</p><p>{{template.Next("创建 XPCOM 组件:前言")}}
</p>
<h3 name=".E5.89.8D.E8.A8.80"> <a href="cn/%e5%88%9b%e5%bb%ba_XPCOM_%e7%bb%84%e4%bb%b6/%e5%89%8d%e8%a8%80">前言</a> </h3>
<dl><dd> <a href="cn/%e5%88%9b%e5%bb%ba_XPCOM_%e7%bb%84%e4%bb%b6/%e5%89%8d%e8%a8%80#.E8.B0.81.E8.AF.A5.E8.AF.BB.E8.BF.99.E6.9C.AC.E4.B9.A6">谁该读这本书</a>
</dd><dd> <a href="cn/%e5%88%9b%e5%bb%ba_XPCOM_%e7%bb%84%e4%bb%b6/%e5%89%8d%e8%a8%80#.E6.9C.AC.E6.95.99.E7.A8.8B.E7.9A.84.E7.BB.84.E7.BB.87">本教程的组织</a> 
</dd><dd> <a href="cn/%e5%88%9b%e5%bb%ba_XPCOM_%e7%bb%84%e4%bb%b6/%e5%89%8d%e8%a8%80#.E6.8C.89.E7.85.A7.E4.BE.8B.E5.AD.90.E6.9D.A5.E5.AD.A6.E4.B9.A0">按照例子来学习</a>
</dd><dd> <a href="cn/%e5%88%9b%e5%bb%ba_XPCOM_%e7%bb%84%e4%bb%b6/%e5%89%8d%e8%a8%80#.E6.9C.AC.E4.B9.A6.E7.9A.84.E4.BD.93.E4.BE.8B">本书的体例</a>
</dd><dd> <a href="cn/%e5%88%9b%e5%bb%ba_XPCOM_%e7%bb%84%e4%bb%b6/%e5%89%8d%e8%a8%80#.E8.87.B4.E8.B0.A2">致谢</a>
</dd></dl>
<h3 name="XPCOM_.E7.AE.80.E4.BB.8B"> <a href="cn/%e5%88%9b%e5%bb%ba_XPCOM_%e7%bb%84%e4%bb%b6/XPCOM_%e7%ae%80%e4%bb%8b">XPCOM 简介</a> </h3>
<dl><dd> <a href="cn/%e5%88%9b%e5%bb%ba_XPCOM_%e7%bb%84%e4%bb%b6/XPCOM_%e7%ae%80%e4%bb%8b#XPCOM_.E8.A7.A3.E5.86.B3.E6.96.B9.E6.A1.88">XPCOM 解决方案</a>
</dd><dd> <a href="cn/%e5%88%9b%e5%bb%ba_XPCOM_%e7%bb%84%e4%bb%b6/XPCOM_%e7%ae%80%e4%bb%8b#Gecko">Gecko</a>
</dd><dd> <a href="cn/%e5%88%9b%e5%bb%ba_XPCOM_%e7%bb%84%e4%bb%b6/XPCOM_%e7%ae%80%e4%bb%8b#.E7.BB.84.E4.BB.B6">组件</a>
</dd><dd> <a href="cn/%e5%88%9b%e5%bb%ba_XPCOM_%e7%bb%84%e4%bb%b6/XPCOM_%e7%ae%80%e4%bb%8b#.E6.8E.A5.E5.8F.A3">接口</a>
<dl><dd> <a href="cn/%e5%88%9b%e5%bb%ba_XPCOM_%e7%bb%84%e4%bb%b6/XPCOM_%e7%ae%80%e4%bb%8b#.E6.8E.A5.E5.8F.A3.E4.B8.8E.E5.B0.81.E8.A3.85">接口与封装</a>
</dd><dd> <a href="cn/%e5%88%9b%e5%bb%ba_XPCOM_%e7%bb%84%e4%bb%b6/XPCOM_%e7%ae%80%e4%bb%8b#nsISupports_.E5.9F.BA.E6.8E.A5.E5.8F.A3"><code>nsISupports</code> 基接口</a>
</dd></dl>
</dd><dd> <a href="cn/%e5%88%9b%e5%bb%ba_XPCOM_%e7%bb%84%e4%bb%b6/XPCOM_%e7%ae%80%e4%bb%8b#XPCOM_.E7.9A.84ID">XPCOM 的ID</a>
<dl><dd> <a href="cn/%e5%88%9b%e5%bb%ba_XPCOM_%e7%bb%84%e4%bb%b6/XPCOM_%e7%ae%80%e4%bb%8b#CID">CID</a>
</dd><dd> <a href="cn/%e5%88%9b%e5%bb%ba_XPCOM_%e7%bb%84%e4%bb%b6/XPCOM_%e7%ae%80%e4%bb%8b#.E5.A5.91.E7.BA.A6_ID">契约 ID</a>
</dd></dl>
</dd><dd> <a href="cn/%e5%88%9b%e5%bb%ba_XPCOM_%e7%bb%84%e4%bb%b6/XPCOM_%e7%ae%80%e4%bb%8b#.E7.B1.BB.E5.8E.82">类厂</a>
<dl><dd> <a href="cn/%e5%88%9b%e5%bb%ba_XPCOM_%e7%bb%84%e4%bb%b6/XPCOM_%e7%ae%80%e4%bb%8b#XPIDL_.E4.B8.8E.E7.B1.BB.E5.9E.8B.E5.BA.93">XPIDL 与类型库</a>
</dd></dl>
</dd><dd> <a href="cn/%e5%88%9b%e5%bb%ba_XPCOM_%e7%bb%84%e4%bb%b6/XPCOM_%e7%ae%80%e4%bb%8b#XPCOM_.E6.9C.8D.E5.8A.A1">XPCOM 服务</a>
</dd><dd> <a href="cn/%e5%88%9b%e5%bb%ba_XPCOM_%e7%bb%84%e4%bb%b6/XPCOM_%e7%ae%80%e4%bb%8b#XPCOM_.E7.B1.BB.E5.9E.8B">XPCOM 类型</a>
<dl><dd> <a href="cn/%e5%88%9b%e5%bb%ba_XPCOM_%e7%bb%84%e4%bb%b6/XPCOM_%e7%ae%80%e4%bb%8b#.E6.96.B9.E6.B3.95.E7.B1.BB.E5.9E.8B">方法类型</a>
</dd><dd> <a href="cn/%e5%88%9b%e5%bb%ba_XPCOM_%e7%bb%84%e4%bb%b6/XPCOM_%e7%ae%80%e4%bb%8b#.E5.BC.95.E7.94.A8.E8.AE.A1.E6.95.B0">引用计数</a>
</dd><dd> <a href="cn/%e5%88%9b%e5%bb%ba_XPCOM_%e7%bb%84%e4%bb%b6/XPCOM_%e7%ae%80%e4%bb%8b#.E7.8A.B6.E6.80.81.E7.A0.81">状态码</a>
</dd><dd> <a href="cn/%e5%88%9b%e5%bb%ba_XPCOM_%e7%bb%84%e4%bb%b6/XPCOM_%e7%ae%80%e4%bb%8b#.E5.8F.98.E9.87.8F.E6.98.A0.E5.B0.84">变量映射</a>
</dd><dd> <a href="cn/%e5%88%9b%e5%bb%ba_XPCOM_%e7%bb%84%e4%bb%b6/XPCOM_%e7%ae%80%e4%bb%8b#.E9.80.9A.E7.94.A8_XPCOM_.E9.94.99.E8.AF.AF.E7.A0.81">通用 XPCOM 错误码</a>
</dd></dl>
</dd></dl>
<h3 name=".E4.BD.BF.E7.94.A8_XPCOM_.E7.BB.84.E4.BB.B6"> <a href="cn/%e5%88%9b%e5%bb%ba_XPCOM_%e7%bb%84%e4%bb%b6/%e4%bd%bf%e7%94%a8_XPCOM_%e7%bb%84%e4%bb%b6">使用 XPCOM 组件</a> </h3>
<dl><dd> <a href="cn/%e5%88%9b%e5%bb%ba_XPCOM_%e7%bb%84%e4%bb%b6/%e4%bd%bf%e7%94%a8_XPCOM_%e7%bb%84%e4%bb%b6#.E7.BB.84.E4.BB.B6.E7.9A.84.E4.BE.8B.E5.AD.90">组件的例子</a>
<dl><dd> <a href="cn/%e5%88%9b%e5%bb%ba_XPCOM_%e7%bb%84%e4%bb%b6/%e4%bd%bf%e7%94%a8_XPCOM_%e7%bb%84%e4%bb%b6#Cookie_.E7.AE.A1.E7.90.86.E5.99.A8">Cookie 管理器</a>
</dd><dd> <a href="cn/%e5%88%9b%e5%bb%ba_XPCOM_%e7%bb%84%e4%bb%b6/%e4%bd%bf%e7%94%a8_XPCOM_%e7%bb%84%e4%bb%b6#WebBrowserFind_.E7.BB.84.E4.BB.B6"><b>WebBrowserFind</b> 组件</a>
</dd><dd> <a href="cn/%e5%88%9b%e5%bb%ba_XPCOM_%e7%bb%84%e4%bb%b6/%e4%bd%bf%e7%94%a8_XPCOM_%e7%bb%84%e4%bb%b6#WebLock_.E7.BB.84.E4.BB.B6"><b>WebLock</b> 组件</a>
</dd></dl>
</dd><dd> <a href="cn/%e5%88%9b%e5%bb%ba_XPCOM_%e7%bb%84%e4%bb%b6/%e4%bd%bf%e7%94%a8_XPCOM_%e7%bb%84%e4%bb%b6#Mozilla_.E4.B8.AD.E4.BD.BF.E7.94.A8.E7.9A.84.E7.BB.84.E4.BB.B6">Mozilla 中使用的组件</a>
<dl><dd> <a href="cn/%e5%88%9b%e5%bb%ba_XPCOM_%e7%bb%84%e4%bb%b6/%e4%bd%bf%e7%94%a8_XPCOM_%e7%bb%84%e4%bb%b6#.E6.9F.A5.E6.89.BE_Mozilla_.E7.BB.84.E4.BB.B6">查找 Mozilla 组件</a>
</dd><dd> <a href="cn/%e5%88%9b%e5%bb%ba_XPCOM_%e7%bb%84%e4%bb%b6/%e4%bd%bf%e7%94%a8_XPCOM_%e7%bb%84%e4%bb%b6#.E5.9C.A8_Cpp_.E4.BB.A3.E7.A0.81.E4.B8.AD.E4.BD.BF.E7.94.A8_XPCOM_.E7.BB.84.E4.BB.B6">在 Cpp 代码中使用 XPCOM 组件</a>
</dd><dd> <a href="cn/%e5%88%9b%e5%bb%ba_XPCOM_%e7%bb%84%e4%bb%b6/%e4%bd%bf%e7%94%a8_XPCOM_%e7%bb%84%e4%bb%b6#XPConnect:_.E5.9C.A8.E8.84.9A.E6.9C.AC.E4.B8.AD.E4.BD.BF.E7.94.A8_XPCOM_.E7.BB.84.E4.BB.B6">XPConnect: 在脚本中使用 XPCOM 组件</a>
</dd></dl>
</dd></dl>
<h3 name="Component_Internals"> <a href="cn/Creating_XPCOM_Components/Component_Internals">Component Internals</a> </h3>
<dl><dd> <a href="cn/Creating_XPCOM_Components/Component_Internals#Creating_Components_in_Cpp">Creating Components in Cpp</a>
</dd><dd> <a href="cn/Creating_XPCOM_Components/Component_Internals#XPCOM_Initialization">XPCOM Initialization</a>
<dl><dd> <a href="cn/Creating_XPCOM_Components/Component_Internals#XPCOM_Registry_Manifests">XPCOM Registry Manifests</a>
</dd><dd> <a href="cn/Creating_XPCOM_Components/Component_Internals#Registration_Methods_in_XPCOM">Registration Methods in XPCOM</a>
</dd><dd> <a href="cn/Creating_XPCOM_Components/Component_Internals#Autoregistration">Autoregistration</a>
</dd><dd> <a href="cn/Creating_XPCOM_Components/Component_Internals#The_Shutdown_Process">The Shutdown Process</a>
</dd><dd> <a href="cn/Creating_XPCOM_Components/Component_Internals#Three_Parts_of_a_XPCOM_Component_Library">Three Parts of a XPCOM Component Library</a>
</dd></dl>
</dd><dd> <a href="cn/Creating_XPCOM_Components/Component_Internals#XPCOM_Glue">XPCOM Glue</a>
<dl><dd> <a href="cn/Creating_XPCOM_Components/Component_Internals#The_Glue_Library">The Glue Library</a>
</dd><dd> <a href="cn/Creating_XPCOM_Components/Component_Internals#XPCOM_String_Classes">XPCOM String Classes</a>
</dd></dl>
</dd></dl>
<h3 name="Creating_the_Component_Code"> <a href="cn/Creating_XPCOM_Components/Creating_the_Component_Code">Creating the Component Code</a> </h3>
<dl><dd> <a href="cn/Creating_XPCOM_Components/Creating_the_Component_Code#What_We.27ll_Be_Working_On">What We'll Be Working On</a>
</dd><dd> <a href="cn/Creating_XPCOM_Components/Creating_the_Component_Code#Component_Registration">Component Registration</a>
<dl><dd> <a href="cn/Creating_XPCOM_Components/Creating_the_Component_Code#The_regxpcom_Program">The <code>regxpcom</code> Program</a>
</dd><dd> <a href="cn/Creating_XPCOM_Components/Creating_the_Component_Code#Registration_Alternatives">Registration Alternatives</a>
</dd></dl>
</dd><dd> <a href="cn/Creating_XPCOM_Components/Creating_the_Component_Code#Overview_of_the_WebLock_Module_Source">Overview of the <b>WebLock</b> Module Source</a>
</dd><dd> <a href="cn/Creating_XPCOM_Components/Creating_the_Component_Code#Digging_In:_Required_Includes_and_Constants">Digging In: Required Includes and Constants</a>
<dl><dd> <a href="cn/Creating_XPCOM_Components/Creating_the_Component_Code#Identifiers_in_XPCOM">Identifiers in XPCOM</a>
</dd><dd> <a href="cn/Creating_XPCOM_Components/Creating_the_Component_Code#Coding_for_the_Registration_Process">Coding for the Registration Process</a>
</dd><dd> <a href="cn/Creating_XPCOM_Components/Creating_the_Component_Code#The_Registration_Methods">The Registration Methods</a>
</dd><dd> <a href="cn/Creating_XPCOM_Components/Creating_the_Component_Code#Creating_an_Instance_of_Your_Component">Creating an Instance of Your Component</a>
</dd></dl>
</dd><dd> <a href="cn/Creating_XPCOM_Components/Creating_the_Component_Code#webLock1.cpp"><code>webLock1.cpp</code></a>
</dd></dl>
<h3 name=".E4.BD.BF.E7.94.A8XPCOM.E5.B7.A5.E5.85.B7.E7.B1.BB.E8.AE.A9.E4.BA.8B.E6.83.85.E5.8F.98.E5.BE.97.E7.AE.80.E5.8D.95"> <a href="cn/%e5%88%9b%e5%bb%baXPCOM%e7%bb%84%e4%bb%b6/%e4%bd%bf%e7%94%a8XPCOM%e5%b7%a5%e5%85%b7%e7%b1%bb%e8%ae%a9%e4%ba%8b%e6%83%85%e5%8f%98%e5%be%97%e7%ae%80%e5%8d%95">使用XPCOM工具类让事情变得简单</a> </h3>
<dl><dd> <a href="cn/%e5%88%9b%e5%bb%baXPCOM%e7%bb%84%e4%bb%b6/%e4%bd%bf%e7%94%a8XPCOM%e5%b7%a5%e5%85%b7%e7%b1%bb%e8%ae%a9%e4%ba%8b%e6%83%85%e5%8f%98%e5%be%97%e7%ae%80%e5%8d%95#XPCOM_.E5.AE.8F">XPCOM 宏</a>
<dl><dd> <a href="cn/%e5%88%9b%e5%bb%baXPCOM%e7%bb%84%e4%bb%b6/%e4%bd%bf%e7%94%a8XPCOM%e5%b7%a5%e5%85%b7%e7%b1%bb%e8%ae%a9%e4%ba%8b%e6%83%85%e5%8f%98%e5%be%97%e7%ae%80%e5%8d%95#.E9.80.9A.E7.94.A8XPCOM.E6.A8.A1.E5.9D.97.E5.AE.8F">通用XPCOM模块宏</a>
</dd><dd> <a href="cn/%e5%88%9b%e5%bb%baXPCOM%e7%bb%84%e4%bb%b6/%e4%bd%bf%e7%94%a8XPCOM%e5%b7%a5%e5%85%b7%e7%b1%bb%e8%ae%a9%e4%ba%8b%e6%83%85%e5%8f%98%e5%be%97%e7%ae%80%e5%8d%95#.E5.9F.BA.E6.9C.AC.E5.AE.9E.E7.8E.B0.E5.AE.8F">基本实现宏</a>
</dd><dd> <a href="cn/%e5%88%9b%e5%bb%baXPCOM%e7%bb%84%e4%bb%b6/%e4%bd%bf%e7%94%a8XPCOM%e5%b7%a5%e5%85%b7%e7%b1%bb%e8%ae%a9%e4%ba%8b%e6%83%85%e5%8f%98%e5%be%97%e7%ae%80%e5%8d%95#.E5.A3.B0.E6.98.8E.E5.AE.8F">声明宏</a>
</dd></dl>
</dd><dd> <a href="cn/%e5%88%9b%e5%bb%baXPCOM%e7%bb%84%e4%bb%b6/%e4%bd%bf%e7%94%a8XPCOM%e5%b7%a5%e5%85%b7%e7%b1%bb%e8%ae%a9%e4%ba%8b%e6%83%85%e5%8f%98%e5%be%97%e7%ae%80%e5%8d%95#webLock2.cpp"><code>webLock2.cpp</code></a>
</dd><dd> <a href="cn/%e5%88%9b%e5%bb%baXPCOM%e7%bb%84%e4%bb%b6/%e4%bd%bf%e7%94%a8XPCOM%e5%b7%a5%e5%85%b7%e7%b1%bb%e8%ae%a9%e4%ba%8b%e6%83%85%e5%8f%98%e5%be%97%e7%ae%80%e5%8d%95#XPCOM.E4.B8.AD.E7.9A.84.E5.AD.97.E7.AC.A6.E4.B8.B2.E7.B1.BB">XPCOM中的字符串类</a>
<dl><dd> <a href="cn/%e5%88%9b%e5%bb%baXPCOM%e7%bb%84%e4%bb%b6/%e4%bd%bf%e7%94%a8XPCOM%e5%b7%a5%e5%85%b7%e7%b1%bb%e8%ae%a9%e4%ba%8b%e6%83%85%e5%8f%98%e5%be%97%e7%ae%80%e5%8d%95#.E4.BD.BF.E7.94.A8.E5.AD.97.E7.AC.A6.E4.B8.B2">使用字符串</a>
</dd><dd> <a href="cn/%e5%88%9b%e5%bb%baXPCOM%e7%bb%84%e4%bb%b6/%e4%bd%bf%e7%94%a8XPCOM%e5%b7%a5%e5%85%b7%e7%b1%bb%e8%ae%a9%e4%ba%8b%e6%83%85%e5%8f%98%e5%be%97%e7%ae%80%e5%8d%95#nsEmbedString_.E5.92.8C_nsEmbedCString"><code>nsEmbedString</code> 和 <code>nsEmbedCString</code></a>
</dd></dl>
</dd><dd> <a href="cn/%e5%88%9b%e5%bb%baXPCOM%e7%bb%84%e4%bb%b6/%e4%bd%bf%e7%94%a8XPCOM%e5%b7%a5%e5%85%b7%e7%b1%bb%e8%ae%a9%e4%ba%8b%e6%83%85%e5%8f%98%e5%be%97%e7%ae%80%e5%8d%95#.E8.81.AA.E6.98.8E.E6.8C.87.E9.92.88">聪明指针</a>
</dd></dl>
<h3 name=".E5.BC.80.E5.A7.8BWebLock"> <a href="cn/%e5%88%9b%e5%bb%ba_XPCOM_%e7%bb%84%e4%bb%b6/%e5%bc%80%e5%a7%8bWebLock">开始<b>WebLock</b></a> </h3>
<dl><dd> <a href="cn/%e5%88%9b%e5%bb%ba_XPCOM_%e7%bb%84%e4%bb%b6/%e5%bc%80%e5%a7%8bWebLock#.E5.90.AF.E5.8A.A8.E6.97.B6.E8.A2.AB.E8.B0.83.E7.94.A8">启动时被调用</a>
<dl><dd> <a href="cn/%e5%88%9b%e5%bb%ba_XPCOM_%e7%bb%84%e4%bb%b6/%e5%bc%80%e5%a7%8bWebLock#.E6.B3.A8.E5.86.8C.E5.88.B0.E6.B6.88.E6.81.AF">注册到消息</a>
</dd><dd> <a href="cn/%e5%88%9b%e5%bb%ba_XPCOM_%e7%bb%84%e4%bb%b6/%e5%bc%80%e5%a7%8bWebLock#.E8.AE.BF.E9.97.AECategory_Manager">访问Category Manager</a>
</dd></dl>
</dd><dd> <a href="cn/%e5%88%9b%e5%bb%ba_XPCOM_%e7%bb%84%e4%bb%b6/%e5%bc%80%e5%a7%8bWebLock#.E6.8F.90.E4.BE.9BWebLock.E8.AE.BF.E9.97.AE">提供<b>WebLock</b>访问</a>
</dd><dd> <a href="cn/%e5%88%9b%e5%bb%ba_XPCOM_%e7%bb%84%e4%bb%b6/%e5%bc%80%e5%a7%8bWebLock#.E5.BB.BA.E7.AB.8BWebLock.E7.BC.96.E7.A8.8B.E6.8E.A5.E5.8F.A3">建立<b>WebLock</b>编程接口</a>
</dd><dd> <a href="cn/%e5%88%9b%e5%bb%ba_XPCOM_%e7%bb%84%e4%bb%b6/%e5%bc%80%e5%a7%8bWebLock#.E5.9C.A8XPIDL.E4.B8.AD.E5.AE.9A.E4.B9.89WebLock.E6.8E.A5.E5.8F.A3">在XPIDL中定义<b>WebLock</b>接口</a>
<dl><dd> <a href="cn/%e5%88%9b%e5%bb%ba_XPCOM_%e7%bb%84%e4%bb%b6/%e5%bc%80%e5%a7%8bWebLock#XPIDL.E4.B9.A6.E5.86.99.E6.A0.BC.E5.BC.8F">XPIDL书写格式</a>
</dd><dd> <a href="cn/%e5%88%9b%e5%bb%ba_XPCOM_%e7%bb%84%e4%bb%b6/%e5%bc%80%e5%a7%8bWebLock#.E8.84.9A.E6.9C.AC.E5.8C.96.E6.8E.A5.E5.8F.A3">脚本化接口</a>
</dd><dd> <a href="cn/%e5%88%9b%e5%bb%ba_XPCOM_%e7%bb%84%e4%bb%b6/%e5%bc%80%e5%a7%8bWebLock#.E5.AE.9E.E7.8E.B0nsISupports">实现<code>nsISupports</code></a>
</dd><dd> <a href="cn/%e5%88%9b%e5%bb%ba_XPCOM_%e7%bb%84%e4%bb%b6/%e5%bc%80%e5%a7%8bWebLock#Web_Locking_.E6.8E.A5.E5.8F.A3">Web Locking 接口</a>
</dd></dl>
</dd><dd> <a href="cn/%e5%88%9b%e5%bb%ba_XPCOM_%e7%bb%84%e4%bb%b6/%e5%bc%80%e5%a7%8bWebLock#.E5.AE.9E.E7.8E.B0WebLock">实现<b>WebLock</b></a>
<dl><dd> <a href="cn/%e5%88%9b%e5%bb%ba_XPCOM_%e7%bb%84%e4%bb%b6/%e5%bc%80%e5%a7%8bWebLock#.E5.A3.B0.E6.98.8E.E5.AE.8F">声明宏</a>
</dd><dd> <a href="cn/%e5%88%9b%e5%bb%ba_XPCOM_%e7%bb%84%e4%bb%b6/%e5%bc%80%e5%a7%8bWebLock#.E5.9C.A8XPCOM.E4.B8.AD.E8.A1.A8.E8.BE.BE.E8.BF.94.E5.9B.9E.E5.80.BC">在XPCOM中表达返回值</a>
</dd><dd> <a href="cn/%e5%88%9b%e5%bb%ba_XPCOM_%e7%bb%84%e4%bb%b6/%e5%bc%80%e5%a7%8bWebLock#XPIDL.E4.BB.A3.E7.A0.81.E7.94.9F.E6.88.90">XPIDL代码生成</a>
</dd><dd> <a href="cn/%e5%88%9b%e5%bb%ba_XPCOM_%e7%bb%84%e4%bb%b6/%e5%bc%80%e5%a7%8bWebLock#.E4.BB.8E.E5.AE.A2.E6.88.B7.E7.AB.AF.E8.8E.B7.E5.8F.96WebLock_Service">从客户端获取WebLock Service</a>
</dd><dd> <a href="cn/%e5%88%9b%e5%bb%ba_XPCOM_%e7%bb%84%e4%bb%b6/%e5%bc%80%e5%a7%8bWebLock#.E5.AE.9E.E7.8E.B0iWebLock.E6.8E.A5.E5.8F.A3">实现<code>iWebLock</code>接口</a>
</dd><dd> <a href="cn/%e5%88%9b%e5%bb%ba_XPCOM_%e7%bb%84%e4%bb%b6/%e5%bc%80%e5%a7%8bWebLock#The_Directory_Service">The Directory Service</a>
</dd><dd> <a href="cn/%e5%88%9b%e5%bb%ba_XPCOM_%e7%bb%84%e4%bb%b6/%e5%bc%80%e5%a7%8bWebLock#.E7.94.A8nsIFile.E6.94.B9.E5.8F.98.E8.B7.AF.E5.BE.84">用<code>nsIFile</code>改变路径</a>
</dd><dd> <a href="cn/%e5%88%9b%e5%bb%ba_XPCOM_%e7%bb%84%e4%bb%b6/%e5%bc%80%e5%a7%8bWebLock#.E7.94.A8nsIFile.E6.93.8D.E4.BD.9C.E6.96.87.E4.BB.B6">用<code>nsIFile</code>操作文件</a>
</dd><dd> <a href="cn/%e5%88%9b%e5%bb%ba_XPCOM_%e7%bb%84%e4%bb%b6/%e5%bc%80%e5%a7%8bWebLock#.E7.94.A8nsILocalFile.E8.AF.BB.E5.8F.96.E6.95.B0.E6.8D.AE">用<code>nsILocalFile</code>读取数据</a>
</dd><dd> <a href="cn/%e5%88%9b%e5%bb%ba_XPCOM_%e7%bb%84%e4%bb%b6/%e5%bc%80%e5%a7%8bWebLock#.E5.A4.84.E7.90.86White_List_Data">处理White List Data</a>
</dd></dl>
</dd><dd> <a href="cn/%e5%88%9b%e5%bb%ba_XPCOM_%e7%bb%84%e4%bb%b6/%e5%bc%80%e5%a7%8bWebLock#iWebLock.E6.96.B9.E6.B3.95.E5.88.97.E4.B8.BE"><code>iWebLock</code>方法列举</a>
<dl><dd> <a href="cn/%e5%88%9b%e5%bb%ba_XPCOM_%e7%bb%84%e4%bb%b6/%e5%bc%80%e5%a7%8bWebLock#Lock_.E5.92.8C_Unlock"><code>Lock</code> and <code>Unlock</code></a>
</dd><dd> <a href="cn/%e5%88%9b%e5%bb%ba_XPCOM_%e7%bb%84%e4%bb%b6/%e5%bc%80%e5%a7%8bWebLock#AddSite"><code>AddSite</code></a>
</dd><dd> <a href="cn/%e5%88%9b%e5%bb%ba_XPCOM_%e7%bb%84%e4%bb%b6/%e5%bc%80%e5%a7%8bWebLock#RemoveSite"><code>RemoveSite</code></a>
</dd><dd> <a href="cn/%e5%88%9b%e5%bb%ba_XPCOM_%e7%bb%84%e4%bb%b6/%e5%bc%80%e5%a7%8bWebLock#SetSites"><code>SetSites</code></a>
</dd><dd> <a href="cn/%e5%88%9b%e5%bb%ba_XPCOM_%e7%bb%84%e4%bb%b6/%e5%bc%80%e5%a7%8bWebLock#GetNext"><code>GetNext</code></a>
</dd><dd> <a href="cn/%e5%88%9b%e5%bb%ba_XPCOM_%e7%bb%84%e4%bb%b6/%e5%bc%80%e5%a7%8bWebLock#GetSites"><code>GetSites</code></a>
</dd><dd> <a href="cn/%e5%88%9b%e5%bb%ba_XPCOM_%e7%bb%84%e4%bb%b6/%e5%bc%80%e5%a7%8bWebLock#HasMoreElements"><code>HasMoreElements</code></a>
</dd></dl>
</dd></dl>
<h3 name="Finishing_the_Component"> <a href="cn/Creating_XPCOM_Components/Finishing_the_Component">Finishing the Component</a> </h3>
<dl><dd> <a href="cn/Creating_XPCOM_Components/Finishing_the_Component#Using_Frozen_Interfaces">Using Frozen Interfaces</a>
<dl><dd> <a href="cn/Creating_XPCOM_Components/Finishing_the_Component#Copying_Interfaces_Into_Your_Build_Environment">Copying Interfaces Into Your Build Environment</a>
</dd><dd> <a href="cn/Creating_XPCOM_Components/Finishing_the_Component#Implementing_the_nsIContentPolicy_Interface">Implementing the <code>nsIContentPolicy</code> Interface</a>
</dd><dd> <a href="cn/Creating_XPCOM_Components/Finishing_the_Component#Receiving_Notifications">Receiving Notifications</a>
</dd></dl>
</dd><dd> <a href="cn/Creating_XPCOM_Components/Finishing_the_Component#Implementing_the_nsIContentPolicy">Implementing the <code>nsIContentPolicy</code></a>
<dl><dd> <a href="cn/Creating_XPCOM_Components/Finishing_the_Component#Uniform_Resource_Locators">Uniform Resource Locators</a>
</dd><dd> <a href="cn/Creating_XPCOM_Components/Finishing_the_Component#Checking_the_White_List">Checking the White List</a>
</dd><dd> <a href="cn/Creating_XPCOM_Components/Finishing_the_Component#Creating_nsIURI_Objects">Creating <code>nsIURI</code> Objects</a>
</dd></dl>
</dd></dl>
<h3 name="Building_the_WebLock_UI"> <a href="cn/Creating_XPCOM_Components/Building_the_WebLock_UI">Building the <b>WebLock</b> UI</a> </h3>
<dl><dd> <a href="cn/Creating_XPCOM_Components/Building_the_WebLock_UI#User_Interface_Package_List">User Interface Package List</a>
</dd><dd> <a href="cn/Creating_XPCOM_Components/Building_the_WebLock_UI#Client_Code_Overview">Client Code Overview</a>
</dd><dd> <a href="cn/Creating_XPCOM_Components/Building_the_WebLock_UI#XUL">XUL</a>
<dl><dd> <a href="cn/Creating_XPCOM_Components/Building_the_WebLock_UI#The_XUL_Document">The XUL Document</a>
</dd><dd> <a href="cn/Creating_XPCOM_Components/Building_the_WebLock_UI#The_Locking_UI">The Locking UI</a>
</dd><dd> <a href="cn/Creating_XPCOM_Components/Building_the_WebLock_UI#Site_Adding_UI">Site Adding UI</a>
</dd><dd> <a href="cn/Creating_XPCOM_Components/Building_the_WebLock_UI#weblock.xul"><code>weblock.xul</code></a>
</dd></dl>
</dd><dd> <a href="cn/Creating_XPCOM_Components/Building_the_WebLock_UI#Overlaying_New_User_Interface_Into_Mozilla">Overlaying New User Interface Into Mozilla</a>
<dl><dd> <a href="cn/Creating_XPCOM_Components/Building_the_WebLock_UI#webLockOverlay.xul"><code>webLockOverlay.xul</code></a>
</dd></dl>
</dd><dd> <a href="cn/Creating_XPCOM_Components/Building_the_WebLock_UI#Other_Resources">Other Resources</a>
<dl><dd> <a href="cn/Creating_XPCOM_Components/Building_the_WebLock_UI#weblock.css"><code>weblock.css</code></a>
</dd><dd> <a href="cn/Creating_XPCOM_Components/Building_the_WebLock_UI#Image_Resources">Image Resources</a>
</dd></dl>
</dd></dl>
<h3 name=".E6.89.93.E5.8C.85_WebLock"> <a href="cn/Creating_XPCOM_Components/Packaging_WebLock">打包 WebLock</a> </h3>
<dl><dd> <a href="cn/Creating_XPCOM_Components/Packaging_WebLock#Component_Installation_Overview">组件安装预览</a>
</dd><dd> <a href="cn/Creating_XPCOM_Components/Packaging_WebLock#Archiving_Resources">资源归档</a>
</dd><dd> <a href="cn/Creating_XPCOM_Components/Packaging_WebLock#The_WebLock_Installation_Script"> <b>WebLock</b> 安装脚本</a>
</dd><dd> <a href="cn/Creating_XPCOM_Components/Packaging_WebLock#The_WebLock_Trigger_Script"><b>WebLock</b> 跟踪脚本</a>
</dd><dd> <a href="cn/Creating_XPCOM_Components/Packaging_WebLock#Distributing_Your_Component">分发你的组件</a>
</dd></dl>
<h3 name=".E9.99.84.E5.BD.95_A_-_.E5.BB.BA.E7.AB.8B_Gecko_SDK"> <a href="cn/%e5%88%9b%e5%bb%ba_XPCOM_%e7%bb%84%e4%bb%b6/%e5%bb%ba%e7%ab%8b_Gecko_SDK">附录 A - 建立 Gecko SDK</a> </h3>
<dl><dd> <a href="cn/%e5%88%9b%e5%bb%ba_XPCOM_%e7%bb%84%e4%bb%b6/%e5%bb%ba%e7%ab%8b_Gecko_SDK#.E4.B8.8B.E8.BD.BD.E5.92.8C.E5.BB.BA.E7.AB.8B_SDK">下载和建立 SDK</a>
</dd><dd> <a href="cn/%e5%88%9b%e5%bb%ba_XPCOM_%e7%bb%84%e4%bb%b6/%e5%bb%ba%e7%ab%8b_Gecko_SDK#.E7.BC.96.E8.AF.91.E4.B8.80.E4.B8.AA_Microsoft_Visual_Cpp_.E5.B7.A5.E7.A8.8B">编译一个 Microsoft Visual Cpp 工程</a>
<dl><dd> <a href="cn/%e5%88%9b%e5%bb%ba_XPCOM_%e7%bb%84%e4%bb%b6/%e5%bb%ba%e7%ab%8b_Gecko_SDK#.E5.88.9B.E5.BB.BA.E4.B8.80.E4.B8.AA.E6.96.B0.E7.9A.84.E5.B7.A5.E7.A8.8B">创建一个新的工程</a>
</dd><dd> <a href="cn/%e5%88%9b%e5%bb%ba_XPCOM_%e7%bb%84%e4%bb%b6/%e5%bb%ba%e7%ab%8b_Gecko_SDK#.E6.8A.8A_Gecko_SDK_.E6.B7.BB.E5.8A.A0.E5.88.B0.E5.B7.A5.E7.A8.8B.E8.AE.BE.E7.BD.AE">把 Gecko SDK 添加到工程设置</a>
</dd></dl>
</dd><dd> <a href="cn/%e5%88%9b%e5%bb%ba_XPCOM_%e7%bb%84%e4%bb%b6/%e5%bb%ba%e7%ab%8b_Gecko_SDK#Unix_.E4.B8.8B.E7.9A.84.E4.B8.80.E4.B8.AA_Makefile">Unix 下的一个 Makefile</a>
</dd></dl>
<h3 name=".E9.99.84.E5.BD.95B_-_.E8.B5.84.E6.BA.90"> <a href="cn/Creating_XPCOM_Components/Resources">附录B - 资源</a> </h3>
<dl><dd> <a href="cn/Creating_XPCOM_Components/Resources#WebLock_Resources">WebLock 资源</a>
</dd><dd> <a href="cn/Creating_XPCOM_Components/Resources#Gecko_Resources">Gecko 资源</a>
</dd><dd> <a href="cn/Creating_XPCOM_Components/Resources#XPCOM_Resources">XPCOM 资源</a>
</dd><dd> <a href="cn/Creating_XPCOM_Components/Resources#General_Development_Resources">General Development 资源</a>
</dd></dl>
<p>{{template.Next("创建 XPCOM 组件:前言")}}
{{template.CXCLicenseBlock()}}
</p>{{ wiki.languages( { "en": "en/Creating_XPCOM_Components" } ) }}
恢复到这个版本