1   /*
2    * (C) 2002 David Carr  david@carr.name
3    *
4    * This program is free software; you can redistribute it and/or modify
5    * it under the terms of the GNU General Public License as published by
6    * the Free Software Foundation; either version 2 of the License, or
7    * (at your option) any later version.
8    *
9    * This program is distributed in the hope that it will be useful,
10   * but WITHOUT ANY WARRANTY; without even the implied warranty of
11   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12   * GNU General Public License for more details.
13   *
14   * You should have received a copy of the GNU General Public License
15   * along with this program; if not, write to the Free Software
16   * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
17   */
18  
19  package net.sourceforge.mflow.api;
20  
21  /***
22   * Interface for the storage of Msgs
23   *
24   * @author <a href="mailto:david@carr.name">David Carr</a>
25   * @version $Revision: 1.4 $
26   */
27  public interface MsgFolder extends MsgFlowComponent {
28    /***
29     * Accessor for all of the Msgs contained in the folder
30     *
31     * @return an array of Msgs
32     */
33    Msg[] getMsg();
34  
35    /***
36     * Mutator for all of the Msgs contained in the folder
37     *
38     * @param msgs an array of Msgs to replace the current contents of the folder
39     */
40    void setMsg(Msg[] msgs);
41  
42    /***
43     * Accessor for a single Msg in the folder
44     *
45     * @return the Msg at the specified index
46     * @param index the index of the Msg
47     */
48    Msg getMsg(int index);
49  
50    /***
51     * Mutator for a single Msg in the folder
52     *
53     * @param index the index
54     * @param msg the Msg to set at the specified index
55     */
56    void setMsg(int index, Msg msg);
57  
58    /***
59     * Adds a Msg to the folder
60     *
61     * @param m the Msg to add to the folder
62     */
63    void addMsg(Msg m);
64  
65    /***
66     * Removes a Msg from the folder.  Will not complain if the specified Msg is
67     * not in the folder.
68     *
69     * @param m the Msg to remove from the folder
70     */
71    void removeMsg(Msg m);
72  
73    /***
74     * Gets the number of new Msgs in the folder
75     * If this information is not current available, returns -1
76     *
77     * @return the number of new Msgs in the folder, or -1 if this information is
78     *   unavailable
79     */
80    int getNewMsgCount();
81  
82    /***
83     * Gets the number of unread Msgs in the folder
84     * If this information is not current available, returns -1
85     *
86     * @return the number of unread Msgs in the folder, or -1 if this information
87     *   is unavailable
88     */
89    int getUnreadMsgCount();
90  
91    /***
92     * Adds a listener for MsgChangeEvents.  These events are thrown whenever a
93     * Msg is added or removed from the folder.
94     *
95     * @param listener the new listener to add
96     */
97    void addMsgChangeListener(MsgChangeListener listener);
98  
99    /***
100    * Accessor for all of the listeners for the folder.
101    *
102    * @return an array of MsgChangeListeners
103    */
104   MsgChangeListener[] getMsgChangeListeners();
105 
106   /***
107    * Mutator for all of the listeners for the folder.
108    *
109    * @param listeners an array of MsgChangeListeners containing the new
110    *   listeners for the folder
111    */
112   void setMsgChangeListeners(MsgChangeListener[] listeners);
113 
114   /***
115    * Removes a listener from the folder.  Does not complain if the listener was
116    * not listening to this folder.
117    *
118    * @param listener the listener to remove
119    */
120   void removeMsgChangeListener(MsgChangeListener listener);
121 
122   /***
123    * Gets a reference to the parent folder
124    *
125    * @return the parent folder, or null if this folder doesn't have a parent
126    */
127   MsgFolder getParent();
128 
129   /***
130    * Sets the parent for the folder
131    *
132    * @param parent the new parent folder, or null to make the folder a root
133    */
134   void setParent(MsgFolder parent);
135 
136   /***
137    * Returns whether or not this folder is a root folder (no parent)
138    *
139    * @return true if this folder is a root folder
140    */
141   boolean isRootFolder();
142 }
This page was automatically generated by Maven