Alphabetical Class Index  Class Hierarchy   File Members   Compound Members   File List  

HIOUtilityPDF.h

00001 //
00002 // Copyright (c) 2000 by Tech Soft 3D, LLC.
00003 // The information contained herein is confidential and proprietary to
00004 // Tech Soft 3D, LLC., and considered a trade secret as defined under
00005 // civil and criminal statutes.  Tech Soft 3D shall pursue its civil
00006 // and criminal remedies in the event of unauthorized use or misappropriation
00007 // of its trade secrets.  Use of this information by anyone other than
00008 // authorized employees of Tech Soft 3D, LLC. is granted only under a
00009 // written non-disclosure agreement, expressly prescribing the scope and
00010 // manner of such use.
00011 //
00012 // $Id: 73d78d5d67523f5d81baeb3a785f8230b50d5792 $
00013 //
00014 
00015 #ifndef _HIOUTILITYPDF_H
00016 #define _HIOUTILITYPDF_H
00017 
00018 #ifdef H_PACK_8
00019 #pragma pack(push)
00020 #pragma pack(8)
00021 #endif
00022 
00023 #include "HTools.h"
00024 #include "HIOManager.h"
00025 #include "HDB.h"
00026 #include <string>
00027 #include <map>
00028 
00029 
00030 
00037 class MVO_API HU3DOptions
00038 {
00039 public:
00041     HU3DOptions() {Reset();};
00043     void Reset(){
00044         m_bExportLines = m_bExportAnnotations = false;
00045     };
00046 
00048     bool m_bExportLines;
00050     bool m_bExportAnnotations;
00051 
00053     bool ExportLines() const {return m_bExportLines;};
00055     void ExportLines(bool onoff) {m_bExportLines = onoff;};
00057     bool ExportAnnotations() const {return m_bExportAnnotations;};
00059     void ExportAnnotations(bool onoff) {m_bExportAnnotations = onoff;};
00060 };
00061 
00064 class MVO_API HIOUtilityPDF: public HOutputHandler
00065 {
00066 public:
00068     HIOUtilityPDF() { 
00069         SetOutputOps(HOutputOpFileOutputByKey);
00070     };
00071 
00072     ~HIOUtilityPDF() {;};
00073 
00076     const char * GetOutputName() { return "HIOUtilityPDF"; }
00077 
00079     void RegisterOutputHandlerTypes() {
00080         HC_Begin_Segment_Search("/driver/pdf");{
00081             char seg[100];
00082             while(HC_Find_Segment(seg)){
00083                 if(strieq(seg, "/driver/pdf")){
00084                     HIORegisterOutputType("pdf",this);
00085                     break;
00086                 }
00087             }
00088         }HC_End_Segment_Search();
00089     };
00090 
00092     const char * GetOutputTypesString() {return "pdf";};
00094     HOutputHandlerStyle GetOutputStyle() {return HOutputHandlerStyleHardcopy;};
00095 
00097     const char * GetOutputDefaultHSRA() {return "painters";};
00098 
00102     bool Has3dSupport(){
00103         return HDB::GetHIOManager()->GetOutputHandler("u3d") != 0;
00104     }
00105 
00112     HFileOutputResult FileOutputByKey(const __wchar_t * filename, HC_KEY key, HOutputHandlerOptions * options);
00113 
00114 #ifdef _MSC_VER
00115     HFileOutputResult FileOutputByKey(const unsigned short * filename, HC_KEY key, HOutputHandlerOptions * options){
00116         H_UTF16 utf16;
00117         utf16.encodedText((utf16_char const*) filename);
00118         return FileOutputByKey(H_WCS(utf16).encodedText(), key, options);
00119     }
00120 #endif
00121 
00122     HFileOutputResult FileOutputByKey(const char * filename, HC_KEY key, HOutputHandlerOptions * options){
00123         return FileOutputByKey(H_WCS(filename).encodedText(), key, options);
00124     }
00125 
00126 protected:
00133     HFileOutputResult FileOutputByKey2D(const __wchar_t * filename, HC_KEY key, HOutputHandlerOptions * options);
00134     HFileOutputResult FileOutputByKey2D(const char * filename, HC_KEY key, HOutputHandlerOptions * options){
00135         return FileOutputByKey2D((__wchar_t*)H_WCS(filename).encodedText(), key, options);
00136     }
00137 
00138 
00139 };
00140 
00141 
00142 #ifdef H_PACK_8
00143 #pragma pack(pop)
00144 #endif
00145 
00146 #endif