EditTrackRepository

Interface for editing tracks and waypoints.

Defines the contract that the data layer must implement. Keeps the domain layer independent from specific data sources (Room, network, etc.).

Inheritors

Properties

Link copied to clipboard
abstract val addedTracks: Flow<Pair<Int, Boolean>>

Functions

Link copied to clipboard
abstract suspend fun addImportedTrack(trackId: Int, center: Boolean): Boolean

Add an imported track to the database.

Link copied to clipboard
abstract suspend fun addWaypoint(waypoint: Waypoint, updateUI: Boolean = false)

Add a single waypoint to a track.

Link copied to clipboard
abstract suspend fun addWaypoints(waypoints: List<Waypoint>)

Add a list of waypoints to the database. Converts the domain model Waypoint to a database entity and inserts it.

Link copied to clipboard
abstract suspend fun changeTrackId(fromTrackId: Int, toTrackId: Int)
Link copied to clipboard
abstract suspend fun clearAll()

Delete all tracks and waypoints from the database.

Link copied to clipboard
abstract suspend fun deleteSegment(trackId: Int, startId: Double, endId: Double)
Link copied to clipboard
abstract suspend fun deleteWaypoint(trackId: Int, id: Double)
Link copied to clipboard
abstract suspend fun getFullTrack(trackId: Int): Track?
Link copied to clipboard
abstract suspend fun getIntervalSize(trackId: Int): Int
abstract suspend fun getIntervalSize(trackId: Int, p1: Double, p2: Double): Int
Link copied to clipboard
abstract suspend fun getTrackFirstWaypointId(trackId: Int): Double?
Link copied to clipboard
abstract suspend fun getTrackIds(): List<Int>
Link copied to clipboard
abstract suspend fun getTrackIdsWithVisibleWaypoints(latNorth: Double, latSouth: Double, lonWest: Double, lonEast: Double): List<Int>
Link copied to clipboard
abstract suspend fun getTrackLastWaypointId(trackId: Int): Double?
Link copied to clipboard
abstract suspend fun getTracksWithVisibleWaypoints(latNorth: Double, latSouth: Double, lonWest: Double, lonEast: Double): List<Pair<Int, List<Waypoint>>>
Link copied to clipboard
abstract suspend fun getTracksWithVisibleWaypointsCount(latNorth: Double, latSouth: Double, lonWest: Double, lonEast: Double): Double
Link copied to clipboard
abstract suspend fun getTrackWaypoints(trackId: Int): List<Waypoint>

Get all waypoints for a specific track.

Link copied to clipboard
abstract suspend fun getTrackWaypointsChunk(trackId: Int, chunkSize: Int, offset: Int): List<Waypoint>
Link copied to clipboard
abstract suspend fun getTrackWaypointsSample(trackId: Int, sampleRate: Int): List<Waypoint>
Link copied to clipboard
abstract suspend fun getVisibleTrackWaypoints(trackId: Int, latNorth: Double, latSouth: Double, lonWest: Double, lonEast: Double): List<Waypoint>
Link copied to clipboard
abstract suspend fun getVisibleTrackWaypointsChunk(trackId: Int, latNorth: Double, latSouth: Double, lonWest: Double, lonEast: Double, chunkSize: Int, offset: Int): List<Waypoint>
Link copied to clipboard
abstract suspend fun getVisibleTrackWaypointsCount(trackId: Int, latNorth: Double, latSouth: Double, lonWest: Double, lonEast: Double): Double
Link copied to clipboard
abstract suspend fun getWaypoint(trackId: Int, index: Int): Waypoint?
Link copied to clipboard
abstract suspend fun getWaypointIndex(trackId: Int, id: Double): Int?
Link copied to clipboard
abstract suspend fun getWaypoints(): List<Waypoint>

Get all waypoints across all tracks.

Link copied to clipboard
abstract suspend fun insertTrack(track: TrackEntity): Long

Insert a new track into the database.

Link copied to clipboard
abstract suspend fun removeTrack(trackId: Int)
Link copied to clipboard
abstract suspend fun removeWaypointsByStep(trackId: Int, step: Int)
abstract suspend fun removeWaypointsByStep(trackId: Int, step: Int, p1: Double, p2: Double)
Link copied to clipboard
abstract suspend fun renumberTrack(trackId: Int, newStart: Double, descending: Boolean, indexDescending: Boolean)
Link copied to clipboard
abstract suspend fun reverseTrack(trackId: Int)
abstract suspend fun reverseTrack(trackId: Int, p1: Double, p2: Double)