00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024 #ifndef PO_PRINT_MONITOR_H
00025 #define PO_PRINT_MONITOR_H
00026
00027 #include <SoVersion.h>
00028
00029 #ifdef _WIN32
00030 # if defined(_DEBUG)
00031 # define __HARDCOPYWDLL "HardCopyWinD.dll"
00032 # define __HARDCOPYWLIB "HardCopyWinD.lib"
00033 # else
00034 # define __HARDCOPYWDLL "HardCopyWin.dll"
00035 # define __HARDCOPYWLIB "HardCopyWin.lib"
00036 # endif
00037 #ifndef HardCopyWin_EXPORTS
00038 #ifndef OIV_DISABLE_AUTOLINK
00039 # pragma comment(lib,__HARDCOPYWLIB)
00040 #endif
00041 #endif
00042 #else
00043 # define __HARDCOPYWDLL "libHardCopyXt"
00044 #endif
00045
00046 #include <Inventor/SbLinear.h>
00047 #include <Inventor/Xt/SoXtComponent.h>
00048
00049 #include <HardCopy/SoVectorizeAction.h>
00050 #include <Inventor/dialog/PoXtDialog.h>
00051 class SoNode;
00052 class SoPath;
00053 class dialogRgbHsvControl;
00054
00055 #include <Inventor/SoModule.h>
00056 #if defined(_WIN32)
00057 SO_MODULE_HEADER(SoHardCopyWin, __HARDCOPYWDLL)
00058 #else
00059 SO_MODULE_HEADER(SoHardCopyXt, __HARDCOPYWDLL)
00060 #endif
00061
00062 struct menuColumn;
00063 class SoDEPRECATED PoPrintMonitor : public SoXtComponent {
00077
00078 public:
00079
00080 typedef void PoPrintMonitorCB(void *userData, PoPrintMonitor *action);
00081
00082 enum PrintDialogMask {
00083 NO_PRINT_MASK = 0x00000000,
00084
00085 UNIT = 0x00000001,
00086
00087 GEOMETRY_WIDTH = 0x00000002,
00088 GEOMETRY_HEIGHT = 0x00000004,
00089 GEOMETRY_POS_X = 0x00000008,
00090 GEOMETRY_POS_Y = 0x00000010,
00096 GEOMETRY = GEOMETRY_WIDTH | GEOMETRY_HEIGHT | GEOMETRY_POS_X | GEOMETRY_POS_Y,
00097
00098 ORIENTATION = 0x00000020,
00099
00100 BORDER_WIDTH = 0x00000040,
00101 BORDER_COLOR = 0x00000080,
00105 BORDER = BORDER_WIDTH | BORDER_COLOR,
00106
00107 BACKGROUND_SET = 0x00000100,
00108 BACKGROUND_COLOR = 0x00000200,
00112 BACKGROUND = BACKGROUND_SET | BACKGROUND_COLOR,
00113
00114 NOMINAL_WIDTH = 0x00000400,
00115 TRANSLATION_METHOD = 0x00000800,
00116 LINE_END_STYLE = 0x00001000,
00117 LINE_JOIN_STYLE = 0x00002000,
00118 MITER_LIMIT = 0x00004000,
00122 PRINT_REGULATION = NOMINAL_WIDTH | TRANSLATION_METHOD
00123 | LINE_END_STYLE | LINE_JOIN_STYLE
00124 | MITER_LIMIT,
00125
00126 PEN_DESCRIPTION = 0x00008000,
00127
00128 COLOR_PRIORITY = 0x00010000,
00129
00133 ALL_PRINT_MASK = UNIT | GEOMETRY | ORIENTATION
00134 | BORDER | BACKGROUND
00135 | PRINT_REGULATION | PEN_DESCRIPTION
00136 | COLOR_PRIORITY
00137 };
00138
00139 enum Presentation {
00140 TOGGLE_FOLD,
00141 TOGGLE_UNFOLD,
00142 LABEL_UNFOLD
00143 };
00144
00145 public:
00146
00150 virtual void setPresentation (Presentation type);
00151
00155 Presentation getPresentation () const;
00156
00162 void setPrintFilter(unsigned long inclusionMask,
00163 unsigned long exclusionMask);
00169 void getPrintFilter(unsigned long &inclusionMask,
00170 unsigned long &exclusionMask) const;
00171
00175 void setApply(SoNode *node);
00176
00180 void setApply(SoPath *path);
00181
00185 void setApply(const SoPathList &pathList, SbBool obeysRules = FALSE);
00186
00192 SoNONUNICODE void setFileName(char *fileName);
00193
00197 void setFileName( const SbString& fileName );
00198
00206 void setAction(SoVectorizeAction *action, SbBool isDestroyed);
00207
00208 virtual void show();
00209 virtual void hide();
00210
00211
00212 private:
00213 SoVectorizeAction * _vectorizeAction;
00214 SoVectorizeAction::DimensionUnit _unit;
00215 dialogRgbHsvControl * _dialogPenDescription;
00216 dialogRgbHsvControl * _colorEditorBorder;
00217 dialogRgbHsvControl * _colorEditorBackground;
00218 void updateXtElements();
00219
00220 private:
00221 PoPrintMonitor(SoWidget Parent, const SbString& name, SbBool buildInsideParent);
00222 virtual ~PoPrintMonitor();
00223
00224 virtual void buildWidget(SoWidget Parent,
00225 const SbString& name,
00226 SbBool buildInsideParent);
00227
00228
00229 virtual void destroyAction() = 0;
00230 virtual int getMenuItems();
00231 virtual void setFilter();
00232
00233 SbBool applyAction();
00234
00235 void addAcceptCallback (PoPrintMonitorCB *func, void *userData = NULL);
00236 void removeAcceptCallback (PoPrintMonitorCB *func, void *userData = NULL);
00237
00238 virtual SbString getDefaultWidgetName() const;
00239 virtual SbString getDefaultTitle() const;
00240 virtual SbString getDefaultIconTitle() const;
00241
00242 PoXtDialog *_dialog;
00243
00244 Presentation _presentation;
00245
00246 menuColumn *_menu;
00247 int _menuItems;
00248
00249 SbString _defaultFileName;
00250
00251 SoNode *_node;
00252 SoPath *_path;
00253 SoPathList *_pathList;
00254 SbBool _obeysRules;
00255 SbBool _destroyAction;
00256
00257 SbString _fileName;
00258
00259 private:
00260 SoCallbackList *_acceptCallbackList;
00261 int _classMenusNb;
00262 unsigned long _incPrintMask;
00263 unsigned long _excPrintMask;
00264
00265 SbBool _isPrintSet;
00266
00267 static void acceptCallback(PoPrintMonitor *printMonitor,
00268 PoXtDialog::PoXtDialogDataCB *data);
00269 static void fileNameCallback(PoPrintMonitor *printMonitor,
00270 PoXtDialog::PoXtDialogDataCB *data);
00271 };
00272
00273 #endif //PO_PRINT_PS_MONITOR_H
00274
00275