pub struct DriveApp {Show 22 fields
auth: GdriveAuth,
remote: Vec<DriveFile>,
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_focus: SetupField,
setup_id_box: TextBox,
setup_secret_box: TextBox,
}Fields§
§auth: GdriveAuth§remote: Vec<DriveFile>§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_focus: SetupField§setup_id_box: TextBox§setup_secret_box: TextBoxImplementations§
Source§impl DriveApp
impl DriveApp
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 して再読み込み)。ルートなら何もしない。
fn action_open_remote(&mut self)
Sourcefn action_download_remote(&mut self)
fn action_download_remote(&mut self)
選択中の remote ファイルの生バイトをそのままローカル FS に保存する (画像/zip など、テキストビューアでは壊れるファイル向け)。
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/secret 設定モードに入る。現在の値を入力欄の初期値にする
(gdrive_auth.json を手動編集しなくても、アプリ内でこの入力から書き込める)。
Sourcefn action_save_setup(&mut self)
fn action_save_setup(&mut self)
入力欄の内容を client_id/secret として保存する。
Trait Implementations§
Source§impl App for DriveApp
impl App for DriveApp
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 DriveApp
impl RefUnwindSafe for DriveApp
impl Send for DriveApp
impl Sync for DriveApp
impl Unpin for DriveApp
impl UnsafeUnpin for DriveApp
impl UnwindSafe for DriveApp
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