|
|
|
@ -19,13 +19,13 @@
|
|
|
|
|
|
|
|
|
|
use std::collections::HashMap;
|
|
|
|
|
|
|
|
|
|
#[derive(Debug, Clone, PartialEq)]
|
|
|
|
|
#[derive(Debug, Clone, PartialEq, Eq)]
|
|
|
|
|
pub struct MatchesDetectedEvent {
|
|
|
|
|
pub matches: Vec<DetectedMatch>,
|
|
|
|
|
pub is_search: bool,
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#[derive(Debug, Clone, PartialEq, Default)]
|
|
|
|
|
#[derive(Debug, Clone, PartialEq, Default, Eq)]
|
|
|
|
|
pub struct DetectedMatch {
|
|
|
|
|
pub id: i32,
|
|
|
|
|
pub trigger: Option<String>,
|
|
|
|
@ -34,17 +34,17 @@ pub struct DetectedMatch {
|
|
|
|
|
pub args: HashMap<String, String>,
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#[derive(Debug, Clone, PartialEq)]
|
|
|
|
|
#[derive(Debug, Clone, PartialEq, Eq)]
|
|
|
|
|
pub struct MatchSelectedEvent {
|
|
|
|
|
pub chosen: DetectedMatch,
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#[derive(Debug, Clone, PartialEq)]
|
|
|
|
|
#[derive(Debug, Clone, PartialEq, Eq)]
|
|
|
|
|
pub struct CauseCompensatedMatchEvent {
|
|
|
|
|
pub m: DetectedMatch,
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#[derive(Debug, Clone, PartialEq)]
|
|
|
|
|
#[derive(Debug, Clone, PartialEq, Eq)]
|
|
|
|
|
pub struct RenderingRequestedEvent {
|
|
|
|
|
pub match_id: i32,
|
|
|
|
|
pub trigger: Option<String>,
|
|
|
|
@ -54,38 +54,38 @@ pub struct RenderingRequestedEvent {
|
|
|
|
|
pub format: TextFormat,
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#[derive(Debug, Clone, PartialEq)]
|
|
|
|
|
#[derive(Debug, Clone, PartialEq, Eq)]
|
|
|
|
|
pub enum TextFormat {
|
|
|
|
|
Plain,
|
|
|
|
|
Markdown,
|
|
|
|
|
Html,
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#[derive(Debug, Clone, PartialEq)]
|
|
|
|
|
#[derive(Debug, Clone, PartialEq, Eq)]
|
|
|
|
|
pub struct ImageRequestedEvent {
|
|
|
|
|
pub match_id: i32,
|
|
|
|
|
pub image_path: String,
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#[derive(Debug, Clone, PartialEq)]
|
|
|
|
|
#[derive(Debug, Clone, PartialEq, Eq)]
|
|
|
|
|
pub struct ImageResolvedEvent {
|
|
|
|
|
pub image_path: String,
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#[derive(Debug, Clone, PartialEq)]
|
|
|
|
|
#[derive(Debug, Clone, PartialEq, Eq)]
|
|
|
|
|
pub struct RenderedEvent {
|
|
|
|
|
pub match_id: i32,
|
|
|
|
|
pub body: String,
|
|
|
|
|
pub format: TextFormat,
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#[derive(Debug, Clone, PartialEq)]
|
|
|
|
|
#[derive(Debug, Clone, PartialEq, Eq)]
|
|
|
|
|
pub struct DiscardPreviousEvent {
|
|
|
|
|
// All Events with a source_id smaller than this one will be discarded
|
|
|
|
|
pub minimum_source_id: u32,
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#[derive(Debug, Clone, PartialEq)]
|
|
|
|
|
#[derive(Debug, Clone, PartialEq, Eq)]
|
|
|
|
|
pub struct DiscardBetweenEvent {
|
|
|
|
|
// All Events with a source_id between start_id (included) and end_id (excluded)
|
|
|
|
|
// will be discarded
|
|
|
|
@ -93,13 +93,13 @@ pub struct DiscardBetweenEvent {
|
|
|
|
|
pub end_id: u32,
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#[derive(Debug, Clone, PartialEq)]
|
|
|
|
|
#[derive(Debug, Clone, PartialEq, Eq)]
|
|
|
|
|
pub struct SecureInputEnabledEvent {
|
|
|
|
|
pub app_name: String,
|
|
|
|
|
pub app_path: String,
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#[derive(Debug, Clone, PartialEq)]
|
|
|
|
|
#[derive(Debug, Clone, PartialEq, Eq)]
|
|
|
|
|
pub struct UndoEvent {
|
|
|
|
|
pub match_id: i32,
|
|
|
|
|
pub trigger: String,
|
|
|
|
|