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, Joerg Riesmeier 00021 * 00022 * Purpose: 00023 * classes: DVConfiguration 00024 * 00025 * Last Update: $Author: meichel $ 00026 * Update Date: $Date: 2005/12/08 16:03:36 $ 00027 * CVS/RCS Revision: $Revision: 1.32 $ 00028 * Status: $State: Exp $ 00029 * 00030 * CVS/RCS Log at end of file 00031 * 00032 */ 00033 00034 00035 #ifndef DVPSCF_H 00036 #define DVPSCF_H 00037 00038 #include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ 00039 #include "dcmtk/ofstd/ofstring.h" /* for class OFString */ 00040 #include "dcmtk/dcmdata/dctypes.h" /* for Uint32 */ 00041 #include "dcmtk/dcmpstat/dvpstyp.h" /* for DVPS enums */ 00042 00043 class OFConfigFile; 00044 class OFConsole; 00045 00050 class DVConfiguration 00051 { 00052 public: 00053 00061 DVConfiguration(const char *config_file=NULL); 00062 00065 virtual ~DVConfiguration(); 00066 00067 /* access to communication partner data */ 00068 00074 Uint32 getNumberOfTargets(DVPSPeerType peerType=DVPSE_storage); 00075 00082 const char *getTargetID(Uint32 idx, DVPSPeerType peerType=DVPSE_storage); 00083 00090 const char *getTargetDescription(const char *targetID); 00091 00098 const char *getTargetHostname(const char *targetID); 00099 00106 unsigned short getTargetPort(const char *targetID); 00107 00114 DVPSPeerType getTargetType(const char *targetID); 00115 00122 const char *getTargetAETitle(const char *targetID); 00123 00130 unsigned long getTargetMaxPDU(const char *targetID); 00131 00138 Sint32 getTargetTimeout(const char *targetID); 00139 00146 OFBool getTargetImplicitOnly(const char *targetID); 00147 00154 OFBool getTargetDisableNewVRs(const char *targetID); 00155 00162 OFBool getTargetBitPreservingMode(const char *targetID); 00163 00170 OFBool getTargetCorrectUIDPadding(const char *targetID); 00171 00178 OFBool getTargetUseTLS(const char *targetID); 00179 00186 const char *getTargetCertificate(const char *targetID); 00187 00194 const char *getTargetPrivateKey(const char *targetID); 00195 00202 const char *getTargetPrivateKeyPassword(const char *targetID); 00203 00211 Uint32 getTargetNumberOfCipherSuites(const char *targetID); 00212 00221 const char *getTargetCipherSuite(const char *targetID, Uint32 idx, OFString& value); 00222 00229 DVPSCertificateVerificationType getTargetPeerAuthentication(const char *targetID); 00230 00237 const char *getTargetDiffieHellmanParameters(const char *targetID); 00238 00245 const char *getTargetRandomSeed(const char *targetID); 00246 00253 OFBool getTargetPrinterSupportsPresentationLUT(const char *targetID); 00254 00261 OFBool getTargetPrinterPresentationLUTMatchRequired(const char *targetID); 00262 00269 OFBool getTargetPrinterPresentationLUTPreferSCPRendering(const char *targetID); 00270 00277 OFBool getTargetPrinterPresentationLUTinFilmSession(const char *targetID); 00278 00286 OFBool getTargetPrinterSupports12BitTransmission(const char *targetID); 00287 00294 OFBool getTargetPrinterSupportsRequestedImageSize(const char *targetID); 00295 00302 OFBool getTargetPrinterSupportsDecimateCrop(const char *targetID); 00303 00310 OFBool getTargetPrinterSupportsTrim(const char *targetID); 00311 00319 Uint32 getTargetPrinterNumberOfBorderDensities(const char *targetID); 00320 00329 const char *getTargetPrinterBorderDensity(const char *targetID, Uint32 idx, OFString& value); 00330 00338 Uint32 getTargetPrinterNumberOfMaxDensities(const char *targetID); 00339 00348 const char *getTargetPrinterMaxDensity(const char *targetID, Uint32 idx, OFString& value); 00349 00357 Uint32 getTargetPrinterNumberOfMinDensities(const char *targetID); 00358 00367 const char *getTargetPrinterMinDensity(const char *targetID, Uint32 idx, OFString& value); 00368 00376 Uint32 getTargetPrinterNumberOfPortraitDisplayFormats(const char *targetID); 00377 00385 Uint32 getTargetPrinterPortraitDisplayFormatRows(const char *targetID, Uint32 idx); 00386 00394 Uint32 getTargetPrinterPortraitDisplayFormatColumns(const char *targetID, Uint32 idx); 00395 00403 OFBool getTargetPrinterSupportsAnnotation(const char *targetID); 00404 00411 OFBool getTargetPrinterSupportsAnnotationBoxSOPClass(const char *targetID); 00412 00419 OFBool getTargetPrinterSessionLabelAnnotation(const char *targetID); 00420 00428 const char *getTargetPrinterAnnotationDisplayFormatID(const char *targetID, OFString& value); 00429 00436 Uint16 getTargetPrinterAnnotationPosition(const char *targetID); 00437 00445 Uint32 getTargetPrinterNumberOfFilmSizeIDs(const char *targetID); 00446 00455 const char *getTargetPrinterFilmSizeID(const char *targetID, Uint32 idx, OFString& value); 00456 00464 Uint32 getTargetPrinterNumberOfMediumTypes(const char *targetID); 00465 00474 const char *getTargetPrinterMediumType(const char *targetID, Uint32 idx, OFString& value); 00475 00483 Uint32 getTargetPrinterNumberOfFilmDestinations(const char *targetID); 00484 00493 const char *getTargetPrinterFilmDestination(const char *targetID, Uint32 idx, OFString& value); 00494 00502 Uint32 getTargetPrinterNumberOfPrinterResolutionIDs(const char *targetID); 00503 00512 const char *getTargetPrinterResolutionID(const char *targetID, Uint32 idx, OFString& value); 00513 00521 Uint32 getTargetPrinterNumberOfMagnificationTypes(const char *targetID); 00522 00531 const char *getTargetPrinterMagnificationType(const char *targetID, Uint32 idx, OFString& value); 00532 00540 Uint32 getTargetPrinterNumberOfSmoothingTypes(const char *targetID); 00541 00550 const char *getTargetPrinterSmoothingType(const char *targetID, Uint32 idx, OFString& value); 00551 00558 Uint32 getTargetPrinterNumberOfConfigurationSettings(const char *targetID); 00559 00567 const char *getTargetPrinterConfigurationSetting(const char *targetID, Uint32 idx); 00568 00576 Uint32 getTargetPrinterNumberOfEmptyImageDensities(const char *targetID); 00577 00586 const char *getTargetPrinterEmptyImageDensity(const char *targetID, Uint32 idx, OFString& value); 00587 00594 OFBool getTargetPrintSCPOmitSOPClassUIDFromCreateResponse(const char *targetID); 00595 00596 /* general settings */ 00597 00603 const char *getLogFolder(); 00604 00610 const char *getLogFile(); 00611 00617 DVPSLogMessageLevel getLogLevel(); 00618 00625 unsigned short getMessagePort(); 00626 00633 OFBool getMessagePortKeepOpen(); 00634 00640 const char *getNetworkAETitle(); 00641 00646 OFBool getQueryRetrieveAutoCreateConfigFile(); 00647 00653 const char *getQueryRetrieveAETitle(); 00654 00659 unsigned short getQueryRetrievePort(); 00660 00665 unsigned long getQueryRetrieveMaxPDU(); 00666 00671 Sint32 getQueryRetrieveTimeout(); 00672 00677 unsigned long getQueryRetrieveMaxAssociations(); 00678 00684 const char *getDatabaseFolder(); 00685 00691 const char *getSpoolFolder(); 00692 00697 OFBool getDetailedLog(); 00698 00703 OFBool getBinaryLog(); 00704 00710 const char *getSenderName(); 00711 00717 const char *getReceiverName(); 00718 00723 const char *getQueryRetrieveServerName(); 00724 00730 const char *getSpoolerName(); 00731 00737 const char *getPrintServerName(); 00738 00744 const char *getDumpToolName(); 00745 00751 const char *getCheckToolName(); 00752 00757 unsigned long getSpoolerSleep(); 00758 00763 OFBool getSpoolerDeletePrintJobs(); 00764 00769 OFBool getSpoolerAlwaysDeleteTerminateJobs(); 00770 00776 const char *getMonitorCharacteristicsFile(); 00777 00781 double getMonitorPixelWidth(); 00782 00786 double getMonitorPixelHeight(); 00787 00792 Uint32 getMaxPreviewResolutionX(); 00793 00798 Uint32 getMaxPreviewResolutionY(); 00799 00807 const char *getGUIConfigEntry(const char *key); 00808 00818 OFBool getGUIConfigEntryBool(const char *key, OFBool dfl); 00819 00825 const char *getLUTFolder(); 00826 00832 const char *getReportFolder(); 00833 00834 /* Presentation Look Up Tables (LUTs) */ 00835 00839 Uint32 getNumberOfLUTs(); 00840 00846 const char *getLUTID(Uint32 idx); 00847 00853 const char *getLUTDescription(const char *lutID); 00854 00860 const char *getLUTFilename(const char *lutID); 00861 00862 /* Structured Reporting (SR) "templates" */ 00863 00867 Uint32 getNumberOfReports(); 00868 00874 const char *getReportID(Uint32 idx); 00875 00882 const char *getReportDescription(const char *reportID); 00883 00890 const char *getReportFilename(const char *reportID); 00891 00892 /* general print settings */ 00893 00898 Uint32 getMinPrintResolutionX(); 00899 00904 Uint32 getMinPrintResolutionY(); 00905 00910 Uint32 getMaxPrintResolutionX(); 00911 00916 Uint32 getMaxPrintResolutionY(); 00917 00922 Uint16 getDefaultPrintIllumination(); 00923 00928 Uint16 getDefaultPrintReflection(); 00929 00930 /* VOI settings */ 00931 00936 Uint32 getNumberOfVOIPresets(const char *modality); 00937 00943 const char *getVOIPresetDescription(const char *modality, Uint32 idx); 00944 00950 double getVOIPresetWindowCenter(const char *modality, Uint32 idx); 00951 00957 double getVOIPresetWindowWidth(const char *modality, Uint32 idx); 00958 00959 /* TLS settings */ 00960 00965 const char *getTLSFolder(); 00966 00971 const char *getTLSCACertificateFolder(); 00972 00978 OFBool getTLSPEMFormat(); 00979 00980 /* User login settings */ 00981 00986 const char *getUserCertificateFolder(); 00987 00991 Uint32 getNumberOfUsers(); 00992 00998 const char *getUserID(Uint32 idx); 00999 01005 const char *getUserLogin(const char *userID); 01006 01012 const char *getUserName(const char *userID); 01013 01019 const char *getUserDICOMName(const char *userID); 01020 01026 const char *getUserOrganization(const char *userID); 01027 01033 const char *getUserCodingSchemeDesignator(const char *userID, OFString& value); 01034 01040 const char *getUserCodingSchemeVersion(const char *userID, OFString& value); 01041 01047 const char *getUserCodeValue(const char *userID, OFString& value); 01048 01054 const char *getUserCodeMeaning(const char *userID, OFString& value); 01055 01061 const char *getUserCertificate(const char *userID); 01062 01068 const char *getUserPrivateKey(const char *userID); 01069 01070 /* Other settings */ 01071 01077 virtual void setLog(OFConsole *stream, OFBool verbMode, OFBool dbgMode); 01078 01079 protected: 01080 01083 OFConsole *logstream; 01084 01087 OFBool verboseMode; 01088 01091 OFBool debugMode; 01092 01093 private: 01094 01097 DVConfiguration(const DVConfiguration&); 01098 01101 DVConfiguration& operator=(const DVConfiguration&); 01102 01109 const char *getConfigEntry(const char *l2_key, const char *l1_key, const char *l0_key); 01110 01118 OFBool getConfigBoolEntry(const char *l2_key, const char *l1_key, const char *l0_key, OFBool deflt); 01119 01120 /* member variables */ 01121 01125 OFConfigFile *pConfig; 01126 01127 }; 01128 01129 #endif 01130 01131 /* 01132 * CVS/RCS Log: 01133 * $Log: dvpscf.h,v $ 01134 * Revision 1.32 2005/12/08 16:03:36 meichel 01135 * Changed include path schema for all DCMTK header files 01136 * 01137 * Revision 1.31 2003/04/29 10:13:56 meichel 01138 * Moved configuration file parser from module dcmpstat to ofstd and renamed 01139 * class to OFConfigFile. Cleaned up implementation (no more friend declarations). 01140 * 01141 * Revision 1.30 2002/11/29 13:16:31 meichel 01142 * Introduced new command line option --timeout for controlling the 01143 * connection request timeout. 01144 * 01145 * Revision 1.29 2002/11/25 18:27:39 meichel 01146 * Converted compile time option to leniently handle space padded UIDs 01147 * in the Storage Service Class into command line / config file option. 01148 * 01149 * Revision 1.28 2001/06/01 15:50:12 meichel 01150 * Updated copyright header 01151 * 01152 * Revision 1.27 2000/11/13 14:20:54 joergr 01153 * Updated comments. 01154 * 01155 * Revision 1.26 2000/11/13 11:52:41 meichel 01156 * Added support for user logins and certificates. 01157 * 01158 * Revision 1.25 2000/11/13 10:42:39 joergr 01159 * Added support for Structured Reporting "templates". 01160 * 01161 * Revision 1.24 2000/10/10 12:23:40 meichel 01162 * Added extensions for TLS encrypted communication 01163 * 01164 * Revision 1.23 2000/06/21 15:40:57 meichel 01165 * Added DICOMscope support for calling the Presentation State Checker. 01166 * 01167 * Revision 1.22 2000/06/07 14:16:21 joergr 01168 * Added configuration file entry "LogLevel" to filter log messages. 01169 * 01170 * Revision 1.21 2000/06/07 13:17:45 meichel 01171 * added binary and textual log facilities to Print SCP. 01172 * 01173 * Revision 1.20 2000/06/06 09:42:48 joergr 01174 * Moved configuration file entry "LogDirectory" from "[PRINT]" to new 01175 * (more general) section "[APPLICATION]". 01176 * 01177 * Revision 1.19 2000/06/05 16:22:27 joergr 01178 * Implemented log message methods. 01179 * 01180 * Revision 1.18 2000/06/02 16:00:43 meichel 01181 * Adapted all dcmpstat classes to use OFConsole for log and error output 01182 * 01183 * Revision 1.17 2000/06/02 13:53:54 joergr 01184 * Implemented start/terminatePrintServer methods. 01185 * 01186 * Revision 1.16 2000/06/02 12:41:51 joergr 01187 * Corrected wrong interface descriptions. 01188 * 01189 * Revision 1.15 2000/05/31 12:56:37 meichel 01190 * Added initial Print SCP support 01191 * 01192 * Revision 1.14 2000/05/30 13:40:02 joergr 01193 * Removed methods which were already marked as "retired". 01194 * Added new section to the config file describing the query/retrieve server 01195 * settings. 01196 * 01197 * Revision 1.13 2000/03/08 16:28:49 meichel 01198 * Updated copyright header. 01199 * 01200 * Revision 1.12 1999/11/03 13:05:32 meichel 01201 * Added support for transmitting annotations in the film session label. 01202 * Added support for dump tool launched from DVInterface. 01203 * 01204 * Revision 1.11 1999/10/20 10:47:14 joergr 01205 * Added support for a down-scaled preview image of the current DICOM image 01206 * (e.g. useful for online-windowing or print preview). 01207 * 01208 * Revision 1.10 1999/10/19 14:46:02 meichel 01209 * added support for the Basic Annotation Box SOP Class 01210 * as well as access methods for Max Density and Min Density. 01211 * 01212 * Revision 1.9 1999/10/13 14:11:56 meichel 01213 * Added config file entries and access methods 01214 * for user-defined VOI presets, log directory, verbatim logging 01215 * and an explicit list of image display formats for each printer. 01216 * 01217 * Revision 1.8 1999/10/07 17:21:46 meichel 01218 * Reworked management of Presentation LUTs in order to create tighter 01219 * coupling between Softcopy and Print. 01220 * 01221 * Revision 1.7 1999/10/01 13:32:36 joergr 01222 * Added new option to config file: AlwaysDeleteTerminateJobs. 01223 * 01224 * Revision 1.6 1999/09/24 15:24:29 meichel 01225 * Added support for CP 173 (Presentation LUT clarifications) 01226 * 01227 * Revision 1.5 1999/09/23 17:37:13 meichel 01228 * Added support for Basic Film Session options to dcmpstat print code. 01229 * 01230 * Revision 1.4 1999/09/15 17:43:26 meichel 01231 * Implemented print job dispatcher code for dcmpstat, adapted dcmprtsv 01232 * and dcmpsprt applications. 01233 * 01234 * Revision 1.3 1999/09/13 15:19:09 meichel 01235 * Added implementations for a number of further print API methods. 01236 * 01237 * Revision 1.2 1999/09/10 12:46:45 meichel 01238 * Added implementations for a number of print API methods. 01239 * 01240 * Revision 1.1 1999/09/08 16:42:02 meichel 01241 * Moved configuration file evaluation to separate class. 01242 * 01243 * 01244 */