001: /***
002: * jwma Java WebMail
003: * Copyright (c) 2000-2003 jwma team
004: *
005: * jwma is free software; you can distribute and use this source
006: * under the terms of the BSD-style license received along with
007: * the distribution.
008: ***/package dtw.webmail.model;
009:
010: import net.wimpi.text.Processor;
011:
012: import java.text.DateFormat;
013: import java.util.Locale;
014:
015: /**
016: * An interface defining the contract for interaction with
017: * the JwmaPreferences model.
018: * <p>
019: * JwmaPreferences allows a view programmer to obtain
020: * information about the users preferences to display
021: * them for reading or editing.
022: *
023: * @author Dieter Wimberger
024: * @version 0.9.7 07/02/2003
025: */
026: public interface JwmaPreferences {
027:
028: /**
029: * Returns a <tt>String</tt> representing
030: * identity of the owner of this <tt>JwmaPreferences</tt>.
031: * <p>
032: * <em>Note</em>:<br>
033: * The format of the string has to be
034: * <tt><username>@<postofficehost></tt>.
035: * <br>
036: *
037: * @return the firstname of this preferences owner.
038: */
039: public String getUserIdentity();
040:
041: /**
042: * Returns a <tt>String</tt> representing the
043: * firstname of the owner of this <tt>JwmaPreferences</tt>.
044: *
045: * @return the firstname of this preferences owner.
046: */
047: public String getFirstname();
048:
049: /**
050: * Returns a <tt>String</tt> representing the
051: * lastname of the owner of this <tt>JwmaPreferences</tt>.
052: *
053: * @return the lastname of this preferences owner.
054: */
055: public String getLastname();
056:
057: /**
058: * Returns a <tt>String</tt> representing the
059: * user's last login date and originating host.
060: *
061: * @return the last login with date and originating
062: * host as <tt>String</tt>.
063: */
064: public String getLastLogin();
065:
066: /**
067: * Returns a <tt>String</tt> representing the
068: * quote character.
069: *
070: * <i><b>Note</b>: it always contains only one character.</i>
071: *
072: * @return the quote character as String.
073: */
074: public String getQuoteChar();
075:
076: /**
077: * Tests if messages should be quoted automatically
078: * when replying.
079: *
080: * @return true if messages should be quoted
081: * automatically, false otherwise.
082: */
083: public boolean isAutoQuote();
084:
085: /**
086: * Returns a <tt>String</tt> representing the
087: * path of the mail root folder.
088: * <p>
089: * <i><b>Note</b>:
090: * This setting varies for different IMAP implementations.
091: * </i>
092: *
093: * @return the mail root folder as String.
094: */
095: public String getRootFolder();
096:
097: /**
098: * Returns a <tt>String</tt> representing the
099: * full name of the draft folder.
100: *
101: * @return the full name of the draft folder as String.
102: */
103: public String getDraftFolder();
104:
105: /**
106: * Tests if messages should be automatically
107: * archived when sent.
108: *
109: * @return true if messages should be archived
110: * automatically, false otherwise.
111: */
112: public boolean isAutoArchiveSent();
113:
114: /**
115: * Returns a <tt>String</tt> representing the
116: * path of the sent-mail-archive.
117: *
118: * @return the path of the sent-mail-archive as <tt>String</tt>.
119: */
120: public String getSentMailArchive();
121:
122: /**
123: * Tests if messages should be automatically
124: * moved when read.
125: *
126: * @return true if messages should be moved
127: * automatically, false otherwise.
128: */
129: public boolean isAutoMoveRead();
130:
131: /**
132: * Returns a <tt>String</tt> representing the
133: * path of the read-mail-archive.
134: *
135: * @return the path of the read-mail-archive as String.
136: */
137: public String getReadMailArchive();
138:
139: /**
140: * Tests if the trash should be emptied
141: * automatically when logging out.
142: *
143: * @return true if the trash should be emptied
144: * automatically, false otherwise.
145: */
146: public boolean isAutoEmpty();
147:
148: /**
149: * Returns a <tt>String</tt> representing the
150: * path of the read-mail-archive.
151: *
152: * @return the path of the read-mail-archive as String.
153: */
154: public String getTrashFolder();
155:
156: /**
157: * Returns a <tt>String</tt> representing the
158: * language.
159: * <p>
160: * Note that this method is a shortcut for
161: * <tt>getLocale().getLanguage()</tt>.
162: * <br>
163: *
164: * @return the language locale as <tt>String</tt>.
165: */
166: public String getLanguage();
167:
168: /**
169: * Returns the <tt>Locale</tt> associated with this
170: * <tt>JwmaPreferences</tt>.
171: *
172: * @return the associated <tt>Locale</tt>.
173: */
174: public Locale getLocale();
175:
176: /**
177: * Returns a <tt>Processor</tt> representing the
178: * users preferred message processor for
179: * processing text/plain messages.
180: *
181: * @return the message processor as <tt>Processor</tt>.
182: */
183: public Processor getMessageProcessor();
184:
185: /**
186: * Convenience method that returns a <tt>String</tt> representing
187: * the users preferred message processor name.
188: *
189: * @return the name of the message processor as <tt>String</tt>.
190: */
191: public String getMessageProcessorName();
192:
193: /**
194: * Returns a <tt>DateFormat</tt> representing the user's
195: * preferred date format.
196: *
197: * @return the user's preferred <tt>DateFormat</tt>.
198: */
199: public DateFormat getDateFormat();
200:
201: /**
202: * Returns the user's default <tt>JwmaMailIdentity</tt>.
203: *
204: * @return a the preferred or default <tt>JwmaMailIdentity</tt>.
205: */
206: public JwmaMailIdentity getMailIdentity();
207:
208: /**
209: * Returns the <tt>JwmaMailIdentity</tt> with the given
210: * unique identifier. If the identifier is invalid,
211: * the method will return the default mail identity.
212: *
213: * @param uid a unique identifier of a mail identity.
214: *
215: * @return the <tt>JwmaMailIdentity</tt> with the given uid.
216: */
217: public JwmaMailIdentity getMailIdentity(String uid);
218:
219: /**
220: * Returns a <tt>JwmaMailIdentities[]</tt> that
221: * contains all <tt>JwmaMailIdentity</tt> instances
222: * of this <tt>JwmaPreferences</tt>.
223: *
224: * @return the user's mail identities as <tt>JwmaMailIdentity[]</tt>.
225: */
226: public JwmaMailIdentity[] listMailIdentities();
227:
228: /**
229: * Tests if the user considers to be an xpert.
230: *
231: * @return true if expert, false otherwise.
232: */
233: public boolean isExpert();
234:
235: /**
236: * Returns a <tt>String</tt> representing the users
237: * preferred style.
238: *
239: * @return the style as <tt>String</tt>.
240: */
241: public String getStyle();
242:
243: /**
244: * Tests if known mime message content should be inlined
245: * when displaying the message.
246: *
247: * @return true if inlining is enabled, false otherwise.
248: */
249: public boolean isDisplayingInlined();
250:
251: /**
252: * Returns the sort criteria preference for messages.
253: *
254: * @return the sort criteria as <tt>int</tt>.
255: */
256: public int getMessageSortCriteria();
257:
258: /**
259: * Sets the sort criteria preference for messages.
260: *
261: * @param crit the sort criteria as <tt>int</tt>.
262: */
263: public void setMessageSortCriteria(int crit);
264:
265: }//class JwmaPreferences
|