NCBI C++ ToolKit
search_form_base.hpp
Go to the documentation of this file.

Go to the SVN repository for this file.

1 #ifndef GUI_CORE___SEARCH_FORM_BASE_HPP
2 #define GUI_CORE___SEARCH_FORM_BASE_HPP
3 
4 /* $Id: search_form_base.hpp 39744 2017-10-31 21:12:13Z katargir $
5  * ===========================================================================
6  *
7  * PUBLIC DOMAIN NOTICE
8  * National Center for Biotechnology Information
9  *
10  * This software/database is a "United States Government Work" under the
11  * terms of the United States Copyright Act. It was written as part of
12  * the author's official duties as a United States Government employee and
13  * thus cannot be copyrighted. This software/database is freely available
14  * to the public for use. The National Library of Medicine and the U.S.
15  * Government have not placed any restriction on its use or reproduction.
16  *
17  * Although all reasonable efforts have been taken to ensure the accuracy
18  * and reliability of the software and data, the NLM and the U.S.
19  * Government do not and cannot warrant the performance or results that
20  * may be obtained by using this software or data. The NLM and the U.S.
21  * Government disclaim all warranties, express or implied, including
22  * warranties of performance, merchantability or fitness for any particular
23  * purpose.
24  *
25  * Please cite the author in any work or product based on this material.
26  *
27  * ===========================================================================
28  *
29  * Authors: Andrey Yazhuk
30  *
31  * File Description:
32  *
33  */
34 
37 
40 
41 #include <gui/utils/command.hpp>
42 #include <gui/utils/mru_list.hpp>
43 
45 
46 #include <wx/srchctrl.h>
47 
49 
50 class wxChoice;
51 
52 
54 
55 class CSearchControl;
56 
57 ///////////////////////////////////////////////////////////////////////////////
58 /// CSearchFormBase
60  public CObjectEx,
61  public IDMSearchForm
62 {
63 public:
64  typedef vector<IDataMiningContext*> TContexts;
66 
67  typedef objects::CFeatListItem TFeatTypeItem;
69 
72 
73 public:
75  virtual ~CSearchFormBase();
76 
77  virtual void SetController(IDMSearchFormController* controller);
78 
79  virtual IDMSearchTool* x_GetTool() = 0;
80 
81  virtual wxSizer* GetWidget(wxWindow * parent);
82 
84  virtual void UpdateContexts();
85 
86  void UpdateContextCombo(wxChoice* combo);
87 
88  virtual void PopupADialog(TDialogType dt);
89  virtual void SetDictionary(list<string> * ddd);
90  virtual void Push();
91  virtual void SetRangeLimit(bool bLimit);
92 
93  virtual string GetMainValue();
94  virtual void SetMainValue(string val);
95 
96  virtual void SetRegistryPath(const string& reg_path);
97  virtual void LoadSettings();
98  virtual void SaveSettings() const;
99 
100 protected:
101  virtual void x_LoadSettings(const CRegistryReadView& /*view*/) = 0;
102  virtual void x_SaveSettings(CRegistryWriteView /*view*/) const = 0;
103 
104 protected:
109  wxSizer* m_Sizer;
111  string m_RegPath;
112 
113  string m_Input;
114  bool m_bRange;
115 
116 private:
119 };
120 
121 ///////////////////////////////////////////////////////////////////////////////
122 /// CSearchControl
123 // helpful autocomplete control
125 {
126 public:
127  CSearchControl(wxWindow *parent, wxWindowID id,
128  const wxString& value = wxEmptyString,
129  const wxPoint& pos = wxDefaultPosition,
130  const wxSize& size = wxDefaultSize,
131  long style = 0,
132  const wxValidator& validator = wxDefaultValidator,
133  const wxString& name = wxSearchCtrlNameStr);
134 
135  /// another constructor.
136  /// This is just for serving the code created using DialogBlock.
137  CSearchControl(wxWindow *parent, wxWindowID id,
138  const wxPoint& pos = wxDefaultPosition,
139  const wxSize& size = wxDefaultSize,
140  long style = 0,
141  const wxValidator& validator = wxDefaultValidator,
142  const wxString& name = wxSearchCtrlNameStr);
143 
144  void SetDictionary(list<string> * dict);
145  void Push();
146 
147 protected:
148 
149  size_t m_MaxSize;
152  list<string> * m_pDict;
153 };
154 
155 
157 
158 
159 #endif // GUI_CORE___SEARCH_FORM_BASE_HPP
CAutoCompleteComboBox.
CObjectEx –.
Definition: ncbiobj.hpp:2531
class CRegistryReadView provides a nested hierarchical view at a particular key.
Definition: reg_view.hpp:58
CSearchControl.
list< string > * m_pDict
CSearchFormBase.
virtual IDMSearchTool * x_GetTool()=0
virtual void x_SaveSettings(CRegistryWriteView) const =0
virtual void x_LoadSettings(const CRegistryReadView &)=0
IDMSearchFormController * m_Controller
CSearchFormBase(const CSearchFormBase &)
CSearchFormBase & operator=(const CSearchFormBase &)
CSearchToolBase::EPatternType TPatternType
CSearchControl * m_Text
IDataMiningContext * m_ActiveContext
objects::CFeatListItem TFeatTypeItem
TFeatTypeItemSet m_FeatTypesSet
set< TFeatTypeItem > TFeatTypeItemSet
map< string, TPatternType > TNameToType
vector< IDataMiningContext * > TContexts
CMRUList< string > TMRUInputs
IDMSearchFormController - interface representing an entity that controls the lifecycle of search Form...
IDMSearchForm - interface for abstract Search From.
virtual wxSizer * GetWidget(wxWindow *)
return a widget associated with the form; the form controls the lifetime of the widget (do not delete...
virtual void SetController(IDMSearchFormController *)
virtual void Push()=0
virtual void PopupADialog(TDialogType dt)=0
ask something in dialog
virtual void SetRangeLimit(bool bLimit)=0
virtual void SetRegistryPath(const string &reg_path)=0
virtual void UpdateContexts()=0
called by Data Mining View to update the list of search contexts
virtual void SaveSettings() const =0
virtual string GetMainValue()
get/set main search value, this is separate from settings
virtual void LoadSettings()=0
virtual void SetDictionary(list< string > *)=0
virtual CIRef< IDMSearchQuery > ConstructQuery()=0
virtual void SetMainValue(string)
IDMSearchTool interface representing a single search tool in Data Mining Service.
IDataMiningContext IDataMiningContext represents an abstract context for a Search.
GUI command routing and handling framework.
#define END_NCBI_SCOPE
End previously defined NCBI scope.
Definition: ncbistl.hpp:103
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
Definition: ncbistl.hpp:100
#define NCBI_GUICORE_EXPORT
Definition: gui_export.h:508
const struct ncbi::grid::netcache::search::fields::SIZE size
const GenericPointer< typename T::ValueType > T2 value
Definition: pointer.h:1227
Modified on Wed Apr 24 14:18:37 2024 by modify_doxy.py rev. 669887