00001 /* AbiSource Application Framework 00002 * Copyright (C) 1998 AbiSource, Inc. 00003 * 00004 * This program is free software; you can redistribute it and/or 00005 * modify it under the terms of the GNU General Public License 00006 * as published by the Free Software Foundation; either version 2 00007 * of the License, or (at your option) any later version. 00008 * 00009 * This program is distributed in the hope that it will be useful, 00010 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00011 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00012 * GNU General Public License for more details. 00013 * 00014 * You should have received a copy of the GNU General Public License 00015 * along with this program; if not, write to the Free Software 00016 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 00017 * 02110-1301 USA. 00018 */ 00019 00020 #ifndef XAP_DIALOG_PRINT_H 00021 #define XAP_DIALOG_PRINT_H 00022 00023 #include "gr_Graphics.h" 00024 00025 #include "xap_Dialog.h" 00026 class FV_View; 00027 class FL_DocLayout; 00028 /*****************************************************************/ 00029 00030 class ABI_EXPORT XAP_Dialog_Print : public XAP_Dialog_AppPersistent 00031 { 00032 public: 00033 XAP_Dialog_Print(XAP_DialogFactory * pDlgFactory, XAP_Dialog_Id id); 00034 virtual ~XAP_Dialog_Print(void); 00035 00036 virtual void useStart(void); 00037 virtual void runModal(XAP_Frame * pFrame) = 0; 00038 virtual void useEnd(void); 00039 00040 typedef enum { a_VOID, a_OK, a_CANCEL } tAnswer; 00041 00042 void setDocumentTitle(const char *); 00043 void setDocumentPathname(const char * ); 00044 void setEnablePageRangeButton(bool bEnable, 00045 UT_uint32 nFirst, 00046 UT_uint32 nLast); 00047 void setEnablePrintSelection(bool bEnable); 00048 void setEnablePrintToFile(bool bEnable); 00049 void setTryToBypassActualDialog(bool bTry); 00050 void setPaperSize (const char * pageSize); 00051 00052 00053 XAP_Dialog_Print::tAnswer getAnswer(void) const; 00054 bool getDoPrintRange(UT_sint32 * pnFirst, UT_sint32 * pnLast) const; 00055 bool getDoPrintSelection(void) const; 00056 bool getDoPrintToFile(const char *) const; 00057 UT_uint32 getNrCopies(void) const; 00058 bool getCollate(void) const; 00059 GR_Graphics::ColorSpace getColorSpace(void) const; 00060 virtual void PrintDirectly(XAP_Frame * /* pFrame */, const char * /*fileName */, const char * /* szPrinter */){} 00061 00062 virtual GR_Graphics * getPrinterGraphicsContext(void) = 0; 00063 virtual void releasePrinterGraphicsContext(GR_Graphics * pGraphics) = 0; 00064 00065 virtual void setPreview(bool ) {} 00066 protected: 00067 bool _getPrintToFilePathname(XAP_Frame * pFrame, 00068 const char * szSuggestedName); 00069 00070 UT_uint32 m_bPersistValid; /* persists (internal) */ 00071 UT_uint32 m_persistNrCopies; /* persists (internal) */ 00072 bool m_persistCollate; /* persists (internal) */ 00073 GR_Graphics::ColorSpace m_persistColorSpace; /* persists (internal) */ 00074 bool m_persistPrintToFile; /* persists (internal) */ 00075 00076 char * m_szDocumentTitle; /* input */ 00077 char * m_szDocumentPathname; /* input */ 00078 bool m_bBypassActualDialog; /* input */ 00079 bool m_bEnablePageRange; /* input */ 00080 bool m_bEnablePrintSelection;/* input */ 00081 bool m_bEnablePrintToFile; /* input */ 00082 bool m_bDoPrintRange; /* output */ 00083 bool m_bDoPrintSelection; /* output */ 00084 bool m_bDoPrintToFile; /* output */ 00085 bool m_bCollate; /* output */ 00086 GR_Graphics::ColorSpace m_cColorSpace; /* output */ 00087 UT_sint32 m_nFirstPage; /* input/output */ 00088 UT_sint32 m_nLastPage; /* input/output */ 00089 UT_uint32 m_nCopies; /* output */ 00090 XAP_Dialog_Print::tAnswer m_answer; /* output */ 00091 char * m_szPrintToFilePathname;/* output */ 00092 char * m_szPrintCommand; /* output */ 00093 00094 char * m_pageSize; 00095 }; 00096 00097 #endif /* XAP_DIALOG_PRINT_H */