2 * CDE - Common Desktop Environment
4 * Copyright (c) 1993-2012, The Open Group. All rights reserved.
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)
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
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
26 * $XConsortium: FindDialog.h /main/4 1996/04/21 19:42:01 drk $
28 * RESTRICTED CONFIDENTIAL INFORMATION:
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
38 * Copyright 1993 Sun Microsystems, Inc. All rights reserved.
46 #include <DtMail/DtMail.hh>
50 // This class is used for the 'Mailer - Find' dialog box.
52 class FindDialog : public Dialog {
55 FindDialog(RoamMenuWindow * parent);
56 ~FindDialog() { clear(); };
59 // These come from 'Dialog'.
62 void popped_down() { };
63 void popup() { XtPopup(_w, XtGrabNone); };
64 void popdown() { XtPopdown(_w); };
65 void widgetDestroyed() {};
67 // The set/clear status methods will set and clear the status line.
69 void setStatus(const char * str);
70 void clearStatus(void);
72 Widget createWorkArea(Widget);
75 // Like initialize() except returns success status.
80 // Set the search direction for find.
82 void setSearchForward(Boolean forward) { // True == Forward, False = Backward.
83 _searchForward = forward;
88 struct ActionAreaItem {
89 char * label; // Button label.
90 XtCallbackProc callback;
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().
101 Boolean findMatching(Boolean findAll = False);
103 Boolean compareMessage(DtMailMessageHandle handle);
105 Boolean compareHeader(DtMailEnv & error,
106 DtMailValueSeq & seq,
107 const char * cmpToString);
109 static void directionCallback(Widget button,
111 XtPointer call_data);
113 static void findCallback(Widget button,
115 XtPointer call_data);
117 static void findSelectAllCallback(Widget button,
119 XtPointer call_data);
121 static void clearCallback(Widget button,
123 XtPointer call_data);
125 static void closeCallback(Widget button,
127 XtPointer call_data);
129 static void helpCallback(Widget button,
131 XtPointer call_data);
133 static void textFieldCallback(Widget, XtPointer, XtPointer);
136 // Pull all fields out of the dialog and store in _text_values;
140 unsigned int _num_text_fields; // Array size.
143 Widget * _text_fields;
145 char ** _text_abstract_name;
146 char ** _text_labels;
147 char ** _text_values;
149 unsigned int _num_buttons; // Array size.
150 ActionAreaItem * _buttonData;
152 Boolean _searchForward;
153 RoamMenuWindow * _roamWindow;