[scriptable, uuid(53b51afe-9de8-40ad-9c81-f2cc1701f1ff)]
interface nsINavHistoryQuery : nsISupports

Constants

 This object encapsulates all the query parameters you're likely to need
 when building up history UI. All parameters are ANDed together.

 This is not intended to be a super-general query mechanism. This was designed
 so that most queries can be done in only one SQL query. This is important
 because, if the user has their profile on a networked drive, query latency
 can be non-negligible.


 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.
const unsigned long TIME_RELATIVE_EPOCH = 0

          
const unsigned long TIME_RELATIVE_TODAY = 1

          
const unsigned long TIME_RELATIVE_NOW = 2

Attributes


          
readonly attribute PRTime absoluteBeginTime

          
readonly attribute PRTime absoluteEndTime

          
attribute AUTF8String annotation
 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.
attribute boolean annotationIsNot

          
attribute PRTime beginTime

          
attribute unsigned long beginTimeReference
 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.
attribute AUTF8String domain
 This controls the meaning of 'domain', and whether it is an exact match
 'domainIsHost' = true, or hierarchical (= false).
attribute boolean domainIsHost

          
attribute PRTime endTime

          
attribute unsigned long endTimeReference

          
readonly attribute unsigned long folderCount

          
readonly attribute boolean hasAnnotation

          
readonly attribute boolean hasBeginTime

          
readonly attribute boolean hasDomain

          
readonly attribute boolean hasEndTime

          
readonly attribute boolean hasSearchTerms

          
readonly attribute boolean hasUri

          
attribute long maxVisits
 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.
attribute long minVisits
 When set, returns only bookmarked items, when unset, returns anything. Setting this
 is equivalent to listing all bookmark folders in the 'folders' parameter.
attribute boolean onlyBookmarked
 Text search terms.
attribute AString searchTerms
 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.
attribute nsIURI uri
 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".
attribute boolean uriIsPrefix

Methods

 Creates a new query item with the same parameters of this one.
 Limit results to items that are in all of the given folders.
void getFolders(out unsigned long count, [array, retval, size_is(count)] out long long folders)
 For the special result type RESULTS_AS_TAG_CONTENTS we can define only
 one folder that must be a tag folder. This is not recursive so results
 will be returned from the first level of that folder.
void setFolders([const, array, size_is(folderCount)] in long long folders, in unsigned long folderCount)