DocumentAtompublic class DocumentAtom extends RecordAtom A Document Atom (type 1001). Holds misc information on the PowerPoint
document, lots of them size and scale related. |
Fields Summary |
---|
private byte[] | _header | private static long | _type | private long | slideSizeX | private long | slideSizeY | private long | notesSizeX | private long | notesSizeY | private long | serverZoomFrom | private long | serverZoomTo | private long | notesMasterPersist | private long | handoutMasterPersist | private int | firstSlideNum | private int | slideSizeType | private byte | saveWithFonts | private byte | omitTitlePlace | private byte | rightToLeft | private byte | showComments | private byte[] | reserved |
Constructors Summary |
---|
protected DocumentAtom(byte[] source, int start, int len)For the Document Atom
// Sanity Checking
if(len < 48) { len = 48; }
// Get the header
_header = new byte[8];
System.arraycopy(source,start,_header,0,8);
// Get the sizes and zoom ratios
slideSizeX = LittleEndian.getInt(source,start+0+8);
slideSizeY = LittleEndian.getInt(source,start+4+8);
notesSizeX = LittleEndian.getInt(source,start+8+8);
notesSizeY = LittleEndian.getInt(source,start+12+8);
serverZoomFrom = LittleEndian.getInt(source,start+16+8);
serverZoomTo = LittleEndian.getInt(source,start+20+8);
// Get the master persists
notesMasterPersist = LittleEndian.getInt(source,start+24+8);
handoutMasterPersist = LittleEndian.getInt(source,start+28+8);
// Get the ID of the first slide
firstSlideNum = (int)LittleEndian.getShort(source,start+32+8);
// Get the slide size type
slideSizeType = (int)LittleEndian.getShort(source,start+34+8);
// Get the booleans as bytes
saveWithFonts = source[start+36+8];
omitTitlePlace = source[start+37+8];
rightToLeft = source[start+38+8];
showComments = source[start+39+8];
// If there's any other bits of data, keep them about
reserved = new byte[len-40-8];
System.arraycopy(source,start+48,reserved,0,reserved.length);
|
Methods Summary |
---|
public int | getFirstSlideNum() return firstSlideNum;
| public long | getHandoutMasterPersist()Returns a reference to the HandoutMaster, or 0 if none return handoutMasterPersist;
| public long | getNotesMasterPersist()Returns a reference to the NotesMaster, or 0 if none return notesMasterPersist;
| public long | getNotesSizeX() return notesSizeX;
| public long | getNotesSizeY() return notesSizeY;
| public boolean | getOmitTitlePlace()Have the placeholders on the title slide been omitted?
if(omitTitlePlace == 0) { return false; } else { return true; }
| public long | getRecordType()We are of type 1001 return _type;
| public boolean | getRightToLeft()Is this a Bi-Directional PPT Doc?
if(rightToLeft == 0) { return false; } else { return true; }
| public boolean | getSaveWithFonts()Was the document saved with True Type fonts embeded?
if(saveWithFonts == 0) { return false; } else { return true; }
| public long | getServerZoomFrom() return serverZoomFrom;
| public long | getServerZoomTo() return serverZoomTo;
| public boolean | getShowComments()Are comment shapes visible?
if(showComments == 0) { return false; } else { return true; }
| public int | getSlideSizeType()The Size of the Document's slides, @see DocumentAtom.SlideSize for values return slideSizeType;
| public long | getSlideSizeX()
return slideSizeX;
| public long | getSlideSizeY() return slideSizeY;
| public void | setNotesSizeX(long x) notesSizeX = x;
| public void | setNotesSizeY(long y) notesSizeY = y;
| public void | setServerZoomFrom(long zoom) serverZoomFrom = zoom;
| public void | setServerZoomTo(long zoom) serverZoomTo = zoom;
| public void | setSlideSizeX(long x) slideSizeX = x;
| public void | setSlideSizeY(long y) slideSizeY = y;
| public void | writeOut(java.io.OutputStream out)Write the contents of the record back, so it can be written
to disk
// Header
out.write(_header);
// The sizes and zoom ratios
writeLittleEndian((int)slideSizeX,out);
writeLittleEndian((int)slideSizeY,out);
writeLittleEndian((int)notesSizeX,out);
writeLittleEndian((int)notesSizeY,out);
writeLittleEndian((int)serverZoomFrom,out);
writeLittleEndian((int)serverZoomTo,out);
// The master persists
writeLittleEndian((int)notesMasterPersist,out);
writeLittleEndian((int)handoutMasterPersist,out);
// The ID of the first slide
writeLittleEndian((short)firstSlideNum,out);
// The slide size type
writeLittleEndian((short)slideSizeType,out);
// The booleans as bytes
out.write(saveWithFonts);
out.write(omitTitlePlace);
out.write(rightToLeft);
out.write(showComments);
// Reserved data
out.write(reserved);
|
|