Change all copyright headers to include 2012.
[Sone.git] / src / main / java / net / pterodactylus / sone / core / ImageInsertListener.java
1 /*
2  * Sone - ImageInsertListener.java - Copyright © 2011–2012 David Roden
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 3 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, see <http://www.gnu.org/licenses/>.
16  */
17
18 package net.pterodactylus.sone.core;
19
20 import java.util.EventListener;
21
22 import net.pterodactylus.sone.core.FreenetInterface.InsertToken;
23 import net.pterodactylus.sone.data.Image;
24 import freenet.keys.FreenetURI;
25
26 /**
27  * Listener interface for objects that want to be notified about the status of
28  * an image insert.
29  *
30  * @see ImageInserter#insertImage(net.pterodactylus.sone.data.TemporaryImage,
31  *      Image)
32  * @see FreenetInterface#insertImage(net.pterodactylus.sone.data.TemporaryImage,
33  *      Image, net.pterodactylus.sone.core.FreenetInterface.InsertToken)
34  * @see InsertToken
35  * @author <a href="mailto:bombe@pterodactylus.net">David ‘Bombe’ Roden</a>
36  */
37 public interface ImageInsertListener extends EventListener {
38
39         /**
40          * Notifies a listener that the insert of the given image started.
41          *
42          * @param image
43          *            The image that is being inserted
44          */
45         public void imageInsertStarted(Image image);
46
47         /**
48          * Notifies a listener that the insert of the given image was aborted by the
49          * user.
50          *
51          * @param image
52          *            The image that is no longer being inserted
53          */
54         public void imageInsertAborted(Image image);
55
56         /**
57          * Notifies a listener that the given image was inserted successfully.
58          *
59          * @param image
60          *            The image that was inserted
61          * @param key
62          *            The final key of the image
63          */
64         public void imageInsertFinished(Image image, FreenetURI key);
65
66         /**
67          * Notifies a listener that the given image could not be inserted.
68          *
69          * @param image
70          *            The image that could not be inserted
71          * @param cause
72          *            The cause of the insertion failure
73          */
74         public void imageInsertFailed(Image image, Throwable cause);
75
76 }