Search completed in 1.22 seconds.
60 results for "nsisimpleenumerator":
Your results are loading. Please wait...
nsISimpleEnumerator
Inherits from: nsISupports Last changed in Gecko 0.9.6 Method overview nsISupports getNext(); boolean hasMoreElements(); Methods getNext() Called to retrieve the next element in the enumerator. The "next" element is the first element upon the first call. Must be preceded by a call to hasMoreElements() which returns PR_TRUE. This method is generally called within a loop to iterate over the elements in the enumerator. nsISupports getNext(); Parameters None. Return value NS_OK if the call succeeded in returning a non-null value through the out parameter. NS_ERROR_FAILURE if there are no more elements to enumerate. ...
...bsequent getNext() calls. ...
Using nsISimpleEnumerator
Using nsISimpleEnumerator <stringbundle>.strings var enumerator = document.getElementById('aStringBundleID').strings; var s = ""; while (enumerator.hasMoreElements()) { var property = enumerator.getNext().QueryInterface(Components.interfaces.nsIPropertyElement); s += property.key + ' = ' + property.value + ';\n'; } alert(s); Example using JavaScript 1.7 features // creates a generator iterating over enum's values function generatorFromSimpleEnumerator(enum, interface) { while (enum.hasMoreElements()) { yield enum.getNext().QueryInterface(interface); } } var b = document.getElementById("stringbundleset").firstChild var props = generatorFromEnumerator(b.strings, Components.interfaces.nsIPropertyElement); var s = ""; for (let property in props) { s += property.key + ' = ' + propert...
...ile (enum.hasMoreElements()) { yield enum.getNext().QueryInterface(interface); } } var b = document.getElementById("stringbundleset").firstChild var props = generatorFromEnumerator(b.strings, Components.interfaces.nsIPropertyElement); var s = ""; for (let property in props) { s += property.key + ' = ' + property.value + ';\n'; } alert(s); Links Code based on Using_nsIPasswordManager nsISimpleEnumerator XUL:Property:strings ...
Starting WebLock
that makes the component accessible from JavaScript or other interpreted languages. In Mozilla, JavaScript is the bridge between components and the XUL-based user interface. The XPIDL Syntax The XPIDL syntax is a mix of C++ and Java, and of course it's very much like the OMG IDL upon which it is closely based. ...
...s very much like the OMG IDL upon which it is closely based. The XPIDL for iWebLock appears below: iWebLock #include "nsISupports.idl" interface nsISimpleEnumerator; [scriptable, uuid(ea54eee4-9548-4b63-b94d-c519ffc91d09)] interface iWeblock : nsISupports { void lock(); void unlock(); // assume strings are UTF-8 void addSite(in string url); void removeSite(in string url); attribute nsISimpleEnumerator sites; }; The first line includes the file nsISupports.idl, which defines the nsISupports interface from which all XPCOM interfaces must derive, and makes it possible for the iWebLock interface to subclass that base interface. #include "nsISupports.idl" The next line of the XPIDL is a forward declaration of the interface nsISimpleEnumerator. Again, this is similar to the forward declare in C...
... Scriptable Interfaces The third line in iWebLock is more complex. ...
...And 12 more matches
XPCOM array guide
Mozilla › Tech › XPCOM › Guide › Arrays
the enumeration as this will often confuse the loop which is enumerating the array. Enumerators Most arrays provide access to an object which is used to enumerate members of the array. These Enumerators maintain state about the current position in the array. Enumerators are used to access the elements in an ordered way, without relying on the underlying array type. These enumerators include: nsISimpleEnumerator - an enumerator for COM objects. nsIStringEnumerator / nsIUTF8StringEnumerator - enumerators for strings Obsolete arrays / enumerators There are some deprecated classes which should not be used by new code. nsISupportsArray - obsoleted by nsIArray and nsIMutableArray, use those instead. nsIEnumerator - obsoleted by nsISimpleEnumerator, use that instead. nsIBidirectionalEnumerator - obsol...
...umerator for COM objects. nsIStringEnumerator / nsIUTF8StringEnumerator - enumerators for strings Obsolete arrays / enumerators There are some deprecated classes which should not be used by new code. nsISupportsArray - obsoleted by nsIArray and nsIMutableArray, use those instead. nsIEnumerator - obsoleted by nsISimpleEnumerator, use that instead. nsIBidirectionalEnumerator - obsoleted by nsISimpleEnumerator, use that instead. Which Array should I use? Do not use nsISupportsArray; it is deprecated. Does your array need to be scriptable? If so, use nsIArray. Example: an array attribute in an IDL file would be nsIArray. Will your array store non-refcounted objects and need automatic resizing? If so, use nsTArray<T>. Example: an array of integers or an array of strings. Will your array...
...ements->RemoveElementAt(0); *elements->AppendElement(newElement, PR_FALSE); } In-place enumeration When accessing all members of an nsIArray, in-place enumeration is preferred over indexed access. However, I seem to have forgotten to implement that. Good thing the interface is under review. Sorry! Enumerators Creating an enumerator from an nsIArray is easy. The method Enumerate() returns a nsISimpleEnumerator which accesses all the elements in the array. Often, simply accessing an array by index, using QueryElementAt is faster. See the section on Enumerators to learn when to properly use enumerators. For example, if you need to iterate an array returned from another object, you might use Enumerate(). ... // get the array nsCOMPtr<nsIArray> array; foo->GetElements(getter_AddRefs(array)); // make an ...
...And 4 more matches
nsIMsgDatabase
nsMsgKey key); nsIMsgDBHdr getMsgHdrForMessageID(in string messageID); boolean ContainsKey(in nsMsgKey key); nsIMsgDBHdr CreateNewHdr(in nsMsgKey key); void AddNewHdrToDB(in nsIMsgDBHdr newHdr, in boolean notify); nsIMsgDBHdr CopyHdrFromExistingHdr(in nsMsgKey key, in nsIMsgDBHdr existingHdr, in boolean addHdrToDB); void ListAllKeys(in nsMsgKeyArrayRef outputKeys); Native code only! ...
...ssageID(in string messageID); boolean ContainsKey(in nsMsgKey key); nsIMsgDBHdr CreateNewHdr(in nsMsgKey key); void AddNewHdrToDB(in nsIMsgDBHdr newHdr, in boolean notify); nsIMsgDBHdr CopyHdrFromExistingHdr(in nsMsgKey key, in nsIMsgDBHdr existingHdr, in boolean addHdrToDB); void ListAllKeys(in nsMsgKeyArrayRef outputKeys); Native code only! ...
... void ListAllOfflineDeletes(in nsMsgKeyArrayPtr offlineDeletes); Native code only! void ListAllOfflineMsgs(in nsMsgKeyArrayPtr offlineMsgs); Native code only! void setAttributesOnPendingHdr(in nsIMsgDBHdr pendingHdr, in string property, in string propertyVal, in long flags); void createCo...
...And 4 more matches
nsIWindowMediator
"@mozilla.org/appshell/window-mediator;1"] .getService(Components.interfaces.nsIWindowMediator); Method overview void addListener(in nsIWindowMediatorListener aListener); boolean calculateZPosition(in nsIXULWindow inWindow, in unsigned long inPosition, in nsIWidget inBelow, out unsigned long outPosition, out nsIWidget outBelow); Native code only! ...
...an calculateZPosition(in nsIXULWindow inWindow, in unsigned long inPosition, in nsIWidget inBelow, out unsigned long outPosition, out nsIWidget outBelow); Native code only! nsISimpleEnumerator getEnumerator(in wstring aWindowType); nsIDOMWindow getMostRecentWindow(in wstring aWindowType); nsIDOMWindow getOuterWindowWithId(in unsigned long long aOuterWindowID); nsISimpleEnumerator getXULWindowEnumerator(in wstring aWindowType); PRUint32 getZLevel(in nsIXULWindow aWindow); Native code only! ...
...low); Native code only! nsISimpleEnumerator getEnumerator(in wstring aWindowType); nsIDOMWindow getMostRecentWindow(in wstring aWindowType); nsIDOMWindow getOuterWindowWithId(in unsigned long long aOuterWindowID); nsISimpleEnumerator getXULWindowEnumerator(in wstring aWindowType); PRUint32 getZLevel(in nsIXULWindow aWindow); Native code only! nsISimpleEnumerator getZOrderDOMWindowEnumerator(in wstring aWindowType, in boolean aFrontToBack); nsISimpleEnumerator getZOrderXULWindowEnumerator(in wstring aWindowType, in boolean aFrontToBack); void registerWindow(in nsIXULWindow aWindow); Native code only! void removeListener(in nsIWindowMediatorListener aListener); void setZLevel(in nsIXULWindow aWindow, in PRUint32 aZLevel)...
...And 4 more matches
nsIComponentRegistrar
xpcom/components/nsIComponentRegistrar.idlScriptable This interface provides methods to access and modify the XPCOM component registry. ...
...gistrar.idlScriptable This interface provides methods to access and modify the XPCOM component registry. ...
... in string aContractID ); Parameters aContractID The ContractID to be queried. Return value The ClassID corresponding to aContractID if one exists and is registered. enumerateCIDs() This method returns an enumerator over the list of registered ClassIDs. Elements of the enumeration can be QueryInterfaced for the nsISupportsID interface. From the nsISupportsID, you can obtain the actual ClassID. nsISimpleEnumerator enumerateCIDs(); Parameters None. Return value An nsISimpleEnumerator over the list of registered classes. Elements of the enumerator implement nsISupportsID. enumerateContractIDs() This method returns an enumerator over the list of registered ContractIDs. Elements of the enumeration can be QueryInterfaced for the nsISupportsCString interface. From the nsISupportsCString interface, you can obtai...
...And 2 more matches
Index
Mozilla › Tech › XPCOM › Index
face. This implementation will allow you to Get(), Set(), Define(), and Undefine() nsIFile. 86 Using nsIPasswordManager Guide, Interfaces, Login Manager, Security The code on this page will work with applications using Toolkit 1.8 and below such as Firefox 2.0.0.x and Thunderbird 2.0.0.x. For similar functionality in Toolkit 1.9, see Using nsILoginManager. 87 Using nsISimpleEnumerator No summary! 88 Using the Gecko SDK Add-ons, Developing Mozilla, Extensions, Gecko, NeedsContent No summary! 89 Using the clipboard Add-ons, Clipboard, Extensions, Guide, Mozilla, XPCOM This section provides information about cutting, copying, and pasting to and from the clipboard. 90 Weak reference XPCOM In XPCOM, a weak re...
...I Reference, XPCOM Interface Reference Called by the Directory Service to obtain an nsIFile object corresponding for a given standard path location. 556 nsIDirectoryServiceProvider2 Directories, File I/O, Files, Interfaces, Interfaces:Scriptable, XPCOM, XPCOM Interface Reference The directory service calls this when it gets a request for a prop and the requested type is nsISimpleEnumerator. 557 getFiles XPCOM, XPCOM API Reference This method is called by the Directory Service to query an enumeration of file or directory locations. 558 nsIDiskCacheStreamInternal Interfaces, Interfaces:Scriptable, NeedsContent We use this method internally to close nsDiskCacheOutputStream under the cache service lock. 559 nsIDispatchSupport Int...
...zilla.org/browser/sessionstartup;1. To use this service, use: 907 nsISessionStore Interfaces, Interfaces:Scriptable, XPCOM, XPCOM API Reference, XPCOM Interface Reference In versions of Firefox prior to 3.5, the user preference browser.sessionstore.enabled must be true for these calls to be successful. Starting in Firefox 3.5, this preference is no longer used. 908 nsISimpleEnumerator Interfaces, Interfaces:Scriptable, XPCOM, XPCOM API Reference, XPCOM Interface Reference Called to retrieve the next element in the enumerator. The "next" element is the first element upon the first call. Must be preceded by a call to hasMoreElements() which returns PR_TRUE. This method is generally called within a loop to iterate over the elements in the enumerator. 909 getN...
...XPCOM API Reference, XPCOM Interface Reference Called to retrieve the next element in the enumerator. The "next" element is the first element upon the first call. Must be preceded by a call to hasMoreElements() which returns PR_TRUE. This method is generally called within a loop to iterate over the elements in the enumerator. 909 getNext Documentation is now located at nsISimpleEnumerator.getNext(). 910 hasMoreElements Documentation is now located at nsISimpleEnumerator.hasMoreElements(). 911 nsISmsDatabaseService Interfaces, Mobile, WebSMS Implemented by: @mozilla.org/sms/smsdatabaseservice;1. To create an instance, use: 912 nsISmsRequestManager Interfaces, Mobile, WebSMS Implemented by: @mozilla.org/sms/smsrequestma...
nsICategoryManager
The category and/or entry are created if they do not exist. string addCategoryEntry( in string aCategory, in string aEntry,...
...The category and/or entry are created if they do not exist. string addCategoryEntry( in string aCategory, in string aEntry, in string aValue, in boolean aPersist, in boo...
...ryEntry( in string aCategory, in string aEntry, in boolean aPersist ); Parameters aCategory The name of the category being modified. ("protocol") aEntry The name of the category entry being deleted. ("http") aPersist Ignored. Category entries never persist across sessions. You should always pass false for this parameter. enumerateCategories() Enumerate all existing categories. nsISimpleEnumerator enumerateCategories(); Parameters None. Return value A simple enumerator, each result QIs to nsISupportsCString. enumerateCategory() Enumerate the entries in a category. nsISimpleEnumerator enumerateCategory( in string aCategory ); Parameters aCategory The category to be enumerated. Return value A simple enumerator, each result QIs to nsISupportsCString. getCategoryEntry() Ge...
...nager> svcMgr; rv = NS_GetServiceManager(getter_AddRefs(svcMgr)); if (NS_FAILED(rv)) return rv; nsCOMPtr<nsICategoryManager> catMgr; rv = svcMgr->GetServiceByContractID(NS_CATEGORYMANAGER_CONTRACTID, NS_GET_IID(nsICategoryManager), getter_AddRefs(catMgr)); if (NS_FAILED(rv)) return rv; nsCOMPtr<nsISimpleEnumerator> cats; rv = catMgr->EnumerateCategories(getter_AddRefs(cats)); if (NS_FAILED(rv)) return rv; PRBool hasMore; while (NS_SUCCEEDED(cats->HasMoreElements(&hasMore) && hasMore) { nsCOMPtr<nsISupports> elem; cats->GetNext(getter_AddRefs(elem)); nsCOMPtr<nsISupportsCString> category = do_QueryInterface(elem, &rv); if (NS_FAILED(rv)) break; nsEmbedCString categ...
nsIClipboardDragDropHookList
.7 Note: This interface is not intended for direct use by embedders; it is an implementation detail. You should access these capabilities indirectly by sending commands using the nsIClipboardDragDropHooks interface. Within Gecko, this interface is used by calling get_Interface on a docshell. Method overview void addClipboardDragDropHooks(in nsIClipboardDragDropHooks aHooks); nsISimpleEnumerator getHookEnumerator(); void removeClipboardDragDropHooks(in nsIClipboardDragDropHooks aHooks); Methods addClipboardDragDropHooks() This method adds a hook to the list. void addClipboardDragDropHooks( in nsIClipboardDragDropHooks aHooks ); Parameters aHooks Implementation of hooks. getHookEnumerator() This method retrieves an enumerator for all hooks which have been added...
...etHookEnumerator(); void removeClipboardDragDropHooks(in nsIClipboardDragDropHooks aHooks); Methods addClipboardDragDropHooks() This method adds a hook to the list. void addClipboardDragDropHooks( in nsIClipboardDragDropHooks aHooks ); Parameters aHooks Implementation of hooks. getHookEnumerator() This method retrieves an enumerator for all hooks which have been added. nsISimpleEnumerator getHookEnumerator(); Parameters None. Return value Returns nsISimpleEnumerator for nsIClipboardDragDropHooks. removeClipboardDragDropHooks() This method removes a hook from the list. Note: If this implementation is not present in the list then removal will be ignored. void removeClipboardDragDropHooks( in nsIClipboardDragDropHooks aHooks ); Parameters aHooks Implementation of hooks. ...
...Returns nsISimpleEnumerator for nsIClipboardDragDropHooks. removeClipboardDragDropHooks() This method removes a hook from the list. Note: If this implementation is not present in the list then removal will be ignored. void removeClipboardDragDropHooks( in nsIClipboardDragDropHooks aHooks ); Parameters aHooks Implementation of hooks. ...
getFiles
<< XPCOM API Reference Summary This method is called by the Directory Service to query an enumeration of file or directory locations. nsISimpleEnumerator getFiles( in string aName ); Parameters aName [in] The symbolic name for an enumeration of file or directory locations. ...
... << XPCOM API Reference Summary This method is called by the Directory Service to query an enumeration of file or directory locations. nsISimpleEnumerator getFiles( in string aName ); Parameters aName [in] The symbolic name for an enumeration of file or directory locations. ...
...hod is called by the Directory Service to query an enumeration of file or directory locations. nsISimpleEnumerator getFiles( in string aName ); Parameters aName [in] The symbolic name for an enumeration of file or directory locations. ...
nsIMemoryReporterManager
orterManager = Components.classes["@mozilla.org/memory-reporter-manager;1"] .getService(Components.interfaces.nsIMemoryReporterManager); Each memory reporter object, which implements nsiMemoryReporter interface, provides information for a given code area. Each code area is identified by a unique path string, which is displayed in about:memory. ...
...manager;1"] .getService(Components.interfaces.nsIMemoryReporterManager); Each memory reporter object, which implements nsiMemoryReporter interface, provides information for a given code area. Each code area is identified by a unique path string, which is displayed in about:memory. ...
...resident PRInt64 Gets the resident size (that is RSS, physical memory used). This reporter is special-cased because it is interesting, is available on all platforms, and returns a meaningful result on all common platforms. -1 means unknown. Read only. Methods enumerateMultiReporters() Returns an enumerator for looking at the installed memory multi-reporters. nsISimpleEnumerator enumerateMultiReporters(); Parameters None. Return value An enumerator of nsIMemoryMultiReporters that are currently registered. enumerateReporters() Returns an enumerator for looking at the installed memory reporters. nsISimpleEnumerator enumerateReporters(); Parameters None. Return value An nsISimpleEnumerator for enumerating installed memory reporters. init() Initializes the memory reporter ...
Chapter 4: Using XPCOM—Implementing advanced processes - Archive of obsolete content
. Listing 5: Closing all browser windows var browsers = WindowMediator.getEnumerator('navigator:browser'); var browser; while (browsers.hasMoreElements()) { browser = browsers.getNext().QueryInterface(Components.interfaces.nsIDOMWindowInternal); browser.BrowserTryToCloseWindow(); } This method returns an overview of the specified window type in the form of an Iterator pattern object called nsISimpleEnumerator. After getting an element with the nsISimpleEnumerator.getNext() method, use the QueryInterface method to get the interface, which allows you to handle each element as a window object. Like the getMostRecentWindow() method, passing null as the parameter for the getEnumerator() method enables you to get all windows in Firefox, including dialogs, etc. Manipulating files using XPCOM XPCOM provide...
...LocalFile.append() method to drill down into a directory (or file). See Listing 8. Listing 8: Traversing directories file.initWithPath('C:\\'); file.append('Documents and Settings'); file.append('All Users'); file.append('Documents'); List files in specified directory Use the directoryEntries property to perform operations on all the files or folders in a given folder. This property returns a nsISimpleEnumerator-type object similar to the window overview, so you can get each element using similar techniques. Listing 9 shows how to list the contents of a folder. Listing 9: Listing the contents of a specific directory file.initWithPath('C:\\'); var children = file.directoryEntries; var child; var list = []; while (children.hasMoreElements()) { child = children.getNext().QueryInterface(Components.interf...
How to implement a custom XUL query processor component - Archive of obsolete content
a string for convenient comparison purposes // or null to say just use string value getBindingObjectFor: function(aVar) { return null; }, // called when a rule matches this item. ...
...ction(aQuery, aRuleNode) { }, // the output for a result has been removed and the result is no longer being used by the builder hasBeenRemoved: function() { } }; // basic wrapper for nsISimpleEnumerator function TemplateResultSet(aArrayOfData) { this._index = 0; this._array = aArrayOfData; } TemplateResultSet.prototype = { QueryInterface: XPCOMUtils.generateQI([Components.interfaces.nsISimpleEnumerator]), hasMoreElements: function() { return this._index < this._array.length; }, getNext: function() { return new TemplateResult(this._array[this._index++]); } }; // The query processor class - implements nsIXULTemplateQueryProcessor function TemplateQueryProcessor() { // our basic list of data this._data = [ {name: "mark", age: 36, hair: "brown", eye: "brown"}...
nsIArray
. It is also convention that if an interface provides access to an nsIArray, that the array should not be QueryInterfaced to an nsIMutableArray for modification. If the interface in question had intended the array to be modified, it would have returned an nsIMutableArray! null is a valid entry in the array, and as such any nsISupports parameters may be null, except where noted. ...
...Return value A new enumerator positioned at the start of the array. Exceptions thrown NS_ERROR_FAILURE If the array is empty (to make it easy to detect errors). NS_ERROR_OUT_OF_MEMORY If there is not enough memory to complete the operation. indexOf() Get the position of a specific element. ...
nsICollection
item nsISupports item to be removed from the list. ...
... item at a specified index in the collection with a new one. ...
nsICookieManager2
nsICookieService is the normal way to do this. This method is something of a back door. void add( in AUTF8String aHost, in AUTF8String aPath, in ACString aName, in ACString aValue, in boolean aIsSecure, in boolean aIsHttpOnly, in boolean aIsSession,...
...the host, path, and name fields of aCookie. getCookiesFromHost() Returns an enumerator of cookies that would be returned to a given host, ignoring the cookie flags isDomain, isSecure, and isHttpOnly. Therefore, if the specified host is "weather.yahoo.com", host or domain cookies for "weather.yahoo.com" and "yahoo.com" would both be returned, while a cookie for "my.weather.yahoo.com" would not. nsISimpleEnumerator getCookiesFromHost( in AUTF8String aHost ); Parameters aHost The host string to look for, such as "google.com". This should consist only of the host portion of the URI and should not contain a leading dot, port number, or other information. Return value An nsISimpleEnumerator of nsICookie2 objects representing the matching cookies. importCookies() Imports an old-style cookie file. Th...
nsIDocShell
utBlankContentViewer(in nsIPrincipal aPrincipal); void createLoadInfo(out nsIDocShellLoadInfo loadInfo); void DetachEditorFromWindow(); Violates the XPCOM interface guidelines void finishRestore(); void firePageHideNotification(in boolean isUnload); Native code only! void fireUnloadNotification(); Native code only! ...
....5 / SeaMonkey 1.0)This feature is obsolete. Although it may still work in some browsers, its use is discouraged since it could be removed at any time. Try to avoid using it. Notify the associated content viewer and all child docshells that they are about to be unloaded. void fireUnloadNotification(); Parameters None. getDocShellEnumerator() Get an enumerator over this docShell and its children. nsISimpleEnumerator getDocShellEnumerator( in long aItemType, in long aDirection ); Parameters aItemType Only include docShells of this type, or if typeAll, include all child shells. Uses types from nsIDocShellTreeItem. aDirection Whether to enumerate forwards or backwards. Return value An enumerator over this docShell and its children. getSessionStorageForPrincipal() Retrieves the session sto...
nsIMicrosummaryService
plemented by: @mozilla.org/microsummary/service;1 as a service: var microsummaryService = Components.classes["@mozilla.org/microsummary/service;1"] .getService(Components.interfaces.nsIMicrosummaryService); Method overview void addGenerator(in nsIURI generatorURI); nsIMicrosummary createMicrosummary(in nsIURI pageURI, in nsIURI generatorURI); nsISimpleEnumerator getBookmarks(); nsIMicrosummaryGenerator getGenerator(in nsIURI generatorURI); nsIMicrosummarySet getMicrosummaries(in nsIURI pageURI, in long long bookmarkID); nsIMicrosummary getMicrosummary(in long long bookmarkID); boolean hasMicrosummary(in long long bookmarkID); nsIMicrosummaryGenerator installGenerator(in nsIDOMDocument xmlDefinition); ...
... pageURI The URI of the page to be summarized. generatorURI The URI of the microsummary generator. Return value Returns an nsIMicrosummary for the given page and generator URIs. getBookmarks() Get the set of bookmarks with microsummaries. In the old RDF-based bookmarks datastore, bookmark IDs are nsIRDFResource objects. In the new Places-based datastore, they are nsIURI objects. nsISimpleEnumerator getBookmarks(); Parameters None. Return value Returns an nsISimpleEnumerator enumeration of bookmark IDs. getGenerator() Return a microsummary generator for the given URI. nsIMicrosummaryGenerator getGenerator( in nsIURI generatorURI ); Parameters generatorURI The URI of the generator. Return value Returns an nsIMicrosummaryGenerator for the given URI. getMicrosummaries() Get the se...
nsIMicrosummarySet
Service. 1.0 66 Introduced Gecko 1.8 Obsolete Gecko 6.0 Inherits from: nsISupports Last changed in Gecko 1.8 (Firefox 1.5 / Thunderbird 1.5 / SeaMonkey 1.0) Warning: Microsummary support was removed in Gecko 6.0 (Firefox 6.0 / Thunderbird 6.0 / SeaMonkey 2.3) Method overview void addObserver(in nsIMicrosummaryObserver observer); nsISimpleEnumerator Enumerate(); void removeObserver(in nsIMicrosummaryObserver observer); Methods addObserver() Add a microsummary observer to this microsummary set. Adding an observer to a set is the equivalent of adding it to each constituent microsummary. void addObserver( in nsIMicrosummaryObserver observer ); Parameters observer The microsummary observer to add. Enum...
... void removeObserver(in nsIMicrosummaryObserver observer); Methods addObserver() Add a microsummary observer to this microsummary set. Adding an observer to a set is the equivalent of adding it to each constituent microsummary. void addObserver( in nsIMicrosummaryObserver observer ); Parameters observer The microsummary observer to add. Enumerate() Retrieve an nsISimpleEnumerator of microsummaries in the set. nsISimpleEnumerator Enumerate(); Parameters None. Return value An enumerator of nsIMicrosummary objects. removeObserver() Remove a microsummary observer from this microsummary. void removeObserver( in nsIMicrosummaryObserver observer ); Parameters observer The microsummary observer to remove. See also nsIMicrosummaryService Microsummary topic...
nsIMsgDBView
eadswithunread", "xfvf" (virtual folders), "search", "group", and "threaded" each with their own implementation of nsIMsgDBView that provides a different sorting/view of the data. ...
...to be used. Defined in the interface: nsMsgViewFlagsType. Return values count Upon return, the count variable may contain the number of messages in the folder. Note: This return value does not appear to be implemented in the base implementation. openWithHdrs() Opens the view with a set of specified headers. Note: This is not implemented in the base implementation. void openWithHdrs(in nsISimpleEnumerator aHeaders, in nsMsgViewSortTypeValue aSortType, in nsMsgViewSortOrderValue aSortOrder, in nsMsgViewFlagsTypeValue aViewFlags, out long aCount); Parameters aHeaders A list of headers to open, arranged in an nsISimpleEnumerator. aSortType A nsMsgViewSortTypeValue designating the sort type used for the folder. Defined...
nsIMsgThread
flags unsigned long Flags attached to the thread. subject ACString Subject of the thread newestMsgDate unsigned long numChildren unsigned long Readonly: Number...
...child, in nsIDBChangeAnnouncer announcer); Parameters child The message to remove announcer An nsIDBChangeAnnouncer to receive notification when the change is made. markChildRead() void markChildRead(in boolean bRead); Parameters bRead true if the messages should be marked read. false if unread. getFirstUnreadChild() nsIMsgDBHdr getFirstUnreadChild(); enumerateMessages() nsISimpleEnumerator enumerateMessages(in nsMsgKey parent); Parameters parent A key representing the message to start enumerating with. ...
nsIObserverService
to provide global notifications for a variety of subsystems. Implemented by @mozilla.org/observer-service;1 as a service: var observerService = Components.classes["@mozilla.org/observer-service;1"] .getService(Components.interfaces.nsIObserverService); Method overview void addObserver( in nsIObserver anObserver, in string aTopic, in boolean ownsWeak); nsISimpleEnumerator enumerateObservers( in string aTopic ); void notifyObservers( in nsISupports aSubject, in string aTopic, in wstring someData ); void removeObserver( in nsIObserver anObserver, in string aTopic ); Methods addObserver() Registers a given listener for a notifications regarding the specified topic. See nsIObserver for a JavaScript example. void addObserver( in nsIObserve...
...cation topic or subject. ownsWeak If set to false, the nsIObserverService will hold a strong reference to anObserver. If set to true and anObserver supports the nsISupportsWeakReference interface, a weak reference will be held. Otherwise an error will be returned. (In most cases, you should use false.) enumerateObservers() Called to enumerate all observers registered for a particular topic. nsISimpleEnumerator enumerateObservers( in string aTopic ); Parameters aTopic The notification topic or subject. Return value Returns an enumeration of all registered listeners. See nsISimpleEnumerator. notifyObservers() This method is called to notify all observers for a particular topic. See Example. void notifyObservers( in nsISupports aSubject, in string aTopic, in wstring someData ); Param...
nsIPasswordManager
Only the host portion of these objects is relevant. Methods addUser() Stores a password. AString addUser(in AUTF8String aHost, in AString aUser, ...
...Only the host portion of these objects is relevant. ...
nsIPermissionManager
Allows access to nsIPermission objects. Read only. Constants Permission type constants Constant Value Description UNKNOWN_ACTION 0 Default permission when no entry is found for a host. It should not be used by consumers. ALLOW_ACTION 1 Permission is allowed. DENY_ACTION 2 Permission is denie...
...cast for each change, and will involve a single permission. data : "deleted" a permission was deleted. The subject is the deleted nsIPermission. data : "added" a permission was added. The subject is the added nsIPermission. data : "changed" a permission was changed. The subject is the new nsIPermission. data : "cleared" the entire permission list was cleared. The subject is null. See also nsISimpleEnumerator ...
nsIPropertyBag
Read only. Methods getProperty() Get a property value for the given name. ...
...Read only. Methods getProperty() Get a property value for the given name. ...
nsISHistory
nt document in session history. Read only. maxLength long Used to Get/Set the maximum number of toplevel documents, session history can hold for each instance. requestedIndex long The index of the last document that started to load that is not yet finished loading. When the document finishes loading the value -1 is returned. Read only. ...
... requestedIndex long The index of the last document that started to load that is not yet finished loading. When the document finishes loading the value -1 is returned. Read only. SHistoryEnumerator nsISimpleEnumerator Called to obtain a enumerator for all the documents stored in session history. The enumerator object thus returned by this method can be traversed using nsISimpleEnumerator. To access individual history entries of the enumerator, perform the following steps: Call GetSHistoryEnumerator() to obtain handle the nsISimpleEnumerator object. Use nsISimpleEnumerator.GetNext() on the object returned by step #1 to obtain handle to the next object in the list. The object returned by this step is of type nsISupports. Perform a QueryInterface on the objec...
nsIStringBundle
ctions unless necessary. Alternatively, a string bundle can be created within a javascript context with nsIStringBundleService. Method overview wstring formatStringFromID(in long aID, [array, size_is(length)] in wstring params, in unsigned long length); wstring formatStringFromName(in wstring aName, [array, size_is(length)] in wstring params, in unsigned long length); nsISimpleEnumerator getSimpleEnumeration(); wstring GetStringFromID(in long aID); wstring GetStringFromName(in wstring aName); Methods formatStringFromID() Returns a formatted string with the given ID from the string bundle, where each occurrence of %S (uppercase) is replaced by each successive element in the supplied array. You may also use other formatting codes. You can only pass Unicod...
...s uses nsTextFormatter::smprintf to do the dirty work. wstring formatStringFromName( in wstring aName, [array, size_is(length)] in wstring params, in unsigned long length ); Parameters aName The name of the string to retrieve. params Parameters to pass in to the string. length The length of the parameter list. Return value Returns the formatted string. getSimpleEnumeration() nsISimpleEnumerator getSimpleEnumeration(); Parameters None. Return value Returns a nsISimpleEnumerator of all nsIPropertyElement entries in the string bundle. GetStringFromID() Retrieves a string from the bundle by its ID. wstring GetStringFromID( in long aID ); Parameters aID The ID of the string to retrieve. String ID's are assigned by the order in which they are stored in the properties file. R...
nsIWindowWatcher
t must be initialized at application startup by calling setWindowCreator(). ...
...his before using this method! nsIDOMWindow getWindowByName( in wstring aTargetName, in nsIDOMWindow aCurrentWindow ); Parameters aTargetName The window name. aCurrentWindow The nsIDOMWindow starting point in the window hierarchy to begin the search. If null, each top level window will be searched. Return value The nsIDOMWindow with the target name. getWindowEnumerator() Get an nsISimpleEnumerator for currently open windows in the order they were opened, guaranteeing that each will be visited exactly once. nsISimpleEnumerator getWindowEnumerator(); Parameters None. Return value An nsISimpleEnumerator which will itself return nsISupports objects which can be nsISupports.QueryInterface() (QueryInterfaced) to an nsIDOMWindow. openWindow() Creates a new window. It will automatically be...
nsIXULTemplateQueryProcessor
hod overview void addBinding(in nsIDOMNode aRuleNode, in nsIAtom aVar, in nsIAtom aRef, in AString aExpr); PRInt32 compareResults(in nsIXULTemplateResult aLeft, in nsIXULTemplateResult aRight, in nsIAtom aVar, in unsigned long aSortHints); nsISupports compileQuery(in nsIXULTemplateBuilder aBuilder, in nsIDOMNode aQuery, in nsIAtom aRefVariable, in nsIAtom aMemberVariable); void done(); nsISimpleEnumerator generateResults(in nsISupports aDatasource, in nsIXULTemplateResult aRef, in nsISupports aQuery); nsISupports getDatasource(in nsIArray aDataSources, in nsIDOMNode aRootNode, in boolean aIsTrusted, in nsIXULTemplateBuilder aBuilder, out boolean aShouldDelayBuilding); void initializeForBuilding(in nsISupports aDatasource, in nsIXULTemplateBuilder aBuilder, in nsIDOMNode aRootNode); nsIXULTem...
...n empty enumerator must be returned. The datasource will be the same as the one passed to the earlier initializeForBuilding() method. The context reference aRef is a reference point used when calculating results. The value of aQuery must be the result of a previous call to compileQuery() from this query processor. This method may be called multiple times, typically with different values for aRef. nsISimpleEnumerator generateResults( in nsISupports aDatasource, in nsIXULTemplateResult aRef, in nsISupports aQuery ); Parameters aDatasource Datasource for the data. aRef Context reference value used as a starting point. aQuery The compiled query returned from query compilation. Return value An enumerator of nsIXULTemplateResult objects as the results. Exceptions thrown NS_ERROR_INVALID_ARG If aQuery is ...
Working With Directories - Archive of obsolete content
em.isFile() && item.lastModifiedTime > lastmod.lastModifiedTime) lastmod = item; } return lastmod; } This example iterates through the files in the Home directory and looks for the file with the latest modification time (the last file in that directory that was written to). As the directoryEntries (nsIFile.Attributes) property is an enumeration, you can iterate over the items by using nsISimpleEnumerator.hasMoreElements() and nsISimpleEnumerator.getNext(). For each item, nsIFile.isFile() is called to check if an item is a file and lastModifiedTime (nsIFile.Attributes) attribute is compared with the time of the lastmod reference. If the time is higher, the lastmod variable is updated as needed. The result is that lastmod will be set to the file with the latest modification time. nsIFile.isFile() i...
strings - Archive of obsolete content
<< XUL Reference strings Type: nsISimpleEnumerator An enumeration of all of the strings in the string bundle. The enumeration contains nsIPropertyElement objects. ...
XPCOM Examples - Archive of obsolete content
npopupshowing attribute on the menulist. The first two lines of getCookies() get the menulist and remove all of the existing items in the menu. This is done because getCookies() is called every time the menu is opened and we don't want to leave the old items there each time. Next, the cookie manager is retrieved. The cookie manager has an enumerator method which returns an object which implements nsISimpleEnumerator. This can be used to iterate over all of the cookies. An enumerator has a hasMoreElements() method which will return true until we get to the last cookie. The getNext() method gets a cookie and moves the enumerator index to the next cookie. Since an enumerator just returns a generic object, we need to QueryInterface() it to an nsICookie before we can use it. In this case, we just use the instance...
stringbundle - Archive of obsolete content
appLocale Obsolete since Gecko 1.9.1 Type: nsILocale Returns the XPCOM object which holds information about the user's locale. This is an object which implements nsILocale. src Type: URL Gets and sets the value of the src attribute. stringBundle Type: nsIStringBundle Returns the XPCOM string bundle object which implements nsIStringBundle. strings Type: nsISimpleEnumerator An enumeration of all of the strings in the string bundle. The enumeration contains nsIPropertyElement objects. Methods getFormattedString( key, strArray ) Return type: string Looks up the format string for the given key name in the string bundle and returns a formatted copy where each occurrence of %S (uppercase) is replaced by each successive element in the supplied array. Alternatively...
RDF in Mozilla FAQ - Archive of obsolete content
asource unless removeXMLSinkObserver is called. How do I access the information in a datasource? The nsIRDFDataSource interface is the means by which you access and manipulate the assertions in a datasource. boolean HasAssertion(aSource, aProperty, aTarget, aTruthValue). This tests the datasource to see if it has the specified tuple. nsIRDFNode GetTarget(aSource, aProperty, aTruthValue). nsISimpleEnumerator GetTargets(aSource, aProperty, aTruthValue). nsIRDFResource GetSource(aProperty, aTarget, aTruthValue). nsISimpleEnumerator GetSources(aProperty, aTarget, aTruthValue). nsISimpleEnumerator ArcLabelsIn(aTarget). nsISimpleEnumerator ArcLabelsOut(aSource). You can also use the RDF container interfaces to access information contained in RDF containers. How do I change information in the dataso...
Overview of Mozilla embedding APIs
h does not imply aggregation. Interface status... none Interface definition: nsIInterfaceRequestor.idl nsIWeakReference This interface is used to retern a proxy reference to a component. Interface status... being reviewed Interface definition: nsIWeakReference.idl nsISimpleEmunerator This interface provides a simple enumeration abstraction. Interface status... being reviewed Interface definition: nsISimpleEnumerator.idl nsIServiceManager This interface allows access to global services within mozilla. Interface status... none Interface definition: nsIServiceManager.h nsIShutdownListener This interface is used to receive notifications when the Service Manager is being shutdown. Interface status... none Interface definition: nsIServiceManager.h nsIComponentManager This interface allows new instances of re...
XPCOMUtils.jsm
m, and foo.jsm needs to load bar.jsm, it can do so like this: Components.utils.import("resource://gre/modules/XPCOMUtils.jsm"); XPCOMUtils.importRelative(this, "bar.jsm"); In other words: importRelative will only work from other code modules (such as JSM files). It will NOT work from overlay scripts or bootstrap.js or etc. Details can be found here: bug 628669 IterSimpleEnumerator() Wraps an nsISimpleEnumerator instance into a JavaScript generator that can be easily iterated over. generator IterSimpleEnumerator( enumerator, interface ); Parameters enumerator The nsISimpleEnumerator instance to iterate over. interface The expected interface for each element. Return value A generator yielding enumerated objects. Example const nsIFile = Components.interfaces.nsIFile; for (var file in XPCO...
Using XPCOM Utilities to Make Things Easier
d it also defines the mRefCnt required by NS_IMPL_ISUPPORTS. Furthermore, NS_DECL_ appended with any interface name in all caps will declare all of the methods of that interface for you. For example, NS_DECL_NSIFOO will declare all of the methods of nsIFoo provided that it exists and that nsIFoo.h was generated by the XPIDL compiler. Consider the following real class: class myEnumerator : public nsISimpleEnumerator { public: NS_DECL_ISUPPORTS NS_DECL_NSISIMPLEENUMERATOR myEnumerator(); virtual ~myEnumerator() {} }; The declaration of this nsISimpleEnumerator class doesn't include any methods other than the contructor and destructor. Instead, the class uses the NS_DECL_ macro[nsISupports-warning]. Using these declaration macros not only saves a tremendous amount of time when you're writ...
Detailed XPCOM hashtable guide
tialize using the Init() function; you can specify whether you need thread-safety at this time. Use the Put(), Get(), and Remove() methods to alter the table. Using nsTHashtable as a hash-set A hash set only tracks the existence of keys: it does not associate data with the keys. This can be done using nsTHashtable<nsSomeHashKey>. The appropriate entries are GetEntry and PutEntry. Future Plans nsISimpleEnumerator support The (obsolete) nsHashtable has a wrapper that exposes an nsISimpleEnumerator on its items. I will add this support to the various nsBaseHashtable classes as well, as needed. Hash Functions All of the above hashtables need a Hash Function. This function converts the key into a semi-unique integer. The mozilla codebase already contains hash functions for most key types, including narrow ...
nsICacheEntryDescriptor
Element( in string key, in string value ); Parameters key The key for setting the meta data. value The value for setting the meta data. ...
nsICacheService
shutdown() Obsolete since Gecko 1.8 (Firefox 1.5 / Thunderbird 1.5 / SeaMonkey 1.0) Shutdown() the cache service. void shutdown(); Parameters None. visitEntries() This method visits entries stored in the cache. Used to implement the about:cache URI. void visitEntries( in nsICacheVisitor visitor ); Parameters visitor The entry to be visited. See also nsICache nsISimpleEnumerator nsICacheListener nsICacheSession nsICacheVisitor ...
nsICookieManager
d as a service. It is implemented by the @mozilla.org/cookiemanager;1 component, but should generally be accessed via Services.cookies Method overview void remove(in AUTF8String aHost, in ACString aName, in AUTF8String aPath, in boolean aBlocked, in jsval aOriginAttributes); void removeAll(); Attributes Attribute Type Description enumerator nsISimpleEnumerator Called to enumerate through each cookie in the cookie list. The objects enumerated over are of type nsICookie. Read only. Methods remove() This method is called to remove an individual cookie from the cookie list, specified by host, name, and path. If the cookie cannot be found, no exception is thrown. Typically, the arguments to this method will be obtained directly from the desired ...
nsIDirectoryEnumerator
1.0 66 Introduced Gecko 1.8 Inherits from: nsISupports Last changed in Gecko 1.8 (Firefox 1.5 / Thunderbird 1.5 / SeaMonkey 1.0) Method overview void close(); Attributes Attribute Type Description nextFile nsIFile The next file in the sequence. ...
nsIDirectoryServiceProvider2
xpcom/io/nsIDirectoryService.idlScriptable An extension of nsIDirectoryServiceProvider which allows multiple files to be returned for the given key. Inherits from: nsIDirectoryServiceProvider Last changed in Gecko 0.9.6 Method overview nsISimpleEnumerator getFiles(in string prop); Methods getFiles() The directory service calls this when it gets a request for a prop and the requested type is nsISimpleEnumerator. nsISimpleEnumerator getFiles( in string prop ); Parameters prop The symbolic name of the file list. Return value An enumerator for a list of file locations. The elements in the enumeration are nsIFile. Use an XPCOM return code of NS_SUCCESS_AGGREGATE_RESULT if this result should be aggregated with other "lower" providers. If you are implementing this from JS, you would be us...
nsIDownloadManager
void resumeDownload(in unsigned long aID); void retryDownload(in unsigned long aID); void saveState(); Obsolete since Gecko 1.8 void startBatchUpdate(); Obsolete since Gecko 1.9.1 Attributes Attribute Type Description activeDownloadCount long The number of files currently being downloaded. Read only. activeDownloads nsISimpleEnumerator An enumeration of active nsIDownloads. Read only. canCleanUp boolean Whether or not there are downloads that can be cleaned up (removed) that is downloads that have completed, have failed or have been canceled. Read only. datasource nsIRDFDataSource Read only. Obsolete since Gecko 1.8 DBConnection mozIStorageConnection The database connection to the...
nsIEnumerator
Sample usage var iter = --------(); try { iter.first(); do { var data = iter.currentItem(); if( data instanceof Ci.nsI------ ) { ... ... ...
nsIFile
Each element in the enumeration is an nsIFile. Read only. Exceptions thrown NS_ERROR_FILE_NOT_DIRECTORY Indicates that this nsIFile does not reference a directory. diskSpaceAvailable PRInt64 The number of bytes available to non-superuser on the disk volume containing the nsIFile. Read only. ...
nsIFilePicker
Exceptions thrown NS_ERROR_FAILURE If you try to read this attribute. displayDirectory nsILocalFile The directory that the file picker dialog should initially display. This should be set this before calling open() or show() to specify a starting point. file nsILocalFile The currently selected file or directory. Read only. files nsISimpleEnumerator An enumerator of the currently selected files. Read only. Note: Only works with modeOpenMultiple mode. fileURL nsIURI The URI of the currently selected file or directory. Read only. filterIndex long The (0-based) index of the filter which is currently selected in the file picker dialog. Set this to choose a particular filter to be selected by default. ...
nsILoadGroup
request is null, then the group's load flags are not changed. groupObserver nsIRequestObserver The group observer is notified when requests are added to and removed from this load group. The groupObserver is weak referenced. notificationCallbacks nsIInterfaceRequestor Notification callbacks for the load group. requests nsISimpleEnumerator Returns the requests contained directly in this group. Enumerator element type: nsIRequest. Read only. Methods addRequest() Adds a new request to the group. This will cause the default load flags to be applied to the request. If this is a foreground request then the groupObserver's onStartRequest will be called. If the request is the default load request or if the default load requ...
nsIMsgFolder
. prettyName AString Old nsIFolder properties and methods. abbreviatedName AString Readonly: Old nsIFolder properties and methods. parent nsIMsgFolder Old nsIFolder properties and methods. parentMsgFolder nsIMsgFolder Readonly: Handy accessor when we want a msg folder. dBTransferInfo nsIDBFolderInfo subFolders nsISimpleEnumerator Readonly: Returns an enumerator containing a list of nsIMsgFolder items that are subfolders of the instance this is called on. hasSubFolders boolean Readonly: Returns true if this folder has sub folders. messages nsISimpleEnumerator Readonly: Returns a list of Components.interfaces.nsIMsgDBHdr. numSubFolders unsigned long Readonly: Returns the numbe...
getNext
...
hasMoreElements
...
nsIStringBundleOverride
= Components.classes["@mozilla.org/intl/stringbundle/text-override;1"] .getService(Components.interfaces.nsIStringBundleOverride); Note: You should never need to use this service directly. Instead, the string bundle service will automatically try to load this service. If there is no custom-strings.txt file then the service will fail to load. Method overview nsISimpleEnumerator enumerateKeysInBundle(in AUTF8String url); AString getStringFromName(in AUTF8String url, in ACString key); Methods enumerateKeysInBundle() Get all override keys for a given string bundle. nsISimpleEnumerator enumerateKeysInBundle( in AUTF8String url ); Parameters url The URL of the original string bundle whose keys are to be overridden. Return value An enumeration of nsIPropertyElement ...
nsIToolkitProfileService
AUTF8String aName); nsIProfileLock lockProfilePath(in nsILocalFile aDirectory, in nsILocalFile aTempDirectory); Attributes Attribute Type Description profileCount unsigned long The number of user profiles currently in existence. This will always return 0, 1, or 2; if there are more than 2 profiles, 2 is always returned. Read only. profiles nsISimpleEnumerator An enumerator providing access to the list of profiles; each profile is an nsIToolkitProfile object (though you must first call aProfile.QueryInterface(Components.interfaces.nsIToolkitProfile) to get access to its attributes and methods). selectedProfile nsIToolkitProfile The profile that is marked as "Default=1" in the Profiles.ini file. (NOT the profile currently in use.) Not ...
XPCOM Interface Reference
ScriptErrornsIScriptError2nsIScriptableIOnsIScriptableInputStreamnsIScriptableUnescapeHTMLnsIScriptableUnicodeConverternsIScrollablensISearchEnginensISearchSubmissionnsISecurityCheckedComponentnsISeekableStreamnsISelectionnsISelection2nsISelection3nsISelectionControllernsISelectionImageServicensISelectionPrivatensIServerSocketnsIServerSocketListenernsIServiceManagernsISessionStartupnsISessionStorensISimpleEnumeratornsISmsDatabaseServicensISmsRequestManagernsISmsServicensISocketProvidernsISocketProviderServicensISocketTransportnsISocketTransportServicensISoundnsISpeculativeConnectnsIStackFramensIStandardURLnsIStreamConverternsIStreamListenernsIStringBundlensIStringBundleOverridensIStringBundleServicensIStringEnumeratornsIStructuredCloneContainernsIStyleSheetServicensISupportsnsISupports proxiesnsISupportsArra...
XPCOM Interface Reference by grouping
erson nsIFeedProcessor nsIFeedProgressListener nsIFeedResult nsIFeedResultListener nsIFeedTextConstruct script mozIJSSubScriptLoader storage mozIStorageVacuumParticipant Util nsIEffectiveTLDService Worker nsIAbstractWorker Data nsIArray nsICategoryManager nsICollection nsIDictionary nsIMutableArray nsISimpleEnumerator nsISupportsChar nsISupportsDouble nsISupportsFloat nsISupportsID nsISupportsInterfacePointer nsISupportsPRBool nsISupportsPrimitive nsISupportsPRInt16 nsISupportsPRInt32 nsISupportsPRInt64 nsISupportsPriority nsISupportsPRTime nsISupportsPRUint16 nsISupportsPRUint32 nsISupportsPRUint64 nsISupportsPRUint8 nsISupportsString nsI...
nsIAbCard/Thunderbird3
firstName AString Shorthand for getProperty and setProperty. lastName AString Shorthand for getProperty and setProperty. displayName AString Shorthand for getProperty and setProperty. primaryEmail AString Shorthand fo...
XPCOM
e a C++ class which implements nsIClassInfo from JavaScript, then you don't have to explicitly call QueryInterface on the JavaScript object to access the object's interfaces.Using nsIDirectoryServicensDirectoryService implements the nsIProperties interface. This implementation will allow you to Get(), Set(), Define(), and Undefine() nsIFile.Using nsIPasswordManagerTechnical review completed.Using nsISimpleEnumeratorUsing the clipboardThis section provides information about cutting, copying, and pasting to and from the clipboard.Using the Gecko SDKWeak referenceIn XPCOM, a weak reference is a special object that contains a pointer to an XPCOM object, but doesnot keep that object alive. If the referent object is destroyed before the weak reference, the pointer inside the weak reference is set to nsnull.Working...
Address Book examples
that is what is used here This article provides examples on accessing and manipulating Thunderbird address books. Address book interfaces provides an overview of the related interfaces. See An overview of Thunderbird components for a general description of the Thunderbird user interface and related programmatic interfaces. How do I get all address books? Use the Address Book Manager to get an nsISimpleEnumerator, then progress through the enumerator, looking for nsIAbItem, nsIAbCollection or nsIAbDirectory interfaces as you require. let abManager = Components.classes["@mozilla.org/abmanager;1"] .getService(Components.interfaces.nsIAbManager); let allAddressBooks = abManager.directories; while (allAddressBooks.hasMoreElements()) { let addressBook = allAddressBooks.getNext() ...
Folders and message lists
drs. Like selectMessage, this function will attempt to scroll the view so the entire selection is visible (which may not be possible for large selections). gFolderDisplay.clearSelection(): Clears the list of selected messages. Listing Messages in a Folder If you have a message folder, and would like to list all the messages in that folder, you can use the .messages attribute, which returns an nsISimpleEnumerator. It's used like this: // Import the fixIterator() function. Components.utils.import("resource:///modules/iteratorUtils.jsm"); for (let msgHdr in fixIterator(myFolder.messages, Components.interfaces.nsIMsgDBHdr)) { // Do something with msgHdr... } ...