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

Go to the SVN repository for this file.

1 #ifndef PKG_ALIGNMENT___LBLAST_UI_DATA_SOURCE__HPP
2 #define PKG_ALIGNMENT___LBLAST_UI_DATA_SOURCE__HPP
3 
4 /* $Id: lblast_ui_data_source.hpp 38477 2017-05-15 21:10:59Z evgeniev $
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: Liangshou Wu
30  *
31  * File Description:
32  *
33  */
34 
35 #include <corelib/ncbistl.hpp>
36 
39 
41 #include <gui/core/pt_item.hpp>
43 
44 #include <gui/utils/extension.hpp>
45 #include <gui/utils/ui_object.hpp>
47 
49 
51 
52 
53 /** @addtogroup GUI_PKG_NCBI_INTERNAL
54 *
55 * @{
56 */
57 
58 /// commands introduced by BAM data source
60  eCmdLoadDB = 12351
61 };
62 
64 class CLBLASTParamsPanel;
65 
66 ///////////////////////////////////////////////////////////////////////////////
67 /// CLBLASTUIDataSource
68 
70  public CObject,
71  public IExtension,
73  public IUIDataSource,
74  public IDataLoaderProvider,
76 {
77 public:
80 
81  /// @name IExtension interface implementation
82  /// @{
83  virtual string GetExtensionIdentifier() const;
84  virtual string GetExtensionLabel() const;
85  /// @}
86 
87  /// @name IServiceLocatorConsumer implementation
88  /// @{
89  virtual void SetServiceLocator(IServiceLocator* locator);
90  /// @}
91 
92  /// @name IUIDataSource interface implementation
93  /// @{
94  virtual IUIDataSourceType& GetType() const;
95 
96  virtual const IUIObject& GetDescr();
97 
98  virtual bool IsOpen();
99  virtual bool Open();
100  virtual bool Close();
101 
102  virtual void EditProperties();
103 
104  virtual IUIToolManager* GetLoadManager();
105 
106  virtual int GetDefaultCommand();
107  virtual wxEvtHandler* CreateEvtHandler();
108  /// @}
109 
110  /// @name IDataLoaderProvider implementation
111  /// @{
112  virtual string AddDataLoader(const objects::CUser_object& obj);
113 
114  virtual string GetLoaderName(const objects::CUser_object& obj) const;
115  /// @}
116 
117  /// @name IExplorerItemCmdContributor implementation
118  /// @{
119  virtual IExplorerItemCmdContributor::TContribution GetMenu(wxTreeCtrl& treeCtrl, PT::TItems& items);
120  /// @}
121 
122 protected:
124 
126 
128 
129  bool m_Open;
130 };
131 
132 
133 ///////////////////////////////////////////////////////////////////////////////
134 /// CLBLASTUIDataSourceType
135 
137  public CObject,
138  public IUIDataSourceType,
139  public IExtension
140 {
141 public:
143 
144  /// @name IUIDataSourceType interface implementation
145  /// @{
146  virtual const IUIObject& GetDescr();
147  virtual IUIDataSource* CreateDataSource();
148  virtual bool AutoCreateDefaultDataSource();
149  /// @}
150 
151  /// @name IExtension interface implementation
152  /// @{
153  virtual string GetExtensionIdentifier() const;
154  virtual string GetExtensionLabel() const;
155  /// @}
156 
157 protected:
159 };
160 
161 
162 ///////////////////////////////////////////////////////////////////////////////
163 /// CLBLASTUILoadManager
164 
166  public CObject,
167  public IUIToolManager,
168  public IRegSettings
169 {
170 public:
172 
173  /// @name IUIToolManager interface implementation
174  /// @{
175  virtual void SetServiceLocator(IServiceLocator* srv_locator);
176  virtual void SetParentWindow(wxWindow* parent);
177  virtual const IUIObject& GetDescriptor() const;
178  virtual void InitUI();
179  virtual void CleanUI();
180  virtual wxPanel* GetCurrentPanel();
181  virtual bool CanDo(EAction action);
182  virtual bool IsFinalState();
183  virtual bool IsCompletedState();
184  virtual bool DoTransition(EAction action);
185  virtual IAppTask* GetTask();
186  /// @}
187 
188  /// @name IRegSettings interface implementation
189  /// @{
190  virtual void SetRegistryPath(const string& path);
191  virtual void LoadSettings();
192  virtual void SaveSettings() const;
193  /// @}
194 
195 protected:
196  enum EState {
197  eInvalid = -1,
200  eCompleted
201  };
202 
203 protected:
205  wxWindow* m_ParentWindow;
206 
209 
210  string m_RegPath;
211  mutable string m_SavedInput; // input saved in the registry
212  string m_AssmAcc;
213  vector<CRef<objects::CSeq_id> > m_RefSeqIds;
214 
218 
220 };
221 
222 
223 /* @} */
224 
226 
227 #endif // PKG_ALIGNMENT___LBLAST_UI_DATA_SOURCE__HPP
CLBLASTUIDataSourceType.
CLBLASTUIDataSource.
CLBLASTUILoadManager.
CObject –.
Definition: ncbiobj.hpp:180
CProjectSelectorPanel - a panel that allows the user to specify how the project items created by a pl...
CUIObject - default mix-in implementation of IUIObject.
Definition: ui_object.hpp:81
IAppTask.
Definition: app_task.hpp:83
IDataLoaderProvider - an interface representing a Data Source.
IExplorerItemCmdContributor - interface representing a component that contributes commands applicable...
Definition: pt_item.hpp:149
pair< wxMenu *, wxEvtHandler * > TContribution
Contribution consists of a Menu object and event handler.
Definition: pt_item.hpp:152
IExtension IExtension interface represents an abstract pluggable component.
Definition: extension.hpp:57
IRegSettings An interface for objects that save / restore settings using CGuiRegistry.
IServiceLocatorConsumer - classes that need IServiceLocator should implement this interface.
Definition: service.hpp:103
IServiceLocator - an abstract mechanism for locating services.
Definition: service.hpp:71
IUIDataSourceType - defines a type of a Data Source, can serve as a Data Source factory.
IUIDataSource - an interface representing a Data Source.
IUIObject - object that provides basic properties often required in a UI object.
Definition: ui_object.hpp:63
virtual string GetExtensionLabel() const
returns a displayable label for this extension ( please capitalize the key words - "My Extension" )
virtual void SaveSettings() const
IServiceLocator * m_SrvLocator
virtual IUIDataSourceType & GetType() const
virtual string GetExtensionLabel() const
returns a displayable label for this extension ( please capitalize the key words - "My Extension" )
CLBLASTUIDataSource(CLBLASTUIDataSourceType &type)
virtual wxPanel * GetCurrentPanel()
Return the panel corresponding to the current state of Tool Manager.
CLBLASTUILoadManager()
CLBLASTUILoadManager.
virtual string GetExtensionIdentifier() const
returns the unique human-readable identifier for the extension the id should use lowercase letters se...
virtual bool IsOpen()
a Data source needs to be open before use and closed after.
virtual const IUIObject & GetDescr()
returns UI description of the object (label, icon etc.)
virtual bool IsCompletedState()
Manager goes into "Complete" state when "Finish" button is pressed and all input data is gatherred an...
CLBLASTUIDataSourceType()
CLBLASTUIDataSourceType.
virtual bool AutoCreateDefaultDataSource()
returns "true" if this type needs to create a default instance of the Data Source at start-up
virtual void CleanUI()
CleanUI() is called after the host finished using the manager.
virtual void SetServiceLocator(IServiceLocator *srv_locator)
Sets / unsets Service Locator.
virtual void SetServiceLocator(IServiceLocator *locator)
virtual IUIDataSource * CreateDataSource()
factory method; create an Data Source instance
virtual bool Open()
Prepares Data Source for use, any initialization that can be potentially time-consuming or may requir...
ELBLASTCommands
commands introduced by BAM data source
virtual IExplorerItemCmdContributor::TContribution GetMenu(wxTreeCtrl &treeCtrl, PT::TItems &items)
for the given set of items returns a contribution
virtual string AddDataLoader(const objects::CUser_object &obj)
Add a new data loader to object manager.
virtual string GetLoaderName(const objects::CUser_object &obj) const
Get the data loader's name based on input object.
virtual IUIToolManager * GetLoadManager()
virtual void SetRegistryPath(const string &path)
virtual void SetParentWindow(wxWindow *parent)
CLBLASTParamsPanel * m_ParamsPanel
CLBLASTLoadParams m_LBLASTParams
CRef< CLBLASTUIDataSourceType > m_Type
virtual wxEvtHandler * CreateEvtHandler()
CProjectSelectorPanel * m_ProjectSelPanel
SProjectSelectorParams m_ProjectParams
virtual bool DoTransition(EAction action)
Performs transition if possible and returns true, otherwise the function shall warn the user about th...
virtual string GetExtensionIdentifier() const
returns the unique human-readable identifier for the extension the id should use lowercase letters se...
vector< CRef< objects::CSeq_id > > m_RefSeqIds
virtual void InitUI()
Initializes the Manager before using it in UI.
virtual const IUIObject & GetDescriptor() const
Returns the object describing this tool (UI meta data).
virtual bool IsFinalState()
True if Tool Manager has reached its final state, i.e.
IServiceLocator * m_SrvLocator
virtual IAppTask * GetTask()
Once parameters are gathered and validated this function is called to produce the final Task object t...
virtual const IUIObject & GetDescr()
returns UI description of the type (label, icon etc.)
virtual bool CanDo(EAction action)
Indicates whether given transition is possible in the current state.
#define END_NCBI_SCOPE
End previously defined NCBI scope.
Definition: ncbistl.hpp:103
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
Definition: ncbistl.hpp:100
vector< CItem * > TItems
Definition: pt_item.hpp:113
The NCBI C++/STL use hints.
SProjectSelectorParams - holds data for CProjectSelectorPanel.
Definition: type.c:6
Modified on Wed May 08 12:05:37 2024 by modify_doxy.py rev. 669887