NCBI C++ ToolKit
ui_file_load_manager.cpp
Go to the documentation of this file.

Go to the SVN repository for this file.

1 /* $Id: ui_file_load_manager.cpp 47479 2023-05-02 13:24:02Z ucko $
2  * ===========================================================================
3  *
4  * PUBLIC DOMAIN NOTICE
5  * National Center for Biotechnology Information
6  *
7  * This software/database is a "United States Government Work" under the
8  * terms of the United States Copyright Act. It was written as part of
9  * the author's official duties as a United States Government employee and
10  * thus cannot be copyrighted. This software/database is freely available
11  * to the public for use. The National Library of Medicine and the U.S.
12  * Government have not placed any restriction on its use or reproduction.
13  *
14  * Although all reasonable efforts have been taken to ensure the accuracy
15  * and reliability of the software and data, the NLM and the U.S.
16  * Government do not and cannot warrant the performance or results that
17  * may be obtained by using this software or data. The NLM and the U.S.
18  * Government disclaim all warranties, express or implied, including
19  * warranties of performance, merchantability or fitness for any particular
20  * purpose.
21  *
22  * Please cite the author in any work or product based on this material.
23  *
24  * ===========================================================================
25  *
26  * Authors: Andrey Yazhuk
27  *
28  */
29 
30 #include <ncbi_pch.hpp>
31 
33 
36 #include <gui/core/open_dlg.hpp>
39 #include <gui/core/document.hpp>
40 
44 
46 
50 
53 
54 #include <util/format_guess.hpp>
55 
56 #include <wx/msgdlg.h>
57 #include <wx/filename.h>
58 
60 
61 ///////////////////////////////////////////////////////////////////////////////
62 /// EXTENSION_POINT__UI_DATA_SOURCE_TYPE Extension point declaration
63 
65  sDSTypeExtPoint("file_format_loader_manager",
66  "File Format Loader Manager");
67 
68 ///////////////////////////////////////////////////////////////////////////////
69 /// CFileLoadManager
71 : m_Descriptor("File Import", ""),
72  m_OpenDlg(NULL),
73  m_SrvLocator(NULL),
74  m_ParentWindow(NULL),
75  m_State(eInvalid),
76  m_CurrFormat(-1),
77  m_CheckFormat(true),
78  m_AltToolManager(NULL),
79  m_OptionPanel(NULL),
80  m_ProjectSelPanel(NULL),
81  m_FilePage(*this),
82  m_OpenObjectsPage()
83 {
84 }
85 
87 {
89 }
90 
92 {
93  // predefined system formats
96 
97  // get all other file format from an Extension Point
98  vector< CIRef<IFileFormatLoaderManager> > managers;
99  GetExtensionAsInterface("file_format_loader_manager", managers);
100 
101  for( size_t i = 0; i < managers.size(); ++i ) {
102  IFileFormatLoaderManager* mgr = managers[i].GetPointer();
103  AddFileFormat(mgr);
104  }
105 }
106 
107 
109 {
110  m_OpenDlg = dlg;
111 }
112 
113 
115 {
116  m_SrvLocator = srv_locator;
117 }
118 
119 
120 void CFileLoadManager::SetParentWindow(wxWindow* parent)
121 {
122  m_ParentWindow = parent;
123 }
124 
125 
127 {
128  if (m_CurrFormat > -1) {
130  return manager->GetDescriptor();
131  }
132 
133  return m_Descriptor;
134 }
135 
136 
138 {
140  if (m_OptionPanel)
142 
143  for( size_t i = 0; i < m_FormatManagers.size(); i++) {
147  manager.InitUI();
148  }
149 }
150 
151 
153 {
154  for( size_t i = 0; i < m_FormatManagers.size(); i++) {
156  manager.CleanUI();
157  manager.SetServiceLocator(NULL);
158  }
159 
160  m_CurrFormat = -1;
163  m_FilePage.Reset();
164 }
165 
166 
168 {
169  _ASSERT(manager);
170  if(manager) {
171  m_FormatManagers.push_back(TFormatMgrRef(manager));
172  }
173 }
174 
175 
177 {
179 
180  if(m_OptionPanel) {
183  }
184 }
185 
186 
187 /// called by File Format panel when a user selects a format
189 {
193 }
194 
195 
197 {
198  if(m_State == eSelectFiles) {
199  return x_GetOptionsPanel();
200  } else if(m_State == eFormatDefined) {
201  // in this state the panel is provided by the current Format Load Manager
203  return manager->GetCurrentPanel();
204  } else if(m_State == eSelectProjects) {
205  if(m_ProjectSelPanel == NULL) {
207 
212  }
213  return m_ProjectSelPanel;
214  }
215  return NULL;
216 }
217 
218 
219 /*
220  bool can = false;
221 
222  if(action == eNext) {
223  // we enable this transition only if the selected file format
224  // manager can handle the selected files
225  TFormatMgrRef manager = m_FormatManagers[m_CurrFormat];
226 
227  vector<string> filenames;
228  m_OptionPanel->GetFilenames(filenames);
229 
230  if(filenames.empty()) {
231  NcbiErrorBox("Please select at least one file!");
232  } else {
233  can = manager->ValidateFilenames(filenames);
234  }
235  }
236  return can;
237 */
238 
240 {
241  switch(m_State) {
242  case eSelectFiles:
243  return action == eNext;
244 
245  case eFormatDefined: {
246  // in this state all decisions are made by the current Format Manager
248  if(manager->IsInitialState()) {
249  return true;
250  } else {
251  return manager->CanDo(action);
252  }
253  }
254  case eSelectProjects:
255  return action == eNext || action == eBack;
256 
257  case eCompleted:
258  return false;
259 
260  default:
261  _ASSERT(false);
262  return false;
263  }
264 }
265 
266 
268 {
269  return m_State == eSelectProjects;
270 }
271 
272 
274 {
275  return m_State == eCompleted;
276 }
277 
278 static const wxFormatString kFORMAT_CONFLICT_MSG = "Detected data format '%s' doesn't appear to match the format you selected.\n"
279  "Are you sure you want to load your data as '%s'?\nClick 'Yes' to proceed or click 'No' to process the data as '%s'.";
280 
281 bool CFileLoadManager::x_CheckFormatConflict(const vector<wxString>& filenames, TFormatMgrRef& manager)
282 {
283  if (m_CurrFormat == 0) // AutoDetect
284  return true;
285  if (manager->CanGuessFormat() == false)
286  return true;
287  try {
288  CFileAutoLoader auto_loader;
290  IFileFormatLoaderManager* detected_manager = auto_loader.GetCurrentManager();
291  if (detected_manager != 0 && detected_manager != manager) {
292  const char* format_name = CFormatGuess::GetFormatName(fmt);
293  wxString detected_frm = format_name ? ToWxString(format_name ) : wxT("No name");
294  wxString selected_frm;
295  m_OptionPanel->GetSelectedFormat(selected_frm);
296  int resp = NcbiMessageBoxW(wxString::Format(kFORMAT_CONFLICT_MSG, detected_frm, selected_frm, detected_frm),
298  if (resp == eCancel)
299  return false;
300  if ( resp == eNo) {
301  m_CurrFormat = -1;
302  manager.Reset(detected_manager);
303  for( size_t i = 0; i < m_FormatManagers.size(); i++) {
304  if (manager == m_FormatManagers[i]) {
305  m_CurrFormat = static_cast<int>(i);
307  break;
308  }
309  }
310 
311  }
312  }
313  } catch (...) {
314  }
315  return true;
316 }
317 
318 
319 // transition to a new state specified by the given action
321 {
323 
324  if(m_State == eSelectFiles && action == eNext) {
325  vector<wxString> filenames;
327 
328  ITERATE(vector<wxString>, it, filenames) {
329  if (!CCompressedFile::FileExists(*it)) {
330  wxMessageBox(wxT("Wrong file name or file doesn't exist:\n") + *it,
331  wxT("File Open Error"),wxICON_ERROR | wxOK);
332  return false;
333  }
334  }
335  if (filenames.empty()) {
336  NcbiErrorBox("Please select at least one file!");
337  return false;
338  }
339 
341  // select Format Manager for the format
343 
345  return false;
346  if (!manager->ValidateFilenames(filenames))
347  return false;
348 
349  string id = manager->GetFileLoaderId();
350  if (id == "file_loader_auto") {
351  CFileAutoLoader* autoLoader = dynamic_cast<CFileAutoLoader*>(manager.GetPointer());
352  if (autoLoader) {
353  IFileFormatLoaderManager* curManager = autoLoader->GetCurrentManager();
354  if (curManager) {
355  id = curManager->GetFileLoaderId();
356  }
357  }
358  }
359 
360  if (id == "file_loader_gbench_project") {
361  // Project and Workspace have no parameters nor do they need Select Project page
362  manager->SetFilenames(filenames);
364  }
365  else if(manager->IsCompletedState()) {
366  manager->SetFilenames(filenames);
367  m_State = eSelectProjects; // skip this manager
368  } else {
369  manager->SetFilenames(filenames);
371  }
372  return true;
373  } else if(m_State == eFormatDefined) {
375 
376  if(action == eBack && manager->IsInitialState()) {
378  if (m_OptionPanel)
380 
381  } else {
382  manager->DoTransition(action);
383 
384  if(action == eNext && manager->IsCompletedState()) {
386  }
387  // otherwise remain in eFormatDefined
388  }
389  return true;
390  } else if(m_State == eSelectProjects) {
391  if(action == eBack) {
393  if(manager->IsInitialState()) {
395  if (m_OptionPanel)
397  } else {
399  manager->DoTransition(action);
400  }
401  return true;
402  } else if(action == eNext) {
406  return true;
407  }
408  }
409  }
410  _ASSERT(false);
411  return false;
412 }
413 
414 
416 {
418  if (!service->HasWorkspace())
419  service->CreateNewWorkspace();
420  CRef<objects::CGBWorkspace> ws = service->GetGBWorkspace();
421 
422  CUniqueLabelGenerator projectNames;
424  string projectName = projectNames.MakeUniqueLabel(new_prj_name);
425 
426  CRef<CGBDocument> doc(CSelectProjectOptions::CreateProject(service, projectName, new_prj_name));
427  service->AddProject(*doc);
428  return doc->GetId();
429 }
430 
432 {
434  if(m_CurrFormat > -1) {
436 
437  vector<wxString> filenames;
438  manager->GetFilenames(filenames);
439  string id = manager->GetFileLoaderId();
440  wxString label = ToWxString(manager->GetDescriptor().GetLabel());
441 
442  ITERATE(vector<wxString>, it, filenames)
444 
445  CIRef<IObjectLoader> loader(dynamic_cast<IObjectLoader*>(manager->GetExecuteUnit()));
446  if (loader) {
448  CSelectProjectOptions options;
450  return new CObjectLoadingTask(srv, *loader, options);
451  }
452  else {
453  IAppTask* task = manager->GetTask();
454  if (!task) return 0;
455 
456  CDataLoadingAppTask* dlTask = dynamic_cast<CDataLoadingAppTask*>(task);
457  if (dlTask) {
458  CSelectProjectOptions options;
460  // Workaround to make sure that all items are added to the same new project
462  auto new_id = x_CreateNewProject("New Project");
463  options.Set_AddToExistingProject(new_id, options.GetFolderName());
464  }
465  dlTask->SetOptions(options);
466  }
467  return task;
468  }
469  }
470 
471  _ASSERT(false); // must not happen
472  return NULL;
473 }
474 
476 {
477  IExecuteUnit* execute_unit = 0;
478  if(m_CurrFormat > -1) {
480  execute_unit = manager->GetExecuteUnit();
481  }
482  return execute_unit;
483 }
484 
486 {
488  return &m_FilePage;
489 }
490 
492 {
493  m_OpenObjectsPage = prevPage;
495 }
496 
498 {
500  return;
501 
502  CFileAutoLoader* auto_loader = dynamic_cast<CFileAutoLoader*>(m_AutodetectFormat.GetPointer());
503  if (nullptr == auto_loader)
504  return;
505 
506  auto_loader->ResentCurrentManager();
507 }
508 
510 {
511  if (m_CurrFormat >= 0) {
513  manager->SetPrevPage(m_OpenObjectsPage);
514  if (m_OpenObjectsPage) {
515  m_OpenObjectsPage->SetNextPage(manager->GetFirstPage());
516  m_OpenObjectsPage->SetOptionsPage(manager->GetOptionsPage());
517  }
518  }
519  else {
520  if (m_OpenObjectsPage) {
523  }
524  }
525 
526  if (m_OpenDlg) {
527  m_OpenDlg->Update();
528  }
529  else if (m_ParentWindow) {
531  m_ParentWindow->ProcessWindowEvent(evt);
532  }
533 }
534 
536 {
537  vector<wxString> filenames;
539 
540  if(filenames.empty()) {
541  NcbiErrorBox("Please select at least one file!");
542  return false;
543  }
544 
546  // select Format Manager for the format
549  return false;
550 
551  if (! manager->ValidateFilenames(filenames)) {
552  NcbiErrorBox("The file(s) cannot be opened with this file format manager!");
553  return false;
554  }
555 
556  manager->SetFilenames(filenames);
557  manager->GetFilenames(filenames);
558  string id = manager->GetFileLoaderId();
559  wxString label = ToWxString(manager->GetDescriptor().GetLabel());
560 
561  ITERATE(vector<wxString>, it, filenames)
563 
564  return true;
565 }
566 
568 {
570 
571  if( ! m_Filenames.empty()) {
572  for( size_t i = 0; i < m_FormatManagers.size(); i++ ) {
574 
575  bool ok = true;
576  for( size_t j = 0; ok && j < m_Filenames.size(); j++ ) {
577  const wxString& name = m_Filenames[j];
578  ok = manager.RecognizeFormat(name);
579  }
580  if(ok) { // manager recognized all files
581  m_CurrFormat = (int)i;
583  return;
584  }
585  }
586  }
587 }
588 
590 {
591  if (!m_OptionPanel) {
592  // create format descriptors
593  vector<CFileLoadOptionPanel::CFormatDescriptor> formats;
594 
595  for( size_t i = 0; i < m_FormatManagers.size(); i++ ) {
597  const IUIObject& ui_obj = manager.GetDescriptor();
598  string id = manager.GetFileLoaderId();
599  wxString label = ToWxString(ui_obj.GetLabel());
600  wxString wildcard = manager.GetFormatWildcard();
601  bool singleFile = manager.SingleFileLoader();
602  // We don't want to overcrowd file format list
603  // User can explicitly use "Project or Workspace" loader on the left
604  bool hidden = (id == "file_loader_gbench_project");
605 
606  formats.push_back(
608  wildcard,
609  singleFile,
610  hidden));
611  }
612 
613  // Create and setup File Loading Panel
615  m_OptionPanel->SetManager(this);
616  m_OptionPanel->SetFormats(formats);
617 
618  if(m_Filenames.empty()) {
619  // select default format
620  m_CurrFormat = std::max(0, m_CurrFormat); // do not allow -1
622  } else {
623  // have files - autoguess
626  }
627 
630  }
631  return m_OptionPanel;
632 }
633 
634 
635 void CFileLoadManager::SetRegistryPath(const string& path)
636 {
637  m_RegPath = path; // store for later use
638  m_RegPath += "2"; // changed contents of MRU section JIRA: GB-1658
639 
640  for( size_t i = 0; i < m_FormatManagers.size(); i++ ) {
641  TFormatMgrRef manager = m_FormatManagers[i];
642  IRegSettings* rgs = dynamic_cast<IRegSettings*>(manager.GetPointer());
643  if(rgs) {
644  string mgr_path = m_RegPath + "." + manager->GetFileLoaderId();
645  rgs->SetRegistryPath(mgr_path);
646  }
647  }
648 }
649 
650 static const char* kSelectedFormatTag = "SelectedFormat";
651 static const char* kMRUTag = "MRUFiles";
652 static const char* kCheckFormatTag = "CheckFormat";
653 
654 
656 {
657  if( ! m_RegPath.empty()) {
659  CRegistryWriteView view = gui_reg.GetWriteView(m_RegPath);
660 
661  /// remember the selected Format (only if m_OptionPanel exists)
662  if(m_OptionPanel) {
664  if(format != -1) {
666  string mgr_label = manager->GetDescriptor().GetLabel();
667  view.Set(kSelectedFormatTag, mgr_label);
668  }
669  }
670 
671  // save MRU Files
672  vector<string> values;
673  // we package times and paths into the same vector (even elements - time, odd - path)
676 
679  CTime time(it->first);
680  time.ToLocalTime();
681  string s_time = time.AsString(format);
682  string filename = FnToStdString(it->second.GetFileName());
683  string manager_label = FnToStdString(it->second.GetFileLoaderLabel());
684  string manager_id = it->second.GetFileLoaderId();
685  values.push_back(s_time);
686  values.push_back(filename);
687  values.push_back(manager_label);
688  values.push_back(manager_id);
689  }
690  view.Set(kMRUTag, values);
691 
693 
694  // save Managers' settigns
695  for( size_t i = 0; i < m_FormatManagers.size(); i++ ) {
696  TFormatMgrRef manager = m_FormatManagers[i];
697  IRegSettings* rgs = dynamic_cast<IRegSettings*>(manager.GetPointer());
698  if(rgs) {
699  rgs->SaveSettings();
700  }
701  }
702  }
703 }
704 
705 
707 {
708  if( ! m_RegPath.empty()) {
710  CRegistryReadView view = gui_reg.GetReadView(m_RegPath);
711 
712  // load the default option
713  string sel_fmt_label = view.GetString(kSelectedFormatTag, "empty");
714 
715  // load MRU Files
717  vector<string> values;
718  view.GetStringVec(kMRUTag, values);
721 
722  for( size_t i = 0; i + 2 < values.size() ; ) {
723  // process two elements at once
724  string s_time = values[i++];
725  wxString filename = FnToWxString(values[i++]);
726  wxString manager_label = FnToWxString(values[i++]);
727  string manager_id = values[i++];
728 
729  CTime time(s_time, format);
730 
731  time_t t = time.GetTimeT();
732  m_FileMRUList.Add(CFileDescriptor(filename, manager_label, manager_id), t);
733  }
734 
735  m_CheckFormat = view.GetBool(kCheckFormatTag, true);
736 
737  // load Managers' settigns
738  for( size_t i = 0; i < m_FormatManagers.size(); i++ ) {
739  TFormatMgrRef manager = m_FormatManagers[i];
740  // load settings (if supported)
741  IRegSettings* rgs = dynamic_cast<IRegSettings*>(manager.GetPointer());
742  if(rgs) {
743  rgs->LoadSettings();
744  }
745  // check whether this is the selected manager
746  string mgr_label = manager->GetDescriptor().GetLabel();
747  if(mgr_label == sel_fmt_label) {
748  m_CurrFormat = (int)i; // found the selected manager
749  }
750  }
751  }
752 }
753 
754 
#define true
Definition: bool.h:35
static bool FileExists(const wxString &fileName)
CDataLoadingAppTask - a task that executes CDataLoadingAppJob.
void SetOptions(const CSelectProjectOptions &options)
CExtensionPointDeclaration - static declaration helper.
CFileAutoLoader.
IFileFormatLoaderManager * GetCurrentManager()
CFormatGuess::EFormat SetFormatManager(const vector< wxString > &filenames)
virtual IWizardPage * GetFirstPage()
Returns first options page (if any) of the tool to be shown in wizard dialog.
CProjectSelectorPanel * m_ProjectSelPanel
virtual bool IsFinalState()
True if Tool Manager has reached its final state, i.e.
IUIToolManager * m_AltToolManager
If a file type is better handled by a different tool manager, set it here.
CFileLoadManager()
CFileLoadManager.
TProjectId x_CreateNewProject(const string &new_prj_name)
virtual void InitUI()
Initializes the Manager before using it in UI.
objects::CGBProjectHandle::TId TProjectId
virtual const IUIObject & GetDescriptor() const
Returns the object describing this tool (UI meta data).
virtual void SetRegistryPath(const string &path)
virtual void OnFormatChanged()
called by File Format panel when a user selects a format
virtual void AddFileFormat(IFileFormatLoaderManager *manager)
virtual IExecuteUnit * GetExecuteUnit()
bool x_CheckFormatConflict(const vector< wxString > &filenames, TFormatMgrRef &manager)
virtual void SetPrevPage(IWizardPage *prevPage)
Sets a wizard page which should show before the first page of the tool.
TFormatMgrRef m_AutodetectFormat
virtual bool CanDo(EAction action)
Indicates whether given transition is possible in the current state.
void SetDialog(COpenDlg *dlg)
virtual void SaveSettings() const
vector< TFormatMgrRef > m_FormatManagers
virtual void SetServiceLocator(IServiceLocator *srv_locator)
Sets / unsets Service Locator.
virtual bool DoTransition(EAction action)
Performs transition if possible and returns true, otherwise the function shall warn the user about th...
SProjectSelectorParams m_ProjectParams
vector< wxString > m_Filenames
CFileLoadOptionPanel * x_GetOptionsPanel()
IWizardPage * m_OpenObjectsPage
IServiceLocator * m_SrvLocator
CIRef< IFileFormatLoaderManager > TFormatMgrRef
CFileLoadOptionPanel * m_OptionPanel
virtual void SetFilenames(vector< wxString > &filenames)
virtual void SetParentWindow(wxWindow *parent)
virtual IAppTask * GetTask()
Once parameters are gathered and validated this function is called to produce the final Task object t...
virtual wxPanel * GetCurrentPanel()
Return the panel corresponding to the current state of Tool Manager.
virtual bool IsCompletedState()
Manager goes into "Complete" state when "Finish" button is pressed and all input data is gatherred an...
bool x_CanLeavePage(bool forward)
virtual void LoadSettings()
virtual void CleanUI()
CleanUI() is called after the host finished using the manager.
void SetFilenames(const vector< wxString > &filenames)
void SetMRU(const TFileMRU &file_mru)
void SetManager(CFileLoadManager *manager)
void GetFilenames(vector< wxString > &filenames) const
void SetCheckFormat(bool value=true)
void SetFormats(const vector< CFormatDescriptor > &formats)
EFormat
The formats are checked in the same order as declared here.
static const char * GetFormatName(EFormat format)
CRegistryWriteView GetWriteView(const string &section)
get a read-write view at a particular level.
Definition: registry.cpp:462
static CGuiRegistry & GetInstance()
access the application-wide singleton
Definition: registry.cpp:400
CRegistryReadView GetReadView(const string &section) const
get a read-only view at a particular level.
Definition: registry.cpp:428
COpenDlg.
Definition: open_dlg.hpp:78
virtual void Update()
Definition: open_dlg.cpp:291
CProjectSelectorPanel - a panel that allows the user to specify how the project items created by a pl...
void SetProjectService(CProjectService *service)
void GetParams(SProjectSelectorParams &params) const
void SetParams(const SProjectSelectorParams &params)
CProjectService - a service providing API for operations with Workspaces and Projects.
class CRegistryReadView provides a nested hierarchical view at a particular key.
Definition: reg_view.hpp:58
bool GetBool(const string &key, bool default_val=false) const
Definition: reg_view.cpp:241
string GetString(const string &key, const string &default_val=kEmptyStr) const
Definition: reg_view.cpp:246
void GetStringVec(const string &key, vector< string > &val) const
Definition: reg_view.cpp:263
void Set(const string &key, int val)
access a named key at this level, with no recursion
Definition: reg_view.cpp:533
CProjectSelectOptions - describes how new Project Items shall be added to a workspace.
static CGBDocument * CreateProject(CProjectService *service, const string &prjName, const string &prjDesc)
void Set_AddToExistingProject(TProjectId &project_id, const string &folder=kEmptyStr)
static void InitProjectnameGenerator(objects::CGBWorkspace &ws, CUniqueLabelGenerator &projectNames)
CTimeFormat –.
Definition: ncbitime.hpp:131
void Clear()
Definition: mru_list.hpp:170
const TTimeToTMap & GetMap() const
Definition: mru_list.hpp:149
void Add(T elem, time_t time=0)
Definition: mru_list.hpp:176
CTime –.
Definition: ncbitime.hpp:296
CUniqueLabelGenerator Modifies the given label so that it becomes unique in the given set of labels b...
@ eCmdUpdateButtons
Definition: wizard_dlg.hpp:86
IAppTask.
Definition: app_task.hpp:83
IFileFormatLoaderManager.
virtual bool RecognizeFormat(const wxString &filename)=0
return true if the given file format is supported by this manager
virtual bool SingleFileLoader() const
returns true if loader can handle only one file
virtual wxString GetFormatWildcard()=0
return file wildcard for the format (example - "*.txt;*.tab" )
virtual string GetFileLoaderId() const =0
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
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
virtual void SetServiceLocator(IServiceLocator *srv_locator)=0
Sets / unsets Service Locator.
virtual const IUIObject & GetDescriptor() const =0
Returns the object describing this tool (UI meta data).
virtual void CleanUI()=0
CleanUI() is called after the host finished using the manager.
virtual void SetParentWindow(wxWindow *parent)=0
virtual void InitUI()=0
Initializes the Manager before using it in UI.
virtual void SetOptionsPage(IWizardPage *)=0
virtual void SetNextPage(IWizardPage *)=0
Definition: map.hpp:338
#define ITERATE(Type, Var, Cont)
ITERATE macro to sequence through container elements.
Definition: ncbimisc.hpp:815
#define NULL
Definition: ncbistd.hpp:225
CIRef< T > GetServiceByType()
retrieves a typed reference to a service, the name of C++ type is used as the name of the service.
Definition: service.hpp:91
void GetExtensionAsInterface(const string &ext_point_id, vector< CIRef< I > > &interfaces)
GetExtensionAsInterface() is a helper function that extracts all extensions implementing the specifie...
string MakeUniqueLabel(const string &label) const
after considering all existing labels produces a modified unique version of the original label
void NcbiErrorBox(const string &message, const string &title="Error")
specialized Message Box function for reporting critical errors
EDialogReturnValue NcbiMessageBoxW(const wxString &message, TDialogType type=eDialog_Ok, EDialogIcon icon=eIcon_Exclamation, const wxString &title=wxT("Error"), EDialogTextMode text_mode=eRaw)
virtual const string & GetLabel() const =0
TObjectType * GetPointer(void) THROWS_NONE
Get pointer,.
Definition: ncbiobj.hpp:998
void Reset(void)
Reset reference object.
Definition: ncbiobj.hpp:773
bool Empty(void) const THROWS_NONE
Check if CRef is empty – not pointing to any object, which means having a null value.
Definition: ncbiobj.hpp:719
#define END_NCBI_SCOPE
End previously defined NCBI scope.
Definition: ncbistl.hpp:103
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
Definition: ncbistl.hpp:100
CTime & ToLocalTime(void)
Convert the time into local time.
Definition: ncbitime.hpp:2465
string AsString(const CTimeFormat &format=kEmptyStr, TSeconds out_tz=eCurrentTimeZone) const
Transform time to string.
Definition: ncbitime.cpp:1511
time_t GetTimeT(void) const
Get time in time_t format.
Definition: ncbitime.cpp:1395
static CTimeFormat GetPredefined(EPredefined fmt, TFlags flags=fDefault)
Get predefined format.
Definition: ncbitime.cpp:388
@ eISO8601_DateTimeSec
Y-M-DTh:m:s (eg 1997-07-16T19:20:30)
Definition: ncbitime.hpp:196
static const char label[]
unsigned int
A callback function used to compare two keys in a database.
Definition: types.hpp:1210
@ eIcon_Exclamation
Definition: types.hpp:65
@ eCancel
Definition: types.hpp:72
@ eDialog_YesNoCancel
Definition: types.hpp:50
int i
#define wxT(x)
Definition: muParser.cpp:41
EIPRangeType t
Definition: ncbi_localip.c:101
T max(T x_, T y_)
static Format format
Definition: njn_ioutil.cpp:53
Format
Definition: njn_ioutil.hpp:52
static int filenames
Definition: pcregrep.c:172
wxEVT_COMMAND_MENU_SELECTED
void ToLoadingOptions(CSelectProjectOptions &options)
#define _ASSERT
static const char * kSelectedFormatTag
static const char * kCheckFormatTag
static CExtensionPointDeclaration sDSTypeExtPoint("file_format_loader_manager", "File Format Loader Manager")
EXTENSION_POINT__UI_DATA_SOURCE_TYPE Extension point declaration.
static const wxFormatString kFORMAT_CONFLICT_MSG
static const char * kMRUTag
wxString ToWxString(const string &s)
Definition: wx_utils.hpp:173
wxString FnToWxString(const string &s)
Definition: wx_utils.cpp:253
string FnToStdString(const wxString &s)
Definition: wx_utils.cpp:268
Modified on Mon Dec 11 02:35:49 2023 by modify_doxy.py rev. 669887