Package org.eclipse.birt.report.model.api

# Class EmbeddedImageHandle

java.lang.Object
org.eclipse.birt.report.model.api.ElementDetailHandle
org.eclipse.birt.report.model.api.ValueHandle
org.eclipse.birt.report.model.api.StructureHandle
org.eclipse.birt.report.model.api.EmbeddedImageHandle

public class EmbeddedImageHandle extends StructureHandle
Represents the handle of an embedded image. The class gives the name and type of the image. Used when an image element `ImageItem`gives a name. Each embedded image has the following properties:

Name
  an embedded image has a unique and required name, so the image item can use the image name to identify an embedded image.
Type
  an embedded image has a choice and required type: bmp, gif, png or x-png.
Data
  value of the image data in Base64 encoding.

## Field Summary

### Fields inherited from class org.eclipse.birt.report.model.api.StructureHandle

`structContext`

### Fields inherited from class org.eclipse.birt.report.model.api.ElementDetailHandle

`elementHandle`

## Constructor Summary

Constructors
Constructor
Description
`EmbeddedImageHandle(SimpleValueHandle valueHandle, int index)`
Constructs the handle of embedded image.

## Method Summary

Modifier and Type
Method
Description
`byte[]`
`getData()`
Returns the byte array of image data.
`String`
`getName()`
Returns the embedded image name.
`String`
`getQualifiedName()`
Returns the qualified name of this element.
`String`
`getType()`
Returns the image type.
`boolean`
`isLibReference()`
Checks whether `EmbeddedImage` has reference to library embedded image.
`void`
`setData(byte[] data)`
Sets the byte array of image data.
`void`
`setName(String name)`
Sets the embedded image name.
`void`
`setType(String type)`
Sets the image type.

### Methods inherited from class org.eclipse.birt.report.model.api.StructureHandle

`drop, getContext, getDefn, getExpressionProperty, getExternalizedValue, getExternalizedValue, getIntProperty, getMember, getProperty, getPropertyDefn, getStringProperty, getStructure, isDesignTime, isLocal, iterator, setDesignTime, setExpressionProperty, setProperty, setPropertySilently`

### Methods inherited from class org.eclipse.birt.report.model.api.ValueHandle

`getReference`

### Methods inherited from class org.eclipse.birt.report.model.api.ElementDetailHandle

`getDesign, getElement, getElementHandle, getModule`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Constructor Details

### EmbeddedImageHandle

public EmbeddedImageHandle(SimpleValueHandle valueHandle, int index)
Constructs the handle of embedded image.

Parameters:
  `valueHandle` - the value handle for embedded image list of one property
  `index` - the position of this embedded image in the list

## Method Details

### getData

public byte[] getData()
Returns the byte array of image data.

Returns:
  the byte array of image data

### setData

public void setData(byte[] data)
Sets the byte array of image data.

Parameters:
  `data` - the byte array to set

### getName

public String getName()
Returns the embedded image name. This name is used to identify an embedded image by image item.

Returns:
  the embedded image name

### setName

public void setName(String name) throws SemanticException
Sets the embedded image name. This name is used to identify an embedded image by image item.

Parameters:
  `name` - the embedded image name to set
Throws:
  `SemanticException` - value required exception

### getType

public String getType()
Returns the image type. The possible values are defined in `DesignChoiceConstants`, and they are:

- `IMAGE_TYPE_IMAGE_JPEG`
- `IMAGE_TYPE_IMAGE_BMP`
- `IMAGE_TYPE_IMAGE_GIF`
- `IMAGE_TYPE_IMAGE_PNG`
- `IMAGE_TYPE_IMAGE_X_PNG`

Returns:
  the image type

### setType

public void setType(String type) throws SemanticException
Sets the image type. The allowed values are defined in `DesignChoiceConstants`, and they are:

- `IMAGE_TYPE_IMAGE_JPEG`
- `IMAGE_TYPE_IMAGE_BMP`
- `IMAGE_TYPE_IMAGE_GIF`
- `IMAGE_TYPE_IMAGE_PNG`
- `IMAGE_TYPE_IMAGE_X_PNG`

Parameters:
  `type` - the image type to set
Throws:
  `SemanticException` - if the image type is not in the choice list.

### getQualifiedName

public String getQualifiedName()
Returns the qualified name of this element. The qualified name is the name of this element if this element is in module user is editing.

Returns:
  the qualified name of thie element.

### isLibReference

public boolean isLibReference()
Checks whether `EmbeddedImage` has reference to library embedded image.

Returns:
  if `EmbeddedImage` has reference to library image and the reference is resolved return `true` else return `false`