Location Navigator
| resources: | Home Installation Mailing List User Feedback Source Code Members |
|---|
Builders are xpcom components that are used to do the incrementing in "Location Navigator". I'm looking for people to get involved an help create new ways to increment locations. To do this we need to create new builders. There are 2 requirements for creating a builder. The component must implement the navIBuilder interface I created, and it must register as a category entry for "urlnav-builders". You can take a look at the navIBuilder interface below:
/**
* Interface for incrementing a value. Implementations of this
* interface can be used to add different types of url building
* add a category entry for urlnav-builders to list your builder
*/
[scriptable, uuid(C9F4AB62-9E2B-4995-A66C-F0947604D8A4)]
interface navIBuilder: nsISupports {
//name of the builder
readonly attribute AString name;
//url of a preference pane for options.xul
readonly attribute AString pane;
//url of a settings overlay for capture.xul
readonly attribute AString overlay;
//used to define properties of a builder
readonly attribute nsIWritablePropertyBag properties;
//main function used to increment a value
AString increment(in AString aValue, in unsigned long aDirection);
//select an initial portion of the capture textbox
void guess(in nsIDOMNode aTextbox);
};
- The name attribute is a readonly string for the name of the builder. This is used in several places when listing builders.
- The pane attribute is a chrome url for a preference window for your builder. Set it to an empty string to not have an options button. The url must point at a prefwindow implementation.
- The overlay attribute is a chrome url for any settings for your builder at capture time. Set it to an empty string to not overlay the capture dialog. The overlay is loaded dynamically, and you can register for 2 events in your overlay, "load" and "accept".
- The properties attribute is a writable property bag that holds any properties associated with your builder. The default builders use this for holding min, max, and step values.
- The increment function is the heart of a builder. It is what actually increments the value. A value string and direction is passed in and the new value string is returned. The direction is a constant defined on the navIList interface.
- The guess function is used in the capture dialog to select an initial portion of the url when the dialog is opened.