2018-08-07 15:01:15 +03:00
|
|
|
/*
|
|
|
|
* meli - ui crate.
|
|
|
|
*
|
|
|
|
* Copyright 2017-2018 Manos Pitsidianakis
|
|
|
|
*
|
|
|
|
* This file is part of meli.
|
|
|
|
*
|
|
|
|
* meli is free software: you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation, either version 3 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* meli is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with meli. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*/
|
|
|
|
|
2018-08-06 22:20:34 +03:00
|
|
|
/*!
|
|
|
|
* User actions that need to be handled by the UI
|
|
|
|
*/
|
|
|
|
|
2019-06-18 21:13:58 +03:00
|
|
|
use crate::components::Component;
|
2019-03-14 12:19:25 +02:00
|
|
|
pub use melib::mailbox::{SortField, SortOrder};
|
2019-05-14 21:47:47 +03:00
|
|
|
use melib::thread::ThreadHash;
|
2019-05-26 02:34:03 +03:00
|
|
|
use melib::EnvelopeHash;
|
2018-08-07 11:47:26 +03:00
|
|
|
|
2018-09-04 01:49:29 +03:00
|
|
|
extern crate uuid;
|
|
|
|
use uuid::Uuid;
|
|
|
|
|
2019-03-14 12:19:25 +02:00
|
|
|
#[derive(Debug)]
|
2018-09-04 01:49:29 +03:00
|
|
|
pub enum ListingAction {
|
2018-09-07 09:44:37 +03:00
|
|
|
SetPlain,
|
|
|
|
SetThreaded,
|
|
|
|
SetCompact,
|
2018-08-05 16:26:42 +03:00
|
|
|
}
|
|
|
|
|
2019-03-14 12:19:25 +02:00
|
|
|
#[derive(Debug)]
|
2018-09-04 01:49:29 +03:00
|
|
|
pub enum TabAction {
|
2019-02-26 17:50:47 +02:00
|
|
|
TabOpen(Option<Box<Component>>),
|
2019-04-06 00:43:50 +03:00
|
|
|
NewDraft(usize),
|
2019-05-14 21:47:47 +03:00
|
|
|
Reply((usize, usize, usize), ThreadHash), // thread coordinates (account, mailbox, root_set idx) and thread hash
|
2018-09-04 01:49:29 +03:00
|
|
|
Close,
|
2019-05-26 02:34:03 +03:00
|
|
|
Edit(usize, EnvelopeHash), // account_position, envelope hash
|
2018-09-04 01:49:29 +03:00
|
|
|
Kill(Uuid),
|
|
|
|
}
|
|
|
|
|
2019-03-14 12:19:25 +02:00
|
|
|
#[derive(Debug)]
|
2018-08-05 16:26:42 +03:00
|
|
|
pub enum Action {
|
2018-09-04 01:49:29 +03:00
|
|
|
Listing(ListingAction),
|
2018-08-05 16:26:42 +03:00
|
|
|
ViewMailbox(usize),
|
2018-08-07 11:47:26 +03:00
|
|
|
Sort(SortField, SortOrder),
|
|
|
|
SubSort(SortField, SortOrder),
|
2018-09-04 01:49:29 +03:00
|
|
|
Tab(TabAction),
|
2019-05-15 20:58:59 +03:00
|
|
|
ToggleThreadSnooze,
|
2018-08-05 16:26:42 +03:00
|
|
|
}
|