declare namespace Titanium { namespace UI { /** * Base event for class Titanium.UI.Toolbar */ interface ToolbarBaseEvent extends Ti.Event { /** * Source object that fired the event. */ source: Titanium.UI.Toolbar; } /** * Fired when the device detects a click against the view. */ interface Toolbar_click_Event extends ToolbarBaseEvent { /** * Returns `true` if the click passed through an overlapping window belonging to another app. * This is a security feature to protect an app from "tapjacking", where a malicious app can use a * system overlay to intercept touch events in your app or to trick the end-user to tap on UI * in your app intended for the overlay. */ obscured: boolean; /** * X coordinate of the event from the `source` view's coordinate system. */ x: number; /** * Y coordinate of the event from the `source` view's coordinate system. */ y: number; } /** * Fired when the device detects a double click against the view. */ interface Toolbar_dblclick_Event extends ToolbarBaseEvent { /** * Returns `true` if the double click passed through an overlapping window belonging to another app. * This is a security feature to protect an app from "tapjacking", where a malicious app can use a * system overlay to intercept touch events in your app or to trick the end-user to tap on UI * in your app intended for the overlay. */ obscured: boolean; /** * X coordinate of the event from the `source` view's coordinate system. */ x: number; /** * Y coordinate of the event from the `source` view's coordinate system. */ y: number; } /** * Fired when the device detects a double tap against the view. */ interface Toolbar_doubletap_Event extends ToolbarBaseEvent { /** * Returns `true` if the double tap passed through an overlapping window belonging to another app. * This is a security feature to protect an app from "tapjacking", where a malicious app can use a * system overlay to intercept touch events in your app or to trick the end-user to tap on UI * in your app intended for the overlay. */ obscured: boolean; /** * X coordinate of the event from the `source` view's coordinate system. */ x: number; /** * Y coordinate of the event from the `source` view's coordinate system. */ y: number; } /** * Fired when the view element gains focus. */ interface Toolbar_focus_Event extends ToolbarBaseEvent { } /** * Fired when a hardware key is pressed in the view. */ interface Toolbar_keypressed_Event extends ToolbarBaseEvent { /** * The code for the physical key that was pressed. For more details, see [KeyEvent](https://developer.android.com/reference/android/view/KeyEvent.html). This API is experimental and subject to change. */ keyCode: number; } /** * Fired when the device detects a long click. */ interface Toolbar_longclick_Event extends ToolbarBaseEvent { } /** * Fired when the device detects a long press. */ interface Toolbar_longpress_Event extends ToolbarBaseEvent { /** * Returns `true` if the long press passed through an overlapping window belonging to another app. * This is a security feature to protect an app from "tapjacking", where a malicious app can use a * system overlay to intercept touch events in your app or to trick the end-user to tap on UI * in your app intended for the overlay. */ obscured: boolean; /** * X coordinate of the event from the `source` view's coordinate system. */ x: number; /** * Y coordinate of the event from the `source` view's coordinate system. */ y: number; } /** * Fired when the device detects a pinch gesture. */ interface Toolbar_pinch_Event extends ToolbarBaseEvent { /** * The average distance between each of the pointers forming the gesture in progress through * the focal point. */ currentSpan: number; /** * The average X distance between each of the pointers forming the gesture in progress through * the focal point. */ currentSpanX: number; /** * The average Y distance between each of the pointers forming the gesture in progress through * the focal point. */ currentSpanY: number; /** * The X coordinate of the current gesture's focal point. */ focusX: number; /** * The Y coordinate of the current gesture's focal point. */ focusY: number; /** * Returns `true` if a scale gesture is in progress, `false` otherwise. */ inProgress: boolean; /** * The previous average distance between each of the pointers forming the gesture in progress through * the focal point. */ previousSpan: number; /** * The previous average X distance between each of the pointers forming the gesture in progress through * the focal point. */ previousSpanX: number; /** * The previous average Y distance between each of the pointers forming the gesture in progress through * the focal point. */ previousSpanY: number; /** * The scale factor relative to the points of the two touches in screen coordinates. */ scale: number; /** * The event time of the current event being processed. */ time: number; /** * The time difference in milliseconds between the previous accepted scaling event and the * current scaling event. */ timeDelta: number; /** * The velocity of the pinch in scale factor per second. */ velocity: number; } /** * Fired when a layout cycle is finished. */ interface Toolbar_postlayout_Event extends ToolbarBaseEvent { } /** * Fired when the device detects a single tap against the view. */ interface Toolbar_singletap_Event extends ToolbarBaseEvent { /** * Returns `true` if the single tap passed through an overlapping window belonging to another app. * This is a security feature to protect an app from "tapjacking", where a malicious app can use a * system overlay to intercept touch events in your app or to trick the end-user to tap on UI * in your app intended for the overlay. */ obscured: boolean; /** * X coordinate of the event from the `source` view's coordinate system. */ x: number; /** * Y coordinate of the event from the `source` view's coordinate system. */ y: number; } /** * Fired when the device detects a swipe gesture against the view. */ interface Toolbar_swipe_Event extends ToolbarBaseEvent { /** * Direction of the swipe--either 'left', 'right', 'up', or 'down'. */ direction: string; /** * Returns `true` if the swipe passed through an overlapping window belonging to another app. * This is a security feature to protect an app from "tapjacking", where a malicious app can use a * system overlay to intercept touch events in your app or to trick the end-user to tap on UI * in your app intended for the overlay. */ obscured: boolean; /** * X coordinate of the event's endpoint from the `source` view's coordinate system. */ x: number; /** * Y coordinate of the event's endpoint from the `source` view's coordinate system. */ y: number; } /** * Fired when a touch event is interrupted by the device. */ interface Toolbar_touchcancel_Event extends ToolbarBaseEvent { /** * A value which indicates the stylus angle on the screen. If the stylus is perpendicular to the screen or no stylus is * being used, the value will be Pi/2. If the stylus is parallel to the screen, the value will be 0. * Note: This property is only available for iOS devices that support 3D-Touch and are 9.1 or later. */ altitudeAngle: number; /** * The x value of the unit vector that points in the direction of the azimuth of the stylus. * Note: This property is only available for iOS devices that support the Apple Pencil and are 9.1 or later. */ azimuthUnitVectorInViewX: number; /** * The y value of the unit vector that points in the direction of the azimuth of the stylus. * Note: This property is only available for iOS devices that support the Apple Pencil and are 9.1 or later. */ azimuthUnitVectorInViewY: number; /** * The current force value of the touch event. * Note: This property is only available for iOS devices that support 3D-Touch and run 9.0 or later and on some Android devices. */ force: number; /** * Maximum possible value of the force property. * Note: This property is only available for iOS devices that support 3D-Touch and run 9.0 or later. */ maximumPossibleForce: number; /** * Returns `true` if the touch passed through an overlapping window belonging to another app. * This is a security feature to protect an app from "tapjacking", where a malicious app can use a * system overlay to intercept touch events in your app or to trick the end-user to tap on UI * in your app intended for the overlay. */ obscured: boolean; /** * The current size of the touch area. Note: This property is only available on some Android devices. */ size: number; /** * The time (in seconds) when the touch was used in correlation with the system start up. * Note: This property is only available for iOS devices that support 3D-Touch and run 9.0 or later. */ timestamp: number; /** * X coordinate of the event from the `source` view's coordinate system. */ x: number; /** * Y coordinate of the event from the `source` view's coordinate system. */ y: number; } /** * Fired when a touch event is completed. */ interface Toolbar_touchend_Event extends ToolbarBaseEvent { /** * A value which indicates the stylus angle on the screen. If the stylus is perpendicular to the screen or no stylus is * being used, the value will be Pi/2. If the stylus is parallel to the screen, the value will be 0. * Note: This property is only available for iOS devices that support 3D-Touch and are 9.1 or later. */ altitudeAngle: number; /** * The x value of the unit vector that points in the direction of the azimuth of the stylus. * Note: This property is only available for iOS devices that support the Apple Pencil and are 9.1 or later. */ azimuthUnitVectorInViewX: number; /** * The y value of the unit vector that points in the direction of the azimuth of the stylus. * Note: This property is only available for iOS devices that support the Apple Penciland are 9.1 or later. */ azimuthUnitVectorInViewY: number; /** * The current force value of the touch event. * Note: This property is only available for iOS devices that support 3D-Touch and run 9.0 or later and on some Android devices. */ force: number; /** * Maximum possible value of the force property. * Note: This property is only available for iOS devices that support 3D-Touch and run 9.0 or later. */ maximumPossibleForce: number; /** * Returns `true` if the touch passed through an overlapping window belonging to another app. * This is a security feature to protect an app from "tapjacking", where a malicious app can use a * system overlay to intercept touch events in your app or to trick the end-user to tap on UI * in your app intended for the overlay. */ obscured: boolean; /** * The current size of the touch area. Note: This property is only available on some Android devices. */ size: number; /** * The time (in seconds) when the touch was used in correlation with the system start up. * Note: This property is only available for iOS devices that support 3D-Touch and run 9.0 or later. */ timestamp: number; /** * X coordinate of the event from the `source` view's coordinate system. */ x: number; /** * Y coordinate of the event from the `source` view's coordinate system. */ y: number; } /** * Fired as soon as the device detects movement of a touch. */ interface Toolbar_touchmove_Event extends ToolbarBaseEvent { /** * A value which indicates the stylus angle on the screen. If the stylus is perpendicular to the screen or no stylus is * being used, the value will be Pi/2. If the stylus is parallel to the screen, the value will be 0. * Note: This property is only available for iOS devices that support 3D-Touch and are 9.1 or later. */ altitudeAngle: number; /** * The x value of the unit vector that points in the direction of the azimuth of the stylus. * Note: This property is only available for iOS devices that support the Apple Pencil and are 9.1 or later. */ azimuthUnitVectorInViewX: number; /** * The y value of the unit vector that points in the direction of the azimuth of the stylus. * Note: This property is only available for iOS devices that support the Apple Pencil and are 9.1 or later. */ azimuthUnitVectorInViewY: number; /** * The current force value of the touch event. * Note: This property is only available for iOS devices that support 3D-Touch and run 9.0 or later and on some Android devices. */ force: number; /** * Maximum possible value of the force property. * Note: This property is only available for iOS devices that support 3D-Touch and run 9.0 or later. */ maximumPossibleForce: number; /** * Returns `true` if the touch passed through an overlapping window belonging to another app. * This is a security feature to protect an app from "tapjacking", where a malicious app can use a * system overlay to intercept touch events in your app or to trick the end-user to tap on UI * in your app intended for the overlay. */ obscured: boolean; /** * The current size of the touch area. Note: This property is only available on some Android devices. */ size: number; /** * The time (in seconds) when the touch was used in correlation with the system start up. * Note: This property is only available for iOS devices that support 3D-Touch and run 9.0 or later. */ timestamp: number; /** * X coordinate of the event from the `source` view's coordinate system. */ x: number; /** * Y coordinate of the event from the `source` view's coordinate system. */ y: number; } /** * Fired as soon as the device detects a touch gesture. */ interface Toolbar_touchstart_Event extends ToolbarBaseEvent { /** * A value which indicates the stylus angle on the screen. If the stylus is perpendicular to the screen or no stylus is * being used, the value will be Pi/2. If the stylus is parallel to the screen, the value will be 0. * Note: This property is only available for iOS devices that support 3D-Touch and are 9.1 or later. */ altitudeAngle: number; /** * The x value of the unit vector that points in the direction of the azimuth of the stylus. * Note: This property is only available for iOS devices that support the Apple Pencil and are 9.1 or later. */ azimuthUnitVectorInViewX: number; /** * The y value of the unit vector that points in the direction of the azimuth of the stylus. * Note: This property is only available for iOS devices that support the Apple Pencil and are 9.1 or later. */ azimuthUnitVectorInViewY: number; /** * The current force value of the touch event. * Note: This property is only available for iOS devices that support 3D-Touch and run 9.0 or later and on some Android devices. */ force: number; /** * Maximum possible value of the force property. * Note: This property is only available for iOS devices that support 3D-Touch and run 9.0 or later. */ maximumPossibleForce: number; /** * Returns `true` if the touch passed through an overlapping window belonging to another app. * This is a security feature to protect an app from "tapjacking", where a malicious app can use a * system overlay to intercept touch events in your app or to trick the end-user to tap on UI * in your app intended for the overlay. */ obscured: boolean; /** * The current size of the touch area. Note: This property is only available on some Android devices. */ size: number; /** * The time (in seconds) when the touch was used in correlation with the system start up. * Note: This property is only available for iOS devices that support 3D-Touch and run 9.0 or later. */ timestamp: number; /** * X coordinate of the event from the `source` view's coordinate system. */ x: number; /** * Y coordinate of the event from the `source` view's coordinate system. */ y: number; } /** * Fired when the device detects a two-finger tap against the view. */ interface Toolbar_twofingertap_Event extends ToolbarBaseEvent { /** * Returns `true` if the tap passed through an overlapping window belonging to another app. * This is a security feature to protect an app from "tapjacking", where a malicious app can use a * system overlay to intercept touch events in your app or to trick the end-user to tap on UI * in your app intended for the overlay. */ obscured: boolean; /** * X coordinate of the event from the `source` view's coordinate system. */ x: number; /** * Y coordinate of the event from the `source` view's coordinate system. */ y: number; } interface ToolbarEventMap extends ProxyEventMap { click: Toolbar_click_Event; dblclick: Toolbar_dblclick_Event; doubletap: Toolbar_doubletap_Event; focus: Toolbar_focus_Event; keypressed: Toolbar_keypressed_Event; longclick: Toolbar_longclick_Event; longpress: Toolbar_longpress_Event; pinch: Toolbar_pinch_Event; postlayout: Toolbar_postlayout_Event; singletap: Toolbar_singletap_Event; swipe: Toolbar_swipe_Event; touchcancel: Toolbar_touchcancel_Event; touchend: Toolbar_touchend_Event; touchmove: Toolbar_touchmove_Event; touchstart: Toolbar_touchstart_Event; twofingertap: Toolbar_twofingertap_Event; } /** * A Toolbar can contain buttons, as well as certain other widgets, including text fields and labels. */ class Toolbar extends Titanium.UI.View { /** * Background color of the view, as a color name or hex triplet. */ backgroundColor: never; /** * Disabled background color of the view, as a color name or hex triplet. */ backgroundDisabledColor: never; /** * Disabled background image for the view, specified as a local file path or URL. */ backgroundDisabledImage: never; /** * Focused background color of the view, as a color name or hex triplet. */ backgroundFocusedColor: never; /** * Focused background image for the view, specified as a local file path or URL. */ backgroundFocusedImage: never; /** * Size of the left end cap. */ backgroundLeftCap: never; /** * Determines whether to tile a background across a view. */ backgroundRepeat: never; /** * Selected background color of the view, as a color name or hex triplet. */ backgroundSelectedColor: never; /** * Selected background image url for the view, specified as a local file path or URL. */ backgroundSelectedImage: never; /** * Size of the top end cap. */ backgroundTopCap: never; /** * Background color for the toolbar, as a color name or hex triplet. */ barColor: string | Titanium.UI.Color; /** * Array of this view's child views. */ readonly children: never; /** * Returns the margin after the toolbar's content when there are action buttons. */ contentInsetEndWithActions: number; /** * Returns the margin at the toolbar's content start when there is a navigation button. */ contentInsetStartWithNavigation: number; /** * If `true`, the background of the toolbar extends upwards. */ extendBackground: boolean; /** * An array of buttons (or other widgets) contained in the toolbar. */ items: Titanium.UI.View[]; /** * Specifies how the view positions its children. * One of: 'composite', 'vertical', or 'horizontal'. */ layout: never; /** * Image to be used as a logo in the Toolbar. */ logo: string | Titanium.Blob | Titanium.Filesystem.File; /** * Image to be used for a navigation icon. */ navigationIcon: string | Titanium.Blob | Titanium.Filesystem.File; /** * Image to be used for the overflow menu. */ overflowIcon: string | Titanium.Blob | Titanium.Filesystem.File; /** * Determines keyboard behavior when this view is focused. Defaults to . */ softKeyboardOnFocus: never; /** * Text of the subtitle. */ subtitle: string; /** * Color for toolbar's subtitle */ subtitleTextColor: string; /** * Text of the title. */ title: string; /** * Color string with any Titanium supported format */ titleTextColor: string; /** * If `true`, a translucent background color is used for the toolbar. */ translucent: boolean; /** * Adds a child to this view's hierarchy. */ add: never; /** * Adds the specified callback as an event listener for the named event. */ addEventListener(name: K, callback: (this: Titanium.UI.Toolbar, event: ToolbarEventMap[K]) => void): void; /** * Adds the specified callback as an event listener for the named event. */ addEventListener(name: string, callback: (param0: Titanium.Event) => void): void; /** * Collapses expanded ActionViews if there is any */ collapseActionViews(): void; /** * Collapses expandend ActionViews and hides overflow menu */ dismissPopupMenus(): void; /** * Fires a synthesized event to any registered listeners. */ fireEvent(name: K, event?: ToolbarEventMap[K]): void; /** * Fires a synthesized event to any registered listeners. */ fireEvent(name: string, event?: any): void; /** * Returns the margin at the toolbar's content end. */ getContentInsetEnd(): number; /** * Returns the margin on the left of the toolbar's content. */ getContentInsetLeft(): number; /** * Returns the margin on the right of the toolbar's content. */ getContentInsetRight(): number; /** * Returns the margin at the toolbar's content start. */ getContentInsetStart(): number; /** * Returns the margin at the toolbar's content end that will be used with the current configuration of the toolbar. */ getCurrentContentInsetEnd(): number; /** * Returns the margin on the left of the toolbar's content that will be used with the current configuration of the toolbar. */ getCurrentContentInsetLeft(): number; /** * Returns the margin on the right of the toolbar's content that will be used with the current configuration of the toolbar. */ getCurrentContentInsetRight(): number; /** * Returns the margin at the toolbar's content start that will be used with the current configuration of the toolbar. */ getCurrentContentInsetStart(): number; /** * Checks if the toolbar is currently hosting an expanded action view. */ hasExpandedActionView(): boolean; /** * Hides the overflow menu if there is one. */ hideOverflowMenu(): void; /** * Checks if the toolbar is currently hosting an expanded action view. */ isOverflowMenuShowing(): boolean; /** * Removes a child view from this view's hierarchy. */ remove: never; /** * Removes all child views from this view's hierarchy. */ removeAllChildren: never; /** * Removes the specified callback as an event listener for the named event. */ removeEventListener(name: K, callback: (this: Titanium.UI.Toolbar, event: ToolbarEventMap[K]) => void): void; /** * Removes the specified callback as an event listener for the named event. */ removeEventListener(name: string, callback: (param0: Titanium.Event) => void): void; /** * Replaces a view at the specified position in the [children](Titanium.UI.View.children) array. */ replaceAt: never; /** * Sets the content margins of the toolbar */ setContentInsetsAbsolute(insetLeft: number, insetRight: number): void; /** * Sets the content margins relative to the layout direction */ setContentInsetsRelative(insetStart: number, insetEnd: number): void; /** * Shows the overflow menu if there is one */ showOverflowMenu(): void; } } }