pub struct OneDriveApp {Show 20 fields
auth: MsAuth,
remote: Vec<OneDriveFile>,
local: Vec<String>,
remote_sel: usize,
local_sel: usize,
pane: Pane,
scroll: usize,
folder_path: Vec<(String, String)>,
device_user_code: String,
device_url: String,
device_code: String,
awaiting_auth: bool,
viewer_open: bool,
viewer_title: String,
viewer_text: String,
viewer_scroll: usize,
status: String,
last_win_w: u32,
setup_mode: bool,
setup_id_box: TextBox,
}Fields§
§auth: MsAuth§remote: Vec<OneDriveFile>§local: Vec<String>§remote_sel: usize§local_sel: usize§pane: Pane§scroll: usize§folder_path: Vec<(String, String)>§device_user_code: String§device_url: String§device_code: String§awaiting_auth: bool§viewer_open: bool§viewer_title: String§viewer_text: String§viewer_scroll: usize§status: String§last_win_w: u32§setup_mode: bool§setup_id_box: TextBoxImplementations§
Source§impl OneDriveApp
impl OneDriveApp
pub fn new() -> Self
fn reload_local(&mut self)
Sourcefn try_refresh(&mut self) -> bool
fn try_refresh(&mut self) -> bool
access_token が空、または期限切れ時に refresh_token で更新を試みる。成功で true。
fn action_login(&mut self)
fn action_poll(&mut self)
Sourcefn current_folder_id(&self) -> Option<&str>
fn current_folder_id(&self) -> Option<&str>
現在のフォルダ(folder_path の末尾。空ならルート)の直下一覧を取得する。
fn action_refresh_remote(&mut self)
Sourcefn action_enter_folder(&mut self, id: String, name: String)
fn action_enter_folder(&mut self, id: String, name: String)
フォルダに入る(folder_path に積んで再読み込み)。
Sourcefn action_leave_folder(&mut self)
fn action_leave_folder(&mut self)
1階層上に戻る(folder_path から1つ pop して再読み込み)。ルートなら何もしない。
Sourcefn action_open_remote(&mut self)
fn action_open_remote(&mut self)
選択中の remote ファイルをダウンロードし、テキストとして解釈できればビューアで開く (フォルダなら代わりに中へ入る)。
Sourcefn action_download_remote(&mut self)
fn action_download_remote(&mut self)
選択中の remote ファイルの生バイトをそのままローカル FS に保存する (画像/zip/docx など、テキストビューアでは壊れるファイル向け)。
fn action_upload_local(&mut self)
fn action_delete_remote(&mut self)
fn action_logout(&mut self)
Sourcefn action_enter_setup(&mut self)
fn action_enter_setup(&mut self)
client_id 設定モードに入る。現在の値を入力欄の初期値にする
(onedrive_auth.json を手動編集しなくても、アプリ内でこの入力から書き込める)。
Sourcefn action_save_setup(&mut self)
fn action_save_setup(&mut self)
入力欄の内容を client_id として保存する。
Trait Implementations§
Source§impl App for OneDriveApp
impl App for OneDriveApp
fn name(&self) -> &str
Source§fn instance_info(&self) -> String
fn instance_info(&self) -> String
インスタンス特有の情報(ファイル名やURLなど)を返す
Source§fn draw(
&mut self,
screen: &Screen,
win_x: u32,
win_y: u32,
win_w: u32,
win_h: u32,
)
fn draw( &mut self, screen: &Screen, win_x: u32, win_y: u32, win_w: u32, win_h: u32, )
ウィンドウ内の描画要求
Source§fn on_mouse(
&mut self,
local_x: i32,
local_y: i32,
btn_left: bool,
_btn_right: bool,
wheel: i32,
)
fn on_mouse( &mut self, local_x: i32, local_y: i32, btn_left: bool, _btn_right: bool, wheel: i32, )
マウスイベント。ローカル座標とホイール移動量が渡される。
共有されるバックバッファを返す
fn active_tab(&self) -> usize
fn switch_tab(&mut self, _idx: usize)
fn add_tab(&mut self)
Source§fn open_file_dialog(&mut self)
fn open_file_dialog(&mut self)
Alt+O: ファイルオープンダイアログを開く(未実装アプリはno-op)
Source§fn tab_thread_fn(&self) -> Option<fn()>
fn tab_thread_fn(&self) -> Option<fn()>
このアプリの各タブ用バックグラウンドスレッド関数を返す。
Some(fn) を返したアプリはタブ追加時にスケジューラでスレッドを起動する。
スレッド関数は引数なしの fn() で、グローバル Mutex 経由でアプリ状態と通信する。
fn get_dom_value(&self, _id: &str) -> Option<String>
fn set_dom_value(&mut self, _id: &str, _val: &str)
fn needs_timer_redraw(&self) -> bool
Source§fn get_buffer_updated_flag(&self) -> Option<Arc<AtomicBool>>
fn get_buffer_updated_flag(&self) -> Option<Arc<AtomicBool>>
ProxyApp の shared_buffer が更新されたことを通知する AtomicBool を返す。
ProxyApp でない通常のアプリは None を返す(デフォルト実装)。
Core 0 の dirty 判定がこのフラグを読んで矩形を登録する。
fn get_dom_content(&self, _id: &str) -> Option<String>
fn set_dom_content(&mut self, _id: &str, _val: &str)
Auto Trait Implementations§
impl Freeze for OneDriveApp
impl RefUnwindSafe for OneDriveApp
impl Send for OneDriveApp
impl Sync for OneDriveApp
impl Unpin for OneDriveApp
impl UnsafeUnpin for OneDriveApp
impl UnwindSafe for OneDriveApp
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
Mutably borrows from an owned value. Read more