123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891 |
- #pragma once
- #include "DelegateArg.hpp"
- #include "WString.hpp"
- #ifndef _DELEGATEARG_DLL
- #define DELEGATEARG_API _declspec(dllimport)
- #else
- #define DELEGATEARG_API _declspec(dllexport)
- #endif
- #pragma warning (disable : 4275)
- class DDateTime;
- namespace ECOM
- {
- namespace DICOM
- {
- class DICOMDataSet;
- class DICOMFile;
- class DICOMCommandSet;
- }
- }
- class ImageShow;
- class DicomFileHolder;
- class DString;
- class DStringArray;
- struct __EventArg_DWString
- {
- DString m_sString;
- WString m_wString;
- __EventArg_DWString ()
- {
- }
- __EventArg_DWString (const __EventArg_DWString & from)
- {
- m_sString = from.m_sString;
- m_wString = from.m_wString;
- }
- void Set (const DString & str) { m_sString = str; }
- void Set (const WString & str) { m_wString = str; }
- template <typename T> T Get () const { }
- template <> DString Get () const { return m_sString; }
- template <> WString Get () const { return m_wString; }
- template <typename T> T GetAs () const { }
- template <> DString GetAs () const { if (m_sString.GetLength () > 0) return m_sString; return m_wString.ToDString (); }
- template <> WString GetAs () const { if (m_wString.GetLength () > 0) return m_wString; return WString (m_sString); }
- __EventArg_DWString & operator = (const DString & str)
- {
- Set (str);
- return (*this);
- }
- __EventArg_DWString & operator = (const WString & str)
- {
- Set (str);
- return (*this);
- }
- __EventArg_DWString & operator = (const __EventArg_DWString & from)
- {
- if (this == &from) return (*this);
- m_sString = from.m_sString;
- m_wString = from.m_wString;
- return (*this);
- }
- inline operator DString () const
- {
- return GetAs <DString> ();
- }
- inline operator WString () const
- {
- return GetAs <WString> ();
- }
- };
- //-----------------------------------------------------------------------------
- // A general DelegateArg of Error
- //-----------------------------------------------------------------------------
- class DELEGATEARG_API EventArgs_Error : public DelegateArgs
- {
- typedef DelegateArgs inherited;
- DECLARE_RTTI (EventArgs_Error)
- public:
- inline EventArgs_Error (int ec)
- {
- iReserved1 = iReserved2 = iReserved3 = iReserved4 = 0;
- ErrorCode = ec;
- }
- inline EventArgs_Error (int ec, const DString & Msg)
- {
- iReserved1 = iReserved2 = iReserved3 = iReserved4 = 0;
- ErrorCode = ec;
- Message = Msg;
- }
- inline EventArgs_Error (int ec, const WString & Msg)
- {
- iReserved1 = iReserved2 = iReserved3 = iReserved4 = 0;
- ErrorCode = ec;
- Message = Msg;
- }
- inline EventArgs_Error (int ec, const DString & Msg, const DString & Src)
- {
- iReserved1 = iReserved2 = iReserved3 = iReserved4 = 0;
- ErrorCode = ec;
- Message = Msg;
- Source = Src;
- }
- public:
- int ErrorCode; // 错误代码
- int iReserved1; // 保留
- int iReserved2; // 保留
- int iReserved3; // 保留
- int iReserved4; // 保留
- DString sReserved1; // 保留
- DString sReserved2; // 保留
- WString wReserved1; // 保留
- WString wReserved2; // 保留
- public:
- __EventArg_DWString Message; // 错误信息
- __EventArg_DWString Detail; // 错误的详细信息
- __EventArg_DWString Comment; // 说明或注释
- __EventArg_DWString Suggestion; // 建议采取的动作
- __EventArg_DWString Source; // 发生错误的位置 (源代码文件名,行号,模块名,类名,函数名,等)
- };
- //-----------------------------------------------------------------------------
- // A general DelegateArg of Pointer
- //-----------------------------------------------------------------------------
- class DELEGATEARG_API EventArgs_Pointer : public DelegateArgs
- {
- typedef DelegateArgs inherited;
- DECLARE_RTTI (EventArgs_Pointer)
- public:
- inline EventArgs_Pointer (void * ptr)
- {
- m_Pointer = ptr;
- }
- public:
- void * m_Pointer;
- };
- //-----------------------------------------------------------------------------
- // A general DelegateArg of DateTime
- //-----------------------------------------------------------------------------
- class DELEGATEARG_API EventArgs_DateTime : public DelegateArgs
- {
- typedef DelegateArgs inherited;
- DECLARE_RTTI (EventArgs_DateTime)
- public:
- inline EventArgs_DateTime (DDateTime * Now)
- {
- m_pNow = Now;
- }
- public:
- const DDateTime * m_pNow;
- };
- //-----------------------------------------------------------------------------
- // A general DelegateArg of int
- //-----------------------------------------------------------------------------
- class DELEGATEARG_API EventArgs_Int : public DelegateArgs
- {
- typedef DelegateArgs inherited;
- DECLARE_RTTI (EventArgs_Int)
- public:
- inline EventArgs_Int (int i)
- {
- m_int = i;
- }
- public:
- int m_int;
- };
- class DELEGATEARG_API EventArgs_2Int : public DelegateArgs
- {
- typedef DelegateArgs inherited;
- DECLARE_RTTI (EventArgs_2Int)
- public:
- inline EventArgs_2Int (int i1, int i2)
- {
- m_int1 = i1;
- m_int2 = i2;
- }
- public:
- int m_int1;
- int m_int2;
- };
- class DELEGATEARG_API EventArgs_3Int : public DelegateArgs
- {
- typedef DelegateArgs inherited;
- DECLARE_RTTI (EventArgs_3Int)
- public:
- inline EventArgs_3Int (int i1, int i2, int i3)
- {
- m_int1 = i1;
- m_int2 = i2;
- m_int3 = i3;
- }
- public:
- int m_int1;
- int m_int2;
- int m_int3;
- };
- class DELEGATEARG_API EventArgs_4Int : public DelegateArgs
- {
- typedef DelegateArgs inherited;
- DECLARE_RTTI (EventArgs_4Int)
- public:
- inline EventArgs_4Int (int i1, int i2, int i3, int i4)
- {
- m_int1 = i1;
- m_int2 = i2;
- m_int3 = i3;
- m_int4 = i4;
- }
- public:
- int m_int1;
- int m_int2;
- int m_int3;
- int m_int4;
- };
- class DELEGATEARG_API EventArgs_5Int : public DelegateArgs
- {
- typedef DelegateArgs inherited;
- DECLARE_RTTI (EventArgs_5Int)
- public:
- inline EventArgs_5Int (int i1, int i2, int i3, int i4, int i5)
- {
- m_int1 = i1;
- m_int2 = i2;
- m_int3 = i3;
- m_int4 = i4;
- m_int5 = i5;
- }
- public:
- int m_int1;
- int m_int2;
- int m_int3;
- int m_int4;
- int m_int5;
- };
- //-----------------------------------------------------------------------------
- // A general DelegateArg of double
- //-----------------------------------------------------------------------------
- class DELEGATEARG_API EventArgs_Double : public DelegateArgs
- {
- typedef DelegateArgs inherited;
- DECLARE_RTTI (EventArgs_Double)
- public:
- inline EventArgs_Double (double d)
- {
- m_double = d;
- }
- public:
- double m_double;
- };
- //-----------------------------------------------------------------------------
- // A general DelegateArg of DString
- //-----------------------------------------------------------------------------
- class DELEGATEARG_API EventArgs_String : public DelegateArgs
- {
- typedef DelegateArgs inherited;
- DECLARE_RTTI (EventArgs_String)
- public:
- inline EventArgs_String (DString s)
- {
- m_String = s;
- }
- public:
- DString m_String;
- };
- class DELEGATEARG_API EventArgs_2String : public EventArgs_String
- {
- typedef EventArgs_String inherited;
- DECLARE_RTTI (EventArgs_2String)
- public:
- inline EventArgs_2String (DString s1, DString s2) : inherited (s1), m_String1 (s1)
- {
- m_String2 = s2;
- }
- public:
- DString & m_String1;
- DString m_String2;
- };
- class DELEGATEARG_API EventArgs_4String : public DelegateArgs
- {
- typedef DelegateArgs inherited;
- DECLARE_RTTI (EventArgs_4String)
- public:
- DString m_String [4];
- };
- class DELEGATEARG_API EventArgs_8String : public DelegateArgs
- {
- typedef DelegateArgs inherited;
- DECLARE_RTTI (EventArgs_8String)
- public:
- EventArgs_8String ()
- {
- }
- EventArgs_8String (const EventArgs_8String & from)
- {
- from.CopyTo (*this);
- }
- public:
- DString m_String [8];
- public:
- void CopyTo (EventArgs_8String & to) const
- {
- for (int Index=0; Index<8; Index++)
- {
- to.m_String [Index] = m_String [Index];
- }
- }
- bool IsEqual (const EventArgs_8String & to) const
- {
- for (int Index=0; Index<8; Index++)
- {
- if (to.m_String [Index] != m_String [Index])
- return false;
- }
- return true;
- }
- EventArgs_8String & operator = (const EventArgs_8String & from)
- {
- from.CopyTo (*this);
- return (*this);
- }
- };
- inline bool __stdcall operator == (const EventArgs_8String& s1, const EventArgs_8String& s2)
- {
- return s1.IsEqual (s2);
- }
- //-----------------------------------------------------------------------------
- // A general DelegateArg of WString
- //-----------------------------------------------------------------------------
- class DELEGATEARG_API EventArgs_WString : public DelegateArgs
- {
- typedef DelegateArgs inherited;
- DECLARE_RTTI (EventArgs_WString)
- public:
- inline EventArgs_WString (WString s)
- {
- m_String = s;
- }
- public:
- WString m_String;
- };
- class DELEGATEARG_API EventArgs_2WString : public EventArgs_WString
- {
- typedef EventArgs_WString inherited;
- DECLARE_RTTI (EventArgs_2WString)
- public:
- inline EventArgs_2WString (WString s1, WString s2) : inherited (s1), m_String1 (s1)
- {
- m_String2 = s2;
- }
- public:
- WString & m_String1;
- WString m_String2;
- };
- //-----------------------------------------------------------------------------
- // A general DelegateArg of DString & WString
- //-----------------------------------------------------------------------------
- class DELEGATEARG_API EventArgs_DWString : public DelegateArgs
- {
- typedef DelegateArgs inherited;
- DECLARE_RTTI (EventArgs_DWString)
- public:
- inline EventArgs_DWString (WString ws, DString ds)
- {
- m_wString = ws;
- m_dString = ds;
- }
- public:
- WString m_wString;
- DString m_dString;
- };
- class DELEGATEARG_API EventArgs_2DWString : public EventArgs_DWString
- {
- typedef EventArgs_DWString inherited;
- DECLARE_RTTI (EventArgs_2DWString)
- public:
- inline EventArgs_2DWString (WString ws1, DString ds1, WString ws2, DString ds2) :
- inherited (ws1, ds1),
- m_wString1 (ws1),
- m_dString1 (ds1)
- {
- m_wString2 = ws2;
- m_dString2 = ds2;
- }
- public:
- WString & m_wString1;
- DString & m_dString1;
- WString m_wString2;
- DString m_dString2;
- };
- //-----------------------------------------------------------------------------
- // A general DelegateArg of DICOM DataSet
- //-----------------------------------------------------------------------------
- class DELEGATEARG_API EventArgs_DataSet : public DelegateArgs
- {
- typedef DelegateArgs inherited;
- DECLARE_RTTI (EventArgs_DataSet)
- public:
- inline EventArgs_DataSet (const ECOM::DICOM::DICOMDataSet * dds)
- {
- m_DDS = dds;
- }
- public:
- const ECOM::DICOM::DICOMDataSet * m_DDS;
- };
- class DELEGATEARG_API EventArgs_DataSetEx : public EventArgs_DataSet
- {
- typedef EventArgs_DataSet inherited;
- DECLARE_RTTI (EventArgs_DataSetEx)
- public:
- inline EventArgs_DataSetEx (const ECOM::DICOM::DICOMDataSet * DDS, DString LocalAE, DString RemoteAE)
- : inherited (DDS)
- {
- m_LocalAETitle = LocalAE;
- m_RemoteAETitle = RemoteAE;
- }
- public:
- DString m_LocalAETitle;
- DString m_RemoteAETitle;
- };
- /*
- class DELEGATEARG_API EventArgs_DataSetEx2 : public EventArgs_DataSetEx
- {
- typedef EventArgs_DataSetEx inherited;
- DECLARE_RTTI (EventArgs_DataSetEx2)
- public:
- inline EventArgs_DataSetEx2 (const DICOMDataSet * DDS, DString LocalAE, DString RemoteAE)
- : inherited (DDS, LocalAE, RemoteAE)
- {
- Reverse1 = Reverse2 = Reverse3 = Reverse4 = 0;
- }
- public:
- DWORD Reverse1;
- DWORD Reverse2;
- DWORD Reverse3;
- DWORD Reverse4;
- };
- */
- #if 0
- //-----------------------------------------------------------------------------
- // A general DelegateArg of FileName
- //-----------------------------------------------------------------------------
- class DELEGATEARG_API EventArgs_FileName : public DelegateArgs
- {
- typedef DelegateArgs inherited;
- DECLARE_RTTI (EventArgs_FileName)
- public:
- inline EventArgs_FileName (WString FN)
- {
- m_FileName = FN;
- }
- public:
- WString m_FileName;
- };
- #else
- class DELEGATEARG_API EventArgs_FileName : public EventArgs_WString
- {
- typedef EventArgs_WString inherited;
- DECLARE_RTTI (EventArgs_FileName)
- public:
- inline EventArgs_FileName (WString FN) : inherited (FN), m_FileName (m_String)
- {
- }
- public:
- WString & m_FileName;
- };
- #endif
- //-----------------------------------------------------------------------------
- // A general DelegateArg of DICOMFile
- //-----------------------------------------------------------------------------
- class DELEGATEARG_API EventArgs_DicomFile : public DelegateArgs
- {
- typedef DelegateArgs inherited;
- DECLARE_RTTI (EventArgs_DicomFile)
- public:
- inline EventArgs_DicomFile (ECOM::DICOM::DICOMFile * DicomFile)
- {
- m_DicomFile = DicomFile;
- }
- public:
- ECOM::DICOM::DICOMFile * m_DicomFile;
- };
- class DELEGATEARG_API EventArgs_DicomFileEx : public EventArgs_DicomFile
- {
- typedef EventArgs_DicomFile inherited;
- DECLARE_RTTI (EventArgs_DicomFileEx)
- public:
- inline EventArgs_DicomFileEx (ECOM::DICOM::DICOMDataSet * DDS, ECOM::DICOM::DICOMFile * DicomFile) :
- EventArgs_DicomFile (DicomFile)
- {
- m_DDS = DDS;
- Reverse1 = Reverse2 = Reverse3 = Reverse4 = 0;
- }
- public:
- ECOM::DICOM::DICOMDataSet * m_DDS;
- public:
- DWORD Reverse1;
- DWORD Reverse2;
- DWORD Reverse3;
- DWORD Reverse4;
- };
- class DELEGATEARG_API EventArgs_DicomFile_ImportExport : public EventArgs_DicomFile
- {
- typedef EventArgs_DicomFile inherited;
- DECLARE_RTTI (EventArgs_DicomFile_ImportExport)
- public:
- inline EventArgs_DicomFile_ImportExport (
- ECOM::DICOM::DICOMFile * DicomFile,
- const char * Calling, const char * Called,
- const char * IP, const char * Port) :
- EventArgs_DicomFile (DicomFile)
- {
- m_Calling = Calling;
- m_Called = Called;
- m_IP = IP;
- m_Port = Port;
- }
- public:
- DString m_Calling;
- DString m_Called;
- DString m_IP;
- DString m_Port;
- };
- //-----------------------------------------------------------------------------
- // A general DelegateArg of DicomFileHolder
- //-----------------------------------------------------------------------------
- class DELEGATEARG_API EventArgs_DicomFileHolder : public DelegateArgs
- {
- typedef DelegateArgs inherited;
- DECLARE_RTTI (EventArgs_DicomFileHolder)
- public:
- inline EventArgs_DicomFileHolder (DicomFileHolder * holder)
- {
- m_pHolder = holder;
- }
- public:
- DicomFileHolder * m_pHolder;
- };
- #if 0
- //-----------------------------------------------------------------------------
- // A general DelegateArg of DicomFileHolder
- //-----------------------------------------------------------------------------
- class DELEGATEARG_API EventArgs_DicomFileHolderEx2 : public EventArgs_DicomFileHolder
- {
- typedef EventArgs_DicomFileHolder inherited;
- DECLARE_RTTI (EventArgs_DicomFileHolderEx2)
- public:
- inline EventArgs_DicomFileHolderEx2 (DicomFileHolder * holder) :
- EventArgs_DicomFileHolder (holder)
- {
- Row = 0;
- Col = 0;
- }
- public:
- int Row;
- int Col;
- };
- #endif
- //-----------------------------------------------------------------------------
- // A general DelegateArg of DICOM Connect
- //-----------------------------------------------------------------------------
- class DELEGATEARG_API EventArgs_Connect : public DelegateArgs
- {
- typedef DelegateArgs inherited;
- DECLARE_RTTI (EventArgs_Connect)
- public:
- inline EventArgs_Connect (void)
- {
- m_pCommandSet = NULL;
- m_bOK = true;
- }
- public:
- const ECOM::DICOM::DICOMCommandSet * m_pCommandSet;
- DString m_CallingAETitle;
- DString m_CalledAETitle;
- DString m_ConnectedNode;
- DString m_ConnectedPort;
- UINT32 m_ConnectionNumber;
- double m_ConnectedTime;
- bool m_bOK;
- };
- #if 0
- //-----------------------------------------------------------------------------
- // A general DelegateArg of EventArgs_2Arg
- //-----------------------------------------------------------------------------
- class DELEGATEARG_API EventArgs_2Arg : public DelegateArgs
- {
- typedef DelegateArgs inherited;
- DECLARE_RTTI (EventArgs_2Arg)
- public:
- inline EventArgs_2Arg (DelegateArgs * arg1, DelegateArgs * arg2)
- {
- m_Arg1 = arg1;
- m_Arg2 = arg2;
- }
- public:
- DelegateArgs * m_Arg1;
- DelegateArgs * m_Arg2;
- };
- //-----------------------------------------------------------------------------
- // A general DelegateArg of EventArgs_3Arg
- //-----------------------------------------------------------------------------
- class DELEGATEARG_API EventArgs_3Arg : public DelegateArgs
- {
- typedef DelegateArgs inherited;
- DECLARE_RTTI (EventArgs_3Arg)
- public:
- inline EventArgs_3Arg (DelegateArgs * arg1, DelegateArgs * arg2, DelegateArgs * arg3)
- {
- m_Arg1 = arg1;
- m_Arg2 = arg2;
- m_Arg3 = arg3;
- }
- public:
- DelegateArgs * m_Arg1;
- DelegateArgs * m_Arg2;
- DelegateArgs * m_Arg3;
- };
- //-----------------------------------------------------------------------------
- // A general DelegateArg of EventArgs_4Arg
- //-----------------------------------------------------------------------------
- class DELEGATEARG_API EventArgs_4Arg : public DelegateArgs
- {
- typedef DelegateArgs inherited;
- DECLARE_RTTI (EventArgs_4Arg)
- public:
- inline EventArgs_4Arg (
- DelegateArgs * arg1, DelegateArgs * arg2,
- DelegateArgs * arg3, DelegateArgs * arg4)
- {
- m_Arg1 = arg1;
- m_Arg2 = arg2;
- m_Arg3 = arg3;
- m_Arg4 = arg4;
- }
- public:
- DelegateArgs * m_Arg1;
- DelegateArgs * m_Arg2;
- DelegateArgs * m_Arg3;
- DelegateArgs * m_Arg4;
- };
- //-----------------------------------------------------------------------------
- // A general DelegateArg of EventArgs_6Arg
- //-----------------------------------------------------------------------------
- class DELEGATEARG_API EventArgs_6Arg : public DelegateArgs
- {
- typedef DelegateArgs inherited;
- DECLARE_RTTI (EventArgs_6Arg)
- public:
- inline EventArgs_6Arg (
- DelegateArgs * arg1, DelegateArgs * arg2,
- DelegateArgs * arg3, DelegateArgs * arg4,
- DelegateArgs * arg5, DelegateArgs * arg6)
- {
- m_Arg1 = arg1;
- m_Arg2 = arg2;
- m_Arg3 = arg3;
- m_Arg4 = arg4;
- m_Arg5 = arg5;
- m_Arg6 = arg6;
- }
- public:
- DelegateArgs * m_Arg1;
- DelegateArgs * m_Arg2;
- DelegateArgs * m_Arg3;
- DelegateArgs * m_Arg4;
- DelegateArgs * m_Arg5;
- DelegateArgs * m_Arg6;
- };
- //-----------------------------------------------------------------------------
- // A general DelegateArg of EventArgs_6Arg
- //-----------------------------------------------------------------------------
- class DELEGATEARG_API EventArgs_8Arg : public DelegateArgs
- {
- typedef DelegateArgs inherited;
- DECLARE_RTTI (EventArgs_8Arg)
- public:
- inline EventArgs_8Arg (
- DelegateArgs * arg1, DelegateArgs * arg2,
- DelegateArgs * arg3, DelegateArgs * arg4,
- DelegateArgs * arg5, DelegateArgs * arg6,
- DelegateArgs * arg7, DelegateArgs * arg8)
- {
- m_Arg1 = arg1;
- m_Arg2 = arg2;
- m_Arg3 = arg3;
- m_Arg4 = arg4;
- m_Arg5 = arg5;
- m_Arg6 = arg6;
- m_Arg7 = arg7;
- m_Arg8 = arg8;
- }
- public:
- DelegateArgs * m_Arg1;
- DelegateArgs * m_Arg2;
- DelegateArgs * m_Arg3;
- DelegateArgs * m_Arg4;
- DelegateArgs * m_Arg5;
- DelegateArgs * m_Arg6;
- DelegateArgs * m_Arg7;
- DelegateArgs * m_Arg8;
- };
- #endif
|