ffi: Remove room list from UDL

This commit is contained in:
Jonas Platte
2023-06-15 11:14:46 +02:00
committed by Jonas Platte
parent 53ae4362f6
commit daf59356cb
3 changed files with 8 additions and 45 deletions

View File

@@ -147,43 +147,3 @@ callback interface SessionVerificationControllerDelegate {
void did_cancel();
void did_finish();
};
enum RoomListState {
"Init",
"FirstRooms",
"AllRooms",
"CarryOn",
"Terminated",
};
callback interface RoomListStateListener {
void on_update(RoomListState state);
};
[Enum]
interface RoomListEntriesUpdate {
Append(sequence<RoomListEntry> values);
Clear();
PushFront(RoomListEntry value);
PushBack(RoomListEntry value);
PopFront();
PopBack();
Insert(u32 index, RoomListEntry value);
Set(u32 index, RoomListEntry value);
Remove(u32 index);
Reset(sequence<RoomListEntry> values);
};
callback interface RoomListEntriesListener {
void on_update(RoomListEntriesUpdate room_entries_update);
};
[Enum]
interface RoomListInput {
Viewport(sequence<RoomListRange> ranges);
};
dictionary RoomListRange {
u32 start;
u32 end_inclusive;
};

View File

@@ -41,8 +41,8 @@ use async_compat::TOKIO1 as RUNTIME;
use matrix_sdk::ruma::events::room::{message::RoomMessageEventContent, MediaSource};
use self::{
client::*, error::ClientError, event::*, notification::*, platform::*, room_list::*,
session_verification::*, sliding_sync::*, task_handle::TaskHandle, timeline::MediaSourceExt,
client::*, error::ClientError, event::*, notification::*, platform::*, session_verification::*,
sliding_sync::*, task_handle::TaskHandle, timeline::MediaSourceExt,
};
uniffi::include_scaffolding!("api");

View File

@@ -54,11 +54,13 @@ impl From<ruma::IdParseError> for RoomListError {
}
}
#[derive(uniffi::Record)]
pub struct RoomListRange {
pub start: u32,
pub end_inclusive: u32,
}
#[derive(uniffi::Enum)]
pub enum RoomListInput {
Viewport { ranges: Vec<RoomListRange> },
}
@@ -142,7 +144,7 @@ pub struct RoomListEntriesResult {
pub entries_stream: Arc<TaskHandle>,
}
// Also declared in the UDL file.
#[derive(uniffi::Enum)]
pub enum RoomListState {
Init,
FirstRooms,
@@ -165,11 +167,12 @@ impl From<matrix_sdk_ui::room_list::State> for RoomListState {
}
}
// Also declared in the UDL file.
#[uniffi::export(callback_interface)]
pub trait RoomListStateListener: Send + Sync + Debug {
fn on_update(&self, state: RoomListState);
}
#[derive(uniffi::Enum)]
pub enum RoomListEntriesUpdate {
Append { values: Vec<RoomListEntry> },
Clear,
@@ -208,7 +211,7 @@ impl From<VectorDiff<matrix_sdk::RoomListEntry>> for RoomListEntriesUpdate {
}
}
// Also declared in the UDL file.
#[uniffi::export(callback_interface)]
pub trait RoomListEntriesListener: Send + Sync + Debug {
fn on_update(&self, room_entries_update: RoomListEntriesUpdate);
}