Struct xpcom::interfaces::nsIFocusManager
[−]
[src]
#[repr(C)]pub struct nsIFocusManager { /* fields omitted */ }
interface nsIFocusManager : nsISupports
/**
* The focus manager deals with all focus related behaviour. Only one element
* in the entire application may have the focus at a time; this element
* receives any keyboard events. While there is only one application-wide
* focused element, each nsIDOMWindow maintains a reference to the element
* that would be focused if the window was active.
*
* If the window's reference is to a frame element (iframe, browser,
* editor), then the child window contains the element that is currently
* focused. If the window's reference is to a root element, then the root is
* focused. If a window's reference is null, then no element is focused, yet
* the window is still focused.
*
* The blur event is fired on an element when it loses the application focus.
* After this blur event, if the focus is moving away from a document, two
* additional blur events are fired on the old document and window containing
* the focus respectively.
*
* When a new document is focused, two focus events are fired on the new
* document and window respectively. Then the focus event is fired on an
* element when it gains the application focus.
*
* A special case is that the root element may be focused, yet does not
* receive the element focus and blur events. Instead a focus outline may be
* drawn around the document.
*
* Blur and focus events do not bubble as per the W3C DOM Events spec.
*/
Methods
impl nsIFocusManager
[src]
pub fn coerce<T: nsIFocusManagerCoerce>(&self) -> &T
[src]
Cast this nsIFocusManager
to one of its base interfaces.
impl nsIFocusManager
[src]
pub const FLAG_RAISE: i64
FLAG_RAISE: i64 = 1
pub const FLAG_NOSCROLL: i64
FLAG_NOSCROLL: i64 = 2
/**
* Do not scroll the element to focus into view
*/
pub const FLAG_NOSWITCHFRAME: i64
FLAG_NOSWITCHFRAME: i64 = 4
/**
* If attempting to change focus in a window that is not focused, do not
* switch focus to that window. Instead, just update the focus within that
* window and leave the application focus as is. This flag will have no
* effect if a child window is focused and an attempt is made to adjust the
* focus in an ancestor, as the frame must be switched in this case.
*/
pub const FLAG_NOPARENTFRAME: i64
FLAG_NOPARENTFRAME: i64 = 8
/**
* This flag is only used when passed to moveFocus. If set, focus is never
* moved to the parent frame of the starting element's document, instead
* iterating around to the beginning of that document again. Child frames
* are navigated as normal.
*/
pub const FLAG_BYMOUSE: i64
FLAG_BYMOUSE: i64 = 4096
/**
* Focus is changing due to a mouse operation, for instance the mouse was
* clicked on an element.
*/
pub const FLAG_BYKEY: i64
FLAG_BYKEY: i64 = 8192
/**
* Focus is changing due to a key operation, for instance pressing the tab
* key. This flag would normally be passed when MOVEFOCUS_FORWARD or
* MOVEFOCUS_BACKWARD is used.
*/
pub const FLAG_BYMOVEFOCUS: i64
FLAG_BYMOVEFOCUS: i64 = 16384
/**
* Focus is changing due to a call to MoveFocus. This flag will be implied
* when MoveFocus is called except when one of the other mechanisms (mouse
* or key) is specified, or when the type is MOVEFOCUS_ROOT or
* MOVEFOCUS_CARET.
*/
pub const FLAG_SHOWRING: i64
FLAG_SHOWRING: i64 = 1048576
/**
* Always show the focus ring or other indicator of focus, regardless of
* other state.
*/
pub const FLAG_BYTOUCH: i64
FLAG_BYTOUCH: i64 = 2097152
/**
* Focus is changing due to a touch operation that generated a mouse event.
* Normally used in conjunction with FLAG_BYMOUSE.
*/
pub const MOVEFOCUS_FORWARD: i64
MOVEFOCUS_FORWARD: i64 = 1
/** move focus forward one element, used when pressing TAB */
pub const MOVEFOCUS_BACKWARD: i64
MOVEFOCUS_BACKWARD: i64 = 2
/** move focus backward one element, used when pressing Shift+TAB */
pub const MOVEFOCUS_FORWARDDOC: i64
MOVEFOCUS_FORWARDDOC: i64 = 3
/** move focus forward to the next frame document, used when pressing F6 */
pub const MOVEFOCUS_BACKWARDDOC: i64
MOVEFOCUS_BACKWARDDOC: i64 = 4
/** move focus forward to the previous frame document, used when pressing Shift+F6 */
pub const MOVEFOCUS_FIRST: i64
MOVEFOCUS_FIRST: i64 = 5
/** move focus to the first focusable element */
pub const MOVEFOCUS_LAST: i64
MOVEFOCUS_LAST: i64 = 6
/** move focus to the last focusable element */
pub const MOVEFOCUS_ROOT: i64
MOVEFOCUS_ROOT: i64 = 7
/** move focus to the root element in the document */
pub const MOVEFOCUS_CARET: i64
MOVEFOCUS_CARET: i64 = 8
/** move focus to a link at the position of the caret. This is a special value used to
* focus links as the caret moves over them in caret browsing mode.
*/
pub const MOVEFOCUS_FIRSTDOC: i64
MOVEFOCUS_FIRSTDOC: i64 = 9
/** move focus to the first focusable document */
pub const MOVEFOCUS_LASTDOC: i64
MOVEFOCUS_LASTDOC: i64 = 10
/** move focus to the last focusable document */
pub unsafe fn GetActiveWindow(
&self,
aActiveWindow: *mut *const mozIDOMWindowProxy
) -> nsresult
[src]
&self,
aActiveWindow: *mut *const mozIDOMWindowProxy
) -> nsresult
/**
* The most active (frontmost) window, or null if no window that is part of
* the application is active. Setting the activeWindow raises it, and
* focuses the current child window's current element, if any. Setting this
* to null or to a non-top-level window throws an NS_ERROR_INVALID_ARG
* exception.
*/
attribute mozIDOMWindowProxy activeWindow;
pub unsafe fn SetActiveWindow(
&self,
aActiveWindow: *const mozIDOMWindowProxy
) -> nsresult
[src]
&self,
aActiveWindow: *const mozIDOMWindowProxy
) -> nsresult
/**
* The most active (frontmost) window, or null if no window that is part of
* the application is active. Setting the activeWindow raises it, and
* focuses the current child window's current element, if any. Setting this
* to null or to a non-top-level window throws an NS_ERROR_INVALID_ARG
* exception.
*/
attribute mozIDOMWindowProxy activeWindow;
pub unsafe fn GetFocusedWindow(
&self,
aFocusedWindow: *mut *const mozIDOMWindowProxy
) -> nsresult
[src]
&self,
aFocusedWindow: *mut *const mozIDOMWindowProxy
) -> nsresult
/**
* The child window within the activeWindow that is focused. This will
* always be activeWindow, a child window of activeWindow or null if no
* child window is focused. Setting the focusedWindow changes the focused
* window and raises the toplevel window it is in. If the current focus
* within the new focusedWindow is a frame element, then the focusedWindow
* will actually be set to the child window and the current element within
* that set as the focused element. This process repeats downwards until a
* non-frame element is found.
*/
attribute mozIDOMWindowProxy focusedWindow;
pub unsafe fn SetFocusedWindow(
&self,
aFocusedWindow: *const mozIDOMWindowProxy
) -> nsresult
[src]
&self,
aFocusedWindow: *const mozIDOMWindowProxy
) -> nsresult
/**
* The child window within the activeWindow that is focused. This will
* always be activeWindow, a child window of activeWindow or null if no
* child window is focused. Setting the focusedWindow changes the focused
* window and raises the toplevel window it is in. If the current focus
* within the new focusedWindow is a frame element, then the focusedWindow
* will actually be set to the child window and the current element within
* that set as the focused element. This process repeats downwards until a
* non-frame element is found.
*/
attribute mozIDOMWindowProxy focusedWindow;
pub unsafe fn GetFocusedElement(
&self,
aFocusedElement: *mut *const nsIDOMElement
) -> nsresult
[src]
&self,
aFocusedElement: *mut *const nsIDOMElement
) -> nsresult
/**
* The element that is currently focused. This will always be an element
* within the document loaded in focusedWindow or null if no element in that
* document is focused.
*/
readonly attribute nsIDOMElement focusedElement;
pub unsafe fn GetLastFocusMethod(
&self,
window: *const mozIDOMWindowProxy,
_retval: *mut uint32_t
) -> nsresult
[src]
&self,
window: *const mozIDOMWindowProxy,
_retval: *mut uint32_t
) -> nsresult
/**
* Returns the method that was used to focus the element in window. This
* will either be 0, FLAG_BYMOUSE or FLAG_BYKEY. If window is null, then
* the current focusedWindow will be used by default. This has the result
* of retrieving the method that was used to focus the currently focused
* element.
*/
uint32_t getLastFocusMethod (in mozIDOMWindowProxy window);
pub unsafe fn SetFocus(
&self,
aElement: *const nsIDOMElement,
aFlags: uint32_t
) -> nsresult
[src]
&self,
aElement: *const nsIDOMElement,
aFlags: uint32_t
) -> nsresult
/**
* Changes the focused element reference within the window containing
* aElement to aElement.
*/
void setFocus (in nsIDOMElement aElement, in unsigned long aFlags);
pub unsafe fn MoveFocus(
&self,
aWindow: *const mozIDOMWindowProxy,
aStartElement: *const nsIDOMElement,
aType: uint32_t,
aFlags: uint32_t,
_retval: *mut *const nsIDOMElement
) -> nsresult
[src]
&self,
aWindow: *const mozIDOMWindowProxy,
aStartElement: *const nsIDOMElement,
aType: uint32_t,
aFlags: uint32_t,
_retval: *mut *const nsIDOMElement
) -> nsresult
/**
* Move the focus to another element. If aStartElement is specified, then
* movement is done relative to aStartElement. If aStartElement is null,
* then movement is done relative to the currently focused element. If no
* element is focused, focus the first focusable element within the
* document (or the last focusable element if aType is MOVEFOCUS_END). This
* method is equivalent to setting the focusedElement to the new element.
*
* Specifying aStartElement and using MOVEFOCUS_LAST is not currently
* implemented.
*
* If no element is found, and aType is either MOVEFOCUS_ROOT or
* MOVEFOCUS_CARET, then the focus is cleared. If aType is any other value,
* the focus is not changed.
*
* Returns the element that was focused. The return value may be null if focus
* was moved into a child process.
*/
nsIDOMElement moveFocus (in mozIDOMWindowProxy aWindow, in nsIDOMElement aStartElement, in unsigned long aType, in unsigned long aFlags);
pub unsafe fn ClearFocus(&self, aWindow: *const mozIDOMWindowProxy) -> nsresult
[src]
/**
* Clears the focused element within aWindow. If the current focusedWindow
* is a descendant of aWindow, sets the current focusedWindow to aWindow.
*
* @throws NS_ERROR_INVALID_ARG if aWindow is null
*/
void clearFocus (in mozIDOMWindowProxy aWindow);
pub unsafe fn GetFocusedElementForWindow(
&self,
aWindow: *const mozIDOMWindowProxy,
aDeep: bool,
aFocusedWindow: *mut *const mozIDOMWindowProxy,
_retval: *mut *const nsIDOMElement
) -> nsresult
[src]
&self,
aWindow: *const mozIDOMWindowProxy,
aDeep: bool,
aFocusedWindow: *mut *const mozIDOMWindowProxy,
_retval: *mut *const nsIDOMElement
) -> nsresult
/**
* Returns the currently focused element within aWindow. If aWindow is equal
* to the current value of focusedWindow, then the returned element will be
* the application-wide focused element (the value of focusedElement). The
* return value will be null if no element is focused.
*
* If aDeep is true, then child frames are traversed and the return value
* may be the element within a child descendant window that is focused. If
* aDeep if false, then the return value will be the frame element if the
* focus is in a child frame.
*
* aFocusedWindow will be set to the currently focused descendant window of
* aWindow, or to aWindow if aDeep is false. This will be set even if no
* element is focused.
*
* @throws NS_ERROR_INVALID_ARG if aWindow is null
*/
nsIDOMElement getFocusedElementForWindow (in mozIDOMWindowProxy aWindow, in boolean aDeep, out mozIDOMWindowProxy aFocusedWindow);
pub unsafe fn MoveCaretToFocus(
&self,
aWindow: *const mozIDOMWindowProxy
) -> nsresult
[src]
&self,
aWindow: *const mozIDOMWindowProxy
) -> nsresult
/**
* Moves the selection caret within aWindow to the current focus.
*/
void moveCaretToFocus (in mozIDOMWindowProxy aWindow);
pub unsafe fn ElementIsFocusable(
&self,
aElement: *const nsIDOMElement,
aFlags: uint32_t,
_retval: *mut bool
) -> nsresult
[src]
&self,
aElement: *const nsIDOMElement,
aFlags: uint32_t,
_retval: *mut bool
) -> nsresult
/***
* Check if given element is focusable.
*/
boolean elementIsFocusable (in nsIDOMElement aElement, in unsigned long aFlags);
pub unsafe fn WindowRaised(
&self,
aWindow: *const mozIDOMWindowProxy
) -> nsresult
[src]
&self,
aWindow: *const mozIDOMWindowProxy
) -> nsresult
/**
* Called when a window has been raised.
*/
[noscript] void windowRaised (in mozIDOMWindowProxy aWindow);
pub unsafe fn WindowLowered(
&self,
aWindow: *const mozIDOMWindowProxy
) -> nsresult
[src]
&self,
aWindow: *const mozIDOMWindowProxy
) -> nsresult
/**
* Called when a window has been lowered.
*/
[noscript] void windowLowered (in mozIDOMWindowProxy aWindow);
pub unsafe fn WindowShown(
&self,
aWindow: *const mozIDOMWindowProxy,
aNeedsFocus: bool
) -> nsresult
[src]
&self,
aWindow: *const mozIDOMWindowProxy,
aNeedsFocus: bool
) -> nsresult
/**
* Called when a new document in a window is shown.
*
* If aNeedsFocus is true, then focus events are expected to be fired on the
* window if this window is in the focused window chain.
*/
[noscript] void windowShown (in mozIDOMWindowProxy aWindow, in boolean aNeedsFocus);
pub unsafe fn WindowHidden(
&self,
aWindow: *const mozIDOMWindowProxy
) -> nsresult
[src]
&self,
aWindow: *const mozIDOMWindowProxy
) -> nsresult
/**
* Called when a document in a window has been hidden or otherwise can no
* longer accept focus.
*/
[noscript] void windowHidden (in mozIDOMWindowProxy aWindow);
pub unsafe fn FireDelayedEvents(
&self,
aDocument: *const nsIDocument
) -> nsresult
[src]
&self,
aDocument: *const nsIDocument
) -> nsresult
/**
* Fire any events that have been delayed due to synchronized actions.
*/
[noscript] void fireDelayedEvents (in nsIDocument aDocument);
pub unsafe fn FocusPlugin(&self, aPlugin: *const nsIContent) -> nsresult
[src]
/**
* Indicate that a plugin wishes to take the focus. This is similar to a
* normal focus except that the widget focus is not changed. Updating the
* widget focus state is the responsibility of the caller.
*/
[noscript] void focusPlugin (in nsIContent aPlugin);
pub unsafe fn ParentActivated(
&self,
aWindow: *const mozIDOMWindowProxy,
active: bool
) -> nsresult
[src]
&self,
aWindow: *const mozIDOMWindowProxy,
active: bool
) -> nsresult
/**
* Used in a child process to indicate that the parent window is now
* active or deactive.
*/
[noscript] void parentActivated (in mozIDOMWindowProxy aWindow, in bool active);
Methods from Deref<Target = nsISupports>
pub fn coerce<T: nsISupportsCoerce>(&self) -> &T
[src]
Cast this nsISupports
to one of its base interfaces.
pub unsafe fn QueryInterface(
&self,
uuid: &nsIID,
result: *mut *mut c_void
) -> nsresult
[src]
&self,
uuid: &nsIID,
result: *mut *mut c_void
) -> nsresult
void QueryInterface (in nsIIDRef uuid, [iid_is (uuid), retval] out nsQIResult result);
pub unsafe fn AddRef(&self) -> nsrefcnt
[src]
[noscript,notxpcom] nsrefcnt AddRef ();
pub unsafe fn Release(&self) -> nsrefcnt
[src]
[noscript,notxpcom] nsrefcnt Release ();
Trait Implementations
impl XpCom for nsIFocusManager
[src]
const IID: nsIID
IID: nsIID = nsID(2262954465, 13917, 18747, [181, 42, 166, 73, 243, 243, 17, 220])
fn query_interface<T: XpCom>(&self) -> Option<RefPtr<T>>
[src]
Perform a QueryInterface call on this object, attempting to dynamically cast it to the requested interface type. Returns Some(RefPtr) if the cast succeeded, and None otherwise. Read more
impl RefCounted for nsIFocusManager
[src]
unsafe fn addref(&self)
[src]
Increment the reference count.
unsafe fn release(&self)
[src]
Decrement the reference count, potentially freeing backing memory.
impl Deref for nsIFocusManager
[src]
type Target = nsISupports
The resulting type after dereferencing.
fn deref(&self) -> &nsISupports
[src]
Dereferences the value.