Fix warnings on FreeBSD
[oweals/cde.git] / cde / programs / dtinfo / dtinfo / src / Agents / SearchResultsAgentMotif.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 /*      Copyright (c) 1994,1995,1996 FUJITSU LIMITED    */
24 /*      All Rights Reserved                             */
25
26 /*
27  * $XConsortium: SearchResultsAgentMotif.hh /main/4 1996/11/18 16:31:10 cde-hal $
28  *
29  * Copyright (c) 1993 HAL Computer Systems International, Ltd.
30  * All rights reserved.  Unpublished -- rights reserved under
31  * the Copyright Laws of the United States.  USE OF A COPYRIGHT
32  * NOTICE IS PRECAUTIONARY ONLY AND DOES NOT IMPLY PUBLICATION
33  * OR DISCLOSURE.
34  * 
35  * THIS SOFTWARE CONTAINS CONFIDENTIAL INFORMATION AND TRADE
36  * SECRETS OF HAL COMPUTER SYSTEMS INTERNATIONAL, LTD.  USE,
37  * DISCLOSURE, OR REPRODUCTION IS PROHIBITED WITHOUT THE
38  * PRIOR EXPRESS WRITTEN PERMISSION OF HAL COMPUTER SYSTEMS
39  * INTERNATIONAL, LTD.
40  * 
41  *                         RESTRICTED RIGHTS LEGEND
42  * Use, duplication, or disclosure by the Government is subject
43  * to the restrictions as set forth in subparagraph (c)(l)(ii)
44  * of the Rights in Technical Data and Computer Software clause
45  * at DFARS 252.227-7013.
46  *
47  *          HAL COMPUTER SYSTEMS INTERNATIONAL, LTD.
48  *                  1315 Dell Avenue
49  *                  Campbell, CA  95008
50  * 
51  */
52
53 #include "UAS.hh"
54
55 class NodeListAgent;
56 class Manager;
57 class ResultID;
58 class WXmText;
59 class AgentListEntry;
60 class WXmToggleButton;
61
62 class SearchResultsAgent : public NodeListAgent
63 {
64 public: // functions
65   SearchResultsAgent();
66
67   void init();
68   XmString form_result_string (UAS_Pointer<UAS_SearchResultsEntry>);
69   void display (ResultID *results);
70   void select_item (WCallback *wcb);
71   void view_activate (WCallback *);
72   void retain_changed (WCallback *wcb);
73   void set_agent_list_entry (AgentListEntry *my_ale)
74     { f_my_ale = my_ale; }
75   bool retain ()
76     { return f_retain; }
77
78   ResultID *resultID()
79     { return f_results; }
80
81   static Boolean fill_list_wp (XtPointer client_data);
82   Boolean fill_list(UAS_List<UAS_SearchResultsEntry> &);
83
84 protected: // functions
85   virtual void create_window();
86   virtual void close_window (WCallback *wcb);
87   void  set_retain_default ();
88   void modify_verify (WCallback *wcb);
89
90   void resize();
91
92 private:
93   static void resizeCB(Widget, XtPointer, XEvent*, Boolean*);
94   void compose_header();
95
96 protected: // variables
97   AgentListEntry *f_my_ale;
98   bool   f_retain;
99   ResultID *f_results;
100   int       f_selected_item;
101   WXmToggleButton *f_retain_toggle;
102   WXmText  *f_query_text;
103   WXmLabel *f_hits_label;
104   WXmLabel *f_scope_label;
105
106   unsigned int f_docs_to_display ;
107   unsigned int f_count ;
108   long f_scale;
109   XtWorkProcId f_work_proc_id;
110   bool f_popped_up;
111   Dimension f_header_indent;
112 };
113
114 // inlines:
115
116 inline
117 SearchResultsAgent::SearchResultsAgent()
118 : f_my_ale(NULL), f_retain(FALSE), f_results(NULL), f_selected_item(0),
119   f_retain_toggle(NULL), f_query_text(NULL), f_hits_label(NULL),
120   f_scope_label(NULL), f_docs_to_display(0), f_count(0), f_scale(0),
121   f_work_proc_id(0), f_popped_up(FALSE), f_header_indent(0)
122 {
123 }