pub struct ViewWindow(/* private fields */);
Expand description
Handle to a window open in the view-process.
The window is closed when all clones of the handle are dropped.
Implementations§
source§impl ViewWindow
impl ViewWindow
sourcepub fn generation(&self) -> ViewProcessGen
pub fn generation(&self) -> ViewProcessGen
Returns the view-process generation on which the window was open.
sourcepub fn set_visible(&self, visible: bool) -> Result<(), ViewProcessOffline>
pub fn set_visible(&self, visible: bool) -> Result<(), ViewProcessOffline>
Set the window visibility.
sourcepub fn set_always_on_top(
&self,
always_on_top: bool,
) -> Result<(), ViewProcessOffline>
pub fn set_always_on_top( &self, always_on_top: bool, ) -> Result<(), ViewProcessOffline>
Set if the window is “top-most”.
sourcepub fn set_movable(&self, movable: bool) -> Result<(), ViewProcessOffline>
pub fn set_movable(&self, movable: bool) -> Result<(), ViewProcessOffline>
Set if the user can drag-move the window.
sourcepub fn set_resizable(&self, resizable: bool) -> Result<(), ViewProcessOffline>
pub fn set_resizable(&self, resizable: bool) -> Result<(), ViewProcessOffline>
Set if the user can resize the window.
sourcepub fn set_icon(
&self,
icon: Option<&ViewImage>,
) -> Result<(), ViewProcessOffline>
pub fn set_icon( &self, icon: Option<&ViewImage>, ) -> Result<(), ViewProcessOffline>
Set the window icon.
sourcepub fn set_cursor(
&self,
cursor: Option<CursorIcon>,
) -> Result<(), ViewProcessOffline>
pub fn set_cursor( &self, cursor: Option<CursorIcon>, ) -> Result<(), ViewProcessOffline>
Set the window cursor icon and visibility.
sourcepub fn set_cursor_image(
&self,
cursor: Option<&ViewImage>,
hotspot: PxPoint,
) -> Result<(), ViewProcessOffline>
pub fn set_cursor_image( &self, cursor: Option<&ViewImage>, hotspot: PxPoint, ) -> Result<(), ViewProcessOffline>
Set the window cursor to a custom image.
Falls back to cursor icon if set to None
.
The hotspot
value is an exact point in the image that is the mouse position. This value is only used if
the image format does not contain a hotspot.
sourcepub fn set_taskbar_visible(
&self,
visible: bool,
) -> Result<(), ViewProcessOffline>
pub fn set_taskbar_visible( &self, visible: bool, ) -> Result<(), ViewProcessOffline>
Set the window icon visibility in the taskbar.
sourcepub fn bring_to_top(&self) -> Result<(), ViewProcessOffline>
pub fn bring_to_top(&self) -> Result<(), ViewProcessOffline>
Bring the window the z top.
sourcepub fn set_state(&self, state: WindowStateAll) -> Result<(), ViewProcessOffline>
pub fn set_state(&self, state: WindowStateAll) -> Result<(), ViewProcessOffline>
Set the window state.
sourcepub fn set_video_mode(&self, mode: VideoMode) -> Result<(), ViewProcessOffline>
pub fn set_video_mode(&self, mode: VideoMode) -> Result<(), ViewProcessOffline>
Set video mode used in exclusive fullscreen.
Set enabled window chrome buttons.
sourcepub fn renderer(&self) -> ViewRenderer
pub fn renderer(&self) -> ViewRenderer
Reference the window renderer.
sourcepub fn set_capture_mode(&self, enabled: bool) -> Result<(), ViewProcessOffline>
pub fn set_capture_mode(&self, enabled: bool) -> Result<(), ViewProcessOffline>
Sets if the headed window is in capture-mode. If true
the resources used to capture
a screenshot may be kept in memory to be reused in the next screenshot capture.
Note that capture must still be requested in each frame request.
sourcepub fn focus(&self) -> Result<FocusResult, ViewProcessOffline>
pub fn focus(&self) -> Result<FocusResult, ViewProcessOffline>
Brings the window to the front and sets input focus.
This request can steal focus from other apps disrupting the user, be careful with it.
sourcepub fn set_focus_indicator(
&self,
indicator: Option<FocusIndicator>,
) -> Result<(), ViewProcessOffline>
pub fn set_focus_indicator( &self, indicator: Option<FocusIndicator>, ) -> Result<(), ViewProcessOffline>
Sets the user attention request indicator, the indicator is cleared when the window is focused or
if canceled by setting to None
.
sourcepub fn drag_move(&self) -> Result<(), ViewProcessOffline>
pub fn drag_move(&self) -> Result<(), ViewProcessOffline>
Moves the window with the left mouse button until the button is released.
There’s no guarantee that this will work unless the left mouse button was pressed immediately before this function is called.
sourcepub fn drag_resize(
&self,
direction: ResizeDirection,
) -> Result<(), ViewProcessOffline>
pub fn drag_resize( &self, direction: ResizeDirection, ) -> Result<(), ViewProcessOffline>
Resizes the window with the left mouse button until the button is released.
There’s no guarantee that this will work unless the left mouse button was pressed immediately before this function is called.
sourcepub fn start_drag_drop(
&self,
data: Vec<DragDropData>,
allowed_effects: DragDropEffect,
) -> Result<Result<DragDropId, DragDropError>, ViewProcessOffline>
pub fn start_drag_drop( &self, data: Vec<DragDropData>, allowed_effects: DragDropEffect, ) -> Result<Result<DragDropId, DragDropError>, ViewProcessOffline>
Start a drag and drop operation, if the window is pressed.
A RAW_APP_DRAG_ENDED_EVENT
will be received when the operation finishes.
sourcepub fn drag_dropped(
&self,
drop_id: DragDropId,
applied: DragDropEffect,
) -> Result<(), ViewProcessOffline>
pub fn drag_dropped( &self, drop_id: DragDropId, applied: DragDropEffect, ) -> Result<(), ViewProcessOffline>
Notify the drag source of what effect was applied for a received drag&drop.
Open system title bar context menu.
sourcepub fn message_dialog(
&self,
dlg: MsgDialog,
responder: ResponderVar<MsgDialogResponse>,
) -> Result<(), ViewProcessOffline>
pub fn message_dialog( &self, dlg: MsgDialog, responder: ResponderVar<MsgDialogResponse>, ) -> Result<(), ViewProcessOffline>
Shows a native message dialog for the window.
The window is not interactive while the dialog is visible and the dialog may be modal in the view-process. In the app-process this is always async, and the response var will update once when the user responds.
sourcepub fn file_dialog(
&self,
dlg: FileDialog,
responder: ResponderVar<FileDialogResponse>,
) -> Result<(), ViewProcessOffline>
pub fn file_dialog( &self, dlg: FileDialog, responder: ResponderVar<FileDialogResponse>, ) -> Result<(), ViewProcessOffline>
Shows a native file/folder dialog for the window.
The window is not interactive while the dialog is visible and the dialog may be modal in the view-process. In the app-process this is always async, and the response var will update once when the user responds.
sourcepub fn access_update(
&self,
update: AccessTreeUpdate,
) -> Result<(), ViewProcessOffline>
pub fn access_update( &self, update: AccessTreeUpdate, ) -> Result<(), ViewProcessOffline>
Update the window’s accessibility info tree.
sourcepub fn set_ime_area(
&self,
area: Option<DipRect>,
) -> Result<(), ViewProcessOffline>
pub fn set_ime_area( &self, area: Option<DipRect>, ) -> Result<(), ViewProcessOffline>
Enable or disable IME by setting a cursor area.
In mobile platforms also shows the software keyboard for Some(_)
and hides it for None
.
sourcepub fn set_system_shutdown_warn(
&self,
reason: Txt,
) -> Result<(), ViewProcessOffline>
pub fn set_system_shutdown_warn( &self, reason: Txt, ) -> Result<(), ViewProcessOffline>
Attempt to set a system wide shutdown warning associated with the window.
Operating systems that support this show the reason
in a warning for the user, it must be a short text
that identifies the critical operation that cannot be cancelled.
Note that there is no guarantee that the view-process or operating system will actually set a block, there is no error result because operating systems can silently ignore block requests at any moment, even after an initial successful block.
Set to an empty text to remove the warning.
sourcepub fn window_extension_raw(
&self,
extension_id: ApiExtensionId,
request: ApiExtensionPayload,
) -> Result<ApiExtensionPayload, ViewProcessOffline>
pub fn window_extension_raw( &self, extension_id: ApiExtensionId, request: ApiExtensionPayload, ) -> Result<ApiExtensionPayload, ViewProcessOffline>
Call a window extension with custom encoded payload.
sourcepub fn window_extension<I, O>(
&self,
extension_id: ApiExtensionId,
request: &I,
) -> Result<Result<O, ApiExtensionRecvError>, ViewProcessOffline>where
I: Serialize,
O: DeserializeOwned,
pub fn window_extension<I, O>(
&self,
extension_id: ApiExtensionId,
request: &I,
) -> Result<Result<O, ApiExtensionRecvError>, ViewProcessOffline>where
I: Serialize,
O: DeserializeOwned,
Call a window extension with serialized payload.
Trait Implementations§
source§impl Clone for ViewWindow
impl Clone for ViewWindow
source§fn clone(&self) -> ViewWindow
fn clone(&self) -> ViewWindow
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for ViewWindow
impl Debug for ViewWindow
source§impl From<ViewWindow> for ViewWindowOrHeadless
impl From<ViewWindow> for ViewWindowOrHeadless
source§fn from(w: ViewWindow) -> Self
fn from(w: ViewWindow) -> Self
source§impl PartialEq for ViewWindow
impl PartialEq for ViewWindow
impl Eq for ViewWindow
Auto Trait Implementations§
impl Freeze for ViewWindow
impl RefUnwindSafe for ViewWindow
impl Send for ViewWindow
impl Sync for ViewWindow
impl Unpin for ViewWindow
impl UnwindSafe for ViewWindow
Blanket Implementations§
source§impl<T> AnyVarValue for Twhere
T: VarValue,
impl<T> AnyVarValue for Twhere
T: VarValue,
source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
dyn Any
methods.source§fn clone_boxed(&self) -> Box<dyn AnyVarValue>
fn clone_boxed(&self) -> Box<dyn AnyVarValue>
source§fn clone_boxed_var(&self) -> Box<dyn AnyVar>
fn clone_boxed_var(&self) -> Box<dyn AnyVar>
LocalVar<Self>
.source§fn eq_any(&self, other: &(dyn AnyVarValue + 'static)) -> bool
fn eq_any(&self, other: &(dyn AnyVarValue + 'static)) -> bool
self
equals other
.source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more