1 /*
2  * Copyright (C) 2023 The Android Open Source Project
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 package com.android.systemui.communal.data.db
18 
19 import androidx.room.ColumnInfo
20 import androidx.room.Entity
21 import androidx.room.PrimaryKey
22 
23 @Entity(tableName = "communal_widget_table")
24 data class CommunalWidgetItem(
25     @PrimaryKey(autoGenerate = true) val uid: Long,
26     /** Id of an app widget */
27     @ColumnInfo(name = "widget_id") val widgetId: Int,
28     /** Component name of the app widget provider */
29     @ColumnInfo(name = "component_name") val componentName: String,
30     /** Reference the id of an item persisted in the glanceable hub */
31     @ColumnInfo(name = "item_id") val itemId: Long,
32 )
33 
34 @Entity(tableName = "communal_item_rank_table")
35 data class CommunalItemRank(
36     /** Unique id of an item persisted in the glanceable hub */
37     @PrimaryKey(autoGenerate = true) val uid: Long,
38     /** Order in which the item will be displayed */
39     @ColumnInfo(name = "rank", defaultValue = "0") val rank: Int,
40 )
41