The SWORD Project  1.9.0.svnversion
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
swsearchable.h
Go to the documentation of this file.
1 /******************************************************************************
2  *
3  * swsearchable.h - class SWSearchable: used to provide an
4  * interface for objects that can be searched.
5  *
6  * $Id: swsearchable.h 3786 2020-08-30 11:35:14Z scribe $
7  *
8  * Copyright 2003-2013 CrossWire Bible Society (http://www.crosswire.org)
9  * CrossWire Bible Society
10  * P. O. Box 2528
11  * Tempe, AZ 85280-2528
12  *
13  * This program is free software; you can redistribute it and/or modify it
14  * under the terms of the GNU General Public License as published by the
15  * Free Software Foundation version 2.
16  *
17  * This program is distributed in the hope that it will be useful, but
18  * WITHOUT ANY WARRANTY; without even the implied warranty of
19  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
20  * General Public License for more details.
21  *
22  */
23 
24 #ifndef SWSEARCHABLE_H
25 #define SWSEARCHABLE_H
26 
27 #include <defs.h>
28 
30 
31 class ListKey;
32 class SWKey;
33 
37 
38 public:
39  SWSearchable();
40  virtual ~SWSearchable();
41 
48  static void nullPercent(char percent, void *userData);
49 
50  // search interface -------------------------------------------------
51 
71  virtual ListKey &search(const char *istr, int searchType = 0, int flags = 0,
72  SWKey * scope = 0,
73  bool * justCheckIfSupported = 0,
74  void (*percent) (char, void *) = &nullPercent,
75  void *percentUserData = 0) = 0;
76 
80  virtual signed char createSearchFramework(
81  void (*percent) (char, void *) = &nullPercent,
82  void *percentUserData = 0); // special search framework
83 
84  virtual void deleteSearchFramework();
85 
89  virtual bool hasSearchFramework() { return false; }
90 
99  virtual bool isSearchOptimallySupported(const char *istr, int searchType, int flags, SWKey *scope);
100 };
101 
103 #endif
#define SWORD_NAMESPACE_START
Definition: defs.h:39
#define SWDLLEXPORT
Definition: defs.h:171
virtual bool hasSearchFramework()
Definition: swsearchable.h:89
#define SWORD_NAMESPACE_END
Definition: defs.h:40
Definition: swkey.h:77