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

Go to the SVN repository for this file.

1 #ifndef GUI_CORE___PROJECT_LOADING_TASK__HPP
2 #define GUI_CORE___PROJECT_LOADING_TASK__HPP
3 
4 /* $Id: project_loading_task.hpp 47479 2023-05-02 13:24:02Z ucko $
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
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 
42 
44 
46 
48 
49 
51 
52 class CProjectService;
53 
55  public CAppTask,
56  public CEventHandler
57 {
59 public:
60  using TProjectId = objects::CGBProjectHandle::TId;
61 
62  /// static data structures for File dialogs
64 
65  CProjectLoadingTask(TProjectId projId, CProjectService* srv, bool add_to_mru);
66  virtual ~CProjectLoadingTask();
67 
68  /// @name IAppTask interface implementation
69  /// @{
70  virtual ETaskState Run();
71  virtual void CancelBackgrounded();
72  /// @}
73 
74  /// functions below handle notifications from the IAppJob
75  void OnAppJobNotification(CEvent* event);
76  void OnAppJobProgress(CEvent* event);
77 protected:
79 
80  ETaskState x_StartJob();
81  ETaskState x_OnWakeUp();
82 
83  string m_TaskName;
86  bool m_AddToMRU;
89 };
90 
92 
93 
94 #endif // GUI_CORE___PROJECT_LOADING_TASK__HPP
95 
User-defined methods of the data storage class.
CAppTask - default implementation of IAppTask, use it as a base class for custom tasks.
virtual ETaskState Run()
execute the task, this function is called on the main UI thread if a task needs to execute in backgro...
virtual void CancelBackgrounded()
make a request to cancel backgrounded task (not called for foreground tasks)
CEventHandler.
CEvent - generic event implementation TODO TODO - Attachments.
Definition: event.hpp:86
CAppJobDispatcher::TJobID TJobID
CProjectService * m_ProjectService
IAppJob::EJobState m_JobState
objects::CGBProjectHandle::TId TProjectId
static SWFileDlgData sm_ProjectDlgData
static data structures for File dialogs
CProjectService - a service providing API for operations with Workspaces and Projects.
ETaskState
List of task states defining the task management FSM.
Definition: app_task.hpp:87
EJobState
Job states (describe FSM)
Definition: app_job.hpp:86
#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_GUICORE_EXPORT
Definition: gui_export.h:508
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.
Modified on Thu Feb 22 17:08:05 2024 by modify_doxy.py rev. 669887