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

Go to the SVN repository for this file.

1 #ifndef PKG_SEQUENCE_EDIT___QUAL_TABLE_LOAD_MANAGER__HPP
2 #define PKG_SEQUENCE_EDIT___QUAL_TABLE_LOAD_MANAGER__HPP
3 
4 /* $Id: qual_table_load_manager.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: Roman Katargin and Bob Falk
30  *
31  * File Description:
32  *
33  */
34 
35 #include <corelib/ncbistl.hpp>
36 #include <corelib/ncbiobj.hpp>
37 
38 #include <gui/gui_export.h>
39 
41 
44 
47 
48 #include <gui/utils/extension.hpp>
50 
52 
54 
57 
58 ///////////////////////////////////////////////////////////////////////////////
59 /// CTableFileLoadManager
60 ///
61 /// CQualTableLoadManager - a Load Manager for Sequin qualifier table files. This
62 /// class implements IFileFormatLoaderManager interface in order to work with
63 /// generic Format LoadManager.
65  public CObject,
67  public IFileLoadPanelClient,
68  public IToolWizard,
69  public IExtension,
70  public IRegSettings
71 {
72 public:
74  void SetTopLevelEntry(CSeq_entry_Handle seq_entry) { m_TopSeqEntry = seq_entry; }
75 
76 
77  /// @name IFileLoadPanelClient interface implementation
78  /// @{
79  virtual string GetLabel() const;
80  virtual wxString GetFormatWildcard() const;
81  virtual string GetFileLoaderId() const { return Id(); }
82  /// @}
83 
84  /// @name IUILoadManager interface implementation
85  /// @{
86  virtual void SetServiceLocator(IServiceLocator* srv_locator);
87  virtual void SetParentWindow(wxWindow* parent);
88  virtual const IUIObject& GetDescriptor() const;
89  virtual void InitUI();
90  virtual void CleanUI();
91  virtual wxPanel* GetCurrentPanel();
92  virtual bool CanDo(EAction action);
93  virtual bool IsFinalState();
94  virtual bool IsCompletedState();
95  virtual bool DoTransition(EAction action);
96  virtual IAppTask* GetTask();
97  virtual IExecuteUnit* GetExecuteUnit();
98  virtual bool SingleFileLoader() const { return true; }
99  virtual IWizardPage* GetFirstPage() { return &m_DelimitersPage; }
100  virtual void SetPrevPage(IWizardPage* prevPage) { m_DelimitersPage.SetPrevPage(prevPage); }
101  /// @}
102 
103  /// @{ IFileFormatLoaderManager - additional members
104  /// @{
105  virtual wxString GetFormatWildcard();
106  virtual bool ValidateFilenames(const vector<wxString>& filenames);
107  virtual void SetFilenames(const vector<wxString>& filenames);
108  virtual void GetFilenames(vector<wxString>& filenames) const;
109  virtual bool IsInitialState();
110  virtual bool RecognizeFormat(const wxString& filename);
111  virtual bool RecognizeFormat(CFormatGuess::EFormat fmt);
112  /// @}
113 
114  /// @name IExtension interface implementation
115  /// @{
116  virtual string GetExtensionIdentifier() const;
117  virtual string GetExtensionLabel() const;
118  /// @}
119 
120  /// @name IRegSettings interface implementation
121  /// @{
122  virtual void SetRegistryPath(const string& path);
123  virtual void LoadSettings();
124  virtual void SaveSettings() const;
125  /// @}
126 
127  static string Id() { return "file_loader_qual_table"; }
128  static string Label() { return "Qualifier Table"; }
129 
130  bool ShouldMakeMailReport();
132 
133 protected:
136  wxWindow* m_ParentWindow;
137  string m_RegPath;
138  vector<wxString> m_FileNames;
139 
141 
142  void x_ConvertToSeqAnnot();
143 
144  /// Data is loaded initially into this table for delimiter processing
146 
147  /// After delimiters and column types are identified, table is copied
148  /// to this table for saving as asn and data (feature) transforms
150 
153 
155 
156  // Wizard navigation implementation
157 
159  {
160  public:
162  virtual wxPanel* GetPanel();
163  virtual bool CanLeavePage(bool forward);
164  virtual IWizardPage* GetNextPage();
167 
168 
169  class CColumnIdPage : public CWizardPage
170  {
171  public:
173  virtual wxPanel* GetPanel();
174  virtual bool CanLeavePage(bool forward);
175  virtual IWizardPage* GetPrevPage();
176  virtual IWizardPage* GetNextPage();
179 
180 
182 };
183 
185 
186 
187 #endif // PKG_SEQUENCE_EDIT___QUAL_TABLE_LOAD_MANAGER__HPP
EFormat
The formats are checked in the same order as declared here.
CObject –.
Definition: ncbiobj.hpp:180
CColumnIdPage(CQualTableLoadManager &manager)
CDelimitersPage(CQualTableLoadManager &manager)
CTableFileLoadManager.
virtual bool IsCompletedState()
Manager goes into "Complete" state when "Finish" button is pressed and all input data is gatherred an...
CRef< CTableImportDataSource > m_ImportedTableData
Data is loaded initially into this table for delimiter processing.
virtual void SetRegistryPath(const string &path)
virtual bool IsFinalState()
True if Tool Manager has reached its final state, i.e.
virtual void InitUI()
Initializes the Manager before using it in UI.
virtual bool CanDo(EAction action)
Indicates whether given transition is possible in the current state.
virtual void SetParentWindow(wxWindow *parent)
virtual string GetLabel() const
virtual void SetFilenames(const vector< wxString > &filenames)
initilize the manager with the given filenames
virtual string GetFileLoaderId() const
CRef< CTableAnnotDataSource > m_AnnotTableData
After delimiters and column types are identified, table is copied to this table for saving as asn and...
virtual void SetServiceLocator(IServiceLocator *srv_locator)
Sets / unsets Service Locator.
virtual bool IsInitialState()
return true if the current state of the loader UI is the first valid state (first step in a wizard-li...
CAttribTableColumnIdPanel * x_GetColumnIdPanel()
CQualTableLoadManager::CDelimitersPage m_DelimitersPage
virtual wxPanel * GetCurrentPanel()
Return the panel corresponding to the current state of Tool Manager.
CAttribTableDelimitersPanel * m_TableDelimitersPanel
virtual void CleanUI()
CleanUI() is called after the host finished using the manager.
CQualTableLoadManager::CColumnIdPage m_ColumnIdPage
virtual wxString GetFormatWildcard() const
return file wildcard for the format (example - "*.txt;*.tab" )
virtual const IUIObject & GetDescriptor() const
Returns the object describing this tool (UI meta data).
virtual bool DoTransition(EAction action)
Performs transition if possible and returns true, otherwise the function shall warn the user about th...
virtual string GetExtensionLabel() const
returns a displayable label for this extension ( please capitalize the key words - "My Extension" )
virtual void SaveSettings() const
CAttribTableDelimitersPanel * x_GetDelimitersPanel()
void SetTopLevelEntry(CSeq_entry_Handle seq_entry)
virtual bool SingleFileLoader() const
returns true if loader can handle only one file
virtual bool RecognizeFormat(const wxString &filename)
return true if the given file format is supported by this manager
virtual string GetExtensionIdentifier() const
returns the unique human-readable identifier for the extension the id should use lowercase letters se...
CAttribTableColumnIdPanel * m_TableColumnIdPanel
virtual IAppTask * GetTask()
Once parameters are gathered and validated this function is called to produce the final Task object t...
virtual IWizardPage * GetFirstPage()
Returns first options page (if any) of the tool to be shown in wizard dialog.
CQualTableLoadManager()
CQualTableLoadManager.
virtual IExecuteUnit * GetExecuteUnit()
virtual void SetPrevPage(IWizardPage *prevPage)
Sets a wizard page which should show before the first page of the tool.
virtual void GetFilenames(vector< wxString > &filenames) const
get actual filenames that will be opened
virtual bool ValidateFilenames(const vector< wxString > &filenames)
checks given filenames and returns true if the manager can handle them, otherwise - shows an error me...
CSeq_entry_Handle –.
CUIObject - default mix-in implementation of IUIObject.
Definition: ui_object.hpp:81
virtual void SetPrevPage(IWizardPage *page)
IAppTask.
Definition: app_task.hpp:83
IExtension IExtension interface represents an abstract pluggable component.
Definition: extension.hpp:57
IFileFormatLoaderManager.
IRegSettings An interface for objects that save / restore settings using CGuiRegistry.
IServiceLocator - an abstract mechanism for locating services.
Definition: service.hpp:71
IUIObject - object that provides basic properties often required in a UI object.
Definition: ui_object.hpp:63
#define END_NCBI_SCOPE
End previously defined NCBI scope.
Definition: ncbistl.hpp:103
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
Definition: ncbistl.hpp:100
Defines to provide correct exporting from DLLs in Windows.
Portable reference counted smart and weak pointers using CWeakRef, CRef, CObject and CObjectEx.
The NCBI C++/STL use hints.
static int filenames
Definition: pcregrep.c:172
Modified on Tue Apr 23 07:38:26 2024 by modify_doxy.py rev. 669887