PDFNoteInfo.h 7.08 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291
#pragma once

#include "LabelInfo.h"
#include "..\MyPDF\src\ReaderType.h"
// Modify By Ray 2018-07-14
//#include "ZxDefine.h"

typedef enum PDFNoteType
{
	NoteNone          = 0,
	NoteLine          = 1,   //   直线
	NoteTextBox       =  2,   //   文本框
	NoteFreedom       = 3,  //   铅笔或者叫自由画笔
	NoteAudio   =4,   //NoteAudio((byte) 17, "音频")
	NoteVideo   =5,   //NoteVideo((byte) 18, "视频")
	NoteImage   =6,   //NoteImage((byte) 19, "图片")
	NoteFile          = 7,  //   附加文件;
	NoteLink,     //第三方资源笔记
	NoteExercise,     //习题
	NoteDoc,
	NoteExcel,
	NotePpt,
	NotePdf,
	NoteComposite
} ;
typedef enum LineType
{
	FullLine   = 0,     // 实线
	WavyLine   = 1,     // 波浪线
	DottedLine = 2,     // 虚线
	HighlightLine=3,
	LineNone=4
};



typedef enum MyResType
{
 	RES_TYPE_NONE   =0,
// 	RES_TYPE_AUDIO  =1,
// 	RES_TYPE_VIDIO  =2,
// 	RES_TYPE_IMAGE  =3,
// 	RES_TYPE_FILE   =4,
// 	RES_TYPE_URL    =5,
 	RES_TYPE_WORD   =1,
	RES_TYPE_PPT    =2,
	RES_TYPE_XLS    =3,
	RES_TYPE_PDF    =4,
	RES_TYPE_FILE    =5,
/*	RES_TYPE_ONENOTE    =9,*/
};
typedef enum PDFNoteInfoOrigin
{
	ORIGIN_NONE   =0,
	ORIGIN_SYSTEM =1,
	ORIGIN_USER   =2
};

typedef enum DOWNLOAD_STATUS
{
	DOWNLOAD_WAIT=0,
	DOWNLOAD_PROCESS=1,
	DOWNLOAD_OK=2,
	DOWNLOAD_FAIL=3
};
typedef enum UPLOAD_STATUS
{
	UPLOAD_WAIT=0,
	UPLOAD_PROCESS=1,
	UPLOAD_OK=2,
	UPLOAD_FAIL=3
};

typedef struct NoteText
{
public:
	char* noteText;
	long  noteLength;
public:
	NoteText()
	{
		noteText=NULL;
		noteLength=0;
	}
	NoteText(char* noteText,long noteLength)
	{
		noteText = (char *)malloc(noteLength);
		ZeroMemory(this->noteText,noteLength);
		memcpy(this->noteText,noteText,noteLength);
		this->noteLength=noteLength;
	}
	~NoteText()
	{
		/*if(noteText!=NULL)
		{
		delete[] noteText;
		noteText=NULL;
		}*/
	}
};

typedef struct textbook_catalogInfo_noteInfo
{
	int pdfId;
	int pageNo;
	int index;
	CString content;
	CString resAddr;
};
typedef struct ResourceType
{
   PDFNoteType nNoteType;
   MyResType nFileType;
};
struct COMPOSITE_INFO
{
	CString title;
	CString desc;
	CString path;
	CString url;
	CString strType;
	CString id;
	int status;
	CString sourceCode;
};

typedef struct textbook_catalogInfo
{
	int catalogId;
	CString bookId;
	CString catalogName;
	int parentId;
	int startPage;
	int endPage;
	int orderNo;
	CString strLeverCode;
	//Add By Ray 2018-06-20
	int nAttachment;
	std::vector<textbook_catalogInfo> catalogInfos;
	std::vector<textbook_catalogInfo_noteInfo> noteInfos;
};

typedef struct note_folder_info
{
	long folderId;
	CString folderName;
	CString createTime;
	CString updateTime;
	CString bookId;
	int exist;
	int noteNum;
};
struct FREE_PEN_INFO
{
	CString coord;
	int		   lineColor;        //	线的颜色
	int            lineWidth;        // 线宽

};
//Add By Ray 2018-10-22 DownloadInfo
class CDownloadNoteFileInfo
{
public:
	LONGLONG m_NoteId;//下载笔记的ID
	int m_nSource;//0=cloud,1=share
	std::string m_DownloadUrl;//访问的URL
	//std::string m_SavePath;//附件的保存路径
	CString m_SavePath;
	DOWNLOAD_STATUS m_status;//下载的状态
	PDFNoteType m_type;//当前下载笔记的类型
	std::string m_strBody;//POST请求的body
	CDownloadNoteFileInfo();
	~CDownloadNoteFileInfo();
};


class CPDFNoteInfo
{
public:
	CPDFNoteInfo(void);
	~CPDFNoteInfo(void);
    //Add By Ray 2018-06-04
	//增加索引FreePenNote及isFatherFlag
	CString resourcePath;
	int           fid;
	BOOL		  isFather;
	long long           id;
	CString	       bookId;           //	书ID
	int            pdfId;            //	注释ID,本书唯一
	PDFNoteType    pdfNoteType;      //	注释类型
	CString        content;          //	高亮或下划线选择的文字 附件文件名称 等信息
	CString        updateTime;       //	时间
	CString		   moveTime;         //移动时间
	CString	       noteCatalog;      //	所在目录
	int            pageIndex;        //	注释所在页面
	CString        contentStartPos;  //	选择文字起始位置
	CString        coord;            //	坐标,如果有多对,以;分割
	std::vector<double> coord_pt;//笔记笔记矩形坐标 x,y,dx,dy

	DWORD		   lineColor;        //	线的颜色
	LineType       lineType;         //	画线类型
	int            lineWidth;        // 线宽
	std::vector<CLabelInfo*> lableInfos;//笔记标签信息
	CString        strLableInfos;
	CString strLabelNameLsit;
	//Modify By Ray 2018-07-04
	//NoteText       noteText;         // 笔记内容(rtf格式的 富文本)、附件文件路径 超链接地址
	CString			noteText;
	int			   sourceType;		 //平台类型

	DWORD		noteTextColor;		//批注字体颜色
	int			noteTextSize;		//批注字体大小
	int			noteTextWidth;		//批注窗口宽度
	int			noteTextHeight;		//批注窗口长度
	int			catalogIndex;		//目录页码
	int         notePostilTextSize;   //流转时批注字体大小
	DWORD       notePostilTextColor;   //流转时批注字体颜色

	int            pageAngle;        // 页面角度
	PDFNoteInfoOrigin     noteOrigin;       // 笔记来源
	int            pageWidth;
	int            pageHeight;
	CString        usercode;         // 用户
	CString        userName;         // 用户
	LONGLONG       ServerID;
	LONGLONG       ShareID;
	CString        LinkURL;
	int			   isCloud;
	CString       strClassId;
	CString		  m_classname;//学生班级

	BOOL IsContainLabel(int labelId);
	//MyResType GetResType();
	ResourceType GetResType(CString strPath=L"");
	void Copy(CPDFNoteInfo pdfInfo);
	static bool ComparPdfInfoByPdfId(CPDFNoteInfo*lhs,CPDFNoteInfo*rhs);//mark
	static bool ComparPdfInfoByPageIndex(CPDFNoteInfo*lhs,CPDFNoteInfo*rhs);
	static bool ComparPdfInfoByUpdateTime(CPDFNoteInfo*lhs,CPDFNoteInfo*rhs);
	static bool ComparPdfInfoByType(CPDFNoteInfo*lhs,CPDFNoteInfo*rhs);
	static bool ComparPdfInfoByMoveTime(CPDFNoteInfo*lhs,CPDFNoteInfo*rhs);
	static bool ComparPdfInfoByFid(CPDFNoteInfo*lhs,CPDFNoteInfo*rhs);
	static bool ComparPdfInfoByCoordX(CPDFNoteInfo*lhs,CPDFNoteInfo*rhs);
	void   SetNoteTextByString(CString noteString);

	CString GetStringByNoteText();

	std::vector<FREE_PEN_INFO*> m_free_pen_line;
	std::vector<CString> m_label_list;//标签列表

	//static TP_NOTES_TYPE PDFNoteType2NoteType(PDFNoteType n_type, LineType l_type);
	//static int NoteType2PDFNoteType(TP_NOTES_TYPE note_type, PDFNoteType &pdf_n_type, LineType &pdf_l_type);

	DuiLib::CListContainerElementUI* pListElement;

	int coordLeft;//仅用于排序

	COMPOSITE_INFO composite_info;
};

typedef struct textbook_catalogInfo_ex
{
	int catalogId;
	CString bookId;
	CString catalogName;
	int parentId;
	int startPage;
	int endPage;
	int orderNo;
	int level;
	bool bShow;
	bool bCanExpand;
	DuiLib::CListContainerElementUI* pListElement;

	std::vector<textbook_catalogInfo_ex> catalogInfos;
	std::vector<CPDFNoteInfo> noteInfos;
};
class CUploadNoteFileInfo
{
public:
	LONGLONG m_NoteId;//下载笔记的ID
	std::string m_OrgId;
	int m_nCloud;//0=Local,1=Cloud
	std::string m_UploadUrl;//上传的URL
	std::string m_Path;//上传的本机路径
	std::string m_cloud_file_url;
	std::string m_Token;
	UPLOAD_STATUS m_status;//上传的状态
	PDFNoteType m_type;//当前上传笔记的类型
	CUploadNoteFileInfo();
	~CUploadNoteFileInfo();
};