WARNING: Most of this content (with the exception of the Mozilla 1.9 XPCOM reference) is very old, and can be expected to be out of date and possibly obsolete. For better XUL documentation, please visit the XUL hub at the Mozilla Developer Center.

nsINavHistoryQuery

IID:53B51AFE-9DE8-40AD-9C81-F2CC1701F1FF
Inherits From:nsISupports

Constants

Time range for results (INCLUSIVE). The *TimeReference is one of the constants TIME_RELATIVE_* which indicates how to interpret the corresponding time value. TIME_RELATIVE_EPOCH (default): The time is relative to Jan 1 1970 GMT, (this is a normal PRTime) TIME_RELATIVE_TODAY: The time is relative to this morning at midnight. Normally used for queries relative to today. For example, a "past week" query would be today-6 days -> today+1 day TIME_RELATIVE_NOW: The time is relative to right now.

Note: PRTime is in MICROseconds since 1 Jan 1970. Javascript date objects are expressed in MILLIseconds since 1 Jan 1970.

As a special case, a 0 time relative to TIME_RELATIVE_EPOCH indicates that the time is not part of the query. This is the default, so an empty query will match any time. The has* functions return whether the corresponding time is considered.

You can read absolute*Time to get the time value that the currently loaded reference points + offset resolve to.

PRUint32 TIME_RELATIVE_EPOCH = 0
PRUint32 TIME_RELATIVE_TODAY = 1
PRUint32 TIME_RELATIVE_NOW = 2

Properties

readonly PRTime absoluteBeginTime

readonly PRTime absoluteEndTime

AUTF8String annotation

PRBool annotationIsNot

Test for existance or non-existance of a given annotation. We don't currently support >1 annotation name per query. If 'annotationIsNot' is true, we test for the non-existance of the specified annotation.

Testing for not annotation will do the same thing as a normal query and remove everything that doesn't have that annotation. Asking for things that DO have a given annotation is a little different. It also includes things that have never been visited. This allows place queries to be returned as well as anything else that may have been tagged with an annotation. This will only work for RESULTS_AS_URI since there will be no visits for these items.

PRTime beginTime

PRUint32 beginTimeReference

AUTF8String domain

This is the host or domain name (controlled by domainIsHost). When domainIsHost, domain only does exact matching on host names. Otherwise, it will return anything whose host name ends in 'domain'.

This one is a little different than most. Setting it to an empty string is a real query and will match any URI that has no host name (local files and such). Set this to NULL (in C++ use SetIsVoid) if you don't want domain matching.

PRBool domainIsHost

This controls the meaning of 'domain', and whether it is an exact match 'domainIsHost' = true, or hierarchical (= false).

PRTime endTime

PRUint32 endTimeReference

readonly PRUint32 folderCount

readonly PRBool hasAnnotation

readonly PRBool hasBeginTime

readonly PRBool hasDomain

readonly PRBool hasEndTime

readonly PRBool hasSearchTerms

readonly PRBool hasUri

PRInt32 maxVisits

PRInt32 minVisits

Set lower or upper limits for how many times an item has been visited. The default is -1, and in that case all items are matched regardless of their visit count.

PRBool onlyBookmarked

When set, returns only bookmarked items, when unset, returns anything. Setting this is equivalent to listing all bookmark folders in the 'folders' parameter.

AString searchTerms

Text search terms.

nsIURI uri

This is a URI to match, to, for example, find out every time you visited a given URI. Use uriIsPrefix to control whether this is an exact match.

PRBool uriIsPrefix

Controls the interpretation of 'uri'. When unset (default), the URI will request an exact match of the specified URI. When set, any history entry beginning in 'uri' will match. For example "http://bar.com/foo" will match "http://bar.com/foo" as well as "http://bar.com/foo/baz.gif".


Methods

nsINavHistoryQuery clone ( ) void getFolders ( out PRUint32 count , out arrayof PRInt64 folders ) void setFolders ( arrayof PRInt64 folders , PRUint32 folderCount )

nsINavHistoryQuery clone ( )

Creates a new query item with the same parameters of this one.


void getFolders ( out PRUint32 count , out arrayof PRInt64 folders )

Limit results to items that are in all of the given folders.

Arguments:
count
folders

void setFolders ( arrayof PRInt64 folders , PRUint32 folderCount )

Arguments:
folders
folderCount

References

This interface is passed as an argument to the following methods:

nsINavHistoryService.executeQuery

This interface is returned from the following methods:

nsINavHistoryQuery.clone, nsINavHistoryService.getNewQuery

Reference documentation is generated from Mozilla's source.