Type xlsxSheetView = Class
	Function Create(sheetobj, file, xml); overload;
	Begin
		sheet_ := sheetobj;
		file_  := file;
		xmlFile_ := xml;
	End;

	Function SetSheetViewOptions(viewIndex, sheetView);
	Begin
		node := xmlFile_.FirstChild('worksheet').FirstChild('sheetViews');
		sheet_view_node := node.FirstChild('sheetView');
		while ifObj(sheet_view_node) do
		Begin
			id := sheet_view_node.GetAttribute('workbookViewId');
			if trystrtoint(id, r) and r = viewIndex then
			Begin
				marshal := SheetView.Marshal();
				class(xlsxXml).UpdateNode(sheet_view_node, marshal['attributes'], array());
				return array(0, '');
			End
			sheet_view_node := sheet_view_node.NextElement();
		End
		return array(1, 'viewIndex not found : ' $ viewIndex);
	End;

	Function GetSheetViewOptions(viewIndex, sheetView);
	Begin
		node := xmlFile_.FirstChild('worksheet').FirstChild('sheetViews');
		sheet_view_node := node.FirstChild('sheetView');
		while ifObj(sheet_view_node) do
		Begin
			id := sheet_view_node.GetAttribute('workbookViewId');
			if trystrtoint(id, r) and r = viewIndex then
			Begin
				marshal := sheet_view_node.Marshal()[0];
				sheetview := TOfficeObj('TSheetView');
				sheetview.ShowGridLines := marshal['attributes']['showGridLines'];
				sheetview.ShowRowColHeaders := marshal['attributes']['showRowColHeaders'];
				sheetview.ZoomScale := marshal['attributes']['zoomScale'];
				sheetview.ZoomScaleNormal := marshal['attributes']['zoomScaleNormal'];
				return array(0, sheetView);
			End
		End
		return array(1, 'viewIndex not found : ' $ viewIndex);
	End

	class Function NewObject(sheetname, file);
	Begin
		o := file.WorkBook().GetSheetObj(sheetname);
		xml := file.WorkBook().GetSheetXmlfile(sheetname);
		if not ifObj(o) then return 0;
		return new xlsxSheetView(o, file, xml);
	End;

private
	file_; //TSExcelFile对象
	sheet_;//XmlSheet对象
	xmlFile_; //sheet对应的xml对象
End;
