18db8d5c80eb37ccda117b556cdfe7dab7103f7f
[oweals/cde.git] / cde / programs / dtinfo / dtinfo / src / UAS / DtSR / DtSR_BookcaseEntry.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 // $TOG: DtSR_BookcaseEntry.hh /main/8 1998/04/17 11:41:33 mgreess $
24 /*      Copyright (c) 1995,1996 FUJITSU LIMITED         */
25 /*      All Rights Reserved                             */
26
27 #ifndef _DTSR_BOOKCASEENTRY_HH_
28 #define _DTSR_BOOKCASEENTRY_HH_
29
30 #include "UAS_BookcaseEntry.hh"
31 #include "UAS_Base.hh"
32 #include "UAS_List.hh"
33 #include "UAS_SearchZones.hh"
34
35 #include "DtSR_Stems.hh"
36
37 extern "C" {
38 #include "Search.h"
39 }
40
41 class DtSR_BookcaseEntry : public UAS_BookcaseEntry
42 {
43   public:
44     DtSR_BookcaseEntry(UAS_Pointer<UAS_Common>& bookcase, int searchable = 0)
45                         : UAS_BookcaseEntry(bookcase, searchable) { };
46     virtual ~DtSR_BookcaseEntry() { };
47   
48 };
49
50 class DtSR_BookcaseSearchEntry : public DtSR_BookcaseEntry
51 {
52   friend class DtSR_SearchEngine;
53
54   public:
55     DtSR_BookcaseSearchEntry(int dbn, UAS_Pointer<UAS_Common>& bc,
56                                       int searchable = 0);
57     virtual ~DtSR_BookcaseSearchEntry();
58
59     short       language() { return f_language; }
60
61     UAS_Pointer<DtSR_Stems>& stems() { return f_stems; }
62     UAS_Pointer<DtSR_Stems>  takeover_stems();
63
64     static void search_zones(UAS_SearchZones& search_zones);
65
66     UAS_Pointer<UAS_Common> bcase() { return uas_bcase; }
67
68
69 #if !defined(SC3) && !defined(__osf__) && !defined(USL) && !defined(linux)
70
71   protected:
72     template <class T> friend class UAS_Pointer;
73
74 #endif
75
76     virtual void unreference();
77
78   private:
79     void _search_zones(UAS_SearchZones& search_zones);
80
81     UAS_Pointer<UAS_String>     f_dbname;
82     int                         f_dbn;
83
84     short                       f_language;
85
86     DtSrKeytype*                f_keytypes;
87     int                         f_ktcount;
88
89     UAS_Pointer<DtSR_Stems> f_stems;
90
91     // list of bookcases to which this belongs
92     static UAS_Pointer<UAS_List<DtSR_BookcaseSearchEntry> > f_bcases;
93     static UAS_List<DtSR_BookcaseSearchEntry> &bcases();
94
95     UAS_Pointer<UAS_Common> uas_bcase;
96 };
97
98 #endif