⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 rtftype.h

📁 没事随便上传的实例``有用的话就好说``没用的话你也就看看`
💻 H
字号:
#ifndef _RTFTYPE_H_
#define _RTFTYPE_H_

//Rtftype.h
#define fTrue 1
#define fFalse 0

typedef struct char_prop
{
    char fBold;
    char fUnderline;
    char fItalic;
} CHP;                  // CHaracter Properties

typedef enum {justL, justR, justC, justF } JUST;
typedef struct para_prop
{
    int xaLeft;                 // left indent in twips
    int xaRight;                // right indent in twips
    int xaFirst;                // first line indent in twips
    JUST just;                  // justification
} PAP;                  // PAragraph Properties

typedef enum {sbkNon, sbkCol, sbkEvn, sbkOdd, sbkPg} SBK;
typedef enum {pgDec, pgURom, pgLRom, pgULtr, pgLLtr} PGN;
typedef struct sect_prop
{
    int cCols;                  // number of columns
    SBK sbk;                    // section break type
    int xaPgn;                  // x position of page number in twips
    int yaPgn;                  // y position of page number in twips
    PGN pgnFormat;              // how the page number is formatted
} SEP;                  // SEction Properties

typedef struct doc_prop
{
    int xaPage;                 // page width in twips
    int yaPage;                 // page height in twips
    int xaLeft;                 // left margin in twips
    int yaTop;                  // top margin in twips
    int xaRight;                // right margin in twips
    int yaBottom;               // bottom margin in twips
    int pgnStart;               // starting page number in twips
    char fFacingp;              // facing pages enabled?
    char fLandscape;            // landscape or portrait??
} DOP;                  // DOcument Properties

typedef enum { rdsNorm, rdsSkip } RDS;              // Rtf Destination State
typedef enum { risNorm, risBin, risHex } RIS;       // Rtf Internal State

typedef struct save             // property save structure
{
    struct save *pNext;         // next save
    CHP chp;
    PAP pap;
    SEP sep;
    DOP dop;
    RDS rds;
    RIS ris;
} SAVE;

// What types of properties are there?
typedef enum 
{
	ipropBold, ipropItalic, ipropUnderline, ipropLeftInd,
    ipropRightInd, ipropFirstInd, ipropCols, ipropPgnX,
	ipropPgnY, ipropXaPage, ipropYaPage, ipropXaLeft,
	ipropXaRight, ipropYaTop, ipropYaBottom, ipropPgnStart,
	ipropSbk, ipropPgnFormat, ipropFacingp, ipropLandscape,
	ipropJust, ipropPard, ipropPlain, ipropSectd,
	ipropMax 
} IPROP;

typedef enum {actnSpec, actnByte, actnWord} ACTN;
typedef enum {propChp, propPap, propSep, propDop} PROPTYPE;

typedef struct propmod
{
    ACTN actn;              // size of value
    PROPTYPE prop;          // structure containing value
    int  offset;            // offset of value from base of structure
} PROP;

typedef enum {ipfnBin, ipfnHex, ipfnSkipDest } IPFN;
typedef enum {idestPict, idestSkip } IDEST;
typedef enum {kwdChar, kwdDest, kwdProp, kwdSpec} KWD;

typedef struct symbol
{
    char *szKeyword;        // RTF keyword
    int  dflt;              // default value to use
    bool fPassDflt;         // true to use default value from this table
    KWD  kwd;               // base action to take
    int  idx;               // index into property table if kwd == kwdProp
                            // index into destination table if kwd == kwdDest
                            // character to print if kwd == kwdChar
} SYM;

typedef struct _NewFont//tatol is 20 + 32 bytes.
{
	COLORREF lfFontColor ;  //the color of char
	LONG lfWeight;			//the weight of char,BOLD
	WORD lfFaceNameIdx;		// the name index of font 
	WORD lfFontSize ;		// the size of char
	
	WORD lfWidth;			// the width of char,缩放比例。
	BYTE bCharSet;
	BYTE lfItalic;			// determind of italic
	
	DWORD lfUnderline;		// determind of underline,first byte is style,3 bytes is color.
    
	BYTE lfStrikeOut;		// 删除线。0 --- 正常,1-- 单线 2-- 双线。
    BYTE lfTopLine;			// 上划线。
	BYTE lfCharCase;		// 0 -- 正常,1 --- 大写,2 -- 小写。
	BYTE lfSetDefault;      // set default value.

	DWORD lfCharEffect;		// 0 -- 正常,1 -- 空心字符,2 -- 阴文,3 -- 阳文。4 -- 阴影。
	BYTE lfCharFrame;		// 边框.
	BYTE lfCharBack;		// 底纹.
	
	char lfCharSpace ;		// the space between two chars
	char lfLineSpace  ;		// the space between two lines
	char lfCharIncrease;	// 字符升降。
}NewFont;

typedef struct _FontMask//
{
	BOOL lfFontColor ;	    //the color of char
	BOOL lfWeight;			//the weight of char
	BOOL lfFaceNameIdx;		// the name index of font 
	BOOL lfFontSize ;		// the size of char
	BOOL lfWidth;			// the width of char
	BOOL bCharSet;
	BOOL lfItalic;			// determind of italic
	BOOL lfUnderline;		// determind of underline
    BOOL lfStrikeOut;		// 删除线。

    BOOL lfTopLine;			// 上划线。
	BOOL lfCharCase;		// 0 -- 无变化,1 --- 大写,2 -- 小写。
	BOOL lfSetDefault;		// 0 -- 无变化,1 --- 大写,2 -- 小写。


	BOOL lfCharEffect;// 0 --正常,1 -- 空心字符。2 -- 阴文,3 -- 阳文。4 -- 阴影。
	BOOL lfCharFrame;		// 边框.
	BOOL lfCharBack;		// 底纹.

	BOOL lfCharSpace ;		// the space between two chars
	BOOL lfLineSpace  ;		// the space between two lines
	BOOL lfCharIncrease;	// 字符升降。
}FontMask;

enum CONTROL_CODE
{
	lfFontColor,
	lfWeight,	  
	lfFaceNameIdx,		  
	lfFontSize,			
	lfWidth,				  
	bCharSet,			
	lfItalic,					  
	lfUnderline,
	lfStrikeOut,	
	
    lfTopLine,		// 上划线。
	lfCharCase,		// 0 -- 无变化,1 --- 大写,2 -- 小写。
	lfSetDefault,		// 0 -- 无变化,1 --- 大写,2 -- 小写。

	lfCharEffect,// 0 --正常,1 -- 空心字符。2 -- 阴文,3 -- 阳文。4 -- 阴影。
	lfCharFrame,	// 边框.
	lfCharBack,		// 底纹.
	
	lfCharSpace,	
	lfLineSpace,
	lfCharIncrease
};

typedef struct strTab
{
    int  idx;               //
    char *szKeyWord;        //
	int  nType;
	int  nOffset;
}KEY_TABLE;

typedef struct mask_Tab
{
    int  idx;               //
	int  nOffset;
}MASK_TABLE;

// map new text to rtf.
typedef struct mapkey_Tab
{
    int  idx;               //
    char *szNewTextKey;        //
    char *szRtfKeyWord;        //
}MAPKEY_TABLE;
#endif

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -