xref: /aosp_15_r20/frameworks/base/packages/SystemUI/plugin/src/com/android/systemui/plugins/clocks/ClockEvents.kt (revision d57664e9bc4670b3ecf6748a746a57c557b6bc9e)
1 /*
2  * Copyright (C) 2024 The Android Open Source Project
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file
5  * except in compliance with the License. You may obtain a copy of the License at
6  *
7  *      http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software distributed under the
10  * License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
11  * KIND, either express or implied. See the License for the specific language governing
12  * permissions and limitations under the License.
13  */
14 package com.android.systemui.plugins.clocks
15 
16 import com.android.systemui.plugins.annotations.ProtectedInterface
17 import com.android.systemui.plugins.annotations.ProtectedReturn
18 import java.util.Locale
19 import java.util.TimeZone
20 
21 /** Events that should call when various rendering parameters change */
22 @ProtectedInterface
23 interface ClockEvents {
24     @get:ProtectedReturn("return false;")
25     /** Set to enable or disable swipe interaction */
26     var isReactiveTouchInteractionEnabled: Boolean // TODO(b/364664388): Remove/Rename
27 
28     /** Call whenever timezone changes */
onTimeZoneChangednull29     fun onTimeZoneChanged(timeZone: TimeZone)
30 
31     /** Call whenever the text time format changes (12hr vs 24hr) */
32     fun onTimeFormatChanged(is24Hr: Boolean)
33 
34     /** Call whenever the locale changes */
35     fun onLocaleChanged(locale: Locale)
36 
37     /** Call whenever the weather data should update */
38     fun onWeatherDataChanged(data: WeatherData)
39 
40     /** Call with alarm information */
41     fun onAlarmDataChanged(data: AlarmData)
42 
43     /** Call with zen/dnd information */
44     fun onZenDataChanged(data: ZenData)
45 
46     /** Update reactive axes for this clock */
47     fun onFontAxesChanged(axes: List<ClockFontAxisSetting>)
48 }
49