1 /*
2  * Copyright (C) 2022 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.accessibility
18 
19 import com.android.systemui.qs.tileimpl.QSTileImpl
20 import com.android.systemui.qs.tiles.ColorCorrectionTile
21 import com.android.systemui.qs.tiles.ColorInversionTile
22 import com.android.systemui.qs.tiles.DreamTile
23 import com.android.systemui.qs.tiles.FontScalingTile
24 import com.android.systemui.qs.tiles.NightDisplayTile
25 import com.android.systemui.qs.tiles.OneHandedModeTile
26 import com.android.systemui.qs.tiles.ReduceBrightColorsTile
27 import dagger.Binds
28 import dagger.Module
29 import dagger.multibindings.IntoMap
30 import dagger.multibindings.StringKey
31 
32 @Module
33 interface AccessibilityModule {
34 
35     /** Inject ColorInversionTile into tileMap in QSModule */
36     @Binds
37     @IntoMap
38     @StringKey(ColorInversionTile.TILE_SPEC)
39     fun bindColorInversionTile(colorInversionTile: ColorInversionTile): QSTileImpl<*>
40 
41     /** Inject NightDisplayTile into tileMap in QSModule */
42     @Binds
43     @IntoMap
44     @StringKey(NightDisplayTile.TILE_SPEC)
45     fun bindNightDisplayTile(nightDisplayTile: NightDisplayTile): QSTileImpl<*>
46 
47     /** Inject ReduceBrightColorsTile into tileMap in QSModule */
48     @Binds
49     @IntoMap
50     @StringKey(ReduceBrightColorsTile.TILE_SPEC)
51     fun bindReduceBrightColorsTile(reduceBrightColorsTile: ReduceBrightColorsTile): QSTileImpl<*>
52 
53     /** Inject OneHandedModeTile into tileMap in QSModule */
54     @Binds
55     @IntoMap
56     @StringKey(OneHandedModeTile.TILE_SPEC)
57     fun bindOneHandedModeTile(oneHandedModeTile: OneHandedModeTile): QSTileImpl<*>
58 
59     /** Inject ColorCorrectionTile into tileMap in QSModule */
60     @Binds
61     @IntoMap
62     @StringKey(ColorCorrectionTile.TILE_SPEC)
63     fun bindColorCorrectionTile(colorCorrectionTile: ColorCorrectionTile): QSTileImpl<*>
64 
65     /** Inject DreamTile into tileMap in QSModule */
66     @Binds
67     @IntoMap
68     @StringKey(DreamTile.TILE_SPEC)
69     fun bindDreamTile(dreamTile: DreamTile): QSTileImpl<*>
70 
71     /** Inject FontScalingTile into tileMap in QSModule */
72     @Binds
73     @IntoMap
74     @StringKey(FontScalingTile.TILE_SPEC)
75     fun bindFontScalingTile(fontScalingTile: FontScalingTile): QSTileImpl<*>
76 }
77