]> git.argeo.org Git - lgpl/argeo-commons.git/blob - CmsImageManager.java
2577dc7775df89373707395542b3cae512807422
[lgpl/argeo-commons.git] / CmsImageManager.java
1 package org.argeo.cms;
2
3 import java.io.InputStream;
4
5 import javax.jcr.Binary;
6 import javax.jcr.Node;
7 import javax.jcr.RepositoryException;
8
9 import org.eclipse.swt.graphics.Image;
10 import org.eclipse.swt.graphics.Point;
11 import org.eclipse.swt.widgets.Control;
12
13 /** Read and write access to images. */
14 public interface CmsImageManager {
15 /** Load image in control */
16 public Boolean load(Node node, Control control, Point size)
17 throws RepositoryException;
18
19 /** @return (0,0) if not available */
20 public Point getImageSize(Node node) throws RepositoryException;
21
22 /**
23 * The related <img tag, with src, width and height set. @return null if not
24 * available
25 */
26 public String getImageTag(Node node) throws RepositoryException;
27
28 /**
29 * The related <img tag, with url, width and height set. Caller must close
30 * the tag (or add additional attributes). @return null if not available
31 */
32 public StringBuilder getImageTagBuilder(Node node, Point size)
33 throws RepositoryException;
34
35 /**
36 * Returns the remotely accessible URL of the image (registering it if
37 * needed) @return null if not available
38 */
39 public String getImageUrl(Node node) throws RepositoryException;
40
41 public Binary getImageBinary(Node node) throws RepositoryException;
42
43 public Image getSwtImage(Node node) throws RepositoryException;
44
45 /** @return URL */
46 public String uploadImage(Node parentNode, String fileName, InputStream in)
47 throws RepositoryException;
48 }