Search in sources :

Example 6 with InteractiveInfoAtom

use of org.apache.poi.hslf.record.InteractiveInfoAtom in project poi by apache.

the class HSLFHyperlink method linkToEmail.

@Override
public void linkToEmail(String emailAddress) {
    InteractiveInfoAtom iia = info.getInteractiveInfoAtom();
    iia.setAction(InteractiveInfoAtom.ACTION_HYPERLINK);
    iia.setJump(InteractiveInfoAtom.JUMP_NONE);
    iia.setHyperlinkType(InteractiveInfoAtom.LINK_Url);
    exHyper.setLinkURL("mailto:" + emailAddress);
    exHyper.setLinkTitle(emailAddress);
    exHyper.setLinkOptions(0x10);
}
Also used : InteractiveInfoAtom(org.apache.poi.hslf.record.InteractiveInfoAtom) TxInteractiveInfoAtom(org.apache.poi.hslf.record.TxInteractiveInfoAtom)

Example 7 with InteractiveInfoAtom

use of org.apache.poi.hslf.record.InteractiveInfoAtom in project poi by apache.

the class HSLFHyperlink method linkToNextSlide.

@Override
public void linkToNextSlide() {
    InteractiveInfoAtom iia = info.getInteractiveInfoAtom();
    iia.setAction(InteractiveInfoAtom.ACTION_JUMP);
    iia.setJump(InteractiveInfoAtom.JUMP_NEXTSLIDE);
    iia.setHyperlinkType(InteractiveInfoAtom.LINK_NextSlide);
    linkToDocument(1, -1, "NEXT", 0x10);
}
Also used : InteractiveInfoAtom(org.apache.poi.hslf.record.InteractiveInfoAtom) TxInteractiveInfoAtom(org.apache.poi.hslf.record.TxInteractiveInfoAtom)

Example 8 with InteractiveInfoAtom

use of org.apache.poi.hslf.record.InteractiveInfoAtom in project poi by apache.

the class HSLFHyperlink method find.

private static void find(List<? extends Record> records, ExObjList exobj, List<HSLFHyperlink> out) {
    ListIterator<? extends Record> iter = records.listIterator();
    while (iter.hasNext()) {
        Record r = iter.next();
        // see if we have InteractiveInfo in the textrun's records
        if (!(r instanceof InteractiveInfo)) {
            continue;
        }
        InteractiveInfo hldr = (InteractiveInfo) r;
        InteractiveInfoAtom info = hldr.getInteractiveInfoAtom();
        if (info == null) {
            continue;
        }
        int id = info.getHyperlinkID();
        ExHyperlink exHyper = exobj.get(id);
        if (exHyper == null) {
            continue;
        }
        HSLFHyperlink link = new HSLFHyperlink(exHyper, hldr);
        out.add(link);
        if (iter.hasNext()) {
            r = iter.next();
            if (!(r instanceof TxInteractiveInfoAtom)) {
                iter.previous();
                continue;
            }
            link.setTextRunInfo((TxInteractiveInfoAtom) r);
        }
    }
}
Also used : InteractiveInfoAtom(org.apache.poi.hslf.record.InteractiveInfoAtom) TxInteractiveInfoAtom(org.apache.poi.hslf.record.TxInteractiveInfoAtom) ExHyperlink(org.apache.poi.hslf.record.ExHyperlink) TxInteractiveInfoAtom(org.apache.poi.hslf.record.TxInteractiveInfoAtom) HSLFEscherClientDataRecord(org.apache.poi.hslf.record.HSLFEscherClientDataRecord) Record(org.apache.poi.hslf.record.Record) InteractiveInfo(org.apache.poi.hslf.record.InteractiveInfo)

Example 9 with InteractiveInfoAtom

use of org.apache.poi.hslf.record.InteractiveInfoAtom in project poi by apache.

the class HSLFHyperlink method linkToUrl.

@Override
public void linkToUrl(String url) {
    InteractiveInfoAtom iia = info.getInteractiveInfoAtom();
    iia.setAction(InteractiveInfoAtom.ACTION_HYPERLINK);
    iia.setJump(InteractiveInfoAtom.JUMP_NONE);
    iia.setHyperlinkType(InteractiveInfoAtom.LINK_Url);
    exHyper.setLinkURL(url);
    exHyper.setLinkTitle(url);
    exHyper.setLinkOptions(0x10);
}
Also used : InteractiveInfoAtom(org.apache.poi.hslf.record.InteractiveInfoAtom) TxInteractiveInfoAtom(org.apache.poi.hslf.record.TxInteractiveInfoAtom)

Example 10 with InteractiveInfoAtom

use of org.apache.poi.hslf.record.InteractiveInfoAtom in project poi by apache.

the class HSLFHyperlink method linkToSlide.

@Override
public void linkToSlide(Slide<HSLFShape, HSLFTextParagraph> slide) {
    assert (slide instanceof HSLFSlide);
    HSLFSlide sl = (HSLFSlide) slide;
    int slideNum = slide.getSlideNumber();
    String alias = "Slide " + slideNum;
    InteractiveInfoAtom iia = info.getInteractiveInfoAtom();
    iia.setAction(InteractiveInfoAtom.ACTION_HYPERLINK);
    iia.setJump(InteractiveInfoAtom.JUMP_NONE);
    iia.setHyperlinkType(InteractiveInfoAtom.LINK_SlideNumber);
    linkToDocument(sl._getSheetNumber(), slideNum, alias, 0x30);
}
Also used : InteractiveInfoAtom(org.apache.poi.hslf.record.InteractiveInfoAtom) TxInteractiveInfoAtom(org.apache.poi.hslf.record.TxInteractiveInfoAtom)

Aggregations

InteractiveInfoAtom (org.apache.poi.hslf.record.InteractiveInfoAtom)10 TxInteractiveInfoAtom (org.apache.poi.hslf.record.TxInteractiveInfoAtom)8 HSLFEscherClientDataRecord (org.apache.poi.hslf.record.HSLFEscherClientDataRecord)2 InteractiveInfo (org.apache.poi.hslf.record.InteractiveInfo)2 EscherContainerRecord (org.apache.poi.ddf.EscherContainerRecord)1 AnimationInfo (org.apache.poi.hslf.record.AnimationInfo)1 AnimationInfoAtom (org.apache.poi.hslf.record.AnimationInfoAtom)1 ExHyperlink (org.apache.poi.hslf.record.ExHyperlink)1 ExObjRefAtom (org.apache.poi.hslf.record.ExObjRefAtom)1 Record (org.apache.poi.hslf.record.Record)1