My favorites | English | Sign in

Google Desktop APIs (Labs)

Gadget API Reference

This page describes the Google Desktop Gadget API — the objects, methods, and properties you can use in your desktop gadgets. Unless otherwise noted, everything documented on this page has been available since Google Desktop 4. For a complete list of what changed in each release, see the Release Notes. For help on using the Gadget API, see Creating a Gadget.

Besides APIs defined by Google Desktop, your gadget can also use the core JavaScript API, the standard XMLHttpRequest class, and the W3C Level 1 DOM. For details, see APIs that a Gadget Can Use.

Contents

In the following list, italics mark links to other pages.

Back to top

gadget.debug

Exposes APIs useful for developing and debugging gadgets. To run in debug mode, unzip your gadget and, from the file you unzipped it to, double-click the gadget.gmanifest file.

Methods

Name and Arguments Description Returns
error(string Message) When the gadget is running in debug mode, displays the string Message in the debug console as an error. void
trace(string Message) When the gadget is running in debug mode, displays the string Message in the debug console. void
warning(string Message) When the gadget is running in debug mode, displays the string Message in the debug console as a warning. void

Back to top

gadget.storage

Provides access to the contents of the gadget package.

Methods

Name and Arguments Description Returns
extract(string filename) Extracts a file from the gadget package to the temp folder and returns the full path to the file extracted. string
openText(string filename) Opens a file from the gadget package and returns the contents as a string. string

Back to top

view

Each view object contains elements (objects that inherit from basicElement). Unlike its children, view does not inherit from basicElement. You must define a view object, in a separate XML file, for each pane UI of your gadget.

Properties

Name Description Type Read/Write
caption Title for this view, by default shown when a gadget is in floating/expanded mode but not shown when the gadget is in the Sidebar. See also the showCaptionAlways property. string Read-Write
children Returns a collection that contains the immediate children of the view element. These children will all be objects descended from basicElement. Only accessible via scripts, not from XML definitions. elements Read
event How the event object is exposed to scripts for event handlers. event Read
height Sets or returns the height of the view, in pixels. integer Read-Write
width Sets or returns the width of the view, in pixels. integer Read-Write
resizable Indicates what happens when the user attempts to resize the gadget using the window border. When "false", the user can't resize the view. When "true", the view is resized and gets an onsize event, letting it reposition its controls to make use of the additional space. When "zoom", the user can resize the window but the view's height and width remain the same; the contents of the view are stretched to fit the window's size. string Read-Write
showCaptionAlways When true, the Sidebar always shows the caption (specified in the caption property) for this view. By default or when this value is false, the caption is not shown when the gadget is in the Sidebar, and is shown when it is in the floating or expanded modes. boolean Read-Write

Methods

Name and Arguments Description Returns
alert(string message) Displays a message box containing the message string. void
appendElement(string xml) Parses the provided element definition, given in XML format, and appends the element as the last child of this view. The new element
beginAnimation(string script, integer startValue, integer endValue, integer duration) Starts an animation timer. The timer runs for duration milliseconds. Script is executed periodically during this time with a value between StartValue and EndValue. An integer identifier that can be used to cancel the animation. Note: The number of times Callback is called depends on the performance and current load of the system. It may be as high as 100 fps.
cancelAnimation(integer Token) Cancels a currently running animation. Token is the identifier returned by beginAnimation. void
clearInterval(integer Token) Cancels an interval or timeout. void
clearTimeout(integer Token)
(added 5.1)
Cancels a timeout that was scheduled using the view setTimeout method. The argument is the token returned by setTimeout. void
confirm(string message) Displays a confirmation box containing the message string. Returns true if OK is pressed, false if not. boolean
insertElement(string xml, element InsertBefore) Parses the XML provided and inserts the element immediately before the InsertBefore element. The new element
prompt(string question, string defaultAnswer)
(added 5.5)
Shows a dialog asking the user to enter text. The first parameter is the prompt shown in the dialog; for example, "Please enter your name". The second parameter is the default text in the edit field; use "" to specify no default text. The return value is the text in the edit field. string
removeAllElements()
(added 5.5)
Removes and destroys all elements contained by this view. void
removeElement(element Item) Removes the specified element. void
resizeBy(integer width, integer height) Changes the size of the view by the specified width and height, based on the view's current width and height. Units are in pixels. void
resizeTo(integer width, integer height) Changes the size of the view to the specified width and height, in pixels. void
setTimeout(string Script, integer Duration) Creates run-once timer. The script will be executed once, after Duration milliseconds. An integer token that can be used to cancel the timeout.
setInterval(string Script, integer Duration) Creates a run-forever timer. The Script will be executed every Duration milliseconds until it is canceled. An integer token that can be used to cancel the interval.

Events

Name Description
oncancel
(added 5.0)
Fires when the user chooses the Cancel button in an options view.
onclick Fires when the left mouse button is clicked.
onclose Fires when the view is about to be closed.
ondblclick Fires when the left mouse button is double-clicked.
ondock
(added 5.1)
Fires when the gadget is moved into the Sidebar.
onkeydown Fires when a key is pressed down.
onkeypress Fires when a key is pressed and released.
onkeyup Fires when a key is released.
onminimize Fires when the gadget is minimized.
onmousedown Fires when the left mouse button is pressed.
onmousemove Fires when the user moves the cursor while over the view.
onmouseout Fires when the mouse cursor leaves the view.
onmouseover Fires when the mouse cursor enters the view.
onmouseup Fires when the left mouse button is released.
onok
(added 5.0)
Fires when the user chooses the OK button in an options view.
onopen Fires when the view is first opened.
onoptionchanged Fires when a property in the options object is added, changed, or removed. event.propertyName specifies which item was changed.
onpopin
(added 5.1)
Fires when the gadget's expanded view closes.
onpopout Fires when the gadget's expanded view opens.
onrclick
(added 5.5)
Fires when the right mouse button is clicked.
onrdblclick
(added 5.5)
Fires when the right mouse button is double clicked.
onrestore Fires when the gadget is restored from the minimized state.
onsize Fires after the view has changed to a new size either as a result of script code modifying the size (e.g. setting view.width or view.height, or calling view.resizeBy or view.resizeTo) or after onsizing was called and a new size was specified. This event cannot be canceled.
onsizing Fires when the user is resizing the gadget. Only fires if resizable is set to true. event.width and event.height contain the new width and height requested by the user. The event code can cancel the event (event.returnValue = false) which causes the gadget to keep its current size. The event code can modify event.width and event.height to change to override the user's selection.
onundock
(added 5.1)
Fires when the gadget is moved out of the Sidebar.

Back to top

basicElement

The basicElement object defines the properties, methods, and events exposed on all elements, with specific elements inheriting what's defined here. When a method is said to return an element, that means an element defined in the gadget's XML definition, descended from basicElement.

Properties

Name Description Type Read/Write
children Retrieves a collection that contains the immediate children of this element. Only accessible via scripts, not from XML definitions. This property is intended for elements (such as div, listbox, and item) that contain other elements. elements Read
cursor Sets or retrieves the cursor to display when the mouse is over this element. Possible values: arrow, ibeam, wait, cross, uparrow, size, sizenwse, sizenesw, sizewe, sizens, sizeall, no, hand, busy, help string Read-Write
dropTarget Sets or retrieves whether this element is a target for drag/drop operations. If true, the ondrag* events will fire when a drag/drop operation is initiated by the user. boolean Read-Write
enabled Sets or retrieves whether or not the element is enabled. Disabled elements do not fire any mouse or keyboard events. boolean Read-Write
height Sets or retrieves the height. The value can be expressed in pixels or as a percentage of the parent's height. integer or string Read-Write
hitTest Sets or retrieves the hit-test value for this element. Possible values: httransparent, htnowhere, htclient, htcaption, htsysmenu, htsize, htmenu, hthscroll, htvscroll, htminbutton, htmaxbutton, htleft, htright, httop, httopleft, httopright, htbottom, htbottomleft, htbottomright, htborder, htobject, htclose, hthelp string Read-Write
mask Sets or retrieves the mask bitmap that defines the clipping path for this element. string Read-Write
name Retrieves the name of the element. string Read
offsetHeight Retrieves the height of the element relative to its parent element, in pixels. This mimics the same-named DHTML property. Only accessible via scripts, not from XML definitions. integer Read
offsetWidth Retrieves the width of the element relative to its parent element, in pixels. This mimics the same-named DHTML property. Only accessible via scripts, not from XML definitions. integer Read
offsetX Retrieves the x position of the element relative to its parent element, in pixels. This mimics the same-named DHTML property. Only accessible via scripts, not from XML definitions. integer Read
offsetY Retrieves the y position of the element relative to its parent element, in pixels. This mimics the same-named DHTML property. Only accessible via scripts, not from XML definitions. integer Read
opacity Sets or retrieves the opacity of the element. Valid range: 0-255 integer Read-Write
parentElement Retrieves the parent element. Only accessible via scripts, not from XML definitions. element Read
pinX Sets or retrieves the horizontal pin. integer Read-Write
pinY Sets or retrieves the vertical pin. integer Read-Write
rotation Sets or retrieves the rotation of the element, in degrees. float Read-Write
tagName Retrieves the name of the tag. Only accessible via scripts, not from XML definitions. string Read
tooltip Sets or retrieves the tooltip displayed when the mouse hovers over this element. string Read-Write
width Sets or retrieves the width. The value can be expressed in pixels or as a percentage of the parent's width. integer or string Read-Write
visible Sets or retrieves whether or not the element is visible. boolean Read-Write
x Sets or retrieves the horizontal position. The value can be expressed in pixels or as a percentage of the parent's width. integer or string Read-Write
y Sets or retrieves the vertical position. The value can be expressed in pixels or as a percentage of the parent's height. integer or string Read-Write

Methods

Name and ArgumentsDescriptionReturns
appendElement(string xml) Parses the XML provided and appends the element as the last child of this element. This method is appropriate only for elements (such as div, listbox, and item) that contain other elements. The new element
focus()
(added 5.1)
Gives the keyboard focus to the element. void
insertElement(string xml, element InsertBefore) Parses the XML provided and inserts the element immediately before the InsertBefore element. The new element
killFocus()
(added 5.1)
Removes the keyboard focus from the element. void
removeElement(element Item) Removes the specified element. This method is appropriate only for elements (such as div, listbox, and item) that contain other elements. void
removeAllElements()
(added 5.1)
Removes and destroys all immediate children of this element. This method is appropriate only for elements (such as div, listbox, and item) that contain other elements. void

Events

Name Description
onclick Fires when the user clicks on the element with the left mouse button.
ondblclick Fires when the user double clicks on the element with the left mouse button.
ondragdrop Fires when the user drops something on the element.
ondragout Fires when the user cancels a drag/drop operation.
ondragover Fires when the user drops an object over the element.
onfocusin Fires when the element receives keyboard focus.
onfocusout Fires when the element loses keyboard focus.
onkeydown Fires when the user presses a key down.
onkeypress Fires when the user presses and releases a key.
onkeyup Fires when the user releases a key.
onmousedown Fires when the user presses the mouse button.
onmousemove Fires whenever the user moves the cursor while over the element.
onmouseout Fires when the user moves the cursor outside of the element.
onmouseover Fires when the user moves the cursor over the element.
onmouseup Fires when the user releases the mouse button.
onmousewheel Fires when the user scrolls the mouse wheel.
onrclick
(added 5.5)
Fires when the user clicks on the element with the right mouse button.
onrdblclick
(added 5.5)
Fires when the user double clicks on the element with the right mouse button.
onsize Fires after the element has changed to a new size.

Back to top

elements

Represents a container of element objects. Use elements.item("foo") to get an element.

Properties

Name Description Type Read/Write
count Returns the number of elements in the collection. integer Read
item (string Name) Returns the element identified by the Name parameter. If multiple elements are defined with the same name, returns the first one. Returns null if no elements match. element Read

Back to top

button

Button object, also inherits all of the properties and methods of the basicElement object. As of 5.5, buttons can also use all label properties except innerText.

Properties

Name Description Type Read/Write
disabledImage Sets or retrieves the image to display when the button is disabled. string Read-Write
downImage Sets or retrieves the image to display when the button is pressed. string Read-Write
image Sets or retrieves the default image for the button. string Read-Write
overImage Sets or retrieves the image to display when the mouse is over the button. string Read-Write

Back to top

checkbox

Checkbox object, also inherits all of the properties and methods of the basicElement object. As of 5.5, checkboxes can also use all label properties except innerText.

Properties

Name Description Type Read/Write
image Sets or retrieves the default image for the checkbox. string Read-Write
checkedDisabledImage Sets or retrieves the image to display when the checkbox is both checked and disabled. string Read-Write
checkedDownImage Sets or retrieves the image to display when the checkbox is both checked and pressed. string Read-Write
checkedOverImage Sets or retrieves the image to display when the checkbox is checked and the mouse is over the checkbox. string Read-Write
checkedImage Sets or retrieves the default image to display when the checkbox is checked. string Read-Write
disabledImage Sets or retrieves the image to display when the checkbox is disabled. string Read-Write
downImage Sets or retrieves the image to display when the checkbox is pressed. string Read-Write
overImage Sets or retrieves the image to display when the mouse is over the button. string Read-Write
value Returns true if the checkbox is checked. boolean Read-Write

Events

Name Description
onchange Fires when the value property changes.

Back to top

object

(Windows only)

Embedded object, which is a windowless ActiveX control, also inherits all of the properties and methods of the basicElement object.

Properties

Name Description Type Read/Write
classId Retrieves the classId used to create the ActiveX control. Note that when defining an objectElement in XML, classId's value must be in the form of either "clsid:GUID_value" or "progid:progid_value", including the quotation marks. string Read
object Retrieves the ActiveX control being hosted. object Read
wmpServiceType Sets or retrieves the service type for the embedded object when that object is Windows Media Player. string Read-Write
wmpSkin Sets or retrieves the name of the Windows Media Player skin file to host within the gadget. The skin file should be packaged in the .gg file. string Read-Write

Back to top

contentarea

General content containment object. While derived from basicElement, many basicElement properties are not supported. Only the x, y, width, height, and name basicElement properties are supported. This contains ContentItem objects; see the ContentItem API reference for details. A view object can only have one contentarea defined within it.

Properties

Name Description Type Read/Write
contentFlags Combination of one or more gddContentFlagXXXX flags. integer Write
maxContentItems Maximum number of allowed content items, defaults to 25. integer Read-Write
contentItems The area's content items. To convert this value to a JavaScript array, use code like this: var items = contentArea.contentItems.toArray() VBArray Read-Write
pinImages Array of images; you can load images using framework.graphics.loadImage() variant Read-Write

Methods

Name and Arguments Description Returns
addContentItem(item, options) Adds a new content item. void
removeContentItem(item) Removes the specified content item. void
removeAllContentItems() Removes all content items. void

Back to top

div

Div object, also inherits all of the properties and methods of the basicElement object.

You can programmatically add and remove elements using the appendElement(), insertElement(), removeElement(), and removeAllElements() methods (inherited from basicElement). To find contained elements, use the children property (also inherited from basicElement).

Properties

Name Description Type Read/Write
autoscroll
(added 5.1)
True if the div automatically shows scrollbars if necessary; false if it doesn't show scrollbars. Default is false. boolean Read-Write
background Sets or retrieves the background color or image for the element. The image is repeated if necessary, not stretched. string Read-Write

Back to top

edit

Edit area object, also inherits all of the properties and methods of the basicElement object. By default, an edit area can be modified. As of 5.5, you can use the readonly property to specify that the element cannot be edited.

The color value format is color="#RRGGBB" (like HTML). Alpha and image texture values are not supported.

Properties

Name Description Type Read/Write
background Sets or retrieves the element's background color. string Read-Write
bold Sets or retrieves whether the text should be bold. boolean Read-Write
color Sets or retrieves the color of the text. string Read-Write
font Sets or retrieves the font for the text. string Read-Write
idealBoundingRect
(added 5.5)
Contains the ideal size for the current text inside the edit element. This property's value is affected by other properties such as multiline and wordwrap. size Read-Write
italic Sets or retrieves whether the text should be italicized. boolean Read-Write
multiline
(added 5.0)
True if the edit element can display multiple lines of text; false if it should display only one. If false, incoming "\n"s are ignored, as are presses of the Enter key. Use the wordWrap property to determine how multiline text is wrapped. boolean Read-Write
passwordChar
(added 5.0)
The character that should be displayed each time the user enters a character. By default, the value is null, which means that the typed character is displayed as-is. Setting the value to a non-null value enables a password-style edit box where the specified character is displayed instead of the typed character. string Read-Write
readonly
(added 5.5)
True if the element cannot be edited. By default, this property is false, indicating that the element can be modified. boolean Read-Write
size Sets or retrieves the size of the text, in points. integer Read-Write
strikeout Sets or retrieves whether the text should be struck-out. boolean Read-Write
underline Sets or retrieves whether the text should be underlined. boolean Read-Write
value Sets or retrieves the value of the element. string Read-Write
wordWrap
(added 5.0)
True if multiline text should wrap at word boundaries so that it doesn't extend beyond the display area; otherwise, false. boolean Read-Write

Events

Name Description
onchange Fires when the value property changes.

Back to top

img

Image object, also inherits all of the properties and methods of the basicElement object.

The following image formats are supported for use in Google Desktop gadgets: GIF, JPEG, TIFF, and (as of 5.0) PNG.

Properties

Name Description Type Read/Write
colorMultiply
(added 5.5)
Permits changing the color of an image at runtime. Use this property when you need multiple colors of the same image — for example, in a gadget where the user can choose between several ribbon colors. For example, to show only the red channel of an image, use colorMultiply="#800000". For information on how to use this property, see the 5.5 release note discussion. string Read-Write
cropMaintainAspect
(added 5.5)
Specifies whether and how the image should be cropped; possible values are "false" (the default), "true", or "photo". A value of "true" maintains the aspect ratio and crops all four sides so that the image fits in the display rectangle. The "photo" value is like "true", except that the top of the photo isn't cropped, since important features such as faces are usually towards the top of a photo. string Read-Write
src Sets or retrieves the image to display. string Read-Write
srcHeight Retrieves the original height of the image being displayed. integer Read
srcWidth Retrieves the original width of the image being displayed. integer Read

Methods

Name and Arguments Description Returns
setSrcSize(integer Width, integer Height) Resizes the image to the Width and Height specified via reduced resolution. If the source image is larger than the display area, using this method to resize the image to the output size will save memory and improve rendering performance. void

Back to top

label

Label object, also inherits all of the properties and methods of the basicElement object. The color value format is any of:

  • color="#RRGGBB" (just like HTML)
  • color="#AARRGGBB" (just like HTML where AA is the alpha value)
  • color="some_image.png" (uses the image as a repeating texture)

Properties

Name Description Type Read/Write
align Sets or retrieves the alignment of the text. Possible values: center, left, right string Read-Write
bold Sets or retrieves whether the text should be bold. boolean Read-Write
color Sets or retrieves the color of the text. string Read-Write
font Sets or retrieves the font for the text. string Read-Write
innerText Sets or retrieves the text displayed. Only accessible via scripts, not from XML definitions. string Read-Write
italic Sets or retrieves whether the text should be italicized. boolean Read-Write
size Sets or retrieves the size of the text, in points. integer Read-Write
strikeout Sets or retrieves whether the text should be struck-out. boolean Read-Write
trimming Sets or retrieves the trimming mode when the text is too large to display. Possible values: none, character, word, character-ellipsis, word-ellipsis, path-ellipsis string Read-Write
underline Sets or retrieves whether the text should be underlined. boolean Read-Write
vAlign Sets or retrieves the vertical aligment. Possible values: top, middle, bottom string Read-Write
wordWrap Sets or retrieves whether the text should wrap to multiple lines. boolean Read-Write

Back to top

a

Defines a link, also inherits all of the properties and methods of the basicElement object.

Properties

Name Description Type Read/Write
align Sets or retrieves the alignment of the text. Possible values: center, left, right string Read-Write
bold Sets or retrieves whether the text should be bold. boolean Read-Write
color Sets or retrieves the color of the text. string Read-Write
font Sets or retrieves the font for the text. string Read-Write
href When set, clicking the link will launch this URL in your default browser. Only http:, https:, and ftp: URLs can be launched. string Read-Write
innerText Sets or retrieves the text displayed. Only accessible via scripts, not from XML definitions. string Read-Write
italic Sets or retrieves whether the text should be italicized. boolean Read-Write
overColor Sets or retrieves the color of the text when the mouse is over the element. string Read-Write
size Sets or retrieves the size of the text, in points. integer Read-Write
strikeout Sets or retrieves whether the text should be struck-out. boolean Read-Write
trimming Sets or retrieves the trimming mode when the text is too large to display. Possible values: none, character, word, character-ellipsis, word-ellipsis, path-ellipsis string Read-Write
underline Sets or retrieves whether the text should be underlined. boolean Read-Write
vAlign Sets or retrieves the vertical aligment. Possible values: top, middle, bottom string Read-Write
wordWrap Sets or retrieves whether the text should wrap to multiple lines. boolean Read-Write

Back to top

progressbar

Progress bar object, also inherits all of the properties and methods of the basicElement object.

Properties

Name Description Type Read/Write
emptyImage Sets or retrieves the image to display when the slider is empty. string Read-Write
fullImage Sets or retrieves the image to display when the slider is full. string Read-Write
max Sets or retrieves the maximum value — the value where the slider is full. integer Read-Write
min Sets or retrieves the minimum value — the value where the slider is empty. integer Read-Write
orientation Sets or retrieves the orientation of the slider. Possible values: horizontal, vertical string Read-Write
thumbDisabledImage Sets or retrieves the thumb image to display when the slider is disabled. string Read-Write
thumbDownImage Sets or retrieves the image to display when the thumb is pressed. string Read-Write
thumbOverImage Sets or retrieves the image to display when the mouse is over the thumb. string Read-Write
thumbImage Sets or retrieves the default image for the thumb. string Read-Write
value Sets or retrieves the value. integer Read-Write

Events

Name Description
onchange Fires when the value property changes.

Back to top

scrollbar

Scrollbar object; inherits all of the properties and methods of the basicElement object. Added 5.1.

Often you can avoid using a scrollbar directly by using the autoscroll property of div or listbox.
Examples:

Use a scrollbar element if you want a scrollbar that's horizontal or that has a custom look or behavior.
Example:

  • HorizontalScrollbar (online and in the SDK)

Properties

NameDescriptionTypeRead/Write
background Background image for the scrollbar. string Read-Write
leftDownImage Down image for the left/up button. string Read-Write
leftImage Normal image for the left/up button. string Read-Write
leftOverImage Hover image for the left/up button. string Read-Write
lineStep Delta value when user clicks one of the buttons. integer Read-Write
max Maximum value of the scrollbar. integer Read-Write
min Minimum value of the scrollbar. integer Read-Write
orientation Orientation of the scrollbar. Possible values: horizontal, vertical. string Read-Write
pageStep Delta value when user clicks on the area between thumb and two end buttons. integer Read-Write
rightDownImage Down image for the right/down button. string Read-Write
rightImage Normal image for the right/down button. string Read-Write
rightOverImage Hover image for the right/down button. string Read-Write
thumbDownImage Down image for thumb. string Read-Write
thumbImage Normal image for thumb. string Read-Write
thumbOverImage Hover image for thumb. string Read-Write
value Current scroll position of the thumb. integer Read-Write

Events

NameDescription
onchange Fires when the value property changes.

Back to top

listbox

Listbox object, also inherits all of the properties and methods of the basicElement object. Added 5.1.

You build a listbox by nesting listitems (5.1) or items (5.5+) inside a listbox. Each item contains one or more elements (typically, a label) to provide the item's display.

You can programmatically add and remove items using the appendElement(), insertElement(), removeElement(), and removeAllElements() methods (inherited from basicElement). To find items, use the children property (also inherited from basicElement).

Example: ListBox (online and in the SDK)

Properties

NameDescriptionTypeRead/Write
autoscroll True if the listbox automatically shows scrollbars if necessary; false if it doesn't show scrollbars. Default is false. boolean Read-Write
background The background color for the listbox — for example, "#FFFFFF" or (with transparency) "#33FFFFFF". string Read-Write
itemHeight The height of the items in the list. The value can be expressed in pixels or as a percentage of the listbox's height. integer or string Read-Write
itemOverColor The background color of the item under the mouse cursor — for example, "#CCFFCC" or (with transparency) "#66CCFFCC". string Read-Write
itemSelectedColor The background color for selected items in the listbox — for example, "#99FF99" or (with transparency) "#6699FF99". string Read-Write
itemSeparator True if the items should have a separator between them; otherwise false. Default is false. boolean Read-Write
itemSeparatorColor
(added 5.5)
If itemSeparator is true, then the value of itemSeparatorColor is used as the color of the line between items. string Read-Write
itemWidth The desired width of the items in the list. The value can be expressed in pixels or as a percentage of the listbox's width. integer or string Read-Write
multiSelect True if the user can select multiple items; false if the user can select only one item at a time. Default is false. boolean Read-Write
selectedIndex The currently selected index. If multiple items are selected, selectedIndex is the index of the first selected item (the item with the lowest number); you can find additional items by walking through the list of children, querying each one's selected property (a property of item). The first item is at index 0. -1 means no items are selected. integer Read-Write
selectedItem The item corresponding to selectedIndex. listitem (5.1) / item (5.5+) Read-Write

Methods

Name and ArgumentsDescriptionReturns
appendString(str)
(added 5.5)
Creates an item element with a single child — a label with the inner text specified by str — and then adds the item as the last one in the combobox. The return value is true if appending the item succeeded; otherwise, it's false. boolean
clearSelection() Unselects all items in the listbox. void
insertStringAt(str, index)
(added 5.5)
Similar to appendString(), but you can specify the index for the new item. If the index is too large or less than zero, the insertion fails (returning false) and no item is created. boolean
removeString(str)
(added 5.5)
Searches for the first (lowest-indexed) item element that has one child (a label), and whose child has inner text exactly equal to str; removes that item, if it is found. void

Events

NameDescription
onchange Fires when the selection changes.

Back to top

item

An item in a listbox; inherits all of the properties and methods of the basicElement object. Used by combobox and listbox.

Version note: The item element was originally named listitem and was introduced in 5.1. As of 5.5, the element name is item and the name listitem is deprecated.

You can programmatically add and remove elements using the appendElement(), insertElement(), removeElement(), and removeAllElements() methods (inherited from basicElement). To find contained elements, use the children property (also inherited from basicElement).

Properties

NameDescriptionTypeRead/Write
background The background color of the item. string Read-Write
selected True if the item is currently selected; otherwise, false. boolean Read-Write

Back to top

combobox

Combobox object, also inherits all of the properties and methods of the basicElement object. Added 5.5.

You build a combobox by nesting items inside a combobox. Each item contains one or more elements (typically, a label) to provide the item's display.

The API for combobox has much in common with the API for listbox. You can programmatically add and remove items using the appendElement(), insertElement(), removeElement(), and removeAllElements() methods (inherited from basicElement) as well as the appendString(), insertStringAt(), and removeString() methods. To find items, use the children property (also inherited from basicElement).

Examples:

Properties

NameDescriptionTypeRead/Write
background The background color for the combobox — for example, "#FFFFFF" or (with transparency) "#33FFFFFF". string Read-Write
droplistVisible True means the dropdown list is visible; false means it isn't (only one element is displayed). boolean Read-Write
itemHeight The height of the items in the list. The value can be expressed in pixels or as a percentage of the combobox's height. integer or string Read-Write
itemOverColor The background color of the item under the mouse cursor — for example, "#CCFFCC" or (with transparency) "#66CCFFCC". string Read-Write
itemSeparator True if the items should have a separator between them; otherwise false. Default is false. boolean Read-Write
itemSeparatorColor If itemSeparator is true, then the value of itemSeparatorColor is used as the color of the line between items. string Read-Write
itemWidth The desired width of the items in the list. The value can be expressed in pixels or as a percentage of the combobox's width. integer or string Read-Write
maxDroplistItems The maximum # of items to show before a scrollbar is displayed. integer Read-Write
selectedIndex The currently selected index. If multiple items are selected, selectedIndex is the index of the first selected item (the item with the lowest number); you can find additional items by walking through the list of children, querying each one's selected property (a property of item). The first item is at index 0. -1 means no items are selected. integer Read-Write
selectedItem The item corresponding to selectedIndex. listitem (5.1) / item (5.5+) Read-Write
type Either "dropdown" (the default, editable control) or "droplist" (uneditable). string Read-Write
value The value of the edit area; useful only for dropdown mode. string Read-Write

Methods

Name and ArgumentsDescriptionReturns
appendString(str) Creates an item element with a single child — a label with the inner text specified by str — and then adds the item as the last one in the combobox. The return value is true if appending the item succeeded; otherwise, it's false. boolean
clearSelection() Unselects all items in the combobox. void
insertStringAt(str, index) Similar to appendString(), but you can specify the index for the new item. If the index is too large or less than zero, the insertion fails (returning false) and no item is created. boolean
removeString(str) Searches for the first (lowest-indexed) item element that has one child (a label), and whose child has inner text exactly equal to str; removes that item, if it is found. void

Events

NameDescription
onchange Fires when the selection changes.
ontextchange Fires when the value property changes.

Back to top

radio

A radio button object. Added 5.5.

You build radio buttons by nesting radio elements inside a view or div. At most one of the radio buttons that are immediately under a view or div can be selected at a time. You can use the value property to check whether a particular radio button is selected.

Radio elements support exactly the same properties, methods, and events as checkbox elements. For a complete list, see the checkbox API reference.

Example: ColorMultiply (online and in the SDK)

Back to top

options

Standalone object, not descended from any other object.

Properties

Name Description Type Read/Write
count Returns the number of items in the dictionary. integer Read
defaultValue (string name) Deprecated. Use putDefaultValue() and getDefaultValue() instead. Sets or returns the defaultValue for the name. string Write
item (string name) Deprecated. Use putValue() and getValue() instead. Sets or returns the current value for name. string Read-Write

Methods

Name and Arguments Description Returns
add(string name, variant value) Adds an item to the dictionary if it doesn't already exist. void
encryptValue(string name, variant value)
(added 5.5)

Encrypts the specified item's value. Once this method is called for an item, the value of the item is stored in encrypted form, even when you subsequently invoke putValue() on the item. The value is automatically decrypted when it is retrieved.

Note: If you remove an item and then re-add it, the item is no longer encrypted.

void
exists(string name) Returns true if the value for name has been set. boolean
getDefaultValue(name)
(added 5.0)
Returns the default value for the name. string
getValue(string name) Returns the value associated with the name. an object
putDefaultValue(name, value)
(added 5.0)
Sets the default value for the name. void
putValue(string name, object value) Sets the value associated with the name, creating the entry if one doesn't already exist for the name. void
remove(string name) Removes the value from the dictionary. void
removeAll() Removes all values from the dictionary. void

Back to top

menu

Methods

Name and Arguments Description Returns
AddItem(item_text, style, handler) Add a single menu item. style is a combination of gddMenuItemFlagXXXX. The handler's function prototype is OnMenuItem(item_text). Returns nothing.
SetItemStyle(item_text, style) Set the style of the given menu item. Style is a combination of gddMenuItemFlagXXXX. Returns nothing.
AddPopup(popup_text) Add a submenu/popup showing the given text. Returns menu object for the new popup menu.

Back to top

event object

The event object contains information about the most recent event. You can refer to the event object using either view.event or just event. For further information and examples of using the Desktop event system, see Gadget Event Handling.

Although the event object has many properties, only a few of them are relevant for any particular event. For example, an onkeypress event has four relevant properties: returnValue, srcElement, type, and keyCode.

Properties of the event object fall into the following categories:

  • Common: Valid for all types of events
  • Mouse: Valid for onmouse* and on*click events
  • Drag and drop: Valid for ondrag* events
  • Keyboard: Valid for onkey* events
  • Other: See the property description

These categories are for convenience. A few properties, such as value, are listed in more than one category.

Common Properties

Name Description Type Read/Write
returnValue If the event can be canceled, the event handler can cancel it with the following code: event.returnValue = false. If a canceled event was fired by a view, no element receives the event. boolean Write
srcElement The element or view that fired the most recent event. view or element Read
type The string name of the event type. Example: "onsize". For Timer and Perfmon events, the value is "". string Read

Mouse-Related Properties

Name Description Type Read/Write
button For onclick, onrclick, onmousedown, and onmouseup events, this field indicates the button clicked.

For other mouse-move events, this field is the combination of buttons that are currently down.
  • 0: no button
  • 1: left button
  • 2: right button
  • 4: middle button
integer Read
wheelDelta The delta of wheel scroll. integer Read
x The horizontal position of the mouse within the view or element. integer Read
y The vertical position of the mouse within the view or element. integer Read

Drag and Drop-Related Properties

Name Description Type Read/Write
dragFiles A collection of strings: the names of the files that are being dragged. collection Read
x The horizontal position of the mouse within the element. integer Read
y The vertical position of the mouse within the element. integer Read

Keyboard-Related Properties

Name Description Type Read/Write
keyCode For onkeydown and onkeyup events, this field indicates the related physical key, which can be a functional key such as Shift or Control. The values are the same as those defined in the VK_* constants in the Microsoft Visual Studio file winuser.h.

For an onkeypress event, this field indicates the actual ASCII character code produced by certain key combinations, including numbers, letters, symbols, white space, and Control-key combinations (such as Ctrl+B). Functional keys don't produce onkeypress events.
integer Read

Other Properties

The remaining properties have more specialized uses.

onsizing

Name Description Type Read/Write
height The new height requested by the user. The event handler can override the user's choice by changing the value of this property. integer Read-Write
width The new width requested by the user. The event handler can override the user's choice by changing the value of this property. integer Read-Write

onoptionchanged

Name Description Type Read/Write
propertyName Which option item changed. string Read

Timers

Name Description Type Read/Write
cookie The timer ID returned from view.setTimeout(), view.setInterval(), or view.beginAnimation(). integer Read
value The current animation value. integer Read

perfmon

(Windows only)

Name Description Type Read/Write
value The current perfmon value. variant Read

Back to top

Framework Namespace

The framework keyword is optional when referring to its descendant objects. For example, framework.system.battery is equivalent to system.battery.

framework

ObjectDescription
audio An object that lets you open, play, and close sound streams such as MP3s.
runtime
(added 5.5)
An object with information about the gadget's environment.
system An object for gathering information about the computer system.

Methods

Name and Arguments Description Returns
BrowseForFile( string Filter)
(Windows only)
Displays the standard browse for file dialog and returns the name of the selected file or an empty string if the dialog is cancelled. The filter string is in the form "Display Name|List of Types" and multiple entries can be added to it. For example, "Music Files|*.mp3;*.wma|All Files|*.*" defines two possible selections from the dialog's Type of File dropdown; Music Files, which are anything matching *.mp3 or *.wma and All Files which matches *.* string
BrowseForFiles( string Filter)
(Windows only)
Displays the standard browse for file dialog and returns a collection containing the names of the selected files or an empty string if the dialog is cancelled. See BrowseForFile for an explanation of the Filter parameter. collection

Back to top

framework.audio

Methods

Name and Arguments Description Returns
open(src, method) Creates an audio clip without playing it. The src argument specifies the location of the sound data. The source can be the path to a file in your gadget's .gg package or an ftp, http, or https URL. The optional method argument lets you specify a method to be called when the audio clip's state changes. An audioclip object
play(src, method) Behaves like the open method, but in addition plays the audio clip. An audioclip object
stop(clip) Stops playing the specified audio clip. void

framework.graphics

A namespace for graphics-related objects.

Method Description
createPoint() Returns a Point object.
createSize() Returns a Size object.
loadImage(image_src) Load and return (as an image object) the given image file. image_src can be path to a local file (remote URLs not supported) or it could be the responseStream member of a XMLHttp object (this allows the gadget to download images using XMLHttp object and load them). You can use the image file object as a value of the contentItem.image property or modify the <smallIcon> and <icon> attributes of the old API's plugin object.

Back to top

framework.runtime

The runtime object has read-only properties with information about the gadget's runtime environment. Added 5.5.

Properties

Name Description Read/Write
appName "Google Desktop" Read
appVersion The running version of Google Desktop. Example: "5.5.708.16558". In future releases, this property may be useful for conditionally using new API while still supporting older versions. Read
osName The name of the computer's operating system (OS). Possible values: "windows vista", "windows server 2003", "windows xp", or "windows 2000". If the OS doesn't fall into any of those categories, an empty string is returned. Read
osVersion The operating system version. Example: "5.1.2.0" for Microsoft Windows XP (also known as Windows NT 5.1), Service Pack 2. The format is as follows: majorVersion.minorVersion.majorServicePackVersion.minorServicePackVersion Read

Back to top

framework.system

Properties

Name Description Read/Write
bios
(added 5.0)
An object representing the computer's BIOS. Read
cursor An object that provides information about the mouse cursor. Read
filesystem An object that provides access to the Windows standard Scripting.FileSystemObject object. Read
machine
(added 5.0)
An object representing the make and model of the computer. Read
memory An object that provides information about the system's memory. Read
network An object that provides information about the system's network connection. Read
perfmon An object that provides information similar to Windows PerfMon. Read
power An object that provides information about the system's power management status. Read
process
(added 5.0)
An object that lets you get information about processes on the computer. Read
processor An object that provides information about the system's CPU. Read
screen An object that provides information about the screen. Read
user
(added 5.5)
An object that provides information about the user. Read

Methods

Name and ArgumentsDescriptionReturns
getFileIcon(filename)
(added 5.0)
Returns the path to the icon associated with the specified file. You can load the image stream using graphics.loadImage(). string
languageCode()
(added 5.0)
Returns the RFC1766 language code of the installed Google Desktop application. A typical value might be "fr", "en-GB", or "zh-CN". string
localTimeToUniversalTime(date)
(added 5.0)
Returns the UTC conversion of the passed-in time. The passed-in time (a JavaScript Date object) is assumed to be in the computer's time zone. a JavaScript Date object

framework.system.bios

An object representing the computer's BIOS. Added 5.0.

NameDescriptionTypeRead/Write
serialNumber The BIOS serial number. string Read

framework.system.cursor

Property Type Description
position point Returns a Point object that contains the current position of the cursor relative to the screen.

framework.system.machine

An object representing the make and model of the computer. Added 5.0.

Properties

NameDescriptionTypeRead/Write
manufacturer The name of the machine's manufacturer. string Read
model The name of the machine's model. string Read

framework.system.memory

Property Type Description
free float The number of bytes of virtual memory (physical + swap) currently free.
total float The total number of bytes of virtual memory (physical + swap).
used float The number of bytes of virtual memory (physical + swap) currently in use.
freePhysical float The number of bytes of physical memory currently free.
totalPhysical float The total number of bytes of physical memory.
usedPhysical float The number of bytes of physical memory currently in use.

framework.system.network

Properties

NameDescriptionTypeRead/Write
online
(added 5.0)
True if the network connection is on; false if it's off. boolean Read
connectionType
(added 5.0)
The type of the connection — for example, 802.3 or LocalTalk. See Network Connection Types for a list of possible values. integer Read
physicalMediaType
(added 5.0)
The type of the physical media — for example, wireless LAN or cable modem. See Network Connection Physical Media Types for a list of possible values. integer Read
wireless Provides information about the system's wireless connection. a wireless object Read

framework.system.network.wireless

Properties

Property Description Type Read/Write
available True if wireless is available. boolean Read
connected True if connected to a wireless network. boolean Read
enumerateAvailableAccessPoints
(added 5.0)
An array of wireless access points; valid only if enumerationSupported is true. an array of wirelessaccesspoint objects Read
enumerationSupported
(added 5.0)
True if enumeration of wireless access points is supported; otherwise, false. boolean Read
name The name of the wireless adapter. string Read
networkName The name of the wireless network. string Read
signalStrength The wireless connection's signal strength. Values are 0-100. integer Read

Methods

Name and ArgumentsDescriptionReturns
connect(access_point_name, method)
(added 5.0)
(Windows only)
Connects to the specified point and, if the method is specified and non-null, calls the method. The method must take one argument; an argument value of true indicates the connection succeeded. void
disconnect(access_point_name, method)
(added 5.0)
(Windows only)
Disconnects from the specified point and, if the method is specified and non-null, calls the method with a boolean status indicating whether the disconnect succeeded. void

framework.system.network.wirelessaccesspoint

(Windows only)

Properties

NameDescriptionTypeRead/Write
name The name of the access point. string Read
type The type of the wireless service; possible values are gddWirelessTypeInfrastructure, gddWirelessTypeIndependent, and gddWirelessTypeAny. integer Read
signalStrength The signal strength of the access point, expressed as a percentage. integer Read

Methods

Name and ArgumentsDescriptionReturns
connect(method) Connects to this access point and, if the method is specified and non-null, calls the method with a boolean status. void
disconnect(method) Disconnects from this access point and, if the method is specified and non-null, calls the method with a boolean status. void

framework.system.perfmon

(Windows only)

Properties

Property Type Description
currentValue ("counter_path") Variant Returns the current value for the specified counter. The counter must have been added using addCounter. Counter paths are defined and documented by the Windows PerfMon application, and look like \Processor(_Total)\% Processor Time or \LogicalDisk(_Total)\% Disk Time. You need to escape special characters such as \. For example:
system.perfmon.currentValue("\\Processor(_Total)\\% Processor Time")

Methods

Name and Arguments Description Returns
addCounter(string counter_path, string script_code) Starts monitoring the specified counter. Whenever this counters value changes, the script code runs. void
removeCounter(string counter_path) Stop monitoring the specified counter. void

framework.system.power

Properties

Note: The integer type properties will return -1 if either the computer does not have a battery or Windows cannot determine their value.

Property Type Description
charging boolean true if the battery is charging.
percentRemaining integer Remaining battery power percentage.
pluggedIn boolean true if the computer is plugged in.
timeRemaining integer The estimated time, in seconds, left before the battery will need to be charged.
timeTotal integer The estimated time, in seconds, the battery will work when fully charged.

framework.system.process

An object that lets you get information about processes on the computer. Added 5.0.

Properties

NameDescriptionTypeRead/Write
enumerateProcesses An enumeration of process IDs for all processes on the system. an enumeration of integers (process IDs) Read
foreground Information about the foreground window process. a processInfo object Read

Methods

Name and ArgumentsDescriptionReturns
getInfo(pid) Returns process information for the given process ID (an integer). a processInfo object

framework.system.processor

Properties

Property Type Description
architecture string The processor architecture (e.g. x86).
count integer The number of installed processors.
family integer The processor's family designation.
model integer The processor's model designation.
name string The processor name (suitable for display).
speed string The processor speed, in mhz.
stepping integer The stepping designation for the processor.
vendor string The processor vendor's name.

framework.system.screen

Properties

Property Type Description
size size Returns a size object that contains the screen's dimensions.

framework.system.user

Added 5.5.

Properties

Property Type Description
idle boolean True if the user has done nothing for a while and might be away from the computer. Otherwise, false.

Back to top

audioclip

Properties

Name Description Type Read/Write
balance The audio signal balance, a number between -10000 and 10000, inclusive. -10000 means that only the left audio channel can be heard; 10000 means that only the right audio channel can be heard. integer Read-Write
currentPosition The current position within the audio clip, where 0 (the initial value) represents the beginning of the clip and duration is the end + 1. integer Read-Write
duration The length, in seconds, of the sound. integer Read
error The most recently reported error code. See Sound Error Codes for all possible states. integer Read
src The location from which the audio data was loaded. string Read-Write
state The audio clip's last reported state; see Sound Playback State for all possible states. integer Read
volume A number between -10000 and 0 (inclusive), where -10000 is silence and 0 is full volume. integer Read-Write

Methods

Name and Arguments Description Returns
play() Starts playing the audio clip from the current position. void
pause() Stops playing the audio clip, maintaining the current position. void
stop() Stops playing the sound, resetting the current position to 0. void

Events

Name Description
onstatechange Fires when the audio clip starts or stops. The handler's function prototype is onStateChange(clip, new_state), where clip is the audioclip before the state change and new_state is the audio clip's new state. See Sound Playback State for all possible states.

Note: This event does not use the global event object.

Back to top

point

Represents a point, as defined by its position. What the coordinate values are relative to depends on the method or property that assigns their values.

Properties

Name Description Type Read/Write
x X-coordinate value. integer Read-Write
y Y-coordinate value. integer Read-Write

Back to top

processInfo

Describes a process on the computer. Added 5.0.

Properties

NameDescriptionTypeRead/Write
processId A system-specific number that identifies the process. integer Read
executablePath The path to the executable file of the process. string Read

Back to top

size

Represents the size of a rectangular area.

Properties

Name Description Type Read/Write
height Height value. integer Read-Write
width Width value. integer Read-Write

Back to top

Constants and Flags

Details View Flags

Name Description
gddDetailsViewFlagNone No flags are passed.
gddDetailsViewFlagToolbarOpen Make the details view title clickable like a button.
gddDetailsViewFlagNegativeFeedback Add a negative feedback button in the details view (e.g. 'Don't show me items like this').
gddDetailsViewFlagRemoveButton Add a 'Remove' button in the details view.
gddDetailsViewFlagShareWithButton Deprecated. Add a button in the details view which displays the friends list when clicked, and the user can share the content item with them.

Back to top

Plug-in Flags

Name Description
gddPluginFlagNone No flags are passed.
gddPluginFlagToolbarBack Add a 'back' button in the plug-in toolbar.
gddPluginFlagToolbarForward Add a 'forward' button in the plug-in toolbar.

Back to top

Plug-in Commands

Name Description
gddCmdAboutDialog Show About dialog.
gddCmdToolbarBack User clicked the 'back' button.
gddCmdToolbarForward User clicked the 'forward' button

Back to top

Content Item Layouts

Name Description
gddContentItemLayoutNowrapItems Single line with just the heading and icon.
gddContentItemLayoutNews A layout displaying the heading, source, and time.
gddContentItemLayoutEmail A layout displaying the heading, source, time, and snippet.

Back to top

Content Flags

Name Description
gddContentFlagNone No flags are passed.
gddContentFlagHaveDetails Show details view when user clicks on content items.
gddContentFlagPinnable Allow user to pin content items so they will always be displayed.
gddContentFlagManualLayout Plug-in will manage the layout of items by giving each item's display position

Back to top

Content Item Flags

Name Description
gddContentItemFlagNone No flags passed.
gddContentItemFlagStatic Item does not take user input.
gddContentItemFlagHighlighted Item is highlighted/shown as bold.
gddContentItemFlagPinned Item is pinned to the top of the list.
gddContentItemFlagTimeAbsolute Item's time is shown as absolute time and not relative to current time.
gddContentItemFlagNegativeFeedback Item can take negative feedback from user.
gddContentItemFlagLeftIcon Item's icon should be displayed on the left side.
gddContentItemFlagNoRemove Do not show a 'remove' option for this item in the context menu.
gddContentItemFlagShareable Deprecated. Item may be shared with friends. This will enable the specific menu item in the context menu and the button in the details view.
gddContentItemFlagShared Deprecated. Indicates that this item was received from another user.
gddContentItemFlagInteracted Indicates that the user has interacted (viewed details/opened etc.) with this item.
gddContentItemFlagDisplayAsIs
(added 5.0)
The content item's text strings (heading, source, snippet) should not be converted to plain text before displaying them onscreen. Without this flag, HTML tags and other markup are stripped out. You can use this flag to display HTML code as-is.
gddContentItemFlagHtml
(added 5.0)
The snippet property of the content item contains HTML text that should be interpreted. Use this flag to make the content in the details view be formatted as HTML. Setting this flag implicitly sets the gddContentItemFlagDisplayAsIs flag.
gddContentItemFlagHidden
(added 5.0)
Can be used to hide content items while still having them in the data structures.

Back to top

Tile Display State

Name Description
gddTileDisplayStateHidden Tile is not visible.
gddTileDisplayStateRestored Tile is restored from being minimized or popped out states.
gddTileDisplayStateMinimized Tile is minimized and only the title bar is visible.
gddTileDisplayStatePoppedOut Tile is 'popped-out' of the sidebar in a separate window.
gddTileDisplayStateResized Tile is resized.

Back to top

Target Device

Name Description
gddTargetSidebar Item is being displayed/drawn in the Sidebar.
gddTargetNotifier Item is being displayed/drawn in the notification window.
gddTargetFloatingView Plug-in/item is being displayed in its own window floating on the desktop.

Back to top

Content Item Display Options

Name Description
gddItemDisplayInSidebar Display the item in the Sidebar.
gddItemDisplayInSidebarIfVisible Display the item in the Sidebar if it is visible.
gddItemDisplayAsNotification Display the item in the notification window.
gddItemDisplayAsNotificationIfSidebarHidden Display the item in the notification window if the Sidebar is hidden.

Back to top

Window Classes

Name Description
gddWndCtrlClassLabel Standard windows static/label control.
gddWndCtrlClassEdit Standard windows single-line edit control.
gddWndCtrlClassList Standard windows listbox/drop-list combobox control.
gddWndCtrlClassButton Standard windows button control (also includes check boxes).

Back to top

Control Types

Name Description
gddWndCtrlTypeNone Nothing passed.

Edit Control Types

Name Description
gddWndCtrlTypeEditPassword Edit box to allow user enter passwords, masks the actual characters entered.

List Control Types

Name Description
gddWndCtrlTypeListOpen Normal list control showing all options in a scrollable window.
gddWndCtrlTypeListDrop Drop down list control (also called a combobox control without in-place editing feature).

Button Control Types

Name Description
gddWndCtrlTypeButtonPush Standard pushbutton.
gddWndCtrlTypeButtonCheck Checkbox control.

Back to top

Font IDs

Name Description
gddFontNormal Font used for normal text.
gddFontSnippet Font used for snippet text (could be slightly smaller than normal font).
gddFontExtraInfo Font used for extra info about items (e.g. source and time).

Back to top

Text Color IDs

Name Description
gddColorNormalText Color used for normal text.
gddColorNormalBackground Color used for the Sidebar background.
gddColorSnippet Color used for snippet text.
gddColorExtraInfo Color used for extra info about items (e.g. source and time).

Back to top

Text Flags

Name Description
gddTextFlagCenter Center text horizontally.
gddTextFlagRight Right align text.
gddTextFlagVCenter Center text vertically.
gddTextFlagBottom Bottom align text.
gddTextFlagWordBreak Break text at word boundaries when wrapping multiple lines.
gddTextFlagSingleLine Display text in a single line without line wraps.

Back to top

Menu Item Flags

Name Description
gddMenuItemFlagGrayed Disabled menu item.
gddMenuItemFlagChecked Checked menu item.

Back to top

Button IDs Which Appear In The Options Dialog

Name Description
gddIdOK OK button
gddIdCancel Cancel button.

Back to top

Levels of Messages Written to the Plug-in Log

Name Description
gddLogLevelDebug Used for normal diagnostic messages.
gddLogLevelInfo Used for informatory messages that might not be normal behavior.
gddLogLevelWarning Used for situations where input/data is unusual and needs attention.
gddLogLevelError Used for critical errors.

Back to top

Status of a Contact in the Friends List

Name Description
gddFriendStatusOnline Friend is online.
gddFriendStatusIdle Friend is idle, has not used the PC recently.
gddFriendStatusBusy Friend is busy.

Back to top

"Send To" Targets

Name Description
gddSendToSidebar Send the data to the given user's sidebar.
gddSendToIM Send the data to the given user using IM.
gddSendToEmail Send the data to the given user using email.

Back to top

Sound Playback State

NameDescription
gddSoundStateError The clip is in an error state and can't be played back. Possible causes: an unsupported audio format or an incorrectly specified location.
gddSoundStateStopped The clip's playback is stopped.
gddSoundStatePlaying The clip's playback is started.
gddSoundStatePaused The clip is paused.

Back to top

Sound Error Codes

NameDescription
gddSoundErrorNoError No error has been reported.
gddSoundErrorUnknown Generic error. Possible causes: DirectShow not available or not functioning correctly.
gddSoundErrorBadClipSrc Clip data could not be found at the specified location.
gddSoundErrorFormatNotSupported The audio format isn't supported.

Back to top

Network Connection Types

This enumeration describes the type of network. It's used for the framework.system.network object's connectionType property.

NameDescription
gddConnectionType802_3 Ethernet (802.3)
gddConnectionType802_5 Token Ring (802.5)
gddConnectionTypeFddi FDDI
gddConnectionTypeWan WAN
gddConnectionTypeLocalTalk LocalTalk
gddConnectionTypeDix DIX
gddConnectionTypeArcnetRaw ARCNET (raw)
gddConnectionTypeArcnet878_2 ARCNET (878.2)
gddConnectionTypeAtm ATM
gddConnectionTypeWirelessWan NDIS wireless
gddConnectionTypeIrda Infrared (IrDA)
gddConnectionTypeBpc Broadcast PC
gddConnectionTypeCoWan Connection-oriented WAN
gddConnectionType1394 IEEE 1394 (firewire) bus
gddConnectionTypeInfiniBand InfiniBand

Back to top

Network Connection Physical Media Types

This enumeration describes the physical medium over which packets are transferred. It's used for the framework.system.network object's physicalMediaType property.

NameDescription
gddPhysicalMediaTypeUnspecified None of the following.
gddPhysicalMediaTypeWirelessLan A wireless LAN network through a miniport driver that conforms to the 802.11 interface.
gddPhysicalMediaTypeCableModem A DOCSIS-based cable network.
gddPhysicalMediaTypePhoneLine Standard phone lines.
gddPhysicalMediaTypePowerLine Wiring that is connected to a power distribution system.
gddPhysicalMediaTypeDSL A Digital Subscriber Line (DSL) network.
gddPhysicalMediaTypeFibreChannel A Fibre Channel interconnect.
gddPhysicalMediaType1394 An IEEE 1394 (firewire) bus.
gddPhysicalMediaTypeWirelessWan A Wireless WAN link.

Back to top

Opacity Constants

These constants are useful for specifying a value for an element's opacity property without needing to know that maximum opacity is 255, and minimum (complete transparency) is 0. For example, to make an item 80% opaque (slightly transparent), use the code someElement.opacity = .8 * gddElementMaxOpacity. Added 5.5.

NameDescription
gddElementMaxOpacity 255: The value that indicates that an element has no transparency.
gddElementMinOpacity 0: The value that indicates that an element is completely transparent. As a rule, to indicate that an element isn't visible, you should instead set its visible property to false.

Back to top