mirror of
https://github.com/ONLYOFFICE/core.git
synced 2026-07-11 03:42:47 +08:00
59 lines
1.1 KiB
C++
59 lines
1.1 KiB
C++
#ifndef CTRLAUTONUMBER_H
|
|
#define CTRLAUTONUMBER_H
|
|
|
|
#include "Ctrl.h"
|
|
#include "../HWPStream.h"
|
|
#include "../HWPElements/HwpRecordTypes.h"
|
|
#include "../Common/Common.h"
|
|
#include "../Common/XMLNode.h"
|
|
|
|
namespace HWP
|
|
{
|
|
|
|
enum class ENumType
|
|
{
|
|
PAGE,
|
|
FOOTNOTE,
|
|
ENDNOTE,
|
|
FIGURE,
|
|
TABLE,
|
|
EQUATION,
|
|
TOTAL_PAGE,
|
|
null
|
|
};
|
|
|
|
inline ENumType GetNumType(int nValue)
|
|
{
|
|
switch(static_cast<ENumType>(nValue))
|
|
{
|
|
case ENumType::PAGE:
|
|
case ENumType::FOOTNOTE:
|
|
case ENumType::ENDNOTE:
|
|
case ENumType::FIGURE:
|
|
case ENumType::TABLE:
|
|
case ENumType::EQUATION:
|
|
case ENumType::TOTAL_PAGE:
|
|
return static_cast<ENumType>(nValue);
|
|
default:
|
|
return ENumType::null;
|
|
}
|
|
}
|
|
|
|
class CCtrlAutoNumber : public CCtrl
|
|
{
|
|
ENumType m_eNumType;
|
|
ENumberShape2 m_eNumShape;
|
|
bool m_bSuperscript;
|
|
public:
|
|
CCtrlAutoNumber(const HWP_STRING& sCtrlID);
|
|
CCtrlAutoNumber(const HWP_STRING& sCtrlID, int nSize, CHWPStream& oBuffer, int nOff, int nVersion);
|
|
CCtrlAutoNumber(const HWP_STRING& sCtrlID, CXMLNode& oNode, int nVersion);
|
|
|
|
ECtrlObjectType GetCtrlType() const override;
|
|
|
|
ENumType GetNumType() const;
|
|
};
|
|
}
|
|
|
|
#endif // CTRLAUTONUMBER_H
|