nsIMicrosummaryService.idl
Go to the documentation of this file.
1 
2 #include "nsISupports.idl"
3 
4 interface nsIDOMDocument;
5 interface nsIDOMNode;
6 interface nsIURI;
7 interface nsISimpleEnumerator;
8 interface nsIMicrosummary;
9 
10 [scriptable, uuid(560b0980-be95-47e9-81cc-4428c073127c)]
12 {
24  void onContentLoaded(in nsIMicrosummary microsummary);
25 
33  void onError(in nsIMicrosummary microsummary);
34 
43  void onElementAppended(in nsIMicrosummary microsummary);
44 };
45 
46 
47 [scriptable, uuid(05b48344-d0a7-427e-934e-9a6e0d5ecced)]
49 {
50  // Has the generator itself, which may be a remote resource, been loaded.
51  readonly attribute boolean loaded;
52 
53  // An arbitrary descriptive name for this microsummary generator.
54  readonly attribute AUTF8String name;
55 
56  // The canonical location and unique identifier of the generator.
57  // It tells us where the generator comes from and where to go for updates.
58  //
59  // For generators referenced by web pages via <link> tags, this URI is
60  // the URL specified by the tag.
61  //
62  // For generators installed via nsSidebar::addMicrosummaryGenerator,
63  // this URI is a URN of the form urn:source:<url>, where <url> is the
64  // remote location from which we installed the generator.
65  //
66  // For generators installed via some other mechanism (f.e. an extension
67  // that dynamically creates generators), this URI is a URN in a form
68  // of the extension's own choosing, with the only restriction being that
69  // the URI be globally unique. To ensure this, we recommend that such
70  // extensions incorporate UUIDs created by nsUUIDGenerator into the URNs
71  // of the generators they create.
72  readonly attribute nsIURI uri;
73 
78  boolean equals(in nsIMicrosummaryGenerator aOther);
79 
80  // For generators installed by the user or bundled with the browser, the
81  // local URI points to the location of the local file containing the
82  // generator's XML.
83  readonly attribute nsIURI localURI;
84 
85  // Whether or not this generator needs page content to generate
86  // a microsummary. Microsummaries generated by XSLT templates need page
87  // content, while those which represent the actual microsummary content
88  // do not.
89  readonly attribute boolean needsPageContent;
90 
105  AString generateMicrosummary(in nsIDOMNode aPageContent);
106 
117  long calculateUpdateInterval(in nsIDOMNode aPageContent);
118 };
119 
120 
121 [scriptable, uuid(6867dc21-077f-4462-937d-cd8b7c680e0c)]
123 {
124  // the URI of the page being summarized
125  readonly attribute nsIURI pageURI;
126 
127  // The generator that generates this microsummary. May need to be loaded.
129 
130  // The content of the microsummary.
131  // Since generators and pages can be remote resources, and we need them
132  // to generate the content, this may not always be available.
133  readonly attribute AString content;
134 
135  // The minimum interval after which this microsummary would like to be refreshed
136  // (or null if it doesn't care).
137  readonly attribute long updateInterval;
138 
139  // Used when a site author has indicated that a microsummary (or an
140  // associated generator) will no longer be available.
141  readonly attribute boolean needsRemoval;
142 
151 
160 
168  boolean equals(in nsIMicrosummary aOther);
169 
176  void update();
177 };
178 
179 [scriptable, uuid(7111e88d-fecd-4b17-b7a9-1fa74e23153f)]
181 {
191 
199  void removeObserver(in nsIMicrosummaryObserver observer);
200 
208 };
209 
210 
211 [scriptable, uuid(D58143A2-74FA-4B13-94ED-113AF8936D80)]
213 {
223  nsIMicrosummaryGenerator getGenerator(in nsIURI generatorURI);
224 
233  void addGenerator(in nsIURI generatorURI);
234 
244  nsIMicrosummaryGenerator installGenerator(in nsIDOMDocument xmlDefinition);
245 
256 
279  nsIMicrosummarySet getMicrosummaries(in nsIURI pageURI,
280  in long long bookmarkID);
281 
292  nsIMicrosummary getMicrosummary(in long long bookmarkID);
293 
306  nsIMicrosummary createMicrosummary(in nsIURI pageURI, in nsIURI generatorURI);
307 
318  void setMicrosummary(in long long bookmarkID,
319  in nsIMicrosummary microsummary);
320 
328  void removeMicrosummary(in long long bookmarkID);
329 
340  boolean hasMicrosummary(in long long bookmarkID);
341 
356  boolean isMicrosummary(in long long bookmarkID,
357  in nsIMicrosummary microsummary);
358 
377  nsIMicrosummary refreshMicrosummary(in long long bookmarkID);
378 };
379 
380 [scriptable, uuid(f9e577a8-19d9-4ca0-a140-b9e43f014470)]
382 {
383  // The ID of the bookmark displaying this title.
384  // Note: in the old bookmarks code, this is an RDF resource. In Places
385  // it is currently a URI, but after the fix for bug 360133 lands it will
386  // become an integer.
387  readonly attribute long long bookmarkID;
388 
389  // The microsummary being displayed as the live title for the bookmark.
390  // The actual value of the microsummary (i.e. the string that gets displayed
391  // to the user) is stored in the content property of this object.
392  readonly attribute nsIMicrosummary microsummary;
393 };
readonly attribute boolean needsPageContent
long calculateUpdateInterval(in nsIDOMNode aPageContent)
readonly attribute long updateInterval
void onError(in nsIMicrosummary microsummary)
readonly attribute nsIURI pageURI
void addObserver(in nsIMicrosummaryObserver observer)
nsIMicrosummaryGenerator installGenerator(in nsIDOMDocument xmlDefinition)
void removeMicrosummary(in long long bookmarkID)
var uuid
boolean isMicrosummary(in long long bookmarkID, in nsIMicrosummary microsummary)
nsIMicrosummaryGenerator getGenerator(in nsIURI generatorURI)
AString generateMicrosummary(in nsIDOMNode aPageContent)
nsIMicrosummarySet getMicrosummaries(in nsIURI pageURI, in long long bookmarkID)
boolean equals(in nsIMicrosummary aOther)
attribute nsIMicrosummaryGenerator generator
nsISimpleEnumerator Enumerate()
function d(s)
readonly attribute nsIURI localURI
readonly attribute AString content
readonly attribute boolean needsRemoval
void addGenerator(in nsIURI generatorURI)
readonly attribute nsIURI uri
readonly attribute nsIMicrosummary microsummary
nsIMicrosummary createMicrosummary(in nsIURI pageURI, in nsIURI generatorURI)
void setMicrosummary(in long long bookmarkID, in nsIMicrosummary microsummary)
nsIMicrosummary refreshMicrosummary(in long long bookmarkID)
boolean hasMicrosummary(in long long bookmarkID)
readonly attribute boolean loaded
void onElementAppended(in nsIMicrosummary microsummary)
nsIMicrosummary getMicrosummary(in long long bookmarkID)
void addObserver(in nsIMicrosummaryObserver observer)
void removeObserver(in nsIMicrosummaryObserver observer)
void onContentLoaded(in nsIMicrosummary microsummary)
nsISimpleEnumerator getBookmarks()
readonly attribute long long bookmarkID
void removeObserver(in nsIMicrosummaryObserver observer)
readonly attribute AUTF8String name
boolean equals(in nsIMicrosummaryGenerator aOther)
let observer