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

Go to the SVN repository for this file.

1 #ifndef GUI_WIDGETS___FILE_LOAD_WIZARD__HPP
2 #define GUI_WIDGETS___FILE_LOAD_WIZARD__HPP
3 
4 /* $Id: file_load_wizard.hpp 44093 2019-10-24 20:19:01Z filippov $
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
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 
43 
45 
47 
49 
51 
52 class CFileLoadPanel;
53 
55  public CObject,
57  public IToolWizard,
58  public IRegSettings
59 {
60 public:
62 
63  /// @name IOpenObjectsPanelClient interface implementation
64  /// @{
65  virtual string GetLabel() const;
66  virtual IExecuteUnit* GetExecuteUnit();
67  /// @}
68 
69  /// @name IToolWizard interface implementation
70  /// @{
71  virtual void SetParentWindow(wxWindow* parent);
72  virtual IWizardPage* GetFirstPage();
73  virtual IWizardPage* GetOptionsPage();
74  virtual void SetPrevPage(IWizardPage* prevPage);
75  virtual void SetNextPage(IWizardPage* nexPage);
76  /// @}
77 
78  /// @name IRegSettings interface implementation
79  /// @{
80  virtual void SetRegistryPath(const string& path);
81  virtual void LoadSettings();
82  virtual void SaveSettings() const;
83  /// @}
84 
85  void LoadFormats(const vector<string>& format_ids);
86 
87  void SetWorkDir(const wxString& workDir);
88 
89  const vector<CIRef<IFileLoadPanelClient> >& GetFormatManagers() const { return m_FormatManagers; }
90  CFileLoadMRUList& GetFileMRUList() { return m_FileMRUList; }
91 
92  void SetFilenames(vector<wxString>& filenames);
93 
94  vector<wxString> GetFilenames() const { return m_Filenames; }
95 
96  void OnFormatChanged(int format);
97 
98 protected:
99  class CFilePage : public IWizardPage
100  {
101  public:
102  CFilePage(CFileLoadWizard& manager) : m_Manager(manager) {}
103  virtual wxPanel* GetPanel();
104  virtual bool CanLeavePage(bool forward) { return m_Manager.x_CanLeavePage(); }
105 
106  virtual IWizardPage* GetNextPage() { return m_Manager.x_GetNextPage(); }
107  virtual IWizardPage* GetPrevPage() { return 0; }
108  virtual IWizardPage* GetOptionsPage() { return m_Manager.x_GetOptionsPage(); }
109  virtual void SetNextPage(IWizardPage*) {}
110  virtual void SetPrevPage(IWizardPage*) {}
111  virtual void SetOptionsPage(IWizardPage*) {}
112 
113  private:
115  };
116 
117  CFileLoadPanel* x_GetFileSelectPanel();
118  bool x_CanLeavePage();
119  IWizardPage* x_GetNextPage();
120  IWizardPage* x_GetOptionsPage();
121  bool x_CheckFormatConflict(const vector<wxString>& filenames);
122 
123 protected:
124  wxWindow* m_ParentWindow;
126 
127  string m_RegPath;
128 
129  vector<CIRef<IFileLoadPanelClient> > m_FormatManagers;
131 
132  vector<wxString> m_Filenames;
136  wxString m_WorkDir;
137 };
138 
139 
141 
142 
143 #endif // GUI_WIDGETS___FILE_LOAD_WIZARD__HPP
144 
CFilePage(CFileLoadWizard &manager)
virtual IWizardPage * GetPrevPage()
virtual bool CanLeavePage(bool forward)
virtual void SetPrevPage(IWizardPage *)
virtual IWizardPage * GetOptionsPage()
virtual void SetOptionsPage(IWizardPage *)
virtual IWizardPage * GetNextPage()
virtual void SetNextPage(IWizardPage *)
vector< wxString > m_Filenames
CFilePage m_FileSelectPage
CFileLoadPanel * m_FileSelectPanel
const vector< CIRef< IFileLoadPanelClient > > & GetFormatManagers() const
CFileLoadMRUList m_FileMRUList
vector< wxString > GetFilenames() const
vector< CIRef< IFileLoadPanelClient > > m_FormatManagers
wxWindow * m_ParentWindow
IWizardPage * m_StartPage
CFileLoadMRUList & GetFileMRUList()
CObject –.
Definition: ncbiobj.hpp:180
virtual IExecuteUnit * GetExecuteUnit()
IRegSettings An interface for objects that save / restore settings using CGuiRegistry.
virtual void SaveSettings() const =0
virtual void LoadSettings()=0
virtual void SetRegistryPath(const string &path)=0
virtual void SetNextPage(IWizardPage *)
Sets a wizard page which should show after the last page of the tool.
Definition: tool_wizard.hpp:63
virtual IWizardPage * GetOptionsPage()
Returns page for tool options (long wizard path via "Options" button)
Definition: tool_wizard.hpp:59
virtual void SetPrevPage(IWizardPage *)
Sets a wizard page which should show before the first page of the tool.
Definition: tool_wizard.hpp:61
virtual void SetParentWindow(wxWindow *parent)=0
virtual IWizardPage * GetFirstPage()
Returns first options page (if any) of the tool to be shown in wizard dialog.
Definition: tool_wizard.hpp:57
string GetLabel(const CSeq_id &id)
#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_GUIWIDGETS_LOADERS_EXPORT
Definition: gui_export.h:525
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 Format format
Definition: njn_ioutil.cpp:53
static int filenames
Definition: pcregrep.c:172
void SetWorkDir(wxWindow *wnd, const wxString &workDir)
Definition: work_dir.cpp:38
Modified on Wed Apr 24 14:15:54 2024 by modify_doxy.py rev. 669887