Debian Codegraph @

src/af/xap/xp/xap_Dlg_Print.h

raw
1 /* AbiSource Application Framework
2 * Copyright (C) 1998 AbiSource, Inc.
3 *
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License
6 * as published by the Free Software Foundation; either version 2
7 * of the License, or (at your option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
17 * 02110-1301 USA.
18 */
19
20 #ifndef XAP_DIALOG_PRINT_H
21 #define XAP_DIALOG_PRINT_H
22
23 #include "gr_Graphics.h"
24
25 #include "xap_Dialog.h"
26 class FV_View;
27 class FL_DocLayout;
28 /*****************************************************************/
29
30 class ABI_EXPORT XAP_Dialog_Print : public XAP_Dialog_AppPersistent
31 {
32 public:
33 XAP_Dialog_Print(XAP_DialogFactory * pDlgFactory, XAP_Dialog_Id id);
34 virtual ~XAP_Dialog_Print(void);
35
36 virtual void useStart(void);
37 virtual void runModal(XAP_Frame * pFrame) = 0;
38 virtual void useEnd(void);
39
40 typedef enum { a_VOID, a_OK, a_CANCEL } tAnswer;
41
42 void setDocumentTitle(const char *);
43 void setDocumentPathname(const char * );
44 void setEnablePageRangeButton(bool bEnable,
45 UT_uint32 nFirst,
46 UT_uint32 nLast);
47 void setEnablePrintSelection(bool bEnable);
48 void setEnablePrintToFile(bool bEnable);
49 void setTryToBypassActualDialog(bool bTry);
50 void setPaperSize (const char * pageSize);
51
52
53 XAP_Dialog_Print::tAnswer getAnswer(void) const;
54 bool getDoPrintRange(UT_sint32 * pnFirst, UT_sint32 * pnLast) const;
55 bool getDoPrintSelection(void) const;
56 bool getDoPrintToFile(const char *) const;
57 UT_uint32 getNrCopies(void) const;
58 bool getCollate(void) const;
59 GR_Graphics::ColorSpace getColorSpace(void) const;
60 virtual void PrintDirectly(XAP_Frame * /* pFrame */, const char * /*fileName */, const char * /* szPrinter */){}
61
62 virtual GR_Graphics * getPrinterGraphicsContext(void) = 0;
63 virtual void releasePrinterGraphicsContext(GR_Graphics * pGraphics) = 0;
64
65 virtual void setPreview(bool ) {}
66 protected:
67 bool _getPrintToFilePathname(XAP_Frame * pFrame,
68 const char * szSuggestedName);
69
70 UT_uint32 m_bPersistValid; /* persists (internal) */
71 UT_uint32 m_persistNrCopies; /* persists (internal) */
72 bool m_persistCollate; /* persists (internal) */
73 GR_Graphics::ColorSpace m_persistColorSpace; /* persists (internal) */
74 bool m_persistPrintToFile; /* persists (internal) */
75
76 char * m_szDocumentTitle; /* input */
77 char * m_szDocumentPathname; /* input */
78 bool m_bBypassActualDialog; /* input */
79 bool m_bEnablePageRange; /* input */
80 bool m_bEnablePrintSelection;/* input */
81 bool m_bEnablePrintToFile; /* input */
82 bool m_bDoPrintRange; /* output */
83 bool m_bDoPrintSelection; /* output */
84 bool m_bDoPrintToFile; /* output */
85 bool m_bCollate; /* output */
86 GR_Graphics::ColorSpace m_cColorSpace; /* output */
87 UT_sint32 m_nFirstPage; /* input/output */
88 UT_sint32 m_nLastPage; /* input/output */
89 UT_uint32 m_nCopies; /* output */
90 XAP_Dialog_Print::tAnswer m_answer; /* output */
91 char * m_szPrintToFilePathname;/* output */
92 char * m_szPrintCommand; /* output */
93
94 char * m_pageSize;
95 };
96
97 #endif /* XAP_DIALOG_PRINT_H */