00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034 #ifndef __DVPSPR_H__
00035 #define __DVPSPR_H__
00036
00037 #include "dcmtk/config/osconfig.h"
00038 #include "dcmtk/dcmdata/dctk.h"
00039 #include "dcmtk/dcmnet/dimse.h"
00040
00044 class DVPSPrintEventHandler
00045 {
00046 public:
00047
00049 virtual ~DVPSPrintEventHandler() {}
00050
00062 virtual DIC_US handleEvent(
00063 T_DIMSE_N_EventReportRQ& eventMessage,
00064 DcmDataset *eventInformation,
00065 DcmDataset *statusDetail)=0;
00066 };
00067
00071 class DVPSPrintMessageHandler
00072 {
00073 public:
00075 DVPSPrintMessageHandler();
00076
00078 virtual ~DVPSPrintMessageHandler();
00079
00094 OFCondition createRQ(
00095 const char *sopclassUID,
00096 OFString& sopinstanceUID,
00097 DcmDataset *attributeListIn,
00098 Uint16& status,
00099 DcmDataset* &attributeListOut);
00100
00114 OFCondition setRQ(
00115 const char *sopclassUID,
00116 const char *sopinstanceUID,
00117 DcmDataset *modificationList,
00118 Uint16& status,
00119 DcmDataset* &attributeListOut);
00120
00136 OFCondition getRQ(
00137 const char *sopclassUID,
00138 const char *sopinstanceUID,
00139 const Uint16 *attributeIdentifierList,
00140 size_t numShorts,
00141 Uint16& status,
00142 DcmDataset* &attributeListOut);
00143
00158 OFCondition actionRQ(
00159 const char *sopclassUID,
00160 const char *sopinstanceUID,
00161 Uint16 actionTypeID,
00162 DcmDataset *actionInformation,
00163 Uint16& status,
00164 DcmDataset* &actionReply);
00165
00174 OFCondition deleteRQ(
00175 const char *sopclassUID,
00176 const char *sopinstanceUID,
00177 Uint16& status);
00178
00197 OFCondition negotiateAssociation(
00198 DcmTransportLayer *tlayer,
00199 const char *myAEtitle,
00200 const char *peerAEtitle,
00201 const char *peerHost,
00202 int peerPort,
00203 long peerMaxPDU,
00204 OFBool negotiatePresentationLUT,
00205 OFBool negotiateAnnotationBox,
00206 OFBool implicitOnly);
00207
00211 OFCondition releaseAssociation();
00212
00216 OFCondition abortAssociation();
00217
00221 void setEventHandler(DVPSPrintEventHandler *handler) { eventHandler = handler; }
00222
00227 void setTimeout(T_DIMSE_BlockingMode blocking, int timeOut) { blockMode=blocking; timeout=timeOut; }
00228
00233 OFBool printerSupportsPresentationLUT();
00234
00239 OFBool printerSupportsAnnotationBox();
00240
00244 void setDumpStream(ostream *stream=NULL)
00245 {
00246 dumpStream = stream;
00247 }
00248
00254 void setLog(OFConsole *stream, OFBool verbMode, OFBool dbgMode);
00255
00256 private:
00257
00259 DVPSPrintMessageHandler(const DVPSPrintMessageHandler& copy);
00261 DVPSPrintMessageHandler& operator=(const DVPSPrintMessageHandler& copy);
00262
00278 OFCondition sendNRequest(
00279 T_ASC_PresentationContextID presId,
00280 T_DIMSE_Message &request,
00281 DcmDataset *rqDataSet,
00282 T_DIMSE_Message &response,
00283 DcmDataset* &statusDetail,
00284 DcmDataset* &rspDataset);
00285
00292 T_ASC_PresentationContextID findAcceptedPC(const char *sopclassuid);
00293
00299 void dumpNMessage(T_DIMSE_Message &msg, DcmItem *dataset, OFBool outgoing);
00300
00302 T_ASC_Association *assoc;
00303
00305 T_ASC_Network *net;
00306
00308 DVPSPrintEventHandler *eventHandler;
00309
00311 T_DIMSE_BlockingMode blockMode;
00312
00314 int timeout;
00315
00317 ostream *dumpStream;
00318
00321 OFConsole *logstream;
00322
00325 OFBool verboseMode;
00326
00329 OFBool debugMode;
00330
00331 };
00332
00333 #endif
00334
00335
00336
00337
00338
00339
00340
00341
00342
00343
00344
00345
00346
00347
00348
00349
00350
00351
00352
00353
00354
00355
00356
00357
00358
00359
00360
00361
00362
00363
00364
00365
00366
00367
00368
00369
00370
00371
00372
00373
00374
00375
00376