-fpermissive to allow GCC to compile old C++
[oweals/cde.git] / cde / programs / dtmail / dtmail / FindDialog.h
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 /*
24  *+SNOTICE
25  *
26  *      $XConsortium: FindDialog.h /main/4 1996/04/21 19:42:01 drk $
27  *
28  *      RESTRICTED CONFIDENTIAL INFORMATION:
29  *      
30  *      The information in this document is subject to special
31  *      restrictions in a confidential disclosure agreement between
32  *      HP, IBM, Sun, USL, SCO and Univel.  Do not distribute this
33  *      document outside HP, IBM, Sun, USL, SCO, or Univel without
34  *      Sun's specific written approval.  This document and all copies
35  *      and derivative works thereof must be returned or destroyed at
36  *      Sun's request.
37  *
38  *      Copyright 1993 Sun Microsystems, Inc.  All rights reserved.
39  *
40  *+ENOTICE
41  */
42
43 #ifndef FINDDIALOG_H
44 #define FINDDIALOG_H
45
46 #include <DtMail/DtMail.hh>
47 #include "Dialog.h"
48
49 //
50 // This class is used for the 'Mailer - Find' dialog box.
51 //
52 class FindDialog : public Dialog {
53
54 public:
55   FindDialog(RoamMenuWindow     * parent);
56   ~FindDialog() { clear(); };
57
58   //
59   // These come from 'Dialog'.
60   //
61   void          popped_up() { };
62   void          popped_down() { };
63   void          popup() { XtPopup(_w, XtGrabNone); };
64   void          popdown() { XtPopdown(_w); };
65   void          widgetDestroyed() {};
66
67   // The set/clear status methods will set and clear the status line.
68   //
69   void setStatus(const char * str);
70   void clearStatus(void);
71
72   Widget        createWorkArea(Widget);
73
74   //
75   // Like initialize() except returns success status.
76   //
77   Boolean               startup();
78
79   //
80   // Set the search direction for find.
81   //
82   void setSearchForward(Boolean forward) {      // True == Forward, False = Backward.
83     _searchForward = forward;
84   };
85
86 private:
87
88   struct ActionAreaItem {
89     char                * label;        // Button label.
90     XtCallbackProc        callback;
91     caddr_t               data;
92   };
93     
94   //
95   // Clear out the data. After this function is complete the
96   // data should look as if the constructor was just called and
97   // before initialize().
98   //
99   void          clear();
100
101   Boolean       findMatching(Boolean findAll = False);
102
103   Boolean       compareMessage(DtMailMessageHandle        handle);
104
105   Boolean       compareHeader(DtMailEnv         & error,
106                       DtMailValueSeq    & seq,
107                       const char        * cmpToString);
108
109   static void   directionCallback(Widget        button,
110                                   XtPointer     closure,
111                                   XtPointer     call_data);
112
113   static void   findCallback(Widget     button,
114                              XtPointer  closure,
115                              XtPointer  call_data);
116
117   static void   findSelectAllCallback(Widget    button,
118                                       XtPointer closure,
119                                       XtPointer call_data);
120
121   static void   clearCallback(Widget    button,
122                               XtPointer closure,
123                               XtPointer call_data);
124
125   static void   closeCallback(Widget    button,
126                               XtPointer closure,
127                               XtPointer call_data);
128
129   static void   helpCallback(Widget     button,
130                              XtPointer  closure,
131                              XtPointer  call_data);
132
133   static void   textFieldCallback(Widget, XtPointer, XtPointer);
134
135   //
136   // Pull all fields out of the dialog and store in _text_values;
137   //
138   void          getAllFields();
139
140   unsigned int     _num_text_fields;            // Array size.
141
142   Widget           _status_text;
143   Widget         * _text_fields;
144   char          ** _text_names;
145   char          ** _text_abstract_name;
146   char          ** _text_labels;
147   char          ** _text_values;
148
149   unsigned int     _num_buttons;                // Array size.
150   ActionAreaItem * _buttonData;
151
152   Boolean          _searchForward;
153   RoamMenuWindow * _roamWindow;
154 };
155
156 #endif