FileDocCategorySizeDatePackage
InteractiveInfoAtom.javaAPI DocApache Poi 3.0.17416Thu May 31 18:45:28 BST 2007org.apache.poi.hslf.record

InteractiveInfoAtom

public class InteractiveInfoAtom extends RecordAtom
Tne atom that holds metadata on Links in the document. (The actual link is held Document.ExObjList.ExHyperlink)
author
Nick Burch
author
Yegor Kozlov

Fields Summary
public static final int
ACTION_NONE
Action Table
public static final int
ACTION_MACRO
public static final int
ACTION_RUNPROGRAM
public static final int
ACTION_JUMP
public static final int
ACTION_HYPERLINK
public static final int
ACTION_OLE
public static final int
ACTION_MEDIA
public static final int
ACTION_CUSTOMSHOW
public static final int
JUMP_NONE
Jump Table
public static final int
JUMP_NEXTSLIDE
public static final int
JUMP_PREVIOUSSLIDE
public static final int
JUMP_FIRSTSLIDE
public static final int
JUMP_LASTSLIDE
public static final int
JUMP_LASTSLIDEVIEWED
public static final int
JUMP_ENDSHOW
private byte[]
_header
Record header.
private byte[]
_data
Record data.
Constructors Summary
protected InteractiveInfoAtom()
Constructs a brand new link related atom record.


                 
      
        _header = new byte[8];
        _data = new byte[16];

        LittleEndian.putShort(_header, 2, (short)getRecordType());
        LittleEndian.putInt(_header, 4, _data.length);
        
        // It is fine for the other values to be zero
    
protected InteractiveInfoAtom(byte[] source, int start, int len)
Constructs the link related atom record from its source data.

param
source the source data as a byte array.
param
start the start offset into the byte array.
param
len the length of the slice in the byte array.

        // Get the header.
        _header = new byte[8];
        System.arraycopy(source,start,_header,0,8);
        
        // Get the record data.
        _data = new byte[len-8];
        System.arraycopy(source,start+8,_data,0,len-8);
        
        // Must be at least 16 bytes long
        if(_data.length < 16) {
        	throw new IllegalArgumentException("The length of the data for a InteractiveInfoAtom must be at least 16 bytes, but was only " + _data.length);
        }
        
        // First 4 bytes - no idea, normally 0
        // Second 4 bytes - the id of the link (from 1 onwards)
        // Third 4 bytes - no idea, normally 4
        // Fourth 4 bytes - no idea, normally 8
    
Methods Summary
public bytegetAction()
Hyperlink Action.

see ACTION_* constants for the list of actions

return
hyperlink action.

        return _data[8];
    
public bytegetFlags()
Flags

  • Bit 1: Animated. If 1, then button is animated
  • Bit 2: Stop sound. If 1, then stop current sound when button is pressed.
  • Bit 3: CustomShowReturn. If 1, and this is a jump to custom show, then return to this slide after custom show.

            return _data[11];
        
  • public intgetHyperlinkID()
    Gets the link number. You will normally look the ExHyperlink with this number to get the details.

    return
    the link number

            return LittleEndian.getInt(_data,4);
        
    public bytegetHyperlinkType()
    hyperlink type

    return
    hyperlink type

            return _data[12];
        
    public bytegetJump()
    Jump

    see JUMP_* constants for the list of actions

    return
    jump

            return _data[10];
        
    public bytegetOleVerb()
    Only valid when action == OLEAction. OLE verb to use, 0 = first verb, 1 = second verb, etc.

            return _data[9];
        
    public longgetRecordType()
    Gets the record type.

    return
    the record type.

     return RecordTypes.InteractiveInfoAtom.typeID; 
    public intgetSoundRef()
    a reference to a sound in the sound collection.

            return LittleEndian.getInt(_data,0);
        
    public voidsetAction(byte val)
    Hyperlink Action

    see ACTION_* constants for the list of actions

    param
    val hyperlink action.

        	_data[8] = val;
        
    public voidsetFlags(byte val)
    Flags

  • Bit 1: Animated. If 1, then button is animated
  • Bit 2: Stop sound. If 1, then stop current sound when button is pressed.
  • Bit 3: CustomShowReturn. If 1, and this is a jump to custom show, then return to this slide after custom show.

        	_data[11] = val;
        
  • public voidsetHyperlinkID(int number)
    Sets the persistent unique identifier of the link

    param
    number the persistent unique identifier of the link

            LittleEndian.putInt(_data,4,number);
        
    public voidsetHyperlinkType(byte val)
    hyperlink type

    param
    val hyperlink type

        	_data[12] = val;
        
    public voidsetJump(byte val)
    Jump

    see JUMP_* constants for the list of actions

    param
    val jump

        	_data[10] = val;
        
    public voidsetOleVerb(byte val)
    Only valid when action == OLEAction. OLE verb to use, 0 = first verb, 1 = second verb, etc.

        	_data[9] = val;
        
    public voidsetSoundRef(int val)
    a reference to a sound in the sound collection.

    param
    val a reference to a sound in the sound collection

        	LittleEndian.putInt(_data, 0, val);
        
    public voidwriteOut(java.io.OutputStream out)
    Write the contents of the record back, so it can be written to disk

    param
    out the output stream to write to.
    throws
    IOException if an error occurs.

            out.write(_header);
            out.write(_data);