mirror of
https://github.com/Novaloop-AG/element-x-android.git
synced 2026-11-04 01:19:33 +00:00
Add KDoc to the authentication, logout, preferences and share API interfaces
Cover the remaining interfaces of features/login, features/logout, features/preferences and features/share, along with their members and parameters. Points recorded here: AccountProviderAccessControl returns true on a build with no enterprise restriction, ExtraDeveloperOptionsRenderer is bound to a no-op in the standard build, DirectLogoutView draws nothing until a logout event is sent, and CacheService exists because clearing a cache destroys the client and the app has to react. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
+7
@@ -8,6 +8,13 @@
|
|||||||
|
|
||||||
package io.element.android.features.login.api
|
package io.element.android.features.login.api
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Extracts the login parameters from a link, so that a deployment can hand out a URL that pre-fills the sign-in screen.
|
||||||
|
*/
|
||||||
interface LoginIntentResolver {
|
interface LoginIntentResolver {
|
||||||
|
/**
|
||||||
|
* @param uriString the link the app was opened with.
|
||||||
|
* @return the account provider and login hint to pre-fill, or `null` when the link is not a login link.
|
||||||
|
*/
|
||||||
fun parse(uriString: String): LoginParams?
|
fun parse(uriString: String): LoginParams?
|
||||||
}
|
}
|
||||||
|
|||||||
+8
@@ -8,6 +8,14 @@
|
|||||||
|
|
||||||
package io.element.android.features.login.api.accesscontrol
|
package io.element.android.features.login.api.accesscontrol
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Enforces the restriction an enterprise deployment can put on which account providers the user may sign in to.
|
||||||
|
*/
|
||||||
interface AccountProviderAccessControl {
|
interface AccountProviderAccessControl {
|
||||||
|
/**
|
||||||
|
* Whether sign-in to this provider is permitted; `true` on a build with no such restriction.
|
||||||
|
*
|
||||||
|
* @param accountProviderUrl the server the user is trying to use.
|
||||||
|
*/
|
||||||
suspend fun isAllowedToConnectToAccountProvider(accountProviderUrl: String): Boolean
|
suspend fun isAllowedToConnectToAccountProvider(accountProviderUrl: String): Boolean
|
||||||
}
|
}
|
||||||
|
|||||||
+10
@@ -10,7 +10,17 @@ package io.element.android.features.logout.api.direct
|
|||||||
|
|
||||||
import androidx.compose.runtime.Composable
|
import androidx.compose.runtime.Composable
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Renders the confirmation dialogs of logging out directly, in particular the warning shown when the user would lose their room keys.
|
||||||
|
*
|
||||||
|
* It draws nothing until the host screen sends a logout event.
|
||||||
|
*/
|
||||||
fun interface DirectLogoutView {
|
fun interface DirectLogoutView {
|
||||||
|
/**
|
||||||
|
* Draws whichever dialog the current state calls for.
|
||||||
|
*
|
||||||
|
* @param state the state produced by the direct logout presenter.
|
||||||
|
*/
|
||||||
@Composable
|
@Composable
|
||||||
fun Render(state: DirectLogoutState)
|
fun Render(state: DirectLogoutState)
|
||||||
}
|
}
|
||||||
|
|||||||
+3
@@ -11,6 +11,9 @@ package io.element.android.features.preferences.api
|
|||||||
import io.element.android.libraries.matrix.api.core.SessionId
|
import io.element.android.libraries.matrix.api.core.SessionId
|
||||||
import kotlinx.coroutines.flow.Flow
|
import kotlinx.coroutines.flow.Flow
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Announces that a session's cache has been cleared, since clearing it destroys the client and the app has to react.
|
||||||
|
*/
|
||||||
interface CacheService {
|
interface CacheService {
|
||||||
/**
|
/**
|
||||||
* A flow of [SessionId], can let the app to know when the
|
* A flow of [SessionId], can let the app to know when the
|
||||||
|
|||||||
+5
@@ -14,6 +14,11 @@ import androidx.compose.ui.Modifier
|
|||||||
* Component for rendering extra developer options in the preferences screen.
|
* Component for rendering extra developer options in the preferences screen.
|
||||||
*/
|
*/
|
||||||
interface ExtraDeveloperOptionsRenderer {
|
interface ExtraDeveloperOptionsRenderer {
|
||||||
|
/**
|
||||||
|
* Draws the extra options. The standard build binds a no-op implementation, so only the builds that actually add options provide a real one.
|
||||||
|
*
|
||||||
|
* @param modifier layout modifier for the container.
|
||||||
|
*/
|
||||||
@Composable
|
@Composable
|
||||||
fun Render(modifier: Modifier)
|
fun Render(modifier: Modifier)
|
||||||
}
|
}
|
||||||
|
|||||||
+3
@@ -11,5 +11,8 @@ package io.element.android.features.share.api
|
|||||||
* Post-processing to be done once a [ShareIntentData] has been consumed.
|
* Post-processing to be done once a [ShareIntentData] has been consumed.
|
||||||
*/
|
*/
|
||||||
fun interface OnSharedData {
|
fun interface OnSharedData {
|
||||||
|
/**
|
||||||
|
* @param data the shared content that has just been handled, so any temporary copy of it can be released.
|
||||||
|
*/
|
||||||
operator fun invoke(data: ShareIntentData)
|
operator fun invoke(data: ShareIntentData)
|
||||||
}
|
}
|
||||||
|
|||||||
+4
@@ -9,10 +9,14 @@ package io.element.android.features.share.api
|
|||||||
|
|
||||||
import android.content.Intent
|
import android.content.Intent
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Recognises the intents another app uses to share content into this one, and resolves what was shared.
|
||||||
|
*/
|
||||||
interface ShareIntentHandler {
|
interface ShareIntentHandler {
|
||||||
/**
|
/**
|
||||||
* This methods aims to handle incoming share intents and parse its data.
|
* This methods aims to handle incoming share intents and parse its data.
|
||||||
*
|
*
|
||||||
|
* @param intent the intent the app was started with.
|
||||||
* @return the [ShareIntentData] if it could be resolved, or null.
|
* @return the [ShareIntentData] if it could be resolved, or null.
|
||||||
*/
|
*/
|
||||||
fun handleIncomingShareIntent(
|
fun handleIncomingShareIntent(
|
||||||
|
|||||||
Reference in New Issue
Block a user