Resolve many build warnings
[oweals/cde.git] / cde / programs / dtinfo / dtinfo / src / Agents / LibraryAgentMotif.hh
1 /* $TOG: LibraryAgentMotif.hh /main/17 1998/07/27 14:20:31 mgreess $ */
2 /*
3  * (c) Copyright 1996 Digital Equipment Corporation.
4  * (c) Copyright 1996 Hewlett-Packard Company.
5  * (c) Copyright 1996 International Business Machines Corp.
6  * (c) Copyright 1996 Sun Microsystems, Inc.
7  * (c) Copyright 1996 Novell, Inc. 
8  * (c) Copyright 1996 FUJITSU LIMITED.
9  * (c) Copyright 1996 Hitachi.
10  */
11 /*
12  * Copyright (c) 1991 HaL Computer Systems, Inc.  All rights reserved.
13  * UNPUBLISHED -- rights reserved under the Copyright Laws of the United
14  * States.  Use of a copyright notice is precautionary only and does not
15  * imply publication or disclosure.
16  * 
17  * This software contains confidential information and trade secrets of HaL
18  * Computer Systems, Inc.  Use, disclosure, or reproduction is prohibited
19  * without the prior express written permission of HaL Computer Systems, Inc.
20  * 
21  *                         RESTRICTED RIGHTS LEGEND
22  * Use, duplication, or disclosure by the Government is subject to
23  * restrictions as set forth in subparagraph (c)(l)(ii) of the Rights in
24  * Technical Data and Computer Software clause at DFARS 252.227-7013.
25  *                        HaL Computer Systems, Inc.
26  *                  1315 Dell Avenue, Campbell, CA  95008
27  * 
28  */
29
30 #include "UAS.hh"
31 #include <X11/Intrinsic.h>
32
33 class OutlineListView;
34 class OutlineListView;
35 class WTopLevelShell;
36 class ScopeMenu;
37 class IcccmAgent;
38
39 struct OutlineListSelectionData;
40
41 struct TrackingEntry;
42
43 class LibraryAgent : public Agent,
44                      public UAS_Receiver<UAS_DocumentRetrievedMsg>
45
46 {
47 public: // functions 
48   LibraryAgent();
49   ~LibraryAgent();
50
51   // load infolib specified in any format
52   static int add_library(char*, Widget parent=NULL);  
53
54   void display (OutlineList *library);
55   void track_to (UAS_Pointer<UAS_Common> &node_ptr);
56   void track (bool scroll = FALSE);
57   void popup();
58   bool popped_down() { return f_popped_down; }
59   void keep_forever()
60     { f_keep_forever = TRUE; }
61
62   OutlineList *outline_list();
63
64   void library_removed (UAS_Pointer<UAS_Common> lib);
65
66   void close_set_sensitive(Boolean set) {
67       f_close_sensitive = set; if (f_close) XtSetSensitive(f_close, set); }
68   void copy_to_clipbd();
69
70 protected: // functions
71   void create_ui();
72   static void close_windowCB(Widget, XtPointer, XtPointer);
73   void close_window();
74   void ui_destroyed(); // leave in for backward compatibility
75   static void ui_destroyedCB(Widget, XtPointer, XtPointer);
76   static void detach_subtreeCB(Widget, XtPointer, XtPointer);
77   void detach_subtree();
78   static void add_libraryCB(Widget, XtPointer, XtPointer);
79   static void remove_libraryCB(Widget, XtPointer, XtPointer);
80   void entry_selected (void *, u_int notify_type);
81   static void display_nodeCB(Widget, XtPointer, XtPointer);
82   void display_node ();
83   static void printCB(Widget, XtPointer, XtPointer);
84   static void print_asCB(Widget, XtPointer, XtPointer);
85   void print(WCallback *);
86   void free_tracking_hierarchy();
87   static void auto_track_toggleCB(Widget, XtPointer, XtPointer);
88   // callbacks for use by drag and drop
89   static void destCB(Widget, XtPointer, XtPointer);
90   static void transferCB(Widget, XtPointer, XtPointer);
91
92   void receive (UAS_DocumentRetrievedMsg &message, void *client_data);
93
94   void text_callback(WCallback *wcb);
95   static void search_help (Widget w, XtPointer client_data,
96                            XEvent *event, Boolean *);
97   void add_quick_help (Widget, const char* help_text);
98   static void quick_helpEH (Widget, XtPointer, XEvent *, Boolean *);
99 //  void test();
100
101 private: // variables
102   //WTopLevelShell         *f_shell;
103   Widget                    f_shell;
104   OutlineListView        *f_doc_tree_view;
105   OutlineElement         *f_oe;
106   bool                    f_keep_forever;
107   WCallback              *f_wm_delete_callback;
108   TrackingEntry          *f_tracking_hierarchy;
109   bool                    f_popped_down;
110   Widget     f_close;
111   Widget     f_copy;
112   Widget     f_detach;
113   Widget     f_detach2;
114   Widget     f_view;
115   Widget     f_view2;
116   Widget     f_print;
117   Widget     f_print2;
118   Widget     f_print_as;
119   Widget     f_remove;
120   Widget     f_remove2;
121   Widget     f_auto_track;
122   bool                    f_close_sensitive;
123   Widget     f_status_text;
124   ScopeMenu             *f_scope_menu;
125
126   UAS_List<UAS_String> f_help_text;
127
128 };
129
130 // inline:
131 inline
132 LibraryAgent::LibraryAgent()
133 : f_shell (NULL),
134   f_oe (NULL),
135   f_keep_forever (FALSE),
136   f_wm_delete_callback (NULL),
137   f_tracking_hierarchy (NULL),
138   f_popped_down (TRUE),
139   f_close (NULL),
140   f_close_sensitive (FALSE)
141 {
142 }