FileDocCategorySizeDatePackage
DocumentAtom.javaAPI DocApache Poi 3.0.16652Mon Jan 01 18:55:34 GMT 2007org.apache.poi.hslf.record

DocumentAtom

public class DocumentAtom extends RecordAtom
A Document Atom (type 1001). Holds misc information on the PowerPoint document, lots of them size and scale related.
author
Nick Burch

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 intgetFirstSlideNum()

 return firstSlideNum; 
public longgetHandoutMasterPersist()
Returns a reference to the HandoutMaster, or 0 if none

 return handoutMasterPersist; 
public longgetNotesMasterPersist()
Returns a reference to the NotesMaster, or 0 if none

 return notesMasterPersist; 
public longgetNotesSizeX()

 return notesSizeX; 
public longgetNotesSizeY()

 return notesSizeY; 
public booleangetOmitTitlePlace()
Have the placeholders on the title slide been omitted?

		if(omitTitlePlace == 0) { return false; } else { return true; } 
public longgetRecordType()
We are of type 1001

 return _type; 
public booleangetRightToLeft()
Is this a Bi-Directional PPT Doc?

		if(rightToLeft == 0) { return false; } else { return true; } 
public booleangetSaveWithFonts()
Was the document saved with True Type fonts embeded?

		if(saveWithFonts == 0) { return false; } else { return true; } 
public longgetServerZoomFrom()

 return serverZoomFrom; 
public longgetServerZoomTo()

 return serverZoomTo; 
public booleangetShowComments()
Are comment shapes visible?

		if(showComments == 0) { return false; } else { return true; } 
public intgetSlideSizeType()
The Size of the Document's slides, @see DocumentAtom.SlideSize for values

 return slideSizeType; 
public longgetSlideSizeX()



	    return slideSizeX; 
public longgetSlideSizeY()

 return slideSizeY; 
public voidsetNotesSizeX(long x)

 notesSizeX = x; 
public voidsetNotesSizeY(long y)

 notesSizeY = y; 
public voidsetServerZoomFrom(long zoom)

 serverZoomFrom = zoom; 
public voidsetServerZoomTo(long zoom)

 serverZoomTo   = zoom; 
public voidsetSlideSizeX(long x)

 slideSizeX = x; 
public voidsetSlideSizeY(long y)

 slideSizeY = y; 
public voidwriteOut(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);