aboutsummaryrefslogtreecommitdiff
path: root/files/fr/mozilla/tech/xpcom/guide/creating_components/index.html
blob: dbffe93c6e3c6baa680f16afb8ab41fdb5326f32 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
---
title: Créer des composants XPCOM
slug: Mozilla/Tech/XPCOM/Guide/Creating_components
translation_of: Mozilla/Tech/XPCOM/Guide/Creating_components
---
<p></p><div class="prevnext" style="text-align: right;">
    <p><a href="/fr/docs/Creating_XPCOM_Components/Preface">Suivant  »</a></p>
</div><p></p>

<p><span class="seoSummary">Ce guide a pour but de vous initier à Gecko, et de vous permettre de créer des composants <a href="https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XPCOM/Guide/Creating_components/en/XPCOM">XPCOM</a> pour les applications Gecko.</span> Bien que le principal objectif soit de vous permettre d'inclure du code C++ dans des composants utilisables dans Gecko, nous espérons pouvoir vous présenter tous les outils, techniques, et technologies qui constituent XPCOM. <span id="result_box" lang="fr"><span class="hps">En conséquence</span><span>,</span> c<span class="hps">e livre</span> <span class="hps">est agencé</span> <span class="hps">de telle sorte que</span> <span class="hps">vous puissiez </span><span class="hps">suivre</span> <span class="hps">et créer</span> <span class="hps">vos propres composants</span> <span class="hps">ou</span> <span class="hps">en apprendre davantage sur</span> <span class="hps">les différents</span> <span class="hps">sujets</span> <span class="hps">XPCOM</span> <span class="hps">individuellement</span><span>, comme un </span><span class="hps">ouvrage de référence</span><span>.</span></span> Par exemple, l'introduction inclue une analyse des composants, et le premier chapitre - dans lequel vous compilerez le code de base et vous l'enregistrerez avec Mozilla - explique la relation entre les composants et les modules, les interfaces XPCOM, et le processus d'enregistrement de manière générale.</p>

<div class="note">
<p><strong>Remarque:</strong> De manière générale, essayez d'éviter de créer des composants XPCOM. Les add-ons devraient utiliser le nouveau <a href="/en-US/Add-ons/SDK">Add-on SDK</a> autant que possible ; cependant, il est probable que dans certains cas cela soit inévitable.</p>
</div>

<div class="note">
<p><strong>Remarque :</strong> Cet article décrit une méthode qui utilise <a href="https://developer.mozilla.org/en-US/docs/Mozilla/XPIDL">xpidl</a> mais vous devriez plutôt utiliser <a href="https://developer.mozilla.org/en-US/docs/Mozilla/WebIDL_bindings">webidl</a>.</p>
</div>

<h3 id="Preface" name="Preface"><a href="https://developer.mozilla.org/fr/docs/Mozilla/Tech/XPCOM/Guide/Creating_components/Preface" title="/en-US/docs/Creating_XPCOM_Components/Preface">Preface</a></h3>

<dl>
 <dd><a href="https://developer.mozilla.org/fr/docs/Mozilla/Tech/XPCOM/Guide/Creating_components/Preface" title="/en-US/docs/Creating_XPCOM_Components/Preface#Who_Should_Read_This_Book">Pour qui est ce tutoriel</a></dd>
 <dd><a href="https://developer.mozilla.org/fr/docs/Mozilla/Tech/XPCOM/Guide/Creating_components/Preface" title="/en-US/docs/Creating_XPCOM_Components/Preface#Organization_of_the_Tutorial">Organisation du tutoriel</a></dd>
 <dd><a href="https://developer.mozilla.org/fr/docs/Mozilla/Tech/XPCOM/Guide/Creating_components/Preface" title="/en-US/docs/Creating_XPCOM_Components/Preface#Following_Along_with_the_Examples">En Pratique</a></dd>
 <dd><a href="https://developer.mozilla.org/fr/docs/Mozilla/Tech/XPCOM/Guide/Creating_components/Preface" title="/en-US/docs/Creating_XPCOM_Components/Preface#Conventions">Conventions</a></dd>
 <dd><a href="https://developer.mozilla.org/fr/docs/Mozilla/Tech/XPCOM/Guide/Creating_components/Preface" title="/en-US/docs/Creating_XPCOM_Components/Preface#Acknowledgements">Remerciements</a></dd>
</dl>

<h3 id="An_Overview_of_XPCOM" name="An_Overview_of_XPCOM"><a href="https://developer.mozilla.org/fr/docs/Mozilla/Tech/XPCOM/Guide/Creating_components/An_Overview_of_XPCOM" title="/en-US/docs/Creating_XPCOM_Components/An_Overview_of_XPCOM">Un aperçu de XPCOM</a></h3>

<dl>
 <dd><a href="https://developer.mozilla.org/fr/docs/Mozilla/Tech/XPCOM/Guide/Creating_components/An_Overview_of_XPCOM" title="/en-US/docs/Creating_XPCOM_Components/An_Overview_of_XPCOM#The_XPCOM_Solution">Solutions XPCOM</a></dd>
 <dd><a href="https://developer.mozilla.org/fr/docs/Mozilla/Tech/XPCOM/Guide/Creating_components/An_Overview_of_XPCOM" title="/en-US/docs/Creating_XPCOM_Components/An_Overview_of_XPCOM#Gecko">Gecko</a></dd>
 <dd><a href="https://developer.mozilla.org/fr/docs/Mozilla/Tech/XPCOM/Guide/Creating_components/An_Overview_of_XPCOM" title="/en-US/docs/Creating_XPCOM_Components/An_Overview_of_XPCOM#Components">Composants</a></dd>
 <dd><a href="https://developer.mozilla.org/fr/docs/Mozilla/Tech/XPCOM/Guide/Creating_components/An_Overview_of_XPCOM" title="/en-US/docs/Creating_XPCOM_Components/An_Overview_of_XPCOM#Interfaces">Interfaces</a>
 <dl>
  <dd><a href="https://developer.mozilla.org/fr/docs/Mozilla/Tech/XPCOM/Guide/Creating_components/An_Overview_of_XPCOM" title="/en-US/docs/Creating_XPCOM_Components/An_Overview_of_XPCOM#Interfaces_and_Encapsulation">Interfaces et Encapsulation</a></dd>
  <dd><a href="https://developer.mozilla.org/fr/docs/Mozilla/Tech/XPCOM/Guide/Creating_components/An_Overview_of_XPCOM" title="/en-US/docs/Creating_XPCOM_Components/An_Overview_of_XPCOM#The_nsISupports_Base_Interface">L'interface de base <code>nsISupports</code></a></dd>
 </dl>
 </dd>
 <dd><a href="https://developer.mozilla.org/fr/docs/Mozilla/Tech/XPCOM/Guide/Creating_components/An_Overview_of_XPCOM" title="/en-US/docs/Creating_XPCOM_Components/An_Overview_of_XPCOM#XPCOM_Identifiers">XPCOM Identifiers</a>
 <dl>
  <dd><a href="https://developer.mozilla.org/fr/docs/Mozilla/Tech/XPCOM/Guide/Creating_components/An_Overview_of_XPCOM" title="/en-US/docs/Creating_XPCOM_Components/An_Overview_of_XPCOM#CID">CID</a></dd>
  <dd><a href="https://developer.mozilla.org/fr/docs/Mozilla/Tech/XPCOM/Guide/Creating_components/An_Overview_of_XPCOM" title="/en-US/docs/Creating_XPCOM_Components/An_Overview_of_XPCOM#Contract_ID">Contract ID</a></dd>
 </dl>
 </dd>
 <dd><a href="https://developer.mozilla.org/fr/docs/Mozilla/Tech/XPCOM/Guide/Creating_components/An_Overview_of_XPCOM" title="/en-US/docs/Creating_XPCOM_Components/An_Overview_of_XPCOM#Factories">Factories</a>
 <dl>
  <dd><a href="https://developer.mozilla.org/fr/docs/Mozilla/Tech/XPCOM/Guide/Creating_components/An_Overview_of_XPCOM" title="/en-US/docs/Creating_XPCOM_Components/An_Overview_of_XPCOM#XPIDL_and_Type_Libraries">XPIDL et bibliothèques de types</a></dd>
 </dl>
 </dd>
 <dd><a href="https://developer.mozilla.org/fr/docs/Mozilla/Tech/XPCOM/Guide/Creating_components/An_Overview_of_XPCOM" title="/en-US/docs/Creating_XPCOM_Components/An_Overview_of_XPCOM#XPCOM_Services">XPCOM Services</a></dd>
 <dd><a href="https://developer.mozilla.org/fr/docs/Mozilla/Tech/XPCOM/Guide/Creating_components/An_Overview_of_XPCOM" title="/en-US/docs/Creating_XPCOM_Components/An_Overview_of_XPCOM#XPCOM_Types">XPCOM Types</a>
 <dl>
  <dd><a href="https://developer.mozilla.org/fr/docs/Mozilla/Tech/XPCOM/Guide/Creating_components/An_Overview_of_XPCOM" title="/en-US/docs/Creating_XPCOM_Components/An_Overview_of_XPCOM#Method_Types">Method Types</a></dd>
  <dd><a href="https://developer.mozilla.org/fr/docs/Mozilla/Tech/XPCOM/Guide/Creating_components/An_Overview_of_XPCOM" title="/en-US/docs/Creating_XPCOM_Components/An_Overview_of_XPCOM#Reference_Counting">Reference Counting</a></dd>
  <dd><a href="https://developer.mozilla.org/fr/docs/Mozilla/Tech/XPCOM/Guide/Creating_components/An_Overview_of_XPCOM" title="/en-US/docs/Creating_XPCOM_Components/An_Overview_of_XPCOM#Status_Codes">Status Codes</a></dd>
  <dd><a href="https://developer.mozilla.org/fr/docs/Mozilla/Tech/XPCOM/Guide/Creating_components/An_Overview_of_XPCOM" title="/en-US/docs/Creating_XPCOM_Components/An_Overview_of_XPCOM#Variable_Mappings">Variable Mappings</a></dd>
  <dd><a href="https://developer.mozilla.org/fr/docs/Mozilla/Tech/XPCOM/Guide/Creating_components/An_Overview_of_XPCOM" title="/en-US/docs/Creating_XPCOM_Components/An_Overview_of_XPCOM#Common_XPCOM_Error_Codes">Codes d'erreur XPCOM</a></dd>
 </dl>
 </dd>
</dl>

<h3 id="Using_XPCOM_Components" name="Using_XPCOM_Components"><a href="/en-US/docs/Creating_XPCOM_Components/Using_XPCOM_Components" title="/en-US/docs/Creating_XPCOM_Components/Using_XPCOM_Components">Utilisation des composants XPCOM</a></h3>

<dl>
 <dd><a href="/en-US/docs/Creating_XPCOM_Components/Using_XPCOM_Components#Component_Examples" title="/en-US/docs/Creating_XPCOM_Components/Using_XPCOM_Components#Component_Examples">Exemples de composants</a>

 <dl>
  <dd><a href="/en-US/docs/Creating_XPCOM_Components/Using_XPCOM_Components#Cookie_Manager" title="/en-US/docs/Creating_XPCOM_Components/Using_XPCOM_Components#Cookie_Manager">gestionnaire de cookies</a></dd>
  <dd><a href="/en-US/docs/Creating_XPCOM_Components/Using_XPCOM_Components#The_WebBrowserFind_Component" title="/en-US/docs/Creating_XPCOM_Components/Using_XPCOM_Components#The_WebBrowserFind_Component"><strong>WebBrowserFind</strong></a></dd>
  <dd><a href="/en-US/docs/Creating_XPCOM_Components/Using_XPCOM_Components#The_WebLock_Component" title="/en-US/docs/Creating_XPCOM_Components/Using_XPCOM_Components#The_WebLock_Component"><strong>WebLock</strong></a></dd>
 </dl>
 </dd>
 <dd><a href="/en-US/docs/Creating_XPCOM_Components/Using_XPCOM_Components#Component_Use_in_Mozilla" title="/en-US/docs/Creating_XPCOM_Components/Using_XPCOM_Components#Component_Use_in_Mozilla">Utilisation de composant dans Mozilla</a>
 <dl>
  <dd><a href="/en-US/docs/Creating_XPCOM_Components/Using_XPCOM_Components#Finding_Mozilla_Components" title="/en-US/docs/Creating_XPCOM_Components/Using_XPCOM_Components#Finding_Mozilla_Components">Trouver des composants Mozilla</a></dd>
  <dd><a href="/en-US/docs/Creating_XPCOM_Components/Using_XPCOM_Components#Using_XPCOM_Components_in_Your_Cpp" title="/en-US/docs/Creating_XPCOM_Components/Using_XPCOM_Components#Using_XPCOM_Components_in_Your_Cpp">Utilisation de composants XPCOM dans votre Cpp</a></dd>
  <dd><a href="/en-US/docs/Creating_XPCOM_Components/Using_XPCOM_Components#XPConnect:_Using_XPCOM_Components_From_Script" title="/en-US/docs/Creating_XPCOM_Components/Using_XPCOM_Components#XPConnect:_Using_XPCOM_Components_From_Script">XPConnect: Utilisation de XPCOM avec un Script</a></dd>
 </dl>
 </dd>
</dl>

<h3 id="Component_Internals" name="Component_Internals"><a href="/en-US/docs/Creating_XPCOM_Components/Component_Internals" title="/en-US/docs/Creating_XPCOM_Components/Component_Internals">Composants Internes</a></h3>

<dl>
 <dd><a href="/en-US/docs/Creating_XPCOM_Components/Component_Internals#Creating_Components_in_Cpp" title="/en-US/docs/Creating_XPCOM_Components/Component_Internals#Creating_Components_in_Cpp">Creation de composants dans  Cpp</a></dd>
 <dd><a href="/en-US/docs/Creating_XPCOM_Components/Component_Internals#XPCOM_Initialization" title="/en-US/docs/Creating_XPCOM_Components/Component_Internals#XPCOM_Initialization">XPCOM Initialization</a>
 <dl>
  <dd><a href="/en-US/docs/Creating_XPCOM_Components/Component_Internals#XPCOM_Registry_Manifests" title="/en-US/docs/Creating_XPCOM_Components/Component_Internals#XPCOM_Registry_Manifests">XPCOM Registry Manifests</a></dd>
  <dd><a href="/en-US/docs/Creating_XPCOM_Components/Component_Internals#Registration_Methods_in_XPCOM" title="/en-US/docs/Creating_XPCOM_Components/Component_Internals#Registration_Methods_in_XPCOM">Registration Methods in XPCOM</a></dd>
  <dd><a href="/en-US/docs/Creating_XPCOM_Components/Component_Internals#Autoregistration" title="/en-US/docs/Creating_XPCOM_Components/Component_Internals#Autoregistration">Autoregistration</a></dd>
  <dd><a href="/en-US/docs/Creating_XPCOM_Components/Component_Internals#The_Shutdown_Process" title="/en-US/docs/Creating_XPCOM_Components/Component_Internals#The_Shutdown_Process">The Shutdown Process</a></dd>
  <dd><a href="/en-US/docs/Creating_XPCOM_Components/Component_Internals#Three_Parts_of_a_XPCOM_Component_Library" title="/en-US/docs/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="/en-US/docs/Creating_XPCOM_Components/Component_Internals#XPCOM_Glue" title="/en-US/docs/Creating_XPCOM_Components/Component_Internals#XPCOM_Glue">XPCOM Glue</a>
 <dl>
  <dd><a href="/en-US/docs/Creating_XPCOM_Components/Component_Internals#The_Glue_Library" title="/en-US/docs/Creating_XPCOM_Components/Component_Internals#The_Glue_Library">The Glue Library</a></dd>
  <dd><a href="/en-US/docs/Creating_XPCOM_Components/Component_Internals#XPCOM_String_Classes" title="/en-US/docs/Creating_XPCOM_Components/Component_Internals#XPCOM_String_Classes">XPCOM String Classes</a></dd>
 </dl>
 </dd>
</dl>

<h3 id="Creating_the_Component_Code" name="Creating_the_Component_Code"><a href="/en-US/docs/Creating_XPCOM_Components/Creating_the_Component_Code" title="/en-US/docs/Creating_XPCOM_Components/Creating_the_Component_Code">Creating the Component Code</a></h3>

<dl>
 <dd><a href="/en-US/docs/Creating_XPCOM_Components/Creating_the_Component_Code#What_We.27ll_Be_Working_On" title="/en-US/docs/Creating_XPCOM_Components/Creating_the_Component_Code#What_We.27ll_Be_Working_On">What We'll Be Working On</a></dd>
 <dd><a href="/en-US/docs/Creating_XPCOM_Components/Creating_the_Component_Code#Component_Registration" title="/en-US/docs/Creating_XPCOM_Components/Creating_the_Component_Code#Component_Registration">Component Registration</a>
 <dl>
  <dd><a href="/en-US/docs/Creating_XPCOM_Components/Creating_the_Component_Code#The_regxpcom_Program" title="/en-US/docs/Creating_XPCOM_Components/Creating_the_Component_Code#The_regxpcom_Program">The <code>regxpcom</code> Program</a></dd>
  <dd><a href="/en-US/docs/Creating_XPCOM_Components/Creating_the_Component_Code#Registration_Alternatives" title="/en-US/docs/Creating_XPCOM_Components/Creating_the_Component_Code#Registration_Alternatives">Registration Alternatives</a></dd>
 </dl>
 </dd>
 <dd><a href="/en-US/docs/Creating_XPCOM_Components/Creating_the_Component_Code#Overview_of_the_WebLock_Module_Source" title="/en-US/docs/Creating_XPCOM_Components/Creating_the_Component_Code#Overview_of_the_WebLock_Module_Source">Overview of the <strong>WebLock</strong> Module Source</a></dd>
 <dd><a href="/en-US/docs/Creating_XPCOM_Components/Creating_the_Component_Code#Digging_In:_Required_Includes_and_Constants" title="/en-US/docs/Creating_XPCOM_Components/Creating_the_Component_Code#Digging_In:_Required_Includes_and_Constants">Digging In: Required Includes and Constants</a>
 <dl>
  <dd><a href="/en-US/docs/Creating_XPCOM_Components/Creating_the_Component_Code#Identifiers_in_XPCOM" title="/en-US/docs/Creating_XPCOM_Components/Creating_the_Component_Code#Identifiers_in_XPCOM">Identifiers in XPCOM</a></dd>
  <dd><a href="/en-US/docs/Creating_XPCOM_Components/Creating_the_Component_Code#Coding_for_the_Registration_Process" title="/en-US/docs/Creating_XPCOM_Components/Creating_the_Component_Code#Coding_for_the_Registration_Process">Coding for the Registration Process</a></dd>
  <dd><a href="/en-US/docs/Creating_XPCOM_Components/Creating_the_Component_Code#The_Registration_Methods" title="/en-US/docs/Creating_XPCOM_Components/Creating_the_Component_Code#The_Registration_Methods">The Registration Methods</a></dd>
  <dd><a href="/en-US/docs/Creating_XPCOM_Components/Creating_the_Component_Code#Creating_an_Instance_of_Your_Component" title="/en-US/docs/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="/en-US/docs/Creating_XPCOM_Components/Creating_the_Component_Code#webLock1.cpp" title="/en-US/docs/Creating_XPCOM_Components/Creating_the_Component_Code#webLock1.cpp"><code>webLock1.cpp</code></a></dd>
</dl>

<h3 id="Using_XPCOM_Utilities_to_Make_Things_Easier" name="Using_XPCOM_Utilities_to_Make_Things_Easier"><a href="/en-US/docs/Creating_XPCOM_Components/Using_XPCOM_Utilities_to_Make_Things_Easier" title="/en-US/docs/Creating_XPCOM_Components/Using_XPCOM_Utilities_to_Make_Things_Easier">Using XPCOM Utilities to Make Things Easier</a></h3>

<dl>
 <dd><a href="/en-US/docs/Creating_XPCOM_Components/Using_XPCOM_Utilities_to_Make_Things_Easier#XPCOM_Macros" title="/en-US/docs/Creating_XPCOM_Components/Using_XPCOM_Utilities_to_Make_Things_Easier#XPCOM_Macros">XPCOM Macros</a>

 <dl>
  <dd><a href="/en-US/docs/Creating_XPCOM_Components/Using_XPCOM_Utilities_to_Make_Things_Easier#Generic_XPCOM_Module_Macros" title="/en-US/docs/Creating_XPCOM_Components/Using_XPCOM_Utilities_to_Make_Things_Easier#Generic_XPCOM_Module_Macros">Generic XPCOM Module Macros</a></dd>
  <dd><a href="/en-US/docs/Creating_XPCOM_Components/Using_XPCOM_Utilities_to_Make_Things_Easier#Common_Implementation_Macros" title="/en-US/docs/Creating_XPCOM_Components/Using_XPCOM_Utilities_to_Make_Things_Easier#Common_Implementation_Macros">Common Implementation Macros</a></dd>
  <dd><a href="/en-US/docs/Creating_XPCOM_Components/Using_XPCOM_Utilities_to_Make_Things_Easier#Declaration_Macros" title="/en-US/docs/Creating_XPCOM_Components/Using_XPCOM_Utilities_to_Make_Things_Easier#Declaration_Macros">Declaration Macros</a></dd>
 </dl>
 </dd>
 <dd><a href="/en-US/docs/Creating_XPCOM_Components/Using_XPCOM_Utilities_to_Make_Things_Easier#webLock2.cpp" title="/en-US/docs/Creating_XPCOM_Components/Using_XPCOM_Utilities_to_Make_Things_Easier#webLock2.cpp"><code>webLock2.cpp</code></a></dd>
 <dd><a href="/en-US/docs/Creating_XPCOM_Components/Using_XPCOM_Utilities_to_Make_Things_Easier#String_Classes_in_XPCOM" title="/en-US/docs/Creating_XPCOM_Components/Using_XPCOM_Utilities_to_Make_Things_Easier#String_Classes_in_XPCOM">String Classes in XPCOM</a>
 <dl>
  <dd><a href="/en-US/docs/Creating_XPCOM_Components/Using_XPCOM_Utilities_to_Make_Things_Easier#Using_Strings" title="/en-US/docs/Creating_XPCOM_Components/Using_XPCOM_Utilities_to_Make_Things_Easier#Using_Strings">Using Strings</a></dd>
  <dd><a href="/en-US/docs/Creating_XPCOM_Components/Using_XPCOM_Utilities_to_Make_Things_Easier#nsEmbedString_and_nsEmbedCString" title="/en-US/docs/Creating_XPCOM_Components/Using_XPCOM_Utilities_to_Make_Things_Easier#nsEmbedString_and_nsEmbedCString"><code>nsEmbedString</code> and <code>nsEmbedCString</code></a></dd>
 </dl>
 </dd>
 <dd><a href="/en-US/docs/Creating_XPCOM_Components/Using_XPCOM_Utilities_to_Make_Things_Easier#Smart_Pointers" title="/en-US/docs/Creating_XPCOM_Components/Using_XPCOM_Utilities_to_Make_Things_Easier#Smart_Pointers">Smart Pointers</a></dd>
</dl>

<h3 id="Starting_WebLock" name="Starting_WebLock"><a href="/en-US/docs/Creating_XPCOM_Components/Starting_WebLock" title="/en-US/docs/Creating_XPCOM_Components/Starting_WebLock">Starting <strong>WebLock</strong></a></h3>

<dl>
 <dd><a href="/en-US/docs/Creating_XPCOM_Components/Starting_WebLock#Getting_Called_at_Startup" title="/en-US/docs/Creating_XPCOM_Components/Starting_WebLock#Getting_Called_at_Startup">Getting Called at Startup</a>

 <dl>
  <dd><a href="/en-US/docs/Creating_XPCOM_Components/Starting_WebLock#Registering_for_Notifications" title="/en-US/docs/Creating_XPCOM_Components/Starting_WebLock#Registering_for_Notifications">Registering for Notifications</a></dd>
  <dd><a href="/en-US/docs/Creating_XPCOM_Components/Starting_WebLock#Getting_Access_to_the_Category_Manager" title="/en-US/docs/Creating_XPCOM_Components/Starting_WebLock#Getting_Access_to_the_Category_Manager">Getting Access to the Category Manager</a></dd>
 </dl>
 </dd>
 <dd><a href="/en-US/docs/Creating_XPCOM_Components/Starting_WebLock#Providing_Access_to_WebLock" title="/en-US/docs/Creating_XPCOM_Components/Starting_WebLock#Providing_Access_to_WebLock">Providing Access to <strong>WebLock</strong></a></dd>
 <dd><a href="/en-US/docs/Creating_XPCOM_Components/Starting_WebLock#Creating_the_WebLock_Programming_Interface" title="/en-US/docs/Creating_XPCOM_Components/Starting_WebLock#Creating_the_WebLock_Programming_Interface">Creating the <strong>WebLock</strong> Programming Interface</a></dd>
 <dd><a href="/en-US/docs/Creating_XPCOM_Components/Starting_WebLock#Defining_the_WebLock_Interface_in_XPIDL" title="/en-US/docs/Creating_XPCOM_Components/Starting_WebLock#Defining_the_WebLock_Interface_in_XPIDL">Defining the <strong>WebLock</strong> Interface in XPIDL</a>
 <dl>
  <dd><a href="/en-US/docs/Creating_XPCOM_Components/Starting_WebLock#The_XPIDL_Syntax" title="/en-US/docs/Creating_XPCOM_Components/Starting_WebLock#The_XPIDL_Syntax">The XPIDL Syntax</a></dd>
  <dd><a href="/en-US/docs/Creating_XPCOM_Components/Starting_WebLock#Scriptable_Interfaces" title="/en-US/docs/Creating_XPCOM_Components/Starting_WebLock#Scriptable_Interfaces">Scriptable Interfaces</a></dd>
  <dd><a href="/en-US/docs/Creating_XPCOM_Components/Starting_WebLock#Subclassing_nsISupports" title="/en-US/docs/Creating_XPCOM_Components/Starting_WebLock#Subclassing_nsISupports">Subclassing <code>nsISupports</code></a></dd>
  <dd><a href="/en-US/docs/Creating_XPCOM_Components/Starting_WebLock#The_Web_Locking_Interface" title="/en-US/docs/Creating_XPCOM_Components/Starting_WebLock#The_Web_Locking_Interface">The Web Locking Interface</a></dd>
 </dl>
 </dd>
 <dd><a href="/en-US/docs/Creating_XPCOM_Components/Starting_WebLock#Implementing_WebLock" title="/en-US/docs/Creating_XPCOM_Components/Starting_WebLock#Implementing_WebLock">Implementing <strong>WebLock</strong></a>
 <dl>
  <dd><a href="/en-US/docs/Creating_XPCOM_Components/Starting_WebLock#Declaration_Macros" title="/en-US/docs/Creating_XPCOM_Components/Starting_WebLock#Declaration_Macros">Declaration Macros</a></dd>
  <dd><a href="/en-US/docs/Creating_XPCOM_Components/Starting_WebLock#Representing_Return_Values_in_XPCOM" title="/en-US/docs/Creating_XPCOM_Components/Starting_WebLock#Representing_Return_Values_in_XPCOM">Representing Return Values in XPCOM</a></dd>
  <dd><a href="/en-US/docs/Creating_XPCOM_Components/Starting_WebLock#XPIDL_Code_Generation" title="/en-US/docs/Creating_XPCOM_Components/Starting_WebLock#XPIDL_Code_Generation">XPIDL Code Generation</a></dd>
  <dd><a href="/en-US/docs/Creating_XPCOM_Components/Starting_WebLock#Getting_the_WebLock_Service_from_a_Client" title="/en-US/docs/Creating_XPCOM_Components/Starting_WebLock#Getting_the_WebLock_Service_from_a_Client">Getting the <strong>WebLock</strong> Service from a Client</a></dd>
  <dd><a href="/en-US/docs/Creating_XPCOM_Components/Starting_WebLock#Implementing_the_iWebLock_Interface" title="/en-US/docs/Creating_XPCOM_Components/Starting_WebLock#Implementing_the_iWebLock_Interface">Implementing the <code>iWebLock</code> Interface</a></dd>
  <dd><a href="/en-US/docs/Creating_XPCOM_Components/Starting_WebLock#The_Directory_Service" title="/en-US/docs/Creating_XPCOM_Components/Starting_WebLock#The_Directory_Service">The Directory Service</a></dd>
  <dd><a href="/en-US/docs/Creating_XPCOM_Components/Starting_WebLock#Modifying_Paths_with_nsIFile" title="/en-US/docs/Creating_XPCOM_Components/Starting_WebLock#Modifying_Paths_with_nsIFile">Modifying Paths with <code>nsIFile</code></a></dd>
  <dd><a href="/en-US/docs/Creating_XPCOM_Components/Starting_WebLock#Manipulating_Files_with_nsIFile" title="/en-US/docs/Creating_XPCOM_Components/Starting_WebLock#Manipulating_Files_with_nsIFile">Manipulating Files with <code>nsIFile</code></a></dd>
  <dd><a href="/en-US/docs/Creating_XPCOM_Components/Starting_WebLock#Using_nsILocalFile_for_Reading_Data" title="/en-US/docs/Creating_XPCOM_Components/Starting_WebLock#Using_nsILocalFile_for_Reading_Data">Using <code>nsILocalFile</code> for Reading Data</a></dd>
  <dd><a href="/en-US/docs/Creating_XPCOM_Components/Starting_WebLock#Processing_the_White_List_Data" title="/en-US/docs/Creating_XPCOM_Components/Starting_WebLock#Processing_the_White_List_Data">Processing the White List Data</a></dd>
 </dl>
 </dd>
 <dd><a href="/en-US/docs/Creating_XPCOM_Components/Starting_WebLock#iWebLock_Method_By_Method" title="/en-US/docs/Creating_XPCOM_Components/Starting_WebLock#iWebLock_Method_By_Method"><code>iWebLock</code> Method By Method</a>
 <dl>
  <dd><a href="/en-US/docs/Creating_XPCOM_Components/Starting_WebLock#Lock_and_Unlock" title="/en-US/docs/Creating_XPCOM_Components/Starting_WebLock#Lock_and_Unlock"><code>Lock</code> and <code>Unlock</code></a></dd>
  <dd><a href="/en-US/docs/Creating_XPCOM_Components/Starting_WebLock#AddSite" title="/en-US/docs/Creating_XPCOM_Components/Starting_WebLock#AddSite"><code>AddSite</code></a></dd>
  <dd><a href="/en-US/docs/Creating_XPCOM_Components/Starting_WebLock#RemoveSite" title="/en-US/docs/Creating_XPCOM_Components/Starting_WebLock#RemoveSite"><code>RemoveSite</code></a></dd>
  <dd><a href="/en-US/docs/Creating_XPCOM_Components/Starting_WebLock#SetSites" title="/en-US/docs/Creating_XPCOM_Components/Starting_WebLock#SetSites"><code>SetSites</code></a></dd>
  <dd><a href="/en-US/docs/Creating_XPCOM_Components/Starting_WebLock#GetNext" title="/en-US/docs/Creating_XPCOM_Components/Starting_WebLock#GetNext"><code>GetNext</code></a></dd>
  <dd><a href="/en-US/docs/Creating_XPCOM_Components/Starting_WebLock#GetSites" title="/en-US/docs/Creating_XPCOM_Components/Starting_WebLock#GetSites"><code>GetSites</code></a></dd>
  <dd><a href="/en-US/docs/Creating_XPCOM_Components/Starting_WebLock#HasMoreElements" title="/en-US/docs/Creating_XPCOM_Components/Starting_WebLock#HasMoreElements"><code>HasMoreElements</code></a></dd>
 </dl>
 </dd>
</dl>

<h3 id="Finishing_the_Component" name="Finishing_the_Component"><a href="/en-US/docs/Creating_XPCOM_Components/Finishing_the_Component" title="/en-US/docs/Creating_XPCOM_Components/Finishing_the_Component">Finishing the Component</a></h3>

<dl>
 <dd><a href="/en-US/docs/Creating_XPCOM_Components/Finishing_the_Component#Using_Frozen_Interfaces" title="/en-US/docs/Creating_XPCOM_Components/Finishing_the_Component#Using_Frozen_Interfaces">Using Frozen Interfaces</a>

 <dl>
  <dd><a href="/en-US/docs/Creating_XPCOM_Components/Finishing_the_Component#Copying_Interfaces_Into_Your_Build_Environment" title="/en-US/docs/Creating_XPCOM_Components/Finishing_the_Component#Copying_Interfaces_Into_Your_Build_Environment">Copying Interfaces Into Your Build Environment</a></dd>
  <dd><a href="/en-US/docs/Creating_XPCOM_Components/Finishing_the_Component#Implementing_the_nsIContentPolicy_Interface" title="/en-US/docs/Creating_XPCOM_Components/Finishing_the_Component#Implementing_the_nsIContentPolicy_Interface">Implementing the <code>nsIContentPolicy</code> Interface</a></dd>
  <dd><a href="/en-US/docs/Creating_XPCOM_Components/Finishing_the_Component#Receiving_Notifications" title="/en-US/docs/Creating_XPCOM_Components/Finishing_the_Component#Receiving_Notifications">Receiving Notifications</a></dd>
 </dl>
 </dd>
 <dd><a href="/en-US/docs/Creating_XPCOM_Components/Finishing_the_Component#Implementing_the_nsIContentPolicy" title="/en-US/docs/Creating_XPCOM_Components/Finishing_the_Component#Implementing_the_nsIContentPolicy">Implementing the <code>nsIContentPolicy</code></a>
 <dl>
  <dd><a href="/en-US/docs/Creating_XPCOM_Components/Finishing_the_Component#Uniform_Resource_Locators" title="/en-US/docs/Creating_XPCOM_Components/Finishing_the_Component#Uniform_Resource_Locators">Uniform Resource Locators</a></dd>
  <dd><a href="/en-US/docs/Creating_XPCOM_Components/Finishing_the_Component#Checking_the_White_List" title="/en-US/docs/Creating_XPCOM_Components/Finishing_the_Component#Checking_the_White_List">Checking the White List</a></dd>
  <dd><a href="/en-US/docs/Creating_XPCOM_Components/Finishing_the_Component#Creating_nsIURI_Objects" title="/en-US/docs/Creating_XPCOM_Components/Finishing_the_Component#Creating_nsIURI_Objects">Creating <code>nsIURI</code> Objects</a></dd>
 </dl>
 </dd>
</dl>

<h3 id="Building_the_WebLock_UI" name="Building_the_WebLock_UI"><a href="/en-US/docs/Creating_XPCOM_Components/Building_the_WebLock_UI" title="/en-US/docs/Creating_XPCOM_Components/Building_the_WebLock_UI">Building the <strong>WebLock</strong> UI</a></h3>

<dl>
 <dd><a href="/en-US/docs/Creating_XPCOM_Components/Building_the_WebLock_UI#User_Interface_Package_List" title="/en-US/docs/Creating_XPCOM_Components/Building_the_WebLock_UI#User_Interface_Package_List">User Interface Package List</a></dd>
 <dd><a href="/en-US/docs/Creating_XPCOM_Components/Building_the_WebLock_UI#Client_Code_Overview" title="/en-US/docs/Creating_XPCOM_Components/Building_the_WebLock_UI#Client_Code_Overview">Client Code Overview</a></dd>
 <dd><a href="/en-US/docs/Creating_XPCOM_Components/Building_the_WebLock_UI#XUL" title="/en-US/docs/Creating_XPCOM_Components/Building_the_WebLock_UI#XUL">XUL</a>
 <dl>
  <dd><a href="/en-US/docs/Creating_XPCOM_Components/Building_the_WebLock_UI#The_XUL_Document" title="/en-US/docs/Creating_XPCOM_Components/Building_the_WebLock_UI#The_XUL_Document">The XUL Document</a></dd>
  <dd><a href="/en-US/docs/Creating_XPCOM_Components/Building_the_WebLock_UI#The_Locking_UI" title="/en-US/docs/Creating_XPCOM_Components/Building_the_WebLock_UI#The_Locking_UI">The Locking UI</a></dd>
  <dd><a href="/en-US/docs/Creating_XPCOM_Components/Building_the_WebLock_UI#Site_Adding_UI" title="/en-US/docs/Creating_XPCOM_Components/Building_the_WebLock_UI#Site_Adding_UI">Site Adding UI</a></dd>
  <dd><a href="/en-US/docs/Creating_XPCOM_Components/Building_the_WebLock_UI#weblock.xul" title="/en-US/docs/Creating_XPCOM_Components/Building_the_WebLock_UI#weblock.xul"><code>weblock.xul</code></a></dd>
 </dl>
 </dd>
 <dd><a href="/en-US/docs/Creating_XPCOM_Components/Building_the_WebLock_UI#Overlaying_New_User_Interface_Into_Mozilla" title="/en-US/docs/Creating_XPCOM_Components/Building_the_WebLock_UI#Overlaying_New_User_Interface_Into_Mozilla">Overlaying New User Interface Into Mozilla</a>
 <dl>
  <dd><a href="/en-US/docs/Creating_XPCOM_Components/Building_the_WebLock_UI#webLockOverlay.xul" title="/en-US/docs/Creating_XPCOM_Components/Building_the_WebLock_UI#webLockOverlay.xul"><code>webLockOverlay.xul</code></a></dd>
 </dl>
 </dd>
 <dd><a href="/en-US/docs/Creating_XPCOM_Components/Building_the_WebLock_UI#Other_Resources" title="/en-US/docs/Creating_XPCOM_Components/Building_the_WebLock_UI#Other_Resources">Other Resources</a>
 <dl>
  <dd><a href="/en-US/docs/Creating_XPCOM_Components/Building_the_WebLock_UI#weblock.css" title="/en-US/docs/Creating_XPCOM_Components/Building_the_WebLock_UI#weblock.css"><code>weblock.css</code></a></dd>
  <dd><a href="/en-US/docs/Creating_XPCOM_Components/Building_the_WebLock_UI#Image_Resources" title="/en-US/docs/Creating_XPCOM_Components/Building_the_WebLock_UI#Image_Resources">Image Resources</a></dd>
 </dl>
 </dd>
</dl>

<h3 id="Packaging_WebLock" name="Packaging_WebLock"><a href="/en-US/docs/Creating_XPCOM_Components/Packaging_WebLock" title="/en-US/docs/Creating_XPCOM_Components/Packaging_WebLock">Packaging WebLock</a></h3>

<dl>
 <dd><a href="/en-US/docs/Creating_XPCOM_Components/Packaging_WebLock#Component_Installation_Overview" title="/en-US/docs/Creating_XPCOM_Components/Packaging_WebLock#Component_Installation_Overview">Component Installation Overview</a></dd>
 <dd><a href="/en-US/docs/Creating_XPCOM_Components/Packaging_WebLock#Archiving_Resources" title="/en-US/docs/Creating_XPCOM_Components/Packaging_WebLock#Archiving_Resources">Archiving Resources</a></dd>
 <dd><a href="/en-US/docs/Creating_XPCOM_Components/Packaging_WebLock#The_WebLock_Installation_Script" title="/en-US/docs/Creating_XPCOM_Components/Packaging_WebLock#The_WebLock_Installation_Script">The <strong>WebLock</strong> Installation Script</a></dd>
 <dd><a href="/en-US/docs/Creating_XPCOM_Components/Packaging_WebLock#The_WebLock_Trigger_Script" title="/en-US/docs/Creating_XPCOM_Components/Packaging_WebLock#The_WebLock_Trigger_Script">The <strong>WebLock</strong> Trigger Script</a></dd>
 <dd><a href="/en-US/docs/Creating_XPCOM_Components/Packaging_WebLock#Distributing_Your_Component" title="/en-US/docs/Creating_XPCOM_Components/Packaging_WebLock#Distributing_Your_Component">Distributing Your Component</a></dd>
</dl>

<h3 id="Appendix_A_-_Setting_up_the_Gecko_SDK" name="Appendix_A_-_Setting_up_the_Gecko_SDK"><a href="/en-US/docs/Creating_XPCOM_Components/Setting_up_the_Gecko_SDK" title="/en-US/docs/Creating_XPCOM_Components/Setting_up_the_Gecko_SDK">Appendix A - Setting up the Gecko SDK</a></h3>

<dl>
 <dd><a href="/en-US/docs/Creating_XPCOM_Components/Setting_up_the_Gecko_SDK#Downloading_and_Setting_the_SDK" title="/en-US/docs/Creating_XPCOM_Components/Setting_up_the_Gecko_SDK#Downloading_and_Setting_the_SDK">Downloading and Setting the SDK</a></dd>
 <dd><a href="/en-US/docs/Creating_XPCOM_Components/Setting_up_the_Gecko_SDK#Building_a_Microsoft_Visual_Cpp_Project" title="/en-US/docs/Creating_XPCOM_Components/Setting_up_the_Gecko_SDK#Building_a_Microsoft_Visual_Cpp_Project">Building a Microsoft Visual Cpp Project</a>
 <dl>
  <dd><a href="/en-US/docs/Creating_XPCOM_Components/Setting_up_the_Gecko_SDK#Creating_a_New_Project" title="/en-US/docs/Creating_XPCOM_Components/Setting_up_the_Gecko_SDK#Creating_a_New_Project">Creating a New Project</a></dd>
  <dd><a href="/en-US/docs/Creating_XPCOM_Components/Setting_up_the_Gecko_SDK#Adding_the_Gecko_SDK_to_the_Project_Settings" title="/en-US/docs/Creating_XPCOM_Components/Setting_up_the_Gecko_SDK#Adding_the_Gecko_SDK_to_the_Project_Settings">Adding the Gecko SDK to the Project Settings</a></dd>
 </dl>
 </dd>
 <dd><a href="/en-US/docs/Creating_XPCOM_Components/Setting_up_the_Gecko_SDK#Building_a_Windows_Project" title="/en-US/docs/Creating XPCOM Components/Setting up the Gecko SDK#Building a Windows Project">Building a Windows Project</a></dd>
 <dd><a href="/en-US/docs/Creating_XPCOM_Components/Setting_up_the_Gecko_SDK#A_Makefile_for_Unix" title="/en-US/docs/Creating_XPCOM_Components/Setting_up_the_Gecko_SDK#A_Makefile_for_Unix">A Makefile for Unix</a></dd>
</dl>

<h3 id="Appendix_B_-_Resources" name="Appendix_B_-_Resources"><a href="/en-US/docs/Creating_XPCOM_Components/Resources" title="/en-US/docs/Creating_XPCOM_Components/Resources">Appendix B - Resources</a></h3>

<dl>
 <dd><a href="/en-US/docs/Creating_XPCOM_Components/Resources#WebLock_Resources" title="/en-US/docs/Creating_XPCOM_Components/Resources#WebLock_Resources">WebLock Resources</a></dd>
 <dd><a href="/en-US/docs/Creating_XPCOM_Components/Resources#Gecko_Resources" title="/en-US/docs/Creating_XPCOM_Components/Resources#Gecko_Resources">Gecko Resources</a></dd>
 <dd><a href="/en-US/docs/Creating_XPCOM_Components/Resources#XPCOM_Resources" title="/en-US/docs/Creating_XPCOM_Components/Resources#XPCOM_Resources">XPCOM Resources</a></dd>
 <dd><a href="/en-US/docs/Creating_XPCOM_Components/Resources#General_Development_Resources" title="/en-US/docs/Creating_XPCOM_Components/Resources#General_Development_Resources">General Development Resources</a></dd>
</dl>

<p></p><div class="prevnext" style="text-align: right;">
    <p><a href="/fr/docs/Creating_XPCOM_Components/Preface">Suivant  »</a></p>
</div> <p></p><div class="licenseblock">
<p>Copyright (c) 2003 by Doug Turner and Ian Oeschger. This material may be distributed only subject to the terms and conditions set forth in the <a class="external" href="http://www.opencontent.org/openpub/" rel="noopener">Open Publication License</a>, v1.02 or later. Distribution of substantively modified versions of this document is prohibited without the explicit permission of the copyright holder. Distribution of the work or derivative of the work in any standard (paper) book form is prohibited unless prior permission is obtained from the copyright holder.</p>
</div><p></p>

<p></p>