Skip to content

Commit 2db182e

Browse files
committed
[WIP] Ideas AssociatedRows + collection
1 parent 9f552f1 commit 2db182e

File tree

2 files changed

+48
-0
lines changed

2 files changed

+48
-0
lines changed
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
/*
2+
* This file is part of bitfireAT/synctools which is released under GPLv3.
3+
* Copyright © All Contributors. See the LICENSE and AUTHOR files in the root directory for details.
4+
* SPDX-License-Identifier: GPL-3.0-or-later
5+
*/
6+
7+
package at.bitfire.synctools.storage.calendar
8+
9+
/**
10+
* Provides associated-event functionality for an [AndroidCalendar].
11+
*/
12+
class AndroidEventStore(
13+
private val calendar: AndroidCalendar
14+
) {
15+
16+
// AssociatedRows CRUD
17+
18+
fun add(events: AssociatedRows) {
19+
// insert main event → id
20+
// insert exceptions with backref original_id
21+
TODO()
22+
}
23+
24+
fun findDirty(): List<AssociatedRows> {
25+
TODO()
26+
}
27+
28+
}
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
/*
2+
* This file is part of bitfireAT/synctools which is released under GPLv3.
3+
* Copyright © All Contributors. See the LICENSE and AUTHOR files in the root directory for details.
4+
* SPDX-License-Identifier: GPL-3.0-or-later
5+
*/
6+
7+
package at.bitfire.synctools.storage.calendar
8+
9+
import android.content.Entity
10+
11+
/**
12+
* Base class for data classes that contains
13+
*
14+
* - a potentially recurring calendar object (event/task) and
15+
* - possible exceptions to it.
16+
*/
17+
data class AssociatedRows(
18+
val main: Entity,
19+
val exceptions: List<Entity>
20+
)

0 commit comments

Comments
 (0)