00001 /* 00002 * 00003 * Copyright (C) 1998-2005, OFFIS 00004 * 00005 * This software and supporting documentation were developed by 00006 * 00007 * Kuratorium OFFIS e.V. 00008 * Healthcare Information and Communication Systems 00009 * Escherweg 2 00010 * D-26121 Oldenburg, Germany 00011 * 00012 * THIS SOFTWARE IS MADE AVAILABLE, AS IS, AND OFFIS MAKES NO WARRANTY 00013 * REGARDING THE SOFTWARE, ITS PERFORMANCE, ITS MERCHANTABILITY OR 00014 * FITNESS FOR ANY PARTICULAR USE, FREEDOM FROM ANY COMPUTER DISEASES OR 00015 * ITS CONFORMITY TO ANY SPECIFICATION. THE ENTIRE RISK AS TO QUALITY AND 00016 * PERFORMANCE OF THE SOFTWARE IS WITH THE USER. 00017 * 00018 * Module: dcmpstat 00019 * 00020 * Author: Marco Eichelberg 00021 * 00022 * Purpose: 00023 * classes: DVPSPrintMessageHandler 00024 * 00025 * Last Update: $Author: meichel $ 00026 * Update Date: $Date: 2005/12/09 14:48:35 $ 00027 * CVS/RCS Revision: $Revision: 1.12 $ 00028 * Status: $State: Exp $ 00029 * 00030 * CVS/RCS Log at end of file 00031 * 00032 */ 00033 00034 #ifndef __DVPSPR_H__ 00035 #define __DVPSPR_H__ 00036 00037 #include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ 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 * $Log: dvpspr.h,v $ 00337 * Revision 1.12 2005/12/09 14:48:35 meichel 00338 * Added missing virtual destructors 00339 * 00340 * Revision 1.11 2005/12/08 16:03:57 meichel 00341 * Changed include path schema for all DCMTK header files 00342 * 00343 * Revision 1.10 2003/09/05 14:31:33 meichel 00344 * Print SCU now supports TLS connections. 00345 * 00346 * Revision 1.9 2001/10/12 13:46:52 meichel 00347 * Adapted dcmpstat to OFCondition based dcmnet module (supports strict mode). 00348 * 00349 * Revision 1.8 2001/06/01 15:50:19 meichel 00350 * Updated copyright header 00351 * 00352 * Revision 1.7 2000/06/02 16:00:50 meichel 00353 * Adapted all dcmpstat classes to use OFConsole for log and error output 00354 * 00355 * Revision 1.6 2000/03/08 16:28:55 meichel 00356 * Updated copyright header. 00357 * 00358 * Revision 1.5 1999/10/28 08:18:56 meichel 00359 * Print client does not attempt any more to negotiate Presentation LUT or 00360 * Annotation Box if config file says that the printer does not support them. 00361 * 00362 * Revision 1.4 1999/10/13 14:10:47 meichel 00363 * Now negotiation Basic Annotation Box SOP Class 00364 * 00365 * Revision 1.3 1999/09/24 15:23:47 meichel 00366 * Print spooler (dcmprtsv) now logs diagnostic messages in log files 00367 * when operating in spool mode. 00368 * 00369 * Revision 1.2 1999/09/17 14:33:58 meichel 00370 * Completed print spool functionality including Supplement 22 support 00371 * 00372 * Revision 1.1 1999/07/30 13:34:49 meichel 00373 * Added new classes managing Stored Print objects 00374 * 00375 * 00376 */