001/* 002 * Gridarta MMORPG map editor for Crossfire, Daimonin and similar games. 003 * Copyright (C) 2000-2010 The Gridarta Developers. 004 * 005 * This program is free software; you can redistribute it and/or modify 006 * it under the terms of the GNU General Public License as published by 007 * the Free Software Foundation; either version 2 of the License, or 008 * (at your option) any later version. 009 * 010 * This program is distributed in the hope that it will be useful, 011 * but WITHOUT ANY WARRANTY; without even the implied warranty of 012 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 013 * GNU General Public License for more details. 014 * 015 * You should have received a copy of the GNU General Public License along 016 * with this program; if not, write to the Free Software Foundation, Inc., 017 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 018 */ 019 020package net.sf.gridarta.model.settings; 021 022import java.io.File; 023import org.jetbrains.annotations.NotNull; 024 025/** 026 * Common settings values. 027 */ 028public interface GlobalSettings { 029 030 /** 031 * Default value for whether the main window's toolbar is shown. 032 */ 033 boolean SHOW_MAIN_TOOLBAR_DEFAULT = true; 034 035 /** 036 * Returns the default archetype directory. 037 * @return the default archetype directory 038 */ 039 @NotNull 040 File getArchDirectoryDefault(); 041 042 /** 043 * Returns the archetype directory. 044 * @return the archetype directory 045 */ 046 @NotNull 047 File getArchDirectory(); 048 049 /** 050 * Sets the archetype directory. 051 * @param archDirectory the archetype directory 052 */ 053 void setArchDirectory(@NotNull File archDirectory); 054 055 /** 056 * Returns the default maps directory. 057 * @return the default maps directory 058 */ 059 @NotNull 060 File getMapsDirectoryDefault(); 061 062 /** 063 * Returns the default maps directory. 064 * @return the default maps directory 065 */ 066 @NotNull 067 File getMapsDirectory(); 068 069 /** 070 * Sets the default maps directory. 071 * @param mapsDirectory the default maps directory 072 */ 073 void setMapsDirectory(@NotNull File mapsDirectory); 074 075 /** 076 * Sets the directory to save created image to. It defaults to {@link 077 * #getMapsDirectory()} and is not retained across editor restarts. 078 * @param imageDirectory the image directory 079 */ 080 void setImageDirectory(@NotNull File imageDirectory); 081 082 /** 083 * Returns the directory to save images to. 084 * @return the image directory 085 */ 086 @NotNull 087 File getImageDirectory(); 088 089 /** 090 * Returns the name of the configuration source. 091 * @return the name of the configuration source 092 */ 093 @NotNull 094 String getConfigSourceName(); 095 096 /** 097 * Sets the name of the configuration source. 098 * @param configSourceName the name 099 */ 100 void setConfigSourceName(@NotNull String configSourceName); 101 102 /** 103 * Returns the default directory for saving maps. 104 * @return the default directory for saving maps 105 */ 106 @NotNull 107 File getCurrentSaveMapDirectory(); 108 109 /** 110 * Sets the default directory for saving maps. 111 * @param currentSaveMapDirectory the default directory for saving maps 112 */ 113 void setCurrentSaveMapDirectory(@NotNull File currentSaveMapDirectory); 114 115 boolean isAutoPopupDocumentation(); 116 117 void setAutoPopupDocumentation(boolean autoPopupDocumentation); 118 119 /** 120 * Returns the pickmap directory. 121 * @return the pickmap directory 122 */ 123 @NotNull 124 File getPickmapDir(); 125 126 /** 127 * Returns whether a media directory is used. 128 * @return whether a media directory is used 129 */ 130 boolean hasMediaDirectory(); 131 132 /** 133 * Returns the default media directory. 134 * @return the default media directory 135 */ 136 @NotNull 137 File getMediaDirectoryDefault(); 138 139 /** 140 * Returns the media directory. It contains background music files. 141 * @return the media directory 142 */ 143 @NotNull 144 File getMediaDirectory(); 145 146 /** 147 * Sets the media directory. It contains background music files. 148 * @param mediaDirectory the media directory 149 */ 150 void setMediaDirectory(@NotNull File mediaDirectory); 151 152 /** 153 * Returns whether an image set is used. 154 * @return whether an image set is used 155 */ 156 boolean hasImageSet(); 157 158 /** 159 * Returns the default image set. 160 * @return the default image set 161 */ 162 @NotNull 163 String getImageSetDefault(); 164 165 /** 166 * Returns the image set. 167 * @return the image set 168 */ 169 @NotNull 170 String getImageSet(); 171 172 /** 173 * Sets the image set. 174 * @param imageSet the image set 175 */ 176 void setImageSet(@NotNull String imageSet); 177 178 /** 179 * Returns the configuration directory which is used to load configuration 180 * information like types.xml. 181 * @return the directory 182 */ 183 @NotNull 184 File getConfigurationDirectory(); 185 186 /** 187 * Returns the directory where collected archetypes are stored. 188 * @return the directory 189 */ 190 @NotNull 191 File getCollectedDirectory(); 192 193 /** 194 * Returns whether the main toolbar should be shown. 195 * @return whether the main toolbar should be shown 196 */ 197 boolean isShowMainToolbar(); 198 199 /** 200 * Sets whether the main toolbar should be shown. 201 * @param selected whether the main toolbar should be shown 202 */ 203 void setShowMainToolbar(boolean selected); 204 205 /** 206 * Returns the user name. 207 * @return the user name 208 */ 209 @NotNull 210 String getUserName(); 211 212 /** 213 * Returns the default user name. 214 * @return the default user name 215 */ 216 @NotNull 217 String getUserNameDefault(); 218 219 /** 220 * Sets the user name. 221 * @param userName the user name 222 */ 223 void setUserName(@NotNull String userName); 224 225 /** 226 * Adds a {@link GlobalSettingsListener} to be notified of changes. 227 * @param listener the listener 228 */ 229 void addGlobalSettingsListener(@NotNull GlobalSettingsListener listener); 230 231 /** 232 * Removes a {@link GlobalSettingsListener} to be notified of changes. 233 * @param listener the listener 234 */ 235 void removeGlobalSettingsListener(@NotNull GlobalSettingsListener listener); 236 237 /** 238 * Returns whether indices should be saved to disk. 239 * @return whether indices should be saved to disk 240 */ 241 boolean saveIndices(); 242 243}