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

Go to the SVN repository for this file.

1 #ifndef GUI_SERVICES___SNP_SEARCH_TOOL_HPP
2 #define GUI_SERVICES___SNP_SEARCH_TOOL_HPP
3 
4 /* $Id: snp_search_tool.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, modified for SNP by Dmitry Rudnev
30  *
31  * File Description:
32  *
33  */
34 
35 #include <corelib/ncbistd.hpp>
36 
39 
40 class wxTextCtrl;
41 class wxChoice;
42 
44 
45 
46 /** @addtogroup GUI_PKG_SEQUENCE
47  *
48  * @{
49  */
50 
51 
52 ///////////////////////////////////////////////////////////////////////////////
53 /// CSNPSearchTool
55 {
56 public:
58 
59  /// @name IUITool implementation
60  /// @{
61  virtual IUITool* Clone() const;
62  virtual string GetName() const;
63  virtual string GetDescription() const;
64  /// @}
65 
66  /// @name IDMSearchTool implementation
67  /// @{
70  /// @}
71 
72  /// @name IExtension implementation
73  /// @{
74  virtual string GetExtensionIdentifier() const;
75  virtual string GetExtensionLabel() const;
76  /// @}
77 
78 protected:
79  /// implementing CSearchToolBase pure virtual function
81 };
82 
83 
84 ///////////////////////////////////////////////////////////////////////////////
85 /// CSNPSearchTool
87  public CObject,
88  public IDMSearchQuery
89 {
90 public:
91  CSNPSearchQuery(const string& terms);
92 
93  string GetTerms() const { return m_Terms; }
94 
95  virtual string ToString() const { return m_Terms; }
96 protected:
97  string m_Terms;
98 };
99 
100 
101 ///////////////////////////////////////////////////////////////////////////////
102 /// CSNPSearchForm
103 
105 {
106 public:
109 
110  /// @name IDMSearchForm implementation
111  /// @{
112  virtual void Create();
113  virtual void Init();
114  virtual void Update();
115 
117 
118  virtual wxSizer * GetWidget(wxWindow * parent);
119 
120  virtual void UpdateContexts();
121 
122 protected:
123  virtual void x_LoadSettings(const CRegistryReadView& view);
124  virtual void x_SaveSettings(CRegistryWriteView view) const;
125 
127 
128 protected:
130  typedef pair<string, string> TStrPair;
131  typedef vector<TStrPair> TNamePairs;
132 };
133 
134 
135 ///////////////////////////////////////////////////////////////////////////////
136 /// CSNPSearchJob
137 ///
139 {
140 public:
141  typedef pair<const char*, const char*> TPair;
142 
144 
145 protected:
146  /// @name CSearchJobBase overridables
147  /// @{
148  virtual bool x_ValidateParams();
149  virtual EJobState x_DoSearch();
150  virtual void x_SetupColumns(CObjectList& obj_list);
151 
152  virtual CObjectListTableModel* x_GetNewOLTModel() const;
153  /// @}
154 
155 protected:
157 };
158 
159 
160 /* @} */
161 
163 
164 
165 /*
166  * ===========================================================================
167  * ===========================================================================
168  */
169 
170 #endif // GUI_SERVICES___SNP_SEARCH_TOOL_HPP
CObjectListTableModel.
CObjectList Data structure representing a list of CObjects with associated Scopes and other optional ...
Definition: object_list.hpp:63
CObject –.
Definition: ncbiobj.hpp:180
CRef –.
Definition: ncbiobj.hpp:618
class CRegistryReadView provides a nested hierarchical view at a particular key.
Definition: reg_view.hpp:58
CSNPSearchForm.
CSNPSearchJob.
CSNPSearchTool.
CSNPSearchTool.
CSearchFormBase.
CSearchJobBase.
CSearchToolBase.
IDMSearchQuery - abstract data mining query.
IDMSearchTool interface representing a single search tool in Data Mining Service.
IDataMiningContext IDataMiningContext represents an abstract context for a Search.
IUITool represents an abstract algorithm that is bound to a UI component.
Definition: ui_tool.hpp:59
Include a standard set of the NCBI C++ Toolkit most basic headers.
virtual void Init()
virtual bool x_ValidateParams()
returns true if Job params are correct, implement in derived classes
virtual void x_LoadSettings(const CRegistryReadView &view)
virtual EJobState x_DoSearch()
performs searching, assuming that params are correct; Implement in derived classes
pair< const char *, const char * > TPair
pair< string, string > TStrPair
virtual string ToString() const
Prepare a string representation of a query (for logging and debugging)
string GetTerms() const
virtual bool IsCompatible(IDataMiningContext *context)
retuns true if the tool is compatible with the provided Search Context
virtual string GetExtensionLabel() const
returns a displayable label for this extension ( please capitalize the key words - "My Extension" )
virtual string GetExtensionIdentifier() const
returns the unique human-readable identifier for the extension the id should use lowercase letters se...
virtual CObjectListTableModel * x_GetNewOLTModel() const
factory method creating new column handler for CObjectListWidget
CSNPSearchTool()
IDMSearchTool.
virtual CIRef< IDMSearchForm > CreateSearchForm()
factory method for creating a form representing the tool
CSNPSearchJob(CSNPSearchQuery &query)
CSNPSearchJob.
virtual wxSizer * GetWidget(wxWindow *parent)
return a widget associated with the form; the form controls the lifetime of the widget (do not delete...
CRef< CSNPSearchQuery > m_Query
virtual string GetDescription() const
returns a detailed description of the method that is used in UI
virtual IUITool * Clone() const
virtual CRef< CSearchJobBase > x_CreateJob(IDMSearchQuery &query)
implementing CSearchToolBase pure virtual function
IDMSearchTool * x_GetTool(void)
virtual string GetName() const
returns unique name of the method that is used in UI to identify it
CRef< CSNPSearchTool > m_Tool
virtual void UpdateContexts()
updates m_ContextCombo
vector< TStrPair > TNamePairs
virtual void Update()
CSNPSearchQuery(const string &terms)
CSNPSearchTool.
virtual void x_SaveSettings(CRegistryWriteView view) const
virtual void x_SetupColumns(CObjectList &obj_list)
add custom columns if needed
virtual CIRef< IDMSearchQuery > ConstructQuery()
virtual void Create()
EJobState
Job states (describe FSM)
Definition: app_job.hpp:86
TObjectType * GetPointer(void) THROWS_NONE
Get pointer,.
Definition: ncbiobj.hpp:998
#define END_NCBI_SCOPE
End previously defined NCBI scope.
Definition: ncbistl.hpp:103
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
Definition: ncbistl.hpp:100
static string query
static CS_CONTEXT * context
Definition: will_convert.c:21
Modified on Mon May 20 05:04:38 2024 by modify_doxy.py rev. 669887