dtinfo subtree dtinfo
[oweals/cde.git] / cde / programs / dtinfo / dtinfo / src / Managers / SearchMgr.hh
1 /*      Copyright (c) 1994,1995,1996 FUJITSU LIMITED    */
2 /*      All Rights Reserved                             */
3
4 /*
5  * $XConsortium: SearchMgr.hh /main/5 1996/06/11 16:27:38 cde-hal $
6  *
7  * Copyright (c) 1992 HaL Computer Systems, Inc.  All rights reserved.
8  * UNPUBLISHED -- rights reserved under the Copyright Laws of the United
9  * States.  Use of a copyright notice is precautionary only and does not
10  * imply publication or disclosure.
11  * 
12  * This software contains confidential information and trade secrets of HaL
13  * Computer Systems, Inc.  Use, disclosure, or reproduction is prohibited
14  * without the prior express written permission of HaL Computer Systems, Inc.
15  * 
16  *                         RESTRICTED RIGHTS LEGEND
17  * Use, duplication, or disclosure by the Government is subject to
18  * restrictions as set forth in subparagraph (c)(l)(ii) of the Rights in
19  * Technical Data and Computer Software clause at DFARS 252.227-7013.
20  *                        HaL Computer Systems, Inc.
21  *                  1315 Dell Avenue, Campbell, CA  95008
22  * 
23  */
24
25 #include "UAS.hh"
26
27 class QueryEditor;
28 class ListView;
29
30 class SearchMgr : public Long_Lived
31 {
32
33 public: // functions
34   SearchMgr();
35   ~SearchMgr();
36
37   UAS_SearchEngine &search_engine();
38   void parse_and_search (char *query, UAS_SearchScope *);
39
40   //  void edit_query();
41   void display_editor();
42
43   ListView &search_history_list_view();
44   void history_entry_activate (FolioObject *object, u_int notify_type,
45                                void *notify_data, void *dependent_data);
46   enum SearchMessageType
47     { NO_HITS, BAD_QUERY };
48   void display_message(SearchMessageType, int error_number = 0);
49
50   void set_history_length (int size)
51     { f_search_history_list.set_length (size); }
52
53   void search_section (const UAS_String &ss) { f_search_section = ss; }
54   UAS_String search_section () { return f_search_section; }
55   void current_hits (UAS_Pointer<UAS_List<UAS_TextRun> > l) {
56     f_current_hits = l;
57   }
58   UAS_Pointer<UAS_List<UAS_TextRun> > current_hits ();
59
60 // friend SearchMgr &search_mgr();
61
62 private:
63   friend class SeReconfigure;
64   void init();
65
66   void add_root   (UAS_Pointer<UAS_Common>& root);
67   void remove_root(UAS_Pointer<UAS_Common>& root);
68
69   List *ibase_list();
70
71 protected: // variables
72   QueryEditor        *f_query_editor;
73   UAS_Pointer<UAS_SearchEngine>      f_search_engine ;
74   HistoryList           f_search_history_list;
75   ListView           *f_search_history_list_view;
76   UAS_String          f_search_section;
77   UAS_Pointer<UAS_List<UAS_TextRun> > f_current_hits;
78   UAS_List<UAS_Common> f_roots;
79
80 private:
81   LONG_LIVED_HH(SearchMgr,search_mgr);
82 };
83
84 LONG_LIVED_HH2(SearchMgr,search_mgr);
85
86