home *** CD-ROM | disk | FTP | other *** search
- /*
- * Copyright (C) 1994, Silicon Graphics, Inc.
- * All Rights Reserved.
- *
- * This is UNPUBLISHED PROPRIETARY SOURCE CODE of Silicon Graphics, Inc.;
- * the contents of this file may not be disclosed to third parties, copied or
- * duplicated in any form, in whole or in part, without the prior written
- * permission of Silicon Graphics, Inc.
- *
- * RESTRICTED RIGHTS LEGEND:
- * Use, duplication or disclosure by the Government is subject to restrictions
- * as set forth in subdivision (c)(1)(ii) of the Rights in Technical Data
- * and Computer Software clause at DFARS 252.227-7013, and/or in similar or
- * successor clauses in the FAR, DOD or NASA FAR Supplement. Unpublished -
- * rights reserved under the Copyright Laws of the United States.
- */
- #ifndef VKPRINTDIALOG_H
- #define VKPRINTDIALOG_H
- /////////////////////////////////////////////////////////////////////////
- // VkPrintDialog.h --
- // A ViewKit dialog class for print spooler interface widget.
- //
- // This class requires impressario development option.
- // Linkage: -lprintui -lspool
- //
- // ivan hajadi@csd.sgi.com
- /////////////////////////////////////////////////////////////////////////
-
- #include <Vk/VkGenericDialog.h>
- #include <X11/Xirisw/PrintBox.h>
-
-
- class VkPrintDialog : public VkGenericDialog {
-
- private:
-
- static String _defaultResources[];
-
- static void cancelCB( Widget, XtPointer, XtPointer );
- static void errorCB( Widget, XtPointer, XtPointer );
- static void jobInfoCB( Widget, XtPointer, XtPointer );
- static void printCB( Widget, XtPointer, XtPointer );
- static void printerActionCB( Widget, XtPointer, XtPointer );
- static void printerSelectCB( Widget, XtPointer, XtPointer );
- static void user1CB( Widget, XtPointer, XtPointer );
- static void user2CB( Widget, XtPointer, XtPointer );
- static void helpCB( Widget, XtPointer, XtPointer );
-
- Widget _printDialog;
-
- ArgList _args;
- Cardinal _count;
- char* _helpString;
-
- Widget createDialog( Widget );
-
- // Dynamically settable values during the life of the object.
- Boolean _fileNameEditable;
- char* _fileName;
- int _fileDescriptor;
-
- // Do the common initialization for VkPrintDialog.
- void init();
-
- protected:
-
- // Subclass can set these options in constructor.
- Boolean _showOptions;
- Boolean _showFileName;
- Boolean _showHelp;
- Boolean _showUser1;
- Boolean _showUser2;
-
- enum JobType { FILENAMES, FILEDESCRIPTOR, BUFFER };
- JobType _jobType;
- XtPointer _buffer;
- int _bufSize;
-
- // Subclass can customize this dialog.
- Widget _workArea;
- virtual Widget createWorkArea( Widget /* parent */ ) { return NULL; }
-
- public:
-
- // Pass <resource,value> list which ends with NULL - like XtVaCreate..
- VkPrintDialog( const char* name, String argName, XtArgVal argValue ... );
- VkPrintDialog( const char* name );
- virtual ~VkPrintDialog();
-
- const char* fileName() const { return _fileName; }
- Boolean fileNameEditable() const { return _fileNameEditable; }
- int fileDescriptor() const { return _fileDescriptor; }
-
- void setFileName( const char* fileName );
- void setFileNameEditable( Boolean );
- void setBuffer( XtPointer buf, int bufSize );
- void setFileDescriptor( int fd );
-
-
- Widget getChild( int );
- void setButtonLabels( const char *print=NULL,
- const char *cancel=NULL,
- const char *help=NULL,
- const char *user1=NULL,
- const char *user2=NULL );
-
- void showHelp( Boolean );
- void showUser1( Boolean );
- void showUser2( Boolean );
-
-
- // Not recommended to use these directly. Use the conviniences.
- virtual Widget post (const char *message = NULL,
- XtCallbackProc okCB = NULL,
- XtCallbackProc cancelCB = NULL,
- XtCallbackProc applyCB = NULL,
- XtPointer clientData = NULL,
- const char *helpString = NULL,
- VkSimpleWindow *parent = NULL,
- Widget parentWidget = NULL);
-
-
- virtual Widget postModal (const char *message = NULL,
- XtCallbackProc okCB = NULL,
- XtCallbackProc cancelCB = NULL,
- XtCallbackProc applyCB = NULL,
- XtPointer clientData = NULL,
- const char *helpString = NULL,
- VkSimpleWindow *parent = NULL,
- Widget parentWidget = NULL);
-
- virtual Widget postBlocked (const char *message = NULL,
- XtCallbackProc okCB = NULL,
- XtCallbackProc cancelCB = NULL,
- XtCallbackProc applyCB = NULL,
- XtPointer clientData = NULL,
- const char *helpString = NULL,
- VkSimpleWindow *parent = NULL,
- Widget parentWidget = NULL);
-
-
- virtual VkDialogReason postAndWait (const char *message = NULL,
- int ok = -1,
- int cancel = -1,
- int apply = -1,
- const char *helpString = NULL,
- VkSimpleWindow *parent = NULL,
- Widget parentWidget = NULL);
-
-
-
- // Sub class can override these to do something.
- virtual void cancel(Widget, XtPointer) {}
- virtual void error(Widget, XtPointer) {}
- virtual void jobInfo(Widget, XtPointer) {}
- virtual void print(Widget, XtPointer) {}
- virtual void printerAction(Widget, XtPointer) {}
- virtual void printerSelect(Widget, XtPointer) {}
- virtual void user1(Widget, XtPointer) {}
- virtual void user2(Widget, XtPointer) {}
-
- // By default help will launch SGI Help Server.
- virtual void help(Widget, XtPointer);
-
-
- operator Widget() const { return _printDialog; }
-
-
- };
-
-
- extern VkPrintDialog* thePrintDialog;
-
-
- #endif
-