diff options
Diffstat (limited to 'files/pt-pt/mozilla/tech')
9 files changed, 0 insertions, 801 deletions
diff --git a/files/pt-pt/mozilla/tech/index.html b/files/pt-pt/mozilla/tech/index.html deleted file mode 100644 index 36bcd94c3a..0000000000 --- a/files/pt-pt/mozilla/tech/index.html +++ /dev/null @@ -1,14 +0,0 @@ ---- -title: Tecnologias da Mozilla -slug: Mozilla/Tech -tags: - - Landing - - Mozilla - - Referencia - - TopicStub - - XUL -translation_of: Mozilla/Tech ---- -<p>A Mozilla tem várias tecnologias, utilizadas como componentes dos seus projetos. Estas estão documentadas aqui.</p> - -<p>{{LandingPageListSubpages}}</p> diff --git a/files/pt-pt/mozilla/tech/places/index.html b/files/pt-pt/mozilla/tech/places/index.html deleted file mode 100644 index 18e2e0cd95..0000000000 --- a/files/pt-pt/mozilla/tech/places/index.html +++ /dev/null @@ -1,75 +0,0 @@ ---- -title: Places -slug: Mozilla/Tech/Places -tags: - - Desenvolvimento da Mozilla - - Extensões - - Extras - - Places -translation_of: Mozilla/Tech/Places ---- -<p>{{ Fx_minversion_header(3) }}</p> - -<p><strong>Places</strong> é o sistema de gestão de marcadores e histórico introduzido no Firefox 3. It offers increased flexibility and complex querying to make handling the places the user goes easier and more convenient. It also includes new features including favicon storage and the ability to annotate pages with arbitrary information. It also introduces new user interfaces for managing all this information; see {{ interwiki('wikimo', 'Places', 'Places on the Mozilla wiki') }}.</p> - -<p>Places armazena os seus dados numa base de dados <a class="external" href="http://sqlite.org/">SQLite</a>, utilizando as interfaces de <a href="/pt-PT/docs/Mozilla/Tech/XPCOM/Armazenamento" title="Storage">mozStorage</a>.</p> - -<table class="topicpage-table"> - <tbody> - <tr> - <td> - <h2 class="Documentation" id="Documentation" name="Documentation">Documentação</h2> - - <dl> - <dt><a href="/en-US/docs/Places_Developer_Guide" title="Places_Developer_Guide">Places migration guide</a></dt> - <dd>Migrating existing code to use the Places API.</dd> - <dt><a href="/en-US/docs/Manipulating_bookmarks_using_Places" title="Manipulating_bookmarks_using_Places">Manipulating bookmarks using Places</a></dt> - <dd>Examples for how to work with bookmarks using the Places API.</dd> - <dt><a href="/en-US/docs/Using_the_Places_tagging_service" title="Using_the_Places_tagging_service">Using the Places tagging service</a></dt> - <dd>How to use the tagging service.</dd> - <dt><a href="/en-US/docs/Using_the_Places_history_service" title="Using_the_Places_history_service">Using the Places history service</a></dt> - <dd>How to access history information using the Places API.</dd> - <dt><a href="/en-US/docs/Using_the_Places_favicon_service" title="Using_the_Places_favicon_service">Using the Places favicon service</a></dt> - <dd>How to manipulate favicons using the Places API.</dd> - <dt><a href="/en-US/docs/Using_the_Places_livemark_service" title="Using_the_Places_livemark_service">Using the Places livemark service</a></dt> - <dd>How to create and manage livemarks.</dd> - <dt><a href="/en-US/docs/Using_the_Places_annotation_service" title="Using_the_Places_annotation_service">Using the Places annotation service</a></dt> - <dd>How to work with the annotation service.</dd> - <dt><a href="/en-US/docs/Mozilla/Tech/Places/Using_the_Places_keywords_API">Using the Places keywords API</a></dt> - <dd>How to manage Places keywords</dd> - </dl> - - <dl> - <dt><a href="/en-US/docs/Querying_Places" title="Querying_Places">Querying Places</a></dt> - <dd>How to query the bookmarks and history system with specific parameters.</dd> - <dt><a href="/en-US/docs/Retrieving_part_of_the_bookmarks_tree" title="Retrieving_part_of_the_bookmarks_tree">Retrieving part of the bookmarks tree</a></dt> - <dd>How to fetch a section of the bookmarks tree using queries.</dd> - <dt><a href="/en-US/docs/Displaying_Places_information_using_views" title="Displaying_Places_information_using_views">Displaying Places information using views</a></dt> - <dd>How to use Places views to display Places data in your own applications or extensions.</dd> - <dt><a href="/en-US/docs/Places_utilities_for_JavaScript" title="Places_utilities_for_JavaScript">Places utilities for JavaScript</a></dt> - <dd>A library of convenient routines that make it easier to work with Places.</dd> - <dt><a href="/en-US/docs/Mozilla/Tech/Places/places.sqlite_Database_Troubleshooting">Places Database troubleshooting</a></dt> - <dd>How to deal with a corrupt places.sqlite database.</dd> - </dl> - - <p><span class="alllinks"><a href="/en-US/docs/tag/Places" title="tag/Places">View All...</a></span></p> - </td> - <td> - <h2 class="Related_Topics" id="Design_documents" name="Design_documents">Design documents</h2> - - <dl> - <dt><a href="/en-US/docs/The_Places_database" title="The_Places_database">The Places database</a></dt> - <dd>High-level overview of the Places database design.</dd> - <dt><a href="/en-US/docs/Places/History_Service_Design" title="Places/History_Service_Design">History Service Design</a></dt> - <dd>Design of the history service.</dd> - <dt><a href="/en-US/docs/Places/Bookmarks_Service/Design" title="Places/Bookmarks_Service/Design">Bookmark Service Design</a></dt> - <dd>Design of the bookmarks service.</dd> - <dt><a href="/en-US/docs/Places/Annotation_Service/Design" title="Places/Annotation_Service/Design">Annotation Service Design</a></dt> - <dd>Design of the annotation service.</dd> - <dt><a href="/en-US/docs/The_Places_frecency_algorithm" title="The_Places_frecency_algorithm">The Places "frecency" algorithm</a></dt> - <dd>The algorithm behind the Places location bar (sometimes called the "awesomebar").</dd> - </dl> - </td> - </tr> - </tbody> -</table> diff --git a/files/pt-pt/mozilla/tech/xpcom/armazenamento/index.html b/files/pt-pt/mozilla/tech/xpcom/armazenamento/index.html deleted file mode 100644 index 2410a763e4..0000000000 --- a/files/pt-pt/mozilla/tech/xpcom/armazenamento/index.html +++ /dev/null @@ -1,372 +0,0 @@ ---- -title: Armazenamento -slug: Mozilla/Tech/XPCOM/Armazenamento -tags: - - API de Kit de Ferramentas - - Armazenamento - - Guia(2) - - Interfaces -translation_of: Mozilla/Tech/XPCOM/Storage ---- -<p><strong>Armazenamento</strong> é uma API de base de dados <a class="external" href="http://www.sqlite.org/">SQLite</a>. Está disponível para os <em>callers </em>de confiança, ou seja, apenas extensões e componentes do Firefox.</p> - -<p>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.</p> - -<div class="note"><strong>Nota:</strong> Storage is not the same as the <a href="/en/DOM/Storage" title="en/DOM/Storage">DOM:Storage</a> feature which can be used by web pages to store persistent data or the <a href="/en/Session_store_API" title="en/Session_store_API">Session store API</a> (an <a href="/en/XPCOM" title="en/XPCOM">XPCOM</a> storage utility for use by extensions).</div> - -<h2 id="Iniciação">Iniciação</h2> - -<p>This document covers the Storage API and some peculiarities of SQLite. It does <em>not</em> cover SQL or "regular" SQLite. You can find some very useful links in the <a href="#See_also">See also section</a> however. For Storage API help, you can post to mozilla.dev.apps.platform on the news server news.mozilla.org. To report bugs, use <a class="link-https" href="https://bugzilla.mozilla.org/enter_bug.cgi?product=Toolkit&component=Storage">Bugzilla</a>.</p> - -<p>The overall procedure for use is:</p> - -<ol> - <li>Get the Storage service - {{ interface("mozIStorageService") }}.</li> - <li>Open a connection to the database of your choice - {{ interface("mozIStorageConnection") }}.</li> - <li>Create statements to execute on the connection - {{ interface("mozIStorageStatement") }}.</li> - <li>Bind parameters to a statement as necessary.</li> - <li>Execute the statement.</li> - <li>Check for errors.</li> - <li>Reset the statement.</li> -</ol> - -<h2 id="Opening_a_connection" name="Opening_a_connection">Abrir uma ligação</h2> - -<p>JavaScript example of opening <code>my_db_file_name.sqlite</code> in the profile directory:</p> - -<pre class="brush: js">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 dbConn = Services.storage.openDatabase(file); // Will also create the file if it does not exist -</pre> - -<p>Likewise, the C++ would look like this:</p> - -<pre class="brush: cpp">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); -</pre> - -<div class="note">Note: <code>MOZ_STORAGE_SERVICE_CONTRACTID</code> is defined in {{ Source("storage/build/mozStorageCID.h") }}.</div> - -<p>{{ Warning("It may be tempting to give your database a name ending in '.sdb' for <strong>s</strong>qlite <strong>d</strong>ata<strong>b</strong>ase, but this is <em>not recommended.</em> 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.") }}</p> - -<h2 id="Statements" name="Statements">Fechar uma ligação</h2> - -<p>To close a connection on which only synchronous transactions were performed, use the <a href="/en-US/docs/mozIStorageConnection#close()" title="/en-US/docs/mozIStorageConnection#close()"><code>mozIStorageConnection.close()</code></a> method. If you performed any asynchronous transactions, you should instead use the <a href="/en-US/docs/mozIStorageConnection#asyncClose()" title="/en-US/docs/mozIStorageConnection#asyncClose()"><code>mozIStorageConnection.asyncClose()</code></a> 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.</p> - -<h2 id="Statements" name="Statements">Statements</h2> - -<p>This section demonstrates how you can execute SQL statements on your database. For a complete reference see {{ interface("mozIStorageStatement") }}.</p> - -<h3 id="Creating_a_statement" name="Creating_a_statement">Creating a Statement</h3> - -<p>There are actually two ways to execute a statement. You should choose the right one based on your needs.</p> - -<h4 id="No_Results_to_be_Returned">No Results to be Returned</h4> - -<p>If you do not need to get any results back, you can use {{ ifmethod("mozIStorageConnection", "executeSimpleSQL") }} API like this in JavaScript:</p> - -<pre class="brush: js">dbConn.executeSimpleSQL("CREATE TEMP TABLE table_name (column_name INTEGER)"); -</pre> - -<p>Similarly, the C++ looks like this:</p> - -<pre class="brush: cpp">rv = mDBConn->ExecuteSimpleSQL(NS_LITERAL_CSTRING("CREATE TEMP TABLE table_name (column_name INTEGER)")); -NS_ENSURE_SUCCESS(rv, rv);</pre> - -<h4 id="Results_to_be_Returned">Results to be Returned</h4> - -<p>However, if you need to get results back, you should create the statement with the {{ ifmethod("mozIStorageConnection", "createStatement") }} API like this in JavaScript:</p> - -<pre class="brush: js">var statement = dbConn.createStatement("SELECT * FROM table_name WHERE column_name = :parameter"); -</pre> - -<p>This example uses a named placeholder called "parameter" to be bound later (described in {{ anch("Binding Parameters") }}). Similarly, the C++ looks like this:</p> - -<pre class="brush: cpp">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); -</pre> - -<p>This example uses the numbered placeholder indexed by zero for a parameter to be bound later (described in {{ anch("Binding Parameters") }}).</p> - -<p>{{ Note("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.") }}</p> - -<p>{{ Note("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.") }}</p> - -<h3 id="Binding_parameters" name="Binding_parameters">Binding Parameters</h3> - -<p>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 <code>NULL</code>.</p> - -<div class="warning">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.</div> - -<h4 id="Binding_One_Set_of_Parameters">Binding One Set of Parameters</h4> - -<p>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 ({{ interface("mozIStorageStatementParams") }}) available ({{ gecko_minversion_inline("1.9.1") }}) that makes binding parameters much easier:</p> - -<pre class="brush: js">var statement = dbConn.createStatement("SELECT * FROM table_name WHERE id = :row_id"); -statement.params.row_id = 1234; -</pre> - -<p>Use :boundParameterName the same way for numeric and non-numeric columns. Do not put the :boundParameterName within apostrophes, because that the binding mechanism does that for you. You can still use this helper object by manually creating the statement wrapper, {{ interface("mozIStorageStatementWrapper") }}, which is provided in Gecko 1.9.1 and later.</p> - -<p>Using named parameters in C++ is a lot more difficult, so it's generally accepted to use numerical placeholders instead. The example below uses {{ ifmethod("mozIStorageStatement", "bindInt32Parameter") }}.<code><span style="font-family: Verdana,Tahoma,sans-serif;"> The full list of </span></code>binding functions can be found with the {{ interface("mozIStorageStatement") }} documentation.</p> - -<p>C++ example:</p> - -<pre class="brush: cpp">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); -</pre> - -<p>{{ Note("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.") }}</p> - -<h4 id="Binding_Multiple_Sets_of_Parameters">Binding Multiple Sets of Parameters</h4> - -<p>{{ gecko_minversion_header("1.9.2") }}</p> - -<p>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.</p> - -<pre class="brush: js">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); -</pre> - -<p>You can attach multiple sets of bindings to a statement by adding multiple {{ interface("mozIStorageBindingParams") }} objects to the array of parameter lists, adding each one through calls to the {{ ifmethod("mozIStorageBindingParamsArray", "addParams") }}. Once all the parameters are set up, a single call to {{ ifmethod("mozIStorageStatement", "bindParameters") }} will ensure that the parameters are bound before execution. You can then <a href="/en/Storage#Asynchronously" title="en/Storage#Asynchronously">execute the statement asynchronously</a>, and the statement will get each set of bindings bound to it before execution asynchronously.</p> - -<h3 id="Executing_a_statement" name="Executing_a_statement">Executing a Statement</h3> - -<p>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 {{ anch("Synchronously") }} below. Otherwise, it's strongly recommended that you use asynchronous execution, for performance reasons.</p> - -<h4 id="Asynchronously">Asynchronously</h4> - -<p>{{ gecko_minversion_header("1.9.1") }}</p> - -<p>Gecko 1.9.1 introduced support for asynchronous execution of a statement by calling {{ ifmethod("mozIStorageStatement", "executeAsync") }} on the statement. Multiple statements can be executed in a transaction by calling {{ ifmethod("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 ({{ lxrsearch("ident", "i", "mozIStorageStatementCallback") }}).</p> - -<p>After you create and bind a statement, your JavaScript should look something like this to execute a statement asynchronously:</p> - -<pre class="brush: js">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!"); - } -}); -</pre> - -<p>The call to <code>executeAsync</code> takes an object that implements <a href="/en-US/docs/MozIStorageStatementCallback" title="/en-US/docs/MozIStorageStatementCallback">mozIStorageStatementCallback</a>. 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.</p> - -<h4 id="Synchronously">Synchronously</h4> - -<p>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 {{ ifmethod("mozIStorageStatement", "executeStep") }}. This function allows you to enumerate all the results produced by the statement.</p> - -<p>As you step through each row, you can obtain each parameter by name through a helper object ({{ interface("mozIStorageStatementRow") }}) in JavaScript ( {{ gecko_minversion_inline("1.9.1") }}) like so:</p> - -<pre class="brush: js">while (statement.executeStep()) { - let value = statement.row.column_name; -} -</pre> - -<p>You can create this helper object yourself if it's not available in your version of Gecko. See {{ interface("mozIStorageStatementWrapper") }} for details.</p> - -<p>In C++, the code would look something like this:</p> - -<pre class="brush: cpp">bool hasMoreData; -while (NS_SUCCEEDED(statement->ExecuteStep(&hasMoreData)) && hasMoreData) { - PRInt32 value; - rv = statement->GetInt32(0, &value); - NS_ENSURE_SUCCESS(rv, rv); -} -</pre> - -<p>You can obtain other types of data by using the various methods available on {{ interface("mozIStorageValueArray") }}.</p> - -<p>Alternatively, if you do not expect any results but still need to execute a bound statement, you can simply call {{ ifmethod("mozIStorageStatement", "execute") }}. This is equivalent to calling {{ ifmethod("mozIStorageStatement", "executeStep") }} and then {{ ifmethod("mozIStorageStatement", "reset") }}.</p> - -<h3 id="Resetting_a_Statement">Resetting a Statement</h3> - -<p>When you execute a statement synchronously, it is important to make sure you reset your statement. You can accomplish this by calling {{ ifmethod("mozIStorageStatement", "reset") }} on the statement. If you end up finalizing the statement (see {{ ifmethod("mozIStorageStatement", "finalize") }}) you do not need to worry about calling {{ ifmethod("mozIStorageStatement", "reset") }}. You should do this before you reuse the statement.</p> - -<p>{{ Warning("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.") }}</p> - -<p>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:</p> - -<pre class="brush: js">var statement = dbConn.createStatement("SELECT * FROM table_name"); -try { - while (statement.step()) { - // Use the results... - } -} -finally { - statement.reset(); -} -</pre> - -<p>In C++, Storage provides a helper object in {{ Source("storage/public/mozStorageHelper.h") }}, <code>mozStorageStatementScoper</code>, 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.</p> - -<pre class="brush: cpp">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. -} -</pre> - -<p>{{ Note("Calling reset is not an expensive operation, and nothing bad happens if you call reset more than once.") }}</p> - -<h2 id="Transactions" name="Transactions">Transações</h2> - -<p>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.</p> - -<p>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 {{ ifmethod("mozIStorageConnection", "executeAsync") }}. This method will manage the transactions for you, so you don't have to worry about them.</p> - -<p>{{ Note("The database engine does not support nested transactions, so attempting to start a transaction when one is already active will throw an exception.") }}</p> - -<p>Transactions can be started with {{ ifmethod("mozIStorageConnection", "beginTransaction") }} or {{ ifmethod("mozIStorageConnection", "beginTransactionAs") }}. The latter takes one of three constants to describe the type of transaction:</p> - -<ul> - <li><code><a href="https://developer.mozilla.org/en-US/docs/XPCOM_Interface_Reference/mozIStorageConnection#TRANSACTION_DEFERRED">mozIStorageConnection.TRANSACTION_DEFERRED</a></code></li> - <li><code><a href="https://developer.mozilla.org/en-US/docs/XPCOM_Interface_Reference/mozIStorageConnection#TRANSACTION_IMMEDIATE">mozIStorageConnection.TRANSACTION_IMMEDIATE</a></code></li> - <li><code><a href="https://developer.mozilla.org/en-US/docs/XPCOM_Interface_Reference/mozIStorageConnection#TRANSACTION_EXCLUSIVE">mozIStorageConnection.TRANSACTION_EXCLUSIVE</a></code></li> -</ul> - -<p>{{ ifmethod("mozIStorageConnection", "beginTransaction") }} is equivalent to calling {{ ifmethod("mozIStorageConnection", "beginTransactionAs") }} and passing <code><a href="https://developer.mozilla.org/en-US/docs/XPCOM_Interface_Reference/mozIStorageConnection#TRANSACTION_DEFERRED">mozIStorageConnection.TRANSACTION_DEFERRED</a></code> In general, this is the method you want to use.</p> - -<p>Once you start a transaction, you can either commit the changes by calling {{ ifmethod("mozIStorageConnection", "commitTransaction") }}, or rollback the changes by calling {{ ifmethod("mozIStorageConnection", "rollbackTransaction") }}.</p> - -<p>In C++ code, there is a helper class defined in {{ Source("storage/public/mozStorageHelper.h") }}, <code>mozStorageTransaction</code>, 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 <code>Commit</code> on the helper object, the transaction will be rolled back.</p> - -<pre class="brush: cpp">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(); -} -</pre> - -<h2 id="Colação_(ordenação)">Colação (ordenação)</h2> - -<p>SQLite provides several collation methods (<code>BINARY</code>, <code>NOCASE</code>, and <code>RTRIM</code>), but these are all very simple and have no support for various text encodings or the user's locale.</p> - -<p>{{ gecko_minversion_header("1.9.2") }}</p> - -<p>{{ Gecko("1.9.2") }} added support for several new collation methods:</p> - -<dl> - <dt><code>locale</code></dt> - <dd>Case- and accent-insensitive collation.</dd> - <dt><code>locale_case_sensitive</code></dt> - <dd>Case-sensitive, accent-insensitive collation.</dd> - <dt><code>locale_accent_sensitive</code></dt> - <dd>Case-insensitive, accent-sensitive collation.</dd> - <dt><code>locale_case_accent_sensitive</code></dt> - <dd>Case- and accent-sensitive collation.</dd> -</dl> - -<p>You can use them quite simply in your <code>SELECT</code> queries, like this:</p> - -<pre>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(); -</pre> - -<h2 id="How_to_corrupt_your_database" name="How_to_corrupt_your_database">How to Corrupt a Database</h2> - -<p>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 <a class="external" href="http://www.sqlite.org/lockingv3.html" title="http://www.sqlite.org/lockingv3.html">SQLite's documentation on this</a>. These are a few simple things you can <strong>avoid </strong>to help make sure this doesn't happen:</p> - -<ul> - <li>Open more than one connection to the same file with names that aren't exactly the same as determined by <code>strcmp</code>. This includes "my.db" and "../dir/my.db" or, on Windows (case-insensitive) "my.db" and "My.db". Sqlite tries to handle many of these cases, but you shouldn't count on it.</li> -</ul> - -<ul> - <li>Access a database from a symbolic or hard link.</li> -</ul> - -<ul> - <li>Access a statement from more than one thread (discussed in {{ Anch("Thread safety") }}).</li> -</ul> - -<ul> - <li>Call {{ ifmethod("mozIStorageService", "backupDatabaseFile") }} on a locked database, assuming this will leave your database locked. Due to {{ bug(626193) }}, locked databases get unlocked when you call this.</li> -</ul> - -<h2 id="Thread_safety" name="Thread_safety">Thread Safety</h2> - -<p>{{ interface("mozIStorageService") }} and {{ interface("mozIStorageConnection") }} are thread safe. However, no other interface or method is, so do not use them on different threads at the same time!</p> - -<p>If you want to use concurrency to work on your database, you should use the asynchronous APIs provided by Storage.</p> - -<h2 id="See_also" name="See_also">Consultar também</h2> - -<ul> - <li>{{ interface("mozIStorageConnection") }} Database connection to a specific file or in-memory data storage</li> - <li>{{ interface("mozIStorageStatement") }} Create and execute SQL statements on a SQLite database.</li> - <li>{{ interface("mozIStorageValueArray") }} Wraps an array of SQL values, such as a result row.</li> - <li>{{ interface("mozIStorageFunction") }} Create a new SQLite function.</li> - <li>{{ interface("mozIStorageAggregateFunction") }} Create a new SQLite aggregate function.</li> - <li>{{ interface("mozIStorageProgressHandler") }} Monitor progress during the execution of a statement.</li> - <li>{{ interface("mozIStorageStatementWrapper") }} Storage statement wrapper</li> - <li>{{ interface("mozIStorageService") }} Storage Service</li> -</ul> - -<ul> - <li><a href="/en/Storage/Performance" title="en/Storage/Performance">Storage:Performance</a> How to get your database connection performing well.</li> - <li><a class="link-https" href="https://addons.mozilla.org/en-US/firefox/addon/3072">Storage Inspector Extension</a> Makes it easy to view any sqlite database files in the current profile.</li> - <li><a class="external" href="http://www.sqlite.org/lang.html">SQLite Syntax</a> Query language understood by SQLite</li> - <li><a class="external" href="http://sqlitebrowser.sourceforge.net/">SQLite Database Browser</a> is a capable free tool available for many platforms. It can be handy for examining existing databases and testing SQL statements.</li> - <li><a class="link-https" href="https://addons.mozilla.org/en-US/firefox/addon/5817">SQLite Manager Extension</a> helps manage sqlite database files on your computer.</li> -</ul> diff --git a/files/pt-pt/mozilla/tech/xpcom/guide/alterações_xpcom_gecko_2.0/index.html b/files/pt-pt/mozilla/tech/xpcom/guide/alterações_xpcom_gecko_2.0/index.html deleted file mode 100644 index ac8d2a2583..0000000000 --- a/files/pt-pt/mozilla/tech/xpcom/guide/alterações_xpcom_gecko_2.0/index.html +++ /dev/null @@ -1,222 +0,0 @@ ---- -title: Alterações de XPCOM no Gecko 2.0 -slug: Mozilla/Tech/XPCOM/Guide/Alterações_XPCOM_Gecko_2.0 -tags: - - Gecko 2.0 - - XPCOM -translation_of: Mozilla/Tech/XPCOM/Guide/Changes_in_Gecko_2.0 ---- -<p>{{ gecko_minversion_header("2") }}</p> - -<p>Várias alterações que afetam a compatibilidade do componente XPCOM estão a ser realizadas no Gecko 2. Este artigo detalha essas alterações, e proporciona sugestões sobre como atualizar o seu código.</p> - -<h2 id="No_more_frozen_interfaces">No more frozen interfaces</h2> - -<p>There are no longer any frozen interfaces; from now on, all interfaces are subject to change. Documentation will be updated as time allows to remove references to interfaces being "frozen" or "unfrozen."</p> - -<h2 id="Component_registration">Component registration</h2> - -<p>The way XPCOM components are registered changed in Gecko 2. Prior to Gecko 2, during component registration, all binary and JavaScript component files were loaded and called, asking them to register themselves. If you used <a href="/en/JavaScript_code_modules/XPCOMUtils.jsm" title="en/JavaScript code modules/XPCOMUtils.jsm">XPCOMUtils.jsm</a>, some of this was hidden from you, but it was still there.</p> - -<p>Starting in Gecko 2, however, components are registered using manifest files, similarly to how chrome is registered. In fact, the same <a href="/en/Chrome_Registration" title="en/chrome.manifest">chrome manifest</a> file will be used to register components.</p> - -<p><strong>All existing XPCOM components</strong> will need to be updated to support this. However, it's very easy to do, and you can actually support both types of registration for backward compatibility.</p> - -<h3 id="Component_manifests">Component manifests</h3> - -<p>All component registration is now handled through manifest files. For extensions, this is the same <code>chrome.manifest</code> currently used to register chrome.</p> - -<h3 id="XPT_files">XPT files</h3> - -<p>The path of any XPT files must be listed explicitly in a manifest using an <code>interfaces</code> directive:</p> - -<pre>interfaces components/mycomponent.xpt</pre> - -<h3 id="JavaScript_components">JavaScript components</h3> - -<p>The registration information for JavaScript components is no longer located in the component itself; instead, it's located in the manifest. The component is loaded only when the XPCOM component manager needs to create a component.</p> - -<p><code>chrome.manifest</code>:</p> - -<pre># The {classID} here must match the classID in mycomponent.js -component {e6b866e3-41b2-4f05-a4d2-3d4bde0f7ef8} components/mycomponent.js -contract @foobar/mycomponent;1 {e6b866e3-41b2-4f05-a4d2-3d4bde0f7ef8} -category profile-after-change MyComponent @foobar/mycomponent;1 -</pre> - -<p>The JavaScript code no longer exports a <code><a href="/en/NSGetModule" title="en/NSGetModule">NSGetModule()</a></code> function. It now must export a <a href="/en/NSGetFactory" title="en/NSGetFactory"><code>NSGetFactory()</code></a> function, which accepts a class ID (CID) as a parameter.</p> - -<p>For example, in your component's JavaScript code :</p> - -<pre class="brush: js">Components.utils.import("resource://gre/modules/XPCOMUtils.jsm"); - -function myComponent() { -} -myComponent.prototype = { - // this must match whatever is in chrome.manifest! - classID: Components.ID("{e6b866e3-41b2-4f05-a4d2-3d4bde0f7ef8}"), - - QueryInterface: XPCOMUtils.generateQI([Components.interfaces.nsIMyComponent]), - - /* nsIMyComponent implementation goes here */ - ... -}; - -// The following line is what XPCOM uses to create components. Each component prototype -// must have a .classID which is used to create it. -const NSGetFactory = XPCOMUtils.generateNSGetFactory([myComponent]); -</pre> - -<p>A component may implement backwards compatibility with Gecko 1.9.2 by dynamically detecting which symbols are exported by XPCOMUtils.jsm and exporting the correct function:</p> - -<pre class="brush: js">/** -* XPCOMUtils.generateNSGetFactory was introduced in Mozilla 2 (Firefox 4, SeaMonkey 2.1). -* XPCOMUtils.generateNSGetModule was introduced in Mozilla 1.9 (Firefox 3.0). -*/ -if (XPCOMUtils.generateNSGetFactory) - var NSGetFactory = XPCOMUtils.generateNSGetFactory([myComponent]); -else - var NSGetModule = XPCOMUtils.generateNSGetModule([myComponent]);</pre> - -<h3 id="Binary_components">Binary components</h3> - -<p>Binary components must be listed explicitly in a manifest using a <code>binary-component</code> directive:</p> - -<pre>binary-component components/mycomponent.dll -</pre> - -<p>C++ in the component must be changed: a binary component no longer exports a <code><a href="/en/NSGetModule" title="en/NSGetModule">NSGetModule()</a></code> function. Instead, it exports an <a href="/en/XPCOM/NSModule" title="en/XPCOM/NSModule"><code>NSModule</code></a> data symbol which points to a <code>mozilla::Module</code> structure. For more information about the <code>mozilla::Module</code> structure, see the <a class="external" href="http://mxr.mozilla.org/mozilla-central/source/xpcom/components/Module.h" title="http://mxr.mozilla.org/mozilla-central/source/xpcom/components/Module.h">Module.h</a> header file. For an up-to-date example of implementing a dynamic modules, see <a class="external" href="http://mxr.mozilla.org/mozilla-central/source/xpcom/sample/nsSampleModule.cpp" title="http://mxr.mozilla.org/mozilla-central/source/xpcom/sample/nsSampleModule.cpp">nsSampleModule.cpp</a>.</p> - -<p>Note that <code>nsIGenericFactory.h</code> has been removed. References to <code>nsIGenericFactory.h</code> should be replaced with <code>mozilla/ModuleUtils.h</code>.</p> - -<p>It is possible for a binary component to be compatible with Mozilla 1.9.2 and Mozilla 2.0 by using the extra macro <code>NS_IMPL_MOZILLA192_NSGETMODULE</code>. See <a class="external" href="http://mxr.mozilla.org/mozilla-central/source/xpcom/sample/nsSampleModule.cpp" title="http://mxr.mozilla.org/mozilla-central/source/xpcom/sample/nsSampleModule.cpp">nsSampleModule.cpp</a> for more details.</p> - -<div class="note"><strong>Note:</strong> Binary XPCOM components <em>must</em> be recompiled for every new major release of Firefox starting with Firefox 4. Your life would be much easier over the long term if you switch to using <a href="/en/js-ctypes" title="https://developer.mozilla.org/en/js-ctypes">js-ctypes</a> instead.</div> - -<p>Also note that extensions using binary components must now use the <a href="/en/Install_Manifests#unpack" title="https://developer.mozilla.org/en/Install_Manifests#unpack">unpack</a> property in the install manifest.</p> - -<h3 id="Platform-specific_directories">Platform-specific directories</h3> - -<p>The component/chrome system used to look in platform-specific subdirectories of an extension, such as <code>platform/WINNT_x86-msvc/chrome.manifest</code> on Windows. This is no longer supported. You can use the <a href="/en/Chrome_Registration#os" title="en/chrome registration#os">OS</a> and <a href="/en/Chrome_Registration#abi" title="en/chrome registration#abi">ABI</a> chrome registration directives to achieve the same effect:</p> - -<pre>binary-component components/windows/mycomponent.dll ABI=WINNT_x86-msvc -binary-component components/mac/mycomponent.dylib ABI=Darwin_x86-gcc3 -binary-component components/mac/mycomponent64.dylib ABI=Darwin_x86_64-gcc3 -binary-component components/linux/mycomponent.so ABI=Linux_x86-gcc3 -</pre> - -<p>This also means that platform-specific preferences are no longer possible. If you need to adjust default preferences based on platform, you can do so at first run by looking up what platform you're on and changing the preferences at that time.</p> - -<h2 id="Category_registration">Category registration</h2> - -<p>Prior to Gecko 2, extensions could listen for the <code>xpcom-startup</code> and <code>app-startup</code> <a href="/en/Observer_Notifications" title="en/Observer Notifications">notifications</a> during startup, and perform actions during those. This is no longer the case. The earliest startup notification extensions can receive now is <code>profile-after-change</code>, which has always been the recommended notification to observe. That's because it's among the earliest notifications that occurs after the profile folder (and therefore preferences and other services) is available.</p> - -<h3 id="What_you_need_to_change">What you need to change</h3> - -<p>If your extension currently observes either <code>xpcom-startup</code> or <code>app-startup</code>, you need to update your code to observe <code>profile-after-change</code> instead.</p> - -<p>Typically, extensions observed <code>app-startup</code> because in the past, you needed to load for <code>app-startup</code> in order to be able to register to observe <code>profile-after-change</code> in the first place. As of {{ gecko("1.9.1") }}, this is no longer the case, however; you can now register for <code>profile-after-change</code> using the Category Manager. See <a href="/en/XPCOM/Receiving_startup_notifications" title="en/XPCOM/Receiving startup notifications">Receiving startup notifications</a> for details.</p> - -<p>To add a category entry, you must insert the following line to your chrome.manifest:</p> - -<pre>category profile-after-change MyComponent @foobar/mycomponent;1 -</pre> - -<div class="warning"><strong>Important</strong>: Formerly, the contract id of the category entry was prefixed with "<code>service,"</code> if the component was implemented as a service. This prefix needs to be dropped when migrating to chrome.manifest.</div> - -<h3 id="Changed_category_names">Changed category names</h3> - -<p>The XPCOM category manager is used to register certain global helper objects. Because chrome.manifest is a space-delimited format, category names with spaces cannot be registered. Therefore the following categories have changed:</p> - -<table class="standard-table"> - <thead> - <tr> - <th scope="col">Old name</th> - <th scope="col">New name</th> - </tr> - <tr> - <td><code>JavaScript global constructor</code></td> - <td><code>JavaScript-global-constructor</code></td> - </tr> - <tr> - <td><code>JavaScript global constructor prototype alias</code></td> - <td><code>JavaScript-global-constructor-prototype-alias</code></td> - </tr> - </thead> - <tbody> - <tr> - <td><code>JavaScript global property</code></td> - <td><code>JavaScript-global-property</code></td> - </tr> - <tr> - <td><code>JavaScript global privileged property</code></td> - <td><code>JavaScript-global-privileged-property</code></td> - </tr> - <tr> - <td><code>JavaScript global static nameset</code></td> - <td><code>JavaScript-global-static-nameset</code></td> - </tr> - <tr> - <td><code>JavaScript global dynamic nameset</code></td> - <td><code>JavaScript-global-dynamic-nameset</code></td> - </tr> - <tr> - <td><code>JavaScript DOM class</code></td> - <td><code>JavaScript-DOM-class</code></td> - </tr> - <tr> - <td><code>JavaScript DOM interface</code></td> - <td><code>JavaScript-DOM-interface</code></td> - </tr> - <tr> - <td><code>XSLT extension functions</code></td> - <td><code>XSLT-extension-functions</code></td> - </tr> - </tbody> -</table> - -<h3 id="But_why">But why?</h3> - -<p>Previously, whenever Gecko detected that the application version had changed, or one or more extensions was added, removed, enabled, or disabled, it was necessary to throw away all existing component registrations, then restart the application (what we call the "Extension Manager restart") during its startup process. This was necessary in order to ensure that any components that should no longer be available are disposed of properly, and to re-register everything, loading any new components that may be needed.</p> - -<p>In theory, this is invisible to the user, but it's a costly process, since every component needs to be loaded and executed, then unloaded, then reloaded again during the restart.</p> - -<p>On top of that, with the ongoing work to make Firefox multithreaded, content processes either need to register components on a per-process basis, or somehow share a component cache with the chrome process.</p> - -<p>The changes to the component registration model let this so-called Extension Manager restart become a thing of the past. Instead of relying on a potentially stale component cache on startup, we read the application's component registrations out of its manifest file and load those components. This gets enough of XPCOM loaded and running that we can then load the Extension Manager and perform the necessary installing, uninstalling, and updating of any installed extensions.</p> - -<p>Once that's done, the extensions can then be loaded by simply reading their manifests, loading their components, and continuing the startup process, all without having to restart the browser.</p> - -<p>Electrolysis content processes can simply read the component registrations during startup.</p> - -<h2 id="XPCNativeWrapper_changes">XPCNativeWrapper changes</h2> - -<h3 id="You_can't_disable_XPCNativeWrappers_from_your_manifest">You can't disable XPCNativeWrappers from your manifest</h3> - -<p>Specifying <code>xpcnativewrappers=no</code> in your manifest (that is, XPCNativeWrapper automation) is no longer supported. This was always intended to be a short-term workaround to allow extensions to continue to work while their authors updated their code to use XPCNativeWrappers.</p> - -<p>If your add-on depends upon XBL bindings attached to content objects—for example, the ability to call functions or get and set properties created by the XBL binding—you will need to use the XPCNativeWrapper property <code>wrappedJSObject</code> to access wrapped objects.</p> - -<p>If you need to be able to call functions or access properties defined by web content, you'll need to do this as well. This may be the case if, for example, you've written an extension that adds a delete button to a web mail service, and the service defines a <code>window.delete()</code> function that you need to call.</p> - -<p>If, on the other hand, all you're doing with content is accessing DOM methods and properties, you've never needed to be using <code>xpcnativewrappers=no</code> in the first place, and should simply remove it from your manifest.</p> - -<h3 id="Miscellaneous_XPCNativeWrapper_changes">Miscellaneous XPCNativeWrapper changes</h3> - -<ul> - <li>Using the <a href="../../../../en/JavaScript/Reference/Operators/Special_Operators/delete_Operator" rel="internal"><code>delete</code></a> operator on "expando" properties of an XPCNativeWrapper no longer throws a security exception.</li> -</ul> - -<h2 id="XPCOMUtils.jsm_changes">XPCOMUtils.jsm changes</h2> - -<p>The <a href="/en/JavaScript_code_modules/XPCOMUtils.jsm" title="en/JavaScript/Code modules/XPCOMUtils.jsm"><code>XPCOMUtils.jsm</code></a> code module has been updated to let you specify the application IDs of the applications you wish to register your component in.</p> - -<h2 id="XPCOM_service_getters">XPCOM service getters</h2> - -<p>A number of commonly used XPCOM services now have service getter functions available in the <a href="/en/XPCOM/mozilla::services_namespace" title="en/XPCOM/mozilla::services namespace">mozilla::services namespace</a>; these make it much easier to get access to these services from C++ code.</p> - -<h2 id="See_also">See also</h2> - -<ul> - <li><a class="external" href="http://blog.mozilla.com/addons/2010/06/14/multiple-breaking-changes-are-coming-for-components-in-extensions/" title="http://blog.mozilla.com/addons/2010/06/14/multiple-breaking-changes-are-coming-for-components-in-extensions/">Multiple breaking changes are coming for components in extensions</a></li> -</ul> diff --git a/files/pt-pt/mozilla/tech/xpcom/guide/index.html b/files/pt-pt/mozilla/tech/xpcom/guide/index.html deleted file mode 100644 index 63fcce03c0..0000000000 --- a/files/pt-pt/mozilla/tech/xpcom/guide/index.html +++ /dev/null @@ -1,21 +0,0 @@ ---- -title: XPCOM guide -slug: Mozilla/Tech/XPCOM/Guide -tags: - - Add-ons - - Extensions - - Guide - - Landing - - Mozilla - - NeedsTranslation - - TopicStub - - XPCOM -translation_of: Mozilla/Tech/XPCOM/Guide ---- -<p><span class="seoSummary">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.</span></p> - -<div class="warning"> -<p><strong>WebExtensions are becoming the new standard for creating add-ons. </strong>Eventually support for XPCOM add-ons will be deprecated, so you should begin to investigate porting your add-ons to use the <a href="/en-US/docs/Mozilla/Add-ons/WebExtensions">WebExtensions</a> API, and <a href="https://mzl.la/webext-feature-needed">report any missing functionality</a> so we can be sure to address your concerns. Work is ongoing on WebExtension capabilities, so your input will help prioritize and plan the work. To learn more about the kinds of changes that will be needed, see <a href="/en-US/docs/Mozilla/Add-ons/WebExtensions/Comparison_with_XUL_XPCOM_extensions">Comparison with XUL/XPCOM extensions</a>. In addition, any binaries you use will then need to be converted for use with the WebExtensions <a href="/en-US/docs/Mozilla/Add-ons/WebExtensions/Native_messaging">native messaging</a> API, or compiled using <a href="https://webassembly.github.io/">WebAssembly</a> or <a href="/en-US/docs/Mozilla/Projects/Emscripten">Emscripten</a>.</p> -</div> - -<p>{{LandingPageListSubpages}}</p> diff --git a/files/pt-pt/mozilla/tech/xpcom/index.html b/files/pt-pt/mozilla/tech/xpcom/index.html deleted file mode 100644 index 4aad9d4fe0..0000000000 --- a/files/pt-pt/mozilla/tech/xpcom/index.html +++ /dev/null @@ -1,52 +0,0 @@ ---- -title: XPCOM -slug: Mozilla/Tech/XPCOM -tags: - - Add-ons - - Extensions - - Extensões - - Extras - - Landing - - Mozilla - - NeedsTranslation - - Precisa de Tradução - - TopicStub - - XPCOM -translation_of: Mozilla/Tech/XPCOM ---- -<p><span class="seoSummary"><strong>XPCOM</strong> é um modelo de objeto componente de plataforma cruzada, similar a Microsoft COM. Este tem múltiplas <a href="/en-US/docs/XPCOM/Language_Bindings" title="XPCOM/Language_Bindings">ligações de l</a>inguagem, permitindo que os componentes XPCOM sejam utilizados e implementados no Java, JavaScript e Python, além das interfaces em C++.</span> As interfaces no XPCOM são definidas num dialeto de IDL, nomeado de <a href="/en-US/docs/XPIDL" title="XPIDL">XPIDL</a>.</p> - -<div class="warning"> -<p><strong>WebExtensions are becoming the new standard for creating add-ons. </strong>Eventually support for XPCOM add-ons will be deprecated, so you should begin to investigate porting your add-ons to use the <a href="/en-US/docs/Mozilla/Add-ons/WebExtensions">WebExtensions</a> API, and <a href="https://mzl.la/webext-feature-needed">report any missing functionality</a> so we can be sure to address your concerns. Work is ongoing on WebExtension capabilities, so your input will help prioritize and plan the work. To learn more about the kinds of changes that will be needed, see <a href="/en-US/docs/Mozilla/Add-ons/WebExtensions/Comparison_with_XUL_XPCOM_extensions">Comparison with XUL/XPCOM extensions</a>. In addition, any binaries you use will then need to be converted for use with the WebExtensions <a href="/en-US/docs/Mozilla/Add-ons/WebExtensions/Native_messaging">native messaging</a> API, or compiled using <a href="https://webassembly.github.io/">WebAssembly</a> or <a href="/en-US/docs/Mozilla/Projects/Emscripten">Emscripten</a>.</p> -</div> - -<p>XPCOM itself provides a set of core components and classes, e.g. file and memory management, threads, basic data structures (strings, arrays, variants), etc. The majority of XPCOM components are not part of this core set and are provided by other parts of the platform (e.g. <a href="/en-US/docs/Gecko" title="Gecko">Gecko</a> or <a href="/en-US/docs/Necko" title="Necko">Necko</a>) or by an application or even by an extension.</p> - -<div class="row topicpage-table"> - <div class="section"><dl><dl><dt class="landingPageList"><a href="/en-US/docs/Mozilla/Tech/XPCOM/Accessing_the_Windows_Registry_Using_XPCOm">Accessing the Windows Registry Using XPCOM</a></dt><dd class="landingPageList">When implementing Windows-specific functionality, it is often useful to access the Windows registry for information about the environment or other installed programs. To this end, there exist <a href="/en/XPCOM" title="en/XPCOM">XPCOM</a> interfaces to read and write registry data. This article will show you how to use the available interfaces in several Mozilla products.</dd><dt class="landingPageList"><a href="/en-US/docs/Mozilla/Tech/XPCOM/Aggregating_the_In-Memory_Datasource">Aggregating the In-Memory Datasource</a></dt><dd class="landingPageList"></dd><dt class="landingPageList"><a href="/en-US/docs/Mozilla/Tech/XPCOM/already_AddRefed">already_AddRefed</a></dt><dd class="landingPageList"><code>already_AddRefed</code> in association with <code><a href="/en-US/docs/NsCOMPtr">nsCOMPtr</a></code> allows you to assign in a pointer <strong>without</strong> <code>AddRef</code>ing it.</dd><dt class="landingPageList"><a href="/en-US/docs/Mozilla/Tech/XPCOM/Binary_compatibility">Binary compatibility</a></dt><dd class="landingPageList">If Mozilla decides to upgrade to a compiler that does not have the same ABI as the current version, any built component may fail. It is a possiblity that is introduced when upgrading to a new compiler without recompiling everything. Effectively, it is a different platform.</dd><dt class="landingPageList"><a href="/en-US/docs/Mozilla/Tech/XPCOM/Bundling_multiple_binary_components">Bundling multiple binary components</a></dt><dd class="landingPageList">Binary XPCOM components are sometimes required to implement low-level features for extensions. Since binary components are linked against a single Gecko SDK, a dependency to a particular version of Gecko is created. If the component uses only "frozen" XPCOM interfaces, there is a good chance the same binary component will work with different versions of Gecko (version 1.8 and 1.9, for example). The more likely case is that the component uses "unfrozen" interfaces and those interfaces can change between Gecko versions. This can create a difficult situation for extension developers trying to support multiple Gecko versions (Firefox 2 and 3, for example).</dd><dt class="landingPageList"><a href="/en-US/docs/Mozilla/Tech/XPCOM/Creating_a_Python_XPCOM_component">Creating a Python XPCOM component</a></dt><dd class="landingPageList"><a href="http://books.mozdev.org/html"><em>Creating Applications with Mozilla</em></a> already provides <a href="http://books.mozdev.org/html/mozilla-chp-8-sect-2.html">a tutorial</a> for making a simple JavaScript or C++ component (implementing the <code>nsISimple</code> interface). Here is how to make the same component in Python using <a href="/en-US/docs/PyXPCOM" title="PyXPCOM">PyXPCOM</a>.</dd><dt class="landingPageList"><a href="/en-US/docs/Mozilla/Tech/XPCOM/Fun_with_XBL_and_XPConnect">Fun With XBL and XPConnect</a></dt><dd class="landingPageList"></dd><dt class="landingPageList"><a href="/en-US/docs/Mozilla/Tech/XPCOM/Generating_GUIDs">Generating GUIDs</a></dt><dd class="landingPageList"><strong>GUID</strong>s are used in Mozilla programming for identifying several types of entities, including XPCOM <a href="/en-US/docs/Interfaces">Interfaces</a> (this type of GUIDs is callled IID), components (CID), and legacy add-ons—like <a href="/en-US/docs/Extensions">extensions</a> and <a href="/en-US/docs/Themes">themes</a>—that were created prior to Firefox 1.5. <a href="/en-US/docs/Install_Manifests#id">Add-ons can (and should) be identified with IDs of the form <code><var>extensionname</var>@<var>organization</var>.<var>tld</var></code></a> since <a href="/en-US/docs/Firefox_1.5_for_developers">Firefox 1.5</a>.</dd><dt class="landingPageList"><a href="/en-US/docs/Mozilla/Tech/XPCOM/Generic_factory">Generic factory</a></dt><dd class="landingPageList">Most XPCOM factories can be very simple. Rick Potts wrote a templated-based generic factory (nsFactory<t>) that simplifies the factory creation process that just requires writing a CreateInstance() method. The new nsIGenericFactory interface takes this a step further, by providing a single interface that can be reused anytime a simple implementation of nsIFactory is needed. Here is the interface, and a description of its use.</t></dd><dt class="landingPageList"><a href="/en-US/docs/Mozilla/Tech/XPCOM/How_to_build_a_binary_XPCOM_component_using_Visual_Studio">How to build a binary XPCOM component using Visual Studio</a></dt><dd class="landingPageList">This is a simple tutorial for building XPCOM objects in C++ using Visual Studio. XPCOM is Mozilla’s cross platform component object model, similar to Microsoft’s COM technology. XPCOM components can be implemented in C, C++, and JavaScript, and can be used from C, C++, and JavaScript. That means you can call JavaScript methods from C++ and vice versa. For more information on the workings of XPCOM look <a href="en/XPCOM">elsewhere</a>.</dd><dt class="landingPageList"><a href="/en-US/docs/Mozilla/Tech/XPCOM/How_to_pass_an_XPCOM_object_to_a_new_window">How To Pass an XPCOM Object to a New Window</a></dt><dd class="landingPageList">If you want to be able to call functions within an XPCOM object from a XUL window's code, you can do so if you pass the XPCOM object as one of the arguments to the window creation method.</dd><dt class="landingPageList"><a href="/en-US/docs/Mozilla/Tech/XPCOM/Interfacing_with_the_XPCOM_cycle_collector">Interfacing with the XPCOM cycle collector</a></dt><dd class="landingPageList">This is a quick overview of the cycle collector introduced into XPCOM for Firefox 3, including a description of the steps involved in modifying an existing C++ class to participate in XPCOM cycle collection. If you have a class that you think is involved in a cyclical-ownership leak, this page is for you.</dd><dt class="landingPageList"><a href="/en-US/docs/Mozilla/Tech/XPCOM/Introduction_to_XPCOM_for_the_DOM">Introduction to XPCOM for the DOM</a></dt><dd class="landingPageList">Warning: this document has not yet been reviewed by the DOM gurus, it might contain some errors.</dd><dt class="landingPageList"><a href="/en-US/docs/Mozilla/Tech/XPCOM/Language_Bindings">Language bindings</a></dt><dd class="landingPageList">An <strong>XPCOM Language Binding</strong> is a bridge between a particular language and <a href="/en/XPCOM" title="en/XPCOM">XPCOM</a> to provide access to XPCOM objects from that language, and to let modules written in that language be used as XPCOM objects by all other languages for which there are XPCOM bindings.</dd><dt class="landingPageList"><a href="/en-US/docs/Mozilla/Tech/XPCOM/Monitoring_HTTP_activity">Monitoring HTTP activity</a></dt><dd class="landingPageList">Gecko includes the <code><a href="/en-US/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsIHttpActivityObserver" title="">nsIHttpActivityObserver</a></code> interface, which you can implement in your code to monitor <a href="/en/HTTP" title="en/HTTP">HTTP</a> transactions in real time, receiving a callback as the transactions take place.</dd><dt class="landingPageList"><a href="/en-US/docs/Mozilla/Tech/XPCOM/nsCOMPtr_versus_RefPtr">nsCOMPtr versus RefPtr</a></dt><dd class="landingPageList">Gecko code uses both <code>nsCOMPtr</code> and <code>RefPtr</code> as smart pointers. This guide provides some explanation and advice on how to choose between them.</dd><dt class="landingPageList"><a href="/en-US/docs/Mozilla/Tech/XPCOM/Observer_Notifications">Observer Notifications</a></dt><dd class="landingPageList">The following are topics that you can observe during the course of an application. Unless otherwise noted you register for the topics using the <code><a href="/en-US/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsIObserverService" title="">nsIObserverService</a></code>.</dd><dt class="landingPageList"><a href="/en-US/docs/Mozilla/Tech/XPCOM/Setting_HTTP_request_headers">Setting HTTP request headers</a></dt><dd class="landingPageList"><a href="/en-US/docs/HTTP">HTTP</a> is one of the core technologies behind the Web. In addition to the actual content, <a href="/en-US/docs/HTTP/Headers">some important information</a> is passed with HTTP headers for both HTTP requests and responses.</dd><dt class="landingPageList"><a href="/en-US/docs/Mozilla/Tech/XPCOM/Storage">Storage</a></dt><dd class="landingPageList"><strong>Storage</strong> is a <a class="external" href="http://www.sqlite.org/">SQLite</a> database API. It is available to trusted callers, meaning extensions and Firefox components only.</dd><dt class="landingPageList"><a href="/en-US/docs/Mozilla/Tech/XPCOM/The_Thread_Manager">The Thread Manager</a></dt><dd class="landingPageList">The Thread Manager, introduced in Firefox 3, offers an easy to use mechanism for creating threads and dispatching events to them for processing.</dd></dl></dl></div> - <div class="section"><dl><dt class="landingPageList"><a href="/en-US/docs/Mozilla/Tech/XPCOM/Troubleshooting_XPCOM_components_registration">Troubleshooting XPCOM components registration</a></dt><dd class="landingPageList">Often the first time you create an XPCOM component, it may fail to register correctly.</dd><dt class="landingPageList"><a href="/en-US/docs/Mozilla/Tech/XPCOM/Using_nsCOMPtr">Using nsCOMPtr</a></dt><dd class="landingPageList">This document is the sum total of everything written down about <code>nsCOMPtr</code>. If you have a question about <code>nsCOMPtr</code>, and this document doesn't answer it, there probably isn't a document that answers it. You'll have to turn to <a class="external" href="news:mozilla.dev.tech.xpcom">the XPCOM newsgroup</a> or another experienced <code>nsCOMPtr</code> user, or find the answer by experimentation.</dd><dt class="landingPageList"><a href="/en-US/docs/Mozilla/Tech/XPCOM/Using_nsIClassInfo">Using nsIClassInfo</a></dt><dd class="landingPageList">If you use a C++ class which implements <code>nsIClassInfo</code> from JavaScript, then you don't have to explicitly call <code>QueryInterface</code> on the JavaScript object to access the object's interfaces.</dd><dt class="landingPageList"><a href="/en-US/docs/Mozilla/Tech/XPCOM/Using_nsIDirectoryService">Using nsIDirectoryService</a></dt><dd class="landingPageList">nsDirectoryService implements the <code><a href="/en-US/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsIProperties" title="">nsIProperties</a></code> interface. This implementation will allow you to <code>Get()</code>, <code>Set()</code>, <code>Define()</code>, and <code>Undefine()</code> <code><a href="/en-US/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsIFile" title="">nsIFile</a></code>.</dd><dt class="landingPageList"><a href="/en-US/docs/Mozilla/Tech/XPCOM/Using_nsIPasswordManager">Using nsIPasswordManager</a></dt><dd class="landingPageList">Technical review completed.</dd><dt class="landingPageList"><a href="/en-US/docs/Mozilla/Tech/XPCOM/Using_nsISimpleEnumerator">Using nsISimpleEnumerator</a></dt><dd class="landingPageList"></dd><dt class="landingPageList"><a href="/en-US/docs/Mozilla/Tech/XPCOM/Using_the_clipboard">Using the clipboard</a></dt><dd class="landingPageList">This section provides information about cutting, copying, and pasting to and from the clipboard.</dd><dt class="landingPageList"><a href="/en-US/docs/Mozilla/Tech/XPCOM/Using_the_Gecko_SDK">Using the Gecko SDK</a></dt><dd class="landingPageList"></dd><dt class="landingPageList"><a href="/en-US/docs/Mozilla/Tech/XPCOM/Weak_reference">Weak reference</a></dt><dd class="landingPageList">In <a href="/en-US/docs/XPCOM">XPCOM</a>, a <strong>weak reference</strong> is a special object that contains a pointer to an XPCOM object, but does<em>not</em> keep that object alive. If the referent object is destroyed before the weak reference, the pointer inside the weak reference is set to <code>nsnull</code>.</dd><dt class="landingPageList"><a href="/en-US/docs/Mozilla/Tech/XPCOM/Working_with_multiple_versions_of_interfaces">Working with Multiple Versions of Interfaces</a></dt><dd class="landingPageList">In this short note we illustrate how one can update an XPCOM module in -order for it to work in both Firefox 2 and Firefox 3, even if the interfaces have -changed in the interim.</dd><dt class="landingPageList"><a href="/en-US/docs/Mozilla/Tech/XPCOM/Working_with_out_parameters">Working with out parameters</a></dt><dd class="landingPageList"></dd><dt class="landingPageList"><a href="/en-US/docs/Mozilla/Tech/XPCOM/wrappedJSObject">wrappedJSObject</a></dt><dd class="landingPageList"><code>wrappedJSObject</code> is a property sometimes available on <a href="en/XPConnect">XPConnect</a> wrappers. When available, it lets you access the JavaScript object hidden by the wrapper.</dd><dt class="landingPageList"><a href="/en-US/docs/Mozilla/Tech/XPCOM/XPCOM_ABI">XPCOM ABI</a></dt><dd class="landingPageList"><a href="/en/XPCOM" title="en/XPCOM">XPCOM</a> <abbr title="Application Binary Interface">ABI</abbr> is the binary interface of XPCOM components. While XPCOM components written in a scripting language (such as <a href="/en/JavaScript" title="en/JavaScript">JavaScript</a>) can be moved across platforms (such as Windows and OS X) without adaptation, those written in a compiled language (such as C++) require recompilation when moving to a different platform. Often, compiled XPCOM components are called 'binary' or 'native'.</dd><dt class="landingPageList"><a href="/en-US/docs/Mozilla/Tech/XPCOM/XPCOM_category_image-sniffing-services">XPCOM category image-sniffing-services</a></dt><dd class="landingPageList">In versions of Firefox prior to Firefox 3, extensions could add decoders for new image types. However, such decoders relied on servers sending correct MIME types; images sent with incorrect MIME types would not be correctly displayed.</dd><dt class="landingPageList"><a href="/en-US/docs/Mozilla/Tech/XPCOM/Glue">XPCOM glue</a></dt><dd class="landingPageList">The XPCOM Glue is a static library which component developers and embedders can link against. It allows developers to link only against the frozen XPCOM method symbols and maintain compatibility with multiple versions of XPCOM.</dd><dt class="landingPageList"><a href="/en-US/docs/Mozilla/Tech/XPCOM/Guide">XPCOM guide</a></dt><dd class="landingPageList">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.</dd><dt class="landingPageList"><a href="/en-US/docs/Mozilla/Tech/XPCOM/XPCOM_ownership_guidelines">XPCOM ownership guidelines</a></dt><dd class="landingPageList">...naturally. If you create a temporary object, obviously it's up to you to destroy it. That's a sure sign of ownership. If you create an object with a longer lifespan, you will own it until you give ownership away.</dd><dt class="landingPageList"><a href="/en-US/docs/Mozilla/Tech/XPCOM/Reference">XPCOM reference</a></dt><dd class="landingPageList">This reference describes the interfaces and functions provided by the <a href="/en-US/docs/Mozilla/Tech/XPCOM">XPCOM</a> library. In addition, it details the various helper classes and functions, as well as the components, provided by the <a href="/en-US/docs/Mozilla/Tech/XPCOM/Glue">XPCOM glue</a> library. The contents herein are oriented primarily toward extension developers and people embedding XPCOM in other projects.</dd><dt class="landingPageList"><a href="/en-US/docs/Mozilla/Tech/XPCOM/XPCOM_tasks">XPCOM tasks</a></dt><dd class="landingPageList">The XPCOM module roughly parallels the C/C++ standard libraries. It overlaps them significantly, but goes beyond them in capabilities. XPCOM sits above the standard libraries. Its role is to extend them with facilities tailored to XPCOM development in general, and specifically the needs of Mozilla. Like the standard libraries, XPCOM must be a fairly self-contained library, so as not to encumber clients with any unnecessary external dependencies.</dd><dt class="landingPageList"><a href="/en-US/docs/Mozilla/Tech/XPCOM/Thread_synchronization">XPCOM Thread Synchronization</a></dt><dd class="landingPageList">XPCOM thread synchronization primitives have the same semantics as those in NSPR, and each method of these synchronization objects (e.g. <code>Mutex::Lock()</code>) has a matching function in NSPR (<code>PR_Lock()</code>). This is no accident, as mozilla:: primitives are merely bare-minimum wrappers around NSPR's.</dd><dt class="landingPageList"><a href="/en-US/docs/Mozilla/Tech/XPCOM/xptcall_FAQ">xptcall FAQ</a></dt><dd class="landingPageList"><code>xptcall</code> is a small low level XPCOM method call library. It is implemented using platform specific C/C++ and assembly language code. It is used to facilitate cross language and cross thread method calls. Porting this code is required in order to make Mozilla run on any given platform.</dd><dt class="landingPageList"><a href="/en-US/docs/Mozilla/Tech/XPCOM/xptcall_porting_guide">Xptcall Porting Guide</a></dt><dd class="landingPageList">Original Author: John Bandhauer, 31 May 1999.</dd><dt class="landingPageList"><a href="/en-US/docs/Mozilla/Tech/XPCOM/xptcall_porting_status">Xptcall Porting Status</a></dt><dd class="landingPageList">This is a status page for the multiplatform porting of xptcall. xptcall has a <a href="/En/Xptcall_FAQ">FAQ</a> and a <a href="/En/Xptcall_Porting_Guide">Porting Guide</a>.</dd></dl></div> - </div> - -<div class="blockIndicator communitybox" dir="ltr"> - - <div class="column-container"> - <h2 id="Join_the_XPCOM_community">Join the XPCOM community</h2> - <div class="column-half"> - <div class="communitysubhead">Choose your preferred method for joining the discussion:</div> - <ul class="communitymailinglist"> - <li><a href="https://lists.mozilla.org/listinfo/dev-tech-xpcom">Mailing list</a></li> - - - <li><a href="http://groups.google.com/group/mozilla.dev.tech.xpcom">Newsgroup</a></li> - <li><a href="http://groups.google.com/group/mozilla.dev.tech.xpcom/feeds">RSS feed</a></li> -</ul> - </div> - <div class="column-half"> - <ul class="communitycontact"><li><strong>IRC: </strong><a href="irc://irc.mozilla.org/developers">#developers</a> <span class="smaller">(<a href="https://wiki.mozilla.org/IRC">learn more</a>)</span></li><li><strong>Tools: </strong><a href="http://ted.mielczarek.org/code/mozilla/jscomponentwiz/">JavaScript Component Wizard</a>, <a href="http://www.mytools360.com-a.googlepages.com/home#XPComPro">Visual C++ Component Wizard</a>, <a href="http://www.yutools.com/wp/tools/yuxpcomwizard/?lang=en">Visual C++ Component Wizard for Visual Studio 2010</a>, <a href="https://addons.mozilla.org/en-US/firefox/addon/xpcomviewer/">XPCOMViewer addon: browse XPCOM interfaces easily</a></li></ul> - </div> - </div> -</div> - -<section id="Quick_Links"><ol><li><a href="http://www.ibm.com/developerworks/library/os-xpcomfirefox/">Tutorial from IBM DeveloperWorks</a></li><li><a href="https://developer.mozilla.org/en-US/docs/Creating_Custom_Firefox_Extensions_with_the_Mozilla_Build_System">Binary components tutorial</a></li><li><a href="http://www.iosart.com/firefox/xpcom/">Linux and Windows how-to guide</a></li><li><a href="http://starkravingfinkle.org/blog/2006/10/mozilla-platform-xpcom-in-c/">Windows example blog post</a></li><li><a href="http://wanderingstan.com/2007-11-16/geekout_how_to_make_a_c_xpcom_component">Another Windows example</a></li><li><a href="http://rcrowley.org/2007/07/17/cross-platform-xpcom-a-howto.html">Mac OS X example</a></li><li><a href="/en-US/docs/Web/JavaScript" title="JavaScript (JS) is a lightweight interpreted or JIT-compiled programming language with first-class functions. While it is most well-known as the scripting language for Web pages, many non-browser environments also use it, such as Node.js, Apache CouchDB and Adobe Acrobat.">JavaScript</a></li></ol></section> diff --git a/files/pt-pt/mozilla/tech/xpcom/reference/glue_classes/index.html b/files/pt-pt/mozilla/tech/xpcom/reference/glue_classes/index.html deleted file mode 100644 index e98aa51571..0000000000 --- a/files/pt-pt/mozilla/tech/xpcom/reference/glue_classes/index.html +++ /dev/null @@ -1,13 +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 ---- -<p><span class="seoSummary">These "glue" classes are provided to make it easier to use XPCOM from C++ code.</span> When these classes are used by a component, you may need to link the component against the XPCOM glue library.</p> -<p>{{LandingPageListSubpages}}</p> diff --git a/files/pt-pt/mozilla/tech/xpcom/reference/index.html b/files/pt-pt/mozilla/tech/xpcom/reference/index.html deleted file mode 100644 index 29d07953d6..0000000000 --- a/files/pt-pt/mozilla/tech/xpcom/reference/index.html +++ /dev/null @@ -1,27 +0,0 @@ ---- -title: XPCOM reference -slug: Mozilla/Tech/XPCOM/Reference -tags: - - Add-ons - - Extensions - - Landing - - Mozilla - - NeedsTranslation - - Reference - - TopicStub - - XPCOM -translation_of: Mozilla/Tech/XPCOM/Reference ---- -<p>This reference describes the interfaces and functions provided by the <a href="/en-US/docs/Mozilla/Tech/XPCOM">XPCOM</a> library. In addition, it details the various helper classes and functions, as well as the components, provided by the <a href="/en-US/docs/Mozilla/Tech/XPCOM/Glue">XPCOM glue</a> library. The contents herein are oriented primarily toward extension developers and people embedding XPCOM in other projects.</p> - -<div class="warning"> -<p><strong>WebExtensions are becoming the new standard for creating add-ons. </strong>Eventually support for XPCOM add-ons will be deprecated, so you should begin to investigate porting your add-ons to use the <a href="/en-US/docs/Mozilla/Add-ons/WebExtensions">WebExtensions</a> API, and <a href="https://mzl.la/webext-feature-needed">report any missing functionality</a> so we can be sure to address your concerns. Work is ongoing on WebExtension capabilities, so your input will help prioritize and plan the work. To learn more about the kinds of changes that will be needed, see <a href="/en-US/docs/Mozilla/Add-ons/WebExtensions/Comparison_with_XUL_XPCOM_extensions">Comparison with XUL/XPCOM extensions</a>. In addition, any binaries you use will then need to be converted for use with the WebExtensions <a href="/en-US/docs/Mozilla/Add-ons/WebExtensions/Native_messaging">native messaging</a> API, or compiled using <a href="https://webassembly.github.io/">WebAssembly</a> or <a href="/en-US/docs/Mozilla/Projects/Emscripten">Emscripten</a>.</p> -</div> - -<div class="note"> -<p>If you're working on a module in the Mozilla codebase that's compiled with the <code>MOZILLA_INTERNAL_API</code> flag set, some of these APIs -- the string functions and classes in particular -- are not the ones you should be using. See the <a href="/en-US/docs/Mozilla/Tech/XPCOM/Guide/Internal_strings">XPCOM internal string guide</a> for documentation of the internal string API used within the Mozilla codebase.</p> -</div> - -<p>{{LandingPageListSubpages}}</p> - -<p>Many XPCOM pages return an <code><a href="/en-US/docs/Mozilla/Tech/XPCOM/Reference/Core_functions/nsresult">nsresult</a></code>. Prior to Gecko 19 {{geckoRelease(19)}}, this was an integer that simply returned an error code. It is now a strongly typed <code>enum</code> 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.</p> diff --git a/files/pt-pt/mozilla/tech/xul/attribute/textbox.type/index.html b/files/pt-pt/mozilla/tech/xul/attribute/textbox.type/index.html deleted file mode 100644 index e30799ed4b..0000000000 --- a/files/pt-pt/mozilla/tech/xul/attribute/textbox.type/index.html +++ /dev/null @@ -1,5 +0,0 @@ ---- -title: textbox.type -slug: Mozilla/Tech/XUL/Attribute/textbox.type ---- -<p>no redirect</p> |