//---------------------------------------------------------------------------

#ifndef CDSImageFH
#define CDSImageFH
//---------------------------------------------------------------------------
#include <Classes.hpp>
#include <stdio.h>
#include <ADODB.hpp>
#include <DB.hpp>
#include <SyncObjs.hpp>
#include <ExtCtrls.hpp>
#include <jpeg.hpp>
#include <GIFimg.hpp>
//---------------------------------------------------------------------------
#include "ITSLibF.h"
#include "CDSItsObjectF.h"
//---------------------------------------------------------------------------

// VMS 이미지 타입
typedef enum en_vms_image_type
{
	vms_image_type_bmp,			/* 0:비트맵 */
	vms_image_type_gif,			/* 1:GIF */
	vms_image_type_jpg,			/* 2:JPG */
	vms_image_type_pcx,			/* 3:PCX */
	vms_image_type_video, 		/* 4:동영상 비디오 */
} EN_VMS_IMAGE_TYPE;

//---------------------------------------------------------------------------
class TCDSImageCell
{
public:
    TCDSImageCell();
    ~TCDSImageCell();

public:
    AnsiString SYMB_LIB_NMBR;   //NUMBER(4)	    N	0		심벌라이브러리 번호
    int        CELL_ID;         //NUMBER(4)	    N			셀 ID
    int        POSX;            //NUMBER(4)	    Y	0		이미지내 셀좌표 X
    int        POSY;            //NUMBER(4)	    Y	0		이미지내 셀좌표 Y
    AnsiString VMS_IFSC_ID;     //NUMBER(10)	Y			VMS 정보제공구간 ID
};

//---------------------------------------------------------------------------
#define MAX_GRADE_SYNB  4

class TCDSImage
{
public:
    TCDSImage();
    ~TCDSImage();

public:
	AnsiString  SYMB_LIB_NMBR;  //	N	NUMBER(4)	    N			심벌라이브러리 번호
    TImage     *IMAG_DATA;      //	N	BLOB	        Y			이미지 데이터(동영상인경우 썸네일)
	AnsiString  SYMB_FILE_NM;   //	N	VARCHAR2(60)	Y			심벌 파일 명
	AnsiString  SYMB_TYPE;      //	N	VARCHAR2(5)	    Y			심벌 유형(SBT0:일반심벌이미지,SBT1:소통정보배경,SBT2:소통정보이미지,SBT3:동영상)
    int         IMAG_SIZE;      //	N	NUMBER(10)	    Y	0		이미지 사이즈
    int         PLAY_TM;        //	N	NUMBER(10)	    Y	0		동영상 플레이 시간
	AnsiString  UPDT_DT;        //	N	VARCHAR2(14)	N	TO_CHAR(sysdate, 'YYYYMMDDHH24MISS')		갱신 일시
	int         Type;

    AnsiString  LocalFileName;  // 저장되어 있는 파일명
    AnsiString  FtpFileName;    // Ftp로 다운로드돼야할 파일명

    AnsiString  GRAD_SYMB_LIB_NMBR[MAX_GRADE_SYNB];

public:
    TItsMap<int, TCDSImageCell*> FLists;

    void Clear();
};
//---------------------------------------------------------------------------

//---------------------------------------------------------------------------
class TCDSImageManager : public TCDSItsObject
{
public:
    TCDSImageManager();
    ~TCDSImageManager();

private:

public:
    TItsMap<AnsiString, TCDSImage*> FLists;

private:
    int LoadVmsSymbolCellInfo(TADOConnection *ADbConn);

public:
    int LoadVmsSymbolInfo(TADOConnection *ADbConn);
};
//---------------------------------------------------------------------------
extern TCDSImageManager *CDSImageManager;
typedef std::map<AnsiString, TCDSImage*>::iterator ImageItr;
//---------------------------------------------------------------------------

#endif
