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 * @author <a href="mailto:bombe@pterodactylus.net">David ‘Bombe’ Roden</a>
12 public interface SoneOptions {
14 boolean isAutoFollow();
15 void setAutoFollow(boolean autoFollow);
17 boolean isSoneInsertNotificationEnabled();
18 void setSoneInsertNotificationEnabled(boolean soneInsertNotificationEnabled);
20 boolean isShowNewSoneNotifications();
21 void setShowNewSoneNotifications(boolean showNewSoneNotifications);
23 boolean isShowNewPostNotifications();
24 void setShowNewPostNotifications(boolean showNewPostNotifications);
26 boolean isShowNewReplyNotifications();
27 void setShowNewReplyNotifications(boolean showNewReplyNotifications);
29 LoadExternalContent getShowCustomAvatars();
30 void setShowCustomAvatars(LoadExternalContent showCustomAvatars);
32 @Nonnull LoadExternalContent getLoadLinkedImages();
33 void setLoadLinkedImages(@Nonnull LoadExternalContent loadLinkedImages);
36 * Possible values for all options that are related to loading external content.
38 * @author <a href="mailto:bombe@pterodactylus.net">David ‘Bombe’ Roden</a>
40 enum LoadExternalContent {
42 /** Never show custom avatars. */
45 /** Only show custom avatars of followed Sones. */
48 /** Only show custom avatars of Sones you manually trust. */
51 /** Only show custom avatars of automatically trusted Sones. */
54 /** Always show custom avatars. */
60 * {@link SoneOptions} implementation.
62 * @author <a href="mailto:bombe@pterodactylus.net">David ‘Bombe’ Roden</a>
64 public class DefaultSoneOptions implements SoneOptions {
66 private boolean autoFollow = false;
67 private boolean soneInsertNotificationsEnabled = false;
68 private boolean showNewSoneNotifications = true;
69 private boolean showNewPostNotifications = true;
70 private boolean showNewReplyNotifications = true;
71 private LoadExternalContent showCustomAvatars = NEVER;
72 private LoadExternalContent loadLinkedImages = NEVER;
75 public boolean isAutoFollow() {
80 public void setAutoFollow(boolean autoFollow) {
81 this.autoFollow = autoFollow;
85 public boolean isSoneInsertNotificationEnabled() {
86 return soneInsertNotificationsEnabled;
90 public void setSoneInsertNotificationEnabled(boolean soneInsertNotificationEnabled) {
91 this.soneInsertNotificationsEnabled = soneInsertNotificationEnabled;
95 public boolean isShowNewSoneNotifications() {
96 return showNewSoneNotifications;
100 public void setShowNewSoneNotifications(boolean showNewSoneNotifications) {
101 this.showNewSoneNotifications = showNewSoneNotifications;
105 public boolean isShowNewPostNotifications() {
106 return showNewPostNotifications;
110 public void setShowNewPostNotifications(boolean showNewPostNotifications) {
111 this.showNewPostNotifications = showNewPostNotifications;
115 public boolean isShowNewReplyNotifications() {
116 return showNewReplyNotifications;
120 public void setShowNewReplyNotifications(boolean showNewReplyNotifications) {
121 this.showNewReplyNotifications = showNewReplyNotifications;
125 public LoadExternalContent getShowCustomAvatars() {
126 return showCustomAvatars;
130 public void setShowCustomAvatars(LoadExternalContent showCustomAvatars) {
131 this.showCustomAvatars = showCustomAvatars;
136 public LoadExternalContent getLoadLinkedImages() {
137 return loadLinkedImages;
141 public void setLoadLinkedImages(@Nonnull LoadExternalContent loadLinkedImages) {
142 this.loadLinkedImages = loadLinkedImages;