01: /***
02: * jwma Java WebMail
03: * Copyright (c) 2000-2003 jwma team
04: *
05: * jwma is free software; you can distribute and use this source
06: * under the terms of the BSD-style license received along with
07: * the distribution.
08: ***/package dtw.webmail.plugin;
09:
10: import java.util.*;
11:
12: import dtw.webmail.model.JwmaException;
13:
14: /**
15: * Interface for a plugin that provides randomly
16: * selected quotes or nonsense, for being appended
17: * to a text message.<p>
18: *
19: * @author Dieter Wimberger
20: * @version 0.9.7 07/02/2003
21: */
22: public interface RandomAppendPlugin extends JwmaPlugin {
23:
24: /**
25: * Returns a randomly selected quote or nonsense
26: * for being appended to a message in a given
27: * <tt>Locale</tt>.
28: *
29: * @param type a <tt>String</tt> representing a type
30: * what will be appended.
31: * @param locale the locale to be used for the append.
32: *
33: *
34: * @return a random <tt>String</tt> to be appended to
35: * the message.
36: */
37: public String getRandomAppend(String type, Locale locale);
38:
39: /**
40: * Returns a list of random append type identifiers this
41: * plugin can provide for a given <tt>Locale</tt>.
42: *
43: *
44: * @param locale the <tt>Locale</tt> to be used.
45: *
46: * @return a <tt>String[]</tt> holding the type
47: * identifiers.
48: */
49: public String[] listAppendTypes(Locale locale);
50:
51: /**
52: * Tests whether this <tt>RandomAppendPlugin</tt>
53: * supports a given append type for a given
54: * <tt>Locale</tt>.
55: * <p>
56: * <em>Note:</em><br>
57: * If the method returns false, the setting will
58: * automatically be <tt>TYPE_NONE</tt>, which
59: * will tell the application logic, that nothing
60: * is to be appended.
61: *
62: *
63: * @param type a <tt>String</tt> representing an
64: * append type.
65: * @param locale the <tt>Locale</tt> to be used.
66: *
67: * @return true if the type is supported, false otherwise.
68: */
69: public boolean supportsAppendType(String type, Locale loc);
70:
71: /**
72: * Defines a type that will flag that a user does
73: * not want anything to be appended to his email.
74: */
75: public static final String TYPE_NONE = "randomappend.none";
76:
77: }//interface RandomAppendPlugin
|