🎨 Replace NEWEST_FIRST comparator with Kotlin version
[Sone.git] / src / main / java / net / pterodactylus / sone / data / SoneOptions.java
1 package net.pterodactylus.sone.data;
2
3 import static net.pterodactylus.sone.data.SoneOptions.LoadExternalContent.NEVER;
4
5 import javax.annotation.Nonnull;
6
7 /**
8  * All Sone-specific options.
9  */
10 public interface SoneOptions {
11
12         boolean isAutoFollow();
13         void setAutoFollow(boolean autoFollow);
14
15         boolean isSoneInsertNotificationEnabled();
16         void setSoneInsertNotificationEnabled(boolean soneInsertNotificationEnabled);
17
18         boolean isShowNewSoneNotifications();
19         void setShowNewSoneNotifications(boolean showNewSoneNotifications);
20
21         boolean isShowNewPostNotifications();
22         void setShowNewPostNotifications(boolean showNewPostNotifications);
23
24         boolean isShowNewReplyNotifications();
25         void setShowNewReplyNotifications(boolean showNewReplyNotifications);
26
27         LoadExternalContent getShowCustomAvatars();
28         void setShowCustomAvatars(LoadExternalContent showCustomAvatars);
29
30         @Nonnull LoadExternalContent getLoadLinkedImages();
31         void setLoadLinkedImages(@Nonnull LoadExternalContent loadLinkedImages);
32
33         /**
34          * Possible values for all options that are related to loading external content.
35          */
36         enum LoadExternalContent {
37
38                 /** Never show custom avatars. */
39                 NEVER,
40
41                 /** Only show custom avatars of followed Sones. */
42                 FOLLOWED,
43
44                 /** Only show custom avatars of Sones you manually trust. */
45                 MANUALLY_TRUSTED,
46
47                 /** Only show custom avatars of automatically trusted Sones. */
48                 TRUSTED,
49
50                 /** Always show custom avatars. */
51                 ALWAYS,
52
53         }
54
55         /**
56          * {@link SoneOptions} implementation.
57          */
58         public class DefaultSoneOptions implements SoneOptions {
59
60                 private boolean autoFollow = false;
61                 private boolean soneInsertNotificationsEnabled = false;
62                 private boolean showNewSoneNotifications = true;
63                 private boolean showNewPostNotifications = true;
64                 private boolean showNewReplyNotifications = true;
65                 private LoadExternalContent showCustomAvatars = NEVER;
66                 private LoadExternalContent loadLinkedImages = NEVER;
67
68                 @Override
69                 public boolean isAutoFollow() {
70                         return autoFollow;
71                 }
72
73                 @Override
74                 public void setAutoFollow(boolean autoFollow) {
75                         this.autoFollow = autoFollow;
76                 }
77
78                 @Override
79                 public boolean isSoneInsertNotificationEnabled() {
80                         return soneInsertNotificationsEnabled;
81                 }
82
83                 @Override
84                 public void setSoneInsertNotificationEnabled(boolean soneInsertNotificationEnabled) {
85                         this.soneInsertNotificationsEnabled = soneInsertNotificationEnabled;
86                 }
87
88                 @Override
89                 public boolean isShowNewSoneNotifications() {
90                         return showNewSoneNotifications;
91                 }
92
93                 @Override
94                 public void setShowNewSoneNotifications(boolean showNewSoneNotifications) {
95                         this.showNewSoneNotifications = showNewSoneNotifications;
96                 }
97
98                 @Override
99                 public boolean isShowNewPostNotifications() {
100                         return showNewPostNotifications;
101                 }
102
103                 @Override
104                 public void setShowNewPostNotifications(boolean showNewPostNotifications) {
105                         this.showNewPostNotifications = showNewPostNotifications;
106                 }
107
108                 @Override
109                 public boolean isShowNewReplyNotifications() {
110                         return showNewReplyNotifications;
111                 }
112
113                 @Override
114                 public void setShowNewReplyNotifications(boolean showNewReplyNotifications) {
115                         this.showNewReplyNotifications = showNewReplyNotifications;
116                 }
117
118                 @Override
119                 public LoadExternalContent getShowCustomAvatars() {
120                         return showCustomAvatars;
121                 }
122
123                 @Override
124                 public void setShowCustomAvatars(LoadExternalContent showCustomAvatars) {
125                         this.showCustomAvatars = showCustomAvatars;
126                 }
127
128                 @Nonnull
129                 @Override
130                 public LoadExternalContent getLoadLinkedImages() {
131                         return loadLinkedImages;
132                 }
133
134                 @Override
135                 public void setLoadLinkedImages(@Nonnull LoadExternalContent loadLinkedImages) {
136                         this.loadLinkedImages = loadLinkedImages;
137                 }
138
139         }
140
141 }