DmxPrintJob.h 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153
  1. /*
  2. * CDE - Common Desktop Environment
  3. *
  4. * Copyright (c) 1993-2012, The Open Group. All rights reserved.
  5. *
  6. * These libraries and programs are free software; you can
  7. * redistribute them and/or modify them under the terms of the GNU
  8. * Lesser General Public License as published by the Free Software
  9. * Foundation; either version 2 of the License, or (at your option)
  10. * any later version.
  11. *
  12. * These libraries and programs are distributed in the hope that
  13. * they will be useful, but WITHOUT ANY WARRANTY; without even the
  14. * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
  15. * PURPOSE. See the GNU Lesser General Public License for more
  16. * details.
  17. *
  18. * You should have received a copy of the GNU Lesser General Public
  19. * License along with these librararies and programs; if not, write
  20. * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
  21. * Floor, Boston, MA 02110-1301 USA
  22. */
  23. /* $XConsortium: DmxPrintJob.h /main/3 1996/04/12 14:12:32 mgreess $ */
  24. #ifndef _DMX_PRINT_JOB_H
  25. #define _DMX_PRINT_JOB_H
  26. /*
  27. *+SNOTICE
  28. *
  29. * $:$
  30. *
  31. * RESTRICTED CONFIDENTIAL INFORMATION:
  32. *
  33. * The information in this document is subject to special
  34. * restrictions in a confidential disclosure agreement between
  35. * HP, IBM, Sun, USL, SCO and Univel. Do not distribute this
  36. * document outside HP, IBM, Sun, USL, SCO, or Univel without
  37. * Sun's specific written approval. This document and all copies
  38. * and derivative works thereof must be returned or destroyed at
  39. * Sun's request.
  40. *
  41. * Copyright 1994 Sun Microsystems, Inc. All rights reserved.
  42. *
  43. *+ENOTICE
  44. */
  45. /*
  46. * Common Desktop Environment
  47. *
  48. * (c) Copyright 1993, 1994, 1995 Hewlett-Packard Company
  49. * (c) Copyright 1993, 1994, 1995 International Business Machines Corp.
  50. * (c) Copyright 1993, 1994, 1995 Sun Microsystems, Inc.
  51. * (c) Copyright 1993, 1994, 1995 Novell, Inc.
  52. * (c) Copyright 1995 Digital Equipment Corp.
  53. * (c) Copyright 1995 Fujitsu Limited
  54. * (c) Copyright 1995 Hitachi, Ltd.
  55. *
  56. *
  57. * RESTRICTED RIGHTS LEGEND
  58. *
  59. *Use, duplication, or disclosure by the U.S. Government is subject to
  60. *restrictions as set forth in subparagraph (c)(1)(ii) of the Rights in
  61. *Technical Data and Computer Software clause in DFARS 252.227-7013. Rights
  62. *for non-DOD U.S. Government Departments and Agencies are as set forth in
  63. *FAR 52.227-19(c)(1,2).
  64. *Hewlett-Packard Company, 3000 Hanover Street, Palo Alto, CA 94304 U.S.A.
  65. *International Business Machines Corp., Route 100, Somers, NY 10589 U.S.A.
  66. *Sun Microsystems, Inc., 2550 Garcia Avenue, Mountain View, CA 94043 U.S.A.
  67. *Novell, Inc., 190 River Road, Summit, NJ 07901 U.S.A.
  68. *Digital Equipment Corp., 111 Powdermill Road, Maynard, MA 01754, U.S.A.
  69. *Fujitsu Limited, 1015, Kamikodanaka Nakahara-Ku, Kawasaki 211, Japan
  70. *Hitachi, Ltd., 6, Kanda Surugadai 4-Chome, Chiyoda-ku, Tokyo 101, Japan
  71. */
  72. #include <stdio.h>
  73. #include <stdlib.h>
  74. #include <unistd.h>
  75. #include <string.h>
  76. #include <sys/types.h>
  77. #include <ctype.h>
  78. #include "Dmx.h"
  79. #include "DmxPrintOptions.h"
  80. #include "DmxPrintOutput.h"
  81. #include "DmxPrintSetup.h"
  82. #include "DtMailTypes.h"
  83. #include "MainWindow.h"
  84. #include "OptCmd.h"
  85. #include "UIComponent.h"
  86. typedef struct _dmx_msg_info
  87. {
  88. int end_position;
  89. DmxMsg *msg;
  90. } DmxMsgInfo;
  91. class DmxPrintJob : public UIComponent
  92. {
  93. private:
  94. DmxMsg *_next_msg;
  95. char *_filename;
  96. DmxMailbox *_mailbox;
  97. MainWindow *_parent;
  98. DmxPrintOutput *_print_output;
  99. DmxPrintSetup *_print_setup;
  100. DtPrintSetupData *_print_data;
  101. Widget _pshell;
  102. DtMailBoolean _silent;
  103. DmxMsgInfo *_spool_msg_info;
  104. int _spool_nmsgs_done;
  105. int _spool_nmsgs_total;
  106. int _spool_npages_done;
  107. int _spool_npages_total;
  108. #ifndef USE_XP_SERVER
  109. Widget _nextpage_shell;
  110. Widget _nextpage_button;
  111. #endif
  112. static void cancelCB (Widget, XtPointer, XtPointer);
  113. static void closeDisplayCB (Widget, XtPointer, XtPointer);
  114. static void pdmNotificationCB (Widget, XtPointer, XtPointer);
  115. static void pdmSetupCB (Widget, XtPointer, XtPointer);
  116. static void printCB (Widget, XtPointer, XtPointer);
  117. static void printOnePageCB (Widget, XtPointer, XtPointer);
  118. void createPrintShell (void);
  119. void createOutputWidgets (void);
  120. void doPrint (void);
  121. #if 0 && defined(PRINTING_SUPPORTED)
  122. static void finishedPrintToFile(
  123. Display*,
  124. XPContext,
  125. XPGetDocStatus,
  126. XPointer);
  127. #endif /* PRINTING_SUPPORTED */
  128. char * getPageHeaderString( DmxMsg*, DmxStringTypeEnum);
  129. Boolean loadOutputWidgets (void);
  130. void updatePageHeaders(
  131. DmxMsg*,
  132. DmxStringTypeEnum,
  133. DmxStringTypeEnum,
  134. DmxStringTypeEnum,
  135. DmxStringTypeEnum);
  136. public:
  137. DmxPrintJob (char*, DtMailBoolean, MainWindow*);
  138. ~DmxPrintJob (void);
  139. void cancel (void);
  140. void execute (void);
  141. };
  142. #endif // _DMX_PRINT_JOB_H