1 /*
2  * Copyright (C) 2024 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.wallpaper.picker.data
18 
19 /**
20  * Represents the model class that would be used for instantiating any type of wallpaper in the
21  * picker. Any wallpaper should be of type LiveWallpaper or StaticWallpaperModel and depending on
22  * the specific type of wallpaper, the individual fields could be null or not null.
23  */
24 sealed class WallpaperModel {
25 
26     /**
27      * All [WallpaperModel] data classes contain commonWallpaperData property which contains common
28      * data amongst all [WallpaperModel] classes.
29      */
30     abstract val commonWallpaperData: CommonWallpaperData
31 
32     data class LiveWallpaperModel(
33         override val commonWallpaperData: CommonWallpaperData,
34         val liveWallpaperData: LiveWallpaperData,
35         val creativeWallpaperData: CreativeWallpaperData?,
36         val internalLiveWallpaperData: InternalLiveWallpaperData?
37     ) : WallpaperModel()
38 
39     data class StaticWallpaperModel(
40         override val commonWallpaperData: CommonWallpaperData,
41         val staticWallpaperData: StaticWallpaperData,
42         val imageWallpaperData: ImageWallpaperData?,
43         val networkWallpaperData: NetworkWallpaperData?,
44         val downloadableWallpaperData: DownloadableWallpaperData?,
45     ) : WallpaperModel()
46 }
47