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 java.text.DateFormat;
011: import java.text.SimpleDateFormat;
012: import java.util.Locale;
013:
014: import net.wimpi.text.Processor;
015:
016: /**
017: * Interface for <tt>JwmaPreferences</tt> implementations.
018: * This is the interface any specialized implementation
019: * has to expose internal to controllers and models.
020: *
021: * @author Dieter Wimberger
022: * @version 0.9.7 07/02/2003
023: */
024: public interface JwmaPreferencesImpl extends JwmaPreferences, Cloneable {
025:
026: /**
027: * Sets the identity of this <tt>JwmaPreferences</tt>.
028: * <p>
029: * <em>Note</em>:<br>
030: * The format of the string has to be
031: * <tt><username>@<postofficehost></tt>.
032: * <br>
033: *
034: * @param id the identity to be set as <tt>String</tt>.
035: */
036: public void setUserIdentity(String userid);
037:
038: /**
039: * Sets the firstname of the owner of this
040: * <tt>JwmaPreferences</tt>.
041: *
042: * @param firstname the owner's firstname.
043: */
044: public void setFirstname(String firstname);
045:
046: /**
047: * Sets the lastname of the owner of this
048: * <tt>JwmaPreferences</tt>.
049: *
050: * @param lastname the owner's lastname.
051: */
052: public void setLastname(String lastname);
053:
054: /**
055: * Sets the the user's last login date and originating host.
056: *
057: * @param address the internet address of the last login.
058: */
059: public void setLastLogin(String lastlogin);
060:
061: /**
062: * Sets a <tt>String</tt> representing the
063: * language.
064: * <p>
065: * Note that this method is a shortcut for
066: * <tt>getLocale().setLanguage()</tt>.
067: * <br>
068: *
069: * @param language the standard ISO639 identifier as <tt>String</tt>.
070: */
071: public void setLanguage(String language);
072:
073: /**
074: * Sets the <tt>Locale</tt> associated with this
075: * <tt>JwmaPreferences</tt>.
076: *
077: * @param locale the <tt>Locale</tt> to be set.
078: */
079: public void setLocale(Locale locale);
080:
081: /**
082: * Sets the quoting character.
083: * <p>
084: * <i><b>Note</b>:
085: * only the first character is taken from the String.</i>
086: *
087: * @return the quote character as String.
088: */
089: public void setQuoteChar(String qc);
090:
091: /**
092: * Sets the flag that controls wheter messages should be automatically
093: * quoted on reply.
094: *
095: * @param doquote true if messages being replied to should be automatically
096: * quoted, false otherwise.
097: */
098: public void setAutoQuote(boolean doquote);
099:
100: /**
101: * Sets the path of the mail root folder.
102: *
103: * @param path the path of root mail folder as
104: * <tt>String</tt>.
105: */
106: public void setRootFolder(String path);
107:
108: /**
109: * Sets the path of the sent-mail-archive.
110: *
111: * @param path the path of the sent-mail-archive as <tt>String</tt>.
112: */
113: public void setSentMailArchive(String path);
114:
115: /**
116: * Sets the path of the read-mail-archive.
117: *
118: * @param path the path of the read-mail-archive as <tt>String</tt>.
119: */
120: public void setReadMailArchive(String path);
121:
122: /**
123: * Sets the path of the trashfolder.
124: *
125: * @param path the path of the trashfolder as <tt>String</tt>.
126: */
127: public void setTrashFolder(String path);
128:
129: /**
130: * Sets the path of the draft folder.
131: *
132: * @param path the path of the draft folder as <tt>String</tt>.
133: */
134: public void setDraftFolder(String path);
135:
136: /**
137: * Sets the flag that controls wheter messages should be automatically
138: * archived when sent.
139: *
140: * @param doarchive true if messages being sent should be automatically
141: * archived, false otherwise.
142: */
143: public void setAutoArchiveSent(boolean doarchive);
144:
145: /**
146: * Sets the flag that controls wheter messages should be automatically
147: * moved when read.
148: *
149: * @param domoveread true if read messages should be automatically
150: * moved, false otherwise.
151: */
152: public void setAutoMoveRead(boolean domoveread);
153:
154: /**
155: * Sets the flag that controls wheter messages should be automatically
156: * deleted from the trash on logout.
157: *
158: * @param b true if messages in trash should be automatically
159: * deleted on logout, false otherwise.
160: */
161: public void setAutoEmpty(boolean b);
162:
163: /**
164: * Returns a <tt>String</tt> representing the
165: * user's contact database UID.
166: *
167: * @return the UID of the contact database as <tt>String</tt>.
168: */
169: public String getContactDatabaseID();
170:
171: /**
172: * Sets a <tt>String</tt> representing the
173: * user's contact database UID.
174: *
175: * @return the UID of the contact database as <tt>String</tt>.
176: */
177: public void setContactDatabaseID(String dbid);
178:
179: /**
180: * Sets the <tt>Processor</tt> representing the
181: * users preferred message processor for
182: * processing plain/text messages by its name.
183: * <p>
184: * Note that this method is a shortcut for
185: * <pre>
186: * <tt>
187: * setMessageProcessor(
188: * JwmaKernel.getReference().getMessageProcessor(String name)
189: * );
190: * </tt>
191: * </pre>
192: * <br>
193: *
194: * @param name the <tt>Processor</tt>'s identifier as <tt>String</tt>.
195: */
196: public void setMessageProcessorName(String name);
197:
198: /**
199: * Sets the <tt>Processor</tt> representing the
200: * users preferred message processor for
201: * processing plain/text messages.
202: *
203: * @param processor the preferred message processor.
204: */
205: public void setMessageProcessor(Processor processor);
206:
207: /**
208: * Sets the <tt>DateFormat</tt> representing the user's
209: * preferred date format.
210: * Note that the passed in dateformat should be an instance
211: * of <tt>SimpleDateFormat</tt>, which is enforced by the
212: * parameter type.
213: *
214: * @param dateformat the user's preferred <tt>SimpleDateFormat</tt>.
215: */
216: public void setDateFormat(SimpleDateFormat dateformat);
217:
218: /**
219: * Sets the user's default identity
220: * <tt>JwmaMailIdentity</tt> instance.
221: *
222: * @param uid the identifier of the <tt>JwmaMailIdentity</tt>
223: * to be set as default.
224: */
225: public void setDefaultMailIdentity(String uid);
226:
227: /**
228: * Adds the given <tt>JwmaMailIdentity</tt>
229: * to this <tt>JwmaPreferences</tt>.
230: *
231: * @param identity the <tt>JwmaMailIdentity</tt> to be added.
232: */
233: public void addMailIdentity(JwmaMailIdentity identity);
234:
235: /**
236: * Removes the <tt>JwmaMailIdentity</tt> with the given id
237: * from this <tt>JwmaPreferences</tt>.
238: *
239: * @param uid the identifier of the <tt>JwmaMailIdentity</tt>
240: * to be removed.
241: */
242: public void removeMailIdentity(String uid);
243:
244: /**
245: * Tests if a <tt>JwmaMailIdentity</tt> with the given index
246: * exists.
247: *
248: * @param uid the identifier of the <tt>JwmaMailIdentity</tt>.
249: *
250: * @param b true if exists, false otherwise.
251: */
252: public boolean existsMailIdentity(String uid);
253:
254: /**
255: * Returns the count of <tt>JwmaMailIdentity</tt> instances
256: * that are associated with this <tt>JwmaPreferences</tt>.
257: *
258: * @return the number of <tt>JwmaMailIdentity</tt> instances
259: * associated with this <tt>JwmaPreferences</tt>.
260: */
261: public int getMailIdentityCount();
262:
263: /**
264: * Sets the flag that shows wheter the owner of
265: * this <tt>JwmaPreferences</tt> considers to be an xpert.
266: *
267: * @param b true if expert, false otherwise.
268: */
269: public void setExpert(boolean b);
270:
271: /**
272: * Sets a <tt>String</tt> representing the users
273: * preferred style.
274: *
275: * @param style the style as <tt>String</tt>.
276: */
277: public void setStyle(String style);
278:
279: /**
280: * Sets the flag that controls whether known
281: * mime message content is displayed inline.
282: *
283: * @return true if inline displaying is to be enabled,
284: * false otherwise.
285: */
286: public void setDisplayingInlined(boolean b);
287:
288: /**
289: * Factory method for an implementation specific
290: * <tt>JwmaMailIdentityImpl</tt>.
291: *
292: * @return an instance of the related <tt>JwmaMailIdentityImpl</tt>
293: * implementation.
294: */
295: public JwmaMailIdentityImpl createMailIdentity();
296:
297: }//interface JwmaPreferencesImpl
|