pub struct PluginHost { /* private fields */ }Expand description
-
instance_name(non-official) -
config_* -
db_* -
debug_*(tracing) -
localization_get_* -
os_enable_or_disable_dlg_item -
os_get_(local_)?app_data_path_cat_filename -
plugin_?et_setting_string -
property_* -
ui_options_add_plugin_page -
utf8_buf_(init|kill) -
version_get_*,plugin_get_version
Implementations§
Source§impl PluginHost
impl PluginHost
Sourcepub fn config_get_int_value(&self, name: &str) -> i32
pub fn config_get_int_value(&self, name: &str) -> i32
Sourcepub fn config_set_int_value(&self, name: &str, value: i32) -> i32
pub fn config_set_int_value(&self, name: &str, value: i32) -> i32
Sourcepub fn config_get_language(&self) -> Option<u16>
pub fn config_get_language(&self) -> Option<u16>
§Returns
None: User DefaultSome(u16): Language identifier
pub fn get_language_name(language: u16) -> String
pub fn get_thread_language_name() -> String
pub fn config_get_language_name(&self) -> String
Source§impl PluginHost
impl PluginHost
pub fn os_get_app_data_path(&self) -> PathBuf
Sourcepub fn os_get_app_data_path_cat_filename(&self, filename: &str) -> PathBuf
pub fn os_get_app_data_path_cat_filename(&self, filename: &str) -> PathBuf
Build the setting or data full path using the specified filename.
The full path is stored in cbuf.
This will either be %APPDATA%\Everything\filename or filename in the same location as your Everything.exe
Depending on your app_data setting.
cbuf must be initialized with Self::utf8_buf_init
See also Self::utf8_buf_init
pub fn os_get_local_app_data_path(&self) -> PathBuf
Sourcepub fn os_get_local_app_data_path_cat_filename(&self, filename: &str) -> PathBuf
pub fn os_get_local_app_data_path_cat_filename(&self, filename: &str) -> PathBuf
Build the data full path using the specified filename.
The full path is stored in cbuf.
This will either be %LOCALAPPDATA%\Everything\filename or filename in the same location as your Everything.exe
Depending on your app_data setting.
Sourcepub fn plugin_get_setting_string(
&self,
data: *mut c_void,
name: &str,
current_string: *mut everything_plugin_utf8_t,
) -> *mut everything_plugin_utf8_t
pub fn plugin_get_setting_string( &self, data: *mut c_void, name: &str, current_string: *mut everything_plugin_utf8_t, ) -> *mut everything_plugin_utf8_t
Get an string setting value by name from the specified setting sorted list.
Returns a pointer to the string value.
current_value is returned if the setting value was not found.
§Note
data: Onsys::EVERYTHING_PLUGIN_PM_START
Sourcepub fn plugin_set_setting_string(
&self,
data: *mut c_void,
name: &str,
value: &str,
)
pub fn plugin_set_setting_string( &self, data: *mut c_void, name: &str, value: &str, )
Writes a string setting value with the specified name to the specified output stream.
§Note
data: Onsys::EVERYTHING_PLUGIN_PM_SAVE_SETTINGSvalue: Must be single-line. Chars after the first newline cannot be read.
Plugins{-instance_name}.ini:
[{plugin_dll}]
{name}={value}
...Sourcepub fn plugin_setting_json_path(&self) -> PathBuf
pub fn plugin_setting_json_path(&self) -> PathBuf
Non-official plugins.json path.
TODO: Named instances
Source§impl PluginHost
impl PluginHost
pub fn ui_options_add_plugin_page( &self, data: *mut c_void, user_data: *mut c_void, name: &str, )
pub fn ui_options_from_page_hwnd(page_hwnd: HWND) -> HWND
Sourcepub fn os_enable_or_disable_dlg_item(
&self,
parent_hwnd: HWND,
id: i32,
enable: bool,
)
pub fn os_enable_or_disable_dlg_item( &self, parent_hwnd: HWND, id: i32, enable: bool, )
Source§impl PluginHost
impl PluginHost
pub fn new(get_proc_address: everything_plugin_get_proc_address_t) -> Self
pub unsafe fn from_data(data: *mut c_void) -> Self
Sourcepub unsafe fn get<T: Copy>(&self, name: &str) -> Option<T>
pub unsafe fn get<T: Copy>(&self, name: &str) -> Option<T>
You can unwrap_unchecked() if the API exists in all versions of Everything.
Sourcepub fn utf8_buf_init(&self, cbuf: *mut everything_plugin_utf8_buf_t)
pub fn utf8_buf_init(&self, cbuf: *mut everything_plugin_utf8_buf_t)
Initialize a cbuf with an empty string.
The cbuf must be killed with Self::utf8_buf_kill
See also Self::utf8_buf_kill
§Note
Usage:
let mut cbuf = MaybeUninit::uninit();
host.utf8_buf_init(cbuf.as_mut_ptr());
unsafe { os_get_app_data_path_cat_filename(filename.as_ptr() as _, cbuf.as_mut_ptr()) };
// Or `utf8_buf_kill()`
self.utf8_buf_into_string(cbuf.as_mut_ptr())Do not move sys::everything_plugin_utf8_buf_t.
Sourcepub fn utf8_buf_kill(&self, cbuf: *mut everything_plugin_utf8_buf_t)
pub fn utf8_buf_kill(&self, cbuf: *mut everything_plugin_utf8_buf_t)
Kill a cbuf initialized with Self::utf8_buf_init.
Any allocated memory is returned to the system.
See also Self::utf8_buf_init
pub fn utf8_buf_into_string( &self, cbuf: *mut everything_plugin_utf8_buf_t, ) -> String
pub fn ipc_window_from_main_thread() -> Option<IpcWindow>
pub fn instance_name_from_main_thread() -> Option<String>
Auto Trait Implementations§
impl Freeze for PluginHost
impl RefUnwindSafe for PluginHost
impl Send for PluginHost
impl Sync for PluginHost
impl Unpin for PluginHost
impl UnsafeUnpin for PluginHost
impl UnwindSafe for PluginHost
Blanket Implementations§
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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§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