1 package net.pterodactylus.sone.data;
3 import static net.pterodactylus.sone.data.SoneOptions.LoadExternalContent.NEVER;
5 import javax.annotation.Nonnull;
8 * All Sone-specific options.
10 public interface SoneOptions {
12 boolean isAutoFollow();
13 void setAutoFollow(boolean autoFollow);
15 boolean isSoneInsertNotificationEnabled();
16 void setSoneInsertNotificationEnabled(boolean soneInsertNotificationEnabled);
18 boolean isShowNewSoneNotifications();
19 void setShowNewSoneNotifications(boolean showNewSoneNotifications);
21 boolean isShowNewPostNotifications();
22 void setShowNewPostNotifications(boolean showNewPostNotifications);
24 boolean isShowNewReplyNotifications();
25 void setShowNewReplyNotifications(boolean showNewReplyNotifications);
27 LoadExternalContent getShowCustomAvatars();
28 void setShowCustomAvatars(LoadExternalContent showCustomAvatars);
30 @Nonnull LoadExternalContent getLoadLinkedImages();
31 void setLoadLinkedImages(@Nonnull LoadExternalContent loadLinkedImages);
34 * Possible values for all options that are related to loading external content.
36 enum LoadExternalContent {
38 /** Never show custom avatars. */
41 /** Only show custom avatars of followed Sones. */
44 /** Only show custom avatars of Sones you manually trust. */
47 /** Only show custom avatars of automatically trusted Sones. */
50 /** Always show custom avatars. */
56 * {@link SoneOptions} implementation.
58 public class DefaultSoneOptions implements SoneOptions {
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;
69 public boolean isAutoFollow() {
74 public void setAutoFollow(boolean autoFollow) {
75 this.autoFollow = autoFollow;
79 public boolean isSoneInsertNotificationEnabled() {
80 return soneInsertNotificationsEnabled;
84 public void setSoneInsertNotificationEnabled(boolean soneInsertNotificationEnabled) {
85 this.soneInsertNotificationsEnabled = soneInsertNotificationEnabled;
89 public boolean isShowNewSoneNotifications() {
90 return showNewSoneNotifications;
94 public void setShowNewSoneNotifications(boolean showNewSoneNotifications) {
95 this.showNewSoneNotifications = showNewSoneNotifications;
99 public boolean isShowNewPostNotifications() {
100 return showNewPostNotifications;
104 public void setShowNewPostNotifications(boolean showNewPostNotifications) {
105 this.showNewPostNotifications = showNewPostNotifications;
109 public boolean isShowNewReplyNotifications() {
110 return showNewReplyNotifications;
114 public void setShowNewReplyNotifications(boolean showNewReplyNotifications) {
115 this.showNewReplyNotifications = showNewReplyNotifications;
119 public LoadExternalContent getShowCustomAvatars() {
120 return showCustomAvatars;
124 public void setShowCustomAvatars(LoadExternalContent showCustomAvatars) {
125 this.showCustomAvatars = showCustomAvatars;
130 public LoadExternalContent getLoadLinkedImages() {
131 return loadLinkedImages;
135 public void setLoadLinkedImages(@Nonnull LoadExternalContent loadLinkedImages) {
136 this.loadLinkedImages = loadLinkedImages;