01: // The contents of this file are subject to the Mozilla Public License Version
02: // 1.1
03: //(the "License"); you may not use this file except in compliance with the
04: //License. You may obtain a copy of the License at http://www.mozilla.org/MPL/
05: //
06: //Software distributed under the License is distributed on an "AS IS" basis,
07: //WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
08: //for the specific language governing rights and
09: //limitations under the License.
10: //
11: //The Original Code is "The Columba Project"
12: //
13: //The Initial Developers of the Original Code are Frederik Dietz and Timo
14: // Stich.
15: //Portions created by Frederik Dietz and Timo Stich are Copyright (C) 2003.
16: //
17: //All Rights Reserved.
18: package org.columba.mail.gui.message;
19:
20: import org.columba.core.context.semantic.api.IContextListener;
21: import org.columba.mail.command.IMailFolderCommandReference;
22: import org.columba.mail.folder.IMailbox;
23:
24: /**
25: * @author fdietz
26: *
27: */
28: public interface IMessageController {
29:
30: /**
31: * Show message in messages viewer.
32: * <p>
33: * Should be called in Command.execute() or in another background thread.
34: *
35: * @param folder
36: * selected folder
37: * @param uid
38: * selected message UID
39: * @throws Exception
40: */
41: void showMessage(IMailbox folder, Object uid) throws Exception;
42:
43: /**
44: * Revalidate message viewer components.
45: * <p>
46: * Call this method after showMessage() to force a repaint():
47: *
48: */
49: void updateGUI() throws Exception;
50:
51: public IMailFolderCommandReference getSelectedReference();
52:
53: public IMailbox getSelectedFolder();
54:
55: public Object getSelectedMessageId();
56:
57: public void addMessageSelectionListener(IMessageSelectionListener l);
58:
59: public void removeMessageSelectionListener(
60: IMessageSelectionListener l);
61:
62: public void clear();
63:
64: /**
65: * Return text.
66: *
67: * @return
68: */
69: public String getText();
70:
71: /**
72: * Return selected text
73: *
74: * @return
75: */
76: public String getSelectedText();
77:
78: /**
79: * Sets the position of the text insertion caret for the TextComponent. Note
80: * that the caret tracks change, so this may move if the underlying text of
81: * the component is changed. If the document is null, does nothing. The
82: * position must be between 0 and the length of the component's text or else
83: * an exception is thrown.
84: *
85: * @param position
86: */
87: public void setCaretPosition(int position);
88:
89: /**
90: * Moves the caret to a new position, leaving behind a mark defined by the
91: * last time setCaretPosition was called. This forms a selection. If the
92: * document is null, does nothing. The position must be between 0 and the
93: * length of the component's text or else an exception is thrown.
94: *
95: * @param position
96: */
97: public void moveCaretPosition(int position);
98:
99: }
|