Update year in copyright lines
[Sone.git] / src / main / java / net / pterodactylus / sone / data / SoneOptions.java
index 819e94a..d7089d9 100644 (file)
@@ -1,13 +1,11 @@
 package net.pterodactylus.sone.data;
 
-import static net.pterodactylus.sone.data.Sone.ShowCustomAvatars.NEVER;
+import static net.pterodactylus.sone.data.SoneOptions.LoadExternalContent.NEVER;
 
-import net.pterodactylus.sone.data.Sone.ShowCustomAvatars;
+import javax.annotation.Nonnull;
 
 /**
  * All Sone-specific options.
- *
- * @author <a href="mailto:bombe@pterodactylus.net">David ‘Bombe’ Roden</a>
  */
 public interface SoneOptions {
 
@@ -26,13 +24,36 @@ public interface SoneOptions {
        boolean isShowNewReplyNotifications();
        void setShowNewReplyNotifications(boolean showNewReplyNotifications);
 
-       ShowCustomAvatars getShowCustomAvatars();
-       void setShowCustomAvatars(ShowCustomAvatars showCustomAvatars);
+       LoadExternalContent getShowCustomAvatars();
+       void setShowCustomAvatars(LoadExternalContent showCustomAvatars);
+
+       @Nonnull LoadExternalContent getLoadLinkedImages();
+       void setLoadLinkedImages(@Nonnull LoadExternalContent loadLinkedImages);
+
+       /**
+        * Possible values for all options that are related to loading external content.
+        */
+       enum LoadExternalContent {
+
+               /** Never show custom avatars. */
+               NEVER,
+
+               /** Only show custom avatars of followed Sones. */
+               FOLLOWED,
+
+               /** Only show custom avatars of Sones you manually trust. */
+               MANUALLY_TRUSTED,
+
+               /** Only show custom avatars of automatically trusted Sones. */
+               TRUSTED,
+
+               /** Always show custom avatars. */
+               ALWAYS,
+
+       }
 
        /**
         * {@link SoneOptions} implementation.
-        *
-        * @author <a href="mailto:bombe@pterodactylus.net">David ‘Bombe’ Roden</a>
         */
        public class DefaultSoneOptions implements SoneOptions {
 
@@ -41,7 +62,8 @@ public interface SoneOptions {
                private boolean showNewSoneNotifications = true;
                private boolean showNewPostNotifications = true;
                private boolean showNewReplyNotifications = true;
-               private ShowCustomAvatars showCustomAvatars = NEVER;
+               private LoadExternalContent showCustomAvatars = NEVER;
+               private LoadExternalContent loadLinkedImages = NEVER;
 
                @Override
                public boolean isAutoFollow() {
@@ -94,15 +116,26 @@ public interface SoneOptions {
                }
 
                @Override
-               public ShowCustomAvatars getShowCustomAvatars() {
+               public LoadExternalContent getShowCustomAvatars() {
                        return showCustomAvatars;
                }
 
                @Override
-               public void setShowCustomAvatars(ShowCustomAvatars showCustomAvatars) {
+               public void setShowCustomAvatars(LoadExternalContent showCustomAvatars) {
                        this.showCustomAvatars = showCustomAvatars;
                }
 
+               @Nonnull
+               @Override
+               public LoadExternalContent getLoadLinkedImages() {
+                       return loadLinkedImages;
+               }
+
+               @Override
+               public void setLoadLinkedImages(@Nonnull LoadExternalContent loadLinkedImages) {
+                       this.loadLinkedImages = loadLinkedImages;
+               }
+
        }
 
 }