dtinfo subtree dtinfo
[oweals/cde.git] / cde / programs / dtinfo / dtinfo / src / UAS / Base / UAS_SearchScope.hh
1 // $XConsortium: UAS_SearchScope.hh /main/5 1996/09/14 13:10:24 cde-hal $
2 #ifndef _UAS_SearchScope_hh_
3 #define _UAS_SearchScope_hh_
4
5 #include "UAS_Base.hh"
6 #include "UAS_Sender.hh"
7 #include "UAS_SearchZones.hh"
8 #include "UAS_BookcaseEntry.hh"
9 #include "UAS_Common.hh"
10
11 #ifndef TRUE
12 #define TRUE 1
13 #endif
14 #ifndef FALSE
15 #define FALSE 0
16 #endif
17
18 //typedef unsigned char bool;
19
20 class UAS_SearchScope;
21
22 struct ScopeCreated {
23   UAS_SearchScope *f_search_scope;
24 };
25
26 struct ScopeDeleted {
27   UAS_SearchScope *f_search_scope;
28 };
29
30 struct ScopeRenamed {
31   UAS_SearchScope *f_search_scope;
32 };
33
34 class UAS_SearchScope: public UAS_Base {
35
36   public:
37
38     UAS_SearchScope (const char *name,
39                      UAS_PtrList<UAS_BookcaseEntry> &bcases,
40                      unsigned int component_mask, bool ro = FALSE);
41     ~UAS_SearchScope();
42
43     /* -------- data retrieval methods -------- */
44
45     const char *name() const
46       { return (f_name); }
47     void set_name (const char *name);
48
49     UAS_SearchZones &search_zones()
50       { return f_search_zones; }
51
52     UAS_PtrList<UAS_BookcaseEntry> &bookcases()
53       { return f_bcases; }
54
55     void bookcases(UAS_PtrList<UAS_BookcaseEntry> &);
56
57     /* -------- data setting methods -------- */
58     const char *name (const char *newname);
59
60     void search_zones (UAS_SearchZones &search_zones)
61       { f_search_zones = search_zones; }
62   
63     /* -------- delete flag -------- */
64
65     bool read_only() const
66       { return (f_read_only); }
67     void set_read_only()
68       { f_read_only = TRUE; }
69
70     bool deleted() const
71       { return f_deleted; }
72     void deleted (bool b)
73       { f_deleted = b; }
74
75     void set_infolib(UAS_Pointer<UAS_Common> il)
76       { f_infolib = il; }
77
78     UAS_Pointer<UAS_Common> get_infolib()
79       { return f_infolib; }
80
81     STATIC_SENDER_HH (ScopeCreated);
82     STATIC_SENDER_HH (ScopeDeleted);
83     STATIC_SENDER_HH (ScopeRenamed);
84
85 #ifdef DEBUG
86     /* -------- for debug only -------- */
87     void dump();
88 #endif
89
90   private:
91     char                           *f_name;
92     bool                            f_deleted;
93     bool                            f_read_only;
94     UAS_Pointer<UAS_Common>         f_infolib;
95     UAS_SearchZones                 f_search_zones;
96     UAS_PtrList<UAS_BookcaseEntry>  f_bcases;
97 };
98
99 #endif