Files
core/ASCOfficePPTXFile/PPTXFormat/Logic/Effects/BiLevel.h

65 lines
1.3 KiB
C++

#pragma once
#ifndef PPTX_LOGIC_BILEVEL_INCLUDE_H_
#define PPTX_LOGIC_BILEVEL_INCLUDE_H_
#include "./../../WrapperWritingElement.h"
namespace PPTX
{
namespace Logic
{
class BiLevel : public WrapperWritingElement
{
public:
PPTX_LOGIC_BASE(BiLevel)
BiLevel& operator=(const BiLevel& oSrc)
{
parentFile = oSrc.parentFile;
parentElement = oSrc.parentElement;
thresh = oSrc.thresh;
return *this;
}
public:
virtual void fromXML(XmlUtils::CXmlNode& node)
{
node.ReadAttributeBase(L"thresh", thresh);
Normalize();
}
virtual CString toXML() const
{
XmlUtils::CAttribute oAttr;
oAttr.Write(_T("thresh"), thresh);
return XmlUtils::CreateNode(_T("a:biLevel"), oAttr);
}
virtual void toPPTY(NSBinPptxRW::CBinaryFileWriter* pWriter) const
{
pWriter->StartRecord(EFFECT_TYPE_BILEVEL);
pWriter->WriteBYTE(NSBinPptxRW::g_nodeAttributeStart);
pWriter->WriteInt2(0, thresh);
pWriter->WriteBYTE(NSBinPptxRW::g_nodeAttributeEnd);
pWriter->EndRecord();
}
public:
nullable_int thresh;
protected:
virtual void FillParentPointersForChilds(){};
AVSINLINE void Normalize()
{
thresh.normalize_positive();
}
};
} // namespace Logic
} // namespace PPTX
#endif // PPTX_LOGIC_BILEVEL_INCLUDE_H_