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