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

Go to the SVN repository for this file.

1 #ifndef GUI_WIDGETS_SEQ___FASTA_DS__HPP
2 #define GUI_WIDGETS_SEQ___FASTA_DS__HPP
3 
4 /* $Id: text_ds.hpp 46154 2021-01-26 16:10:41Z asztalos $
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/ncbiobj.hpp>
36 #include <gui/gui_export.h>
37 
39 
42 
44 
45 struct SFlatFileParams;
46 class CJobCancelable;
47 
49 
50 class CSeq_feat;
51  class CSeq_loc;
52  class CSubmit_block;
54 
55 /// Class to deliver partial results as part of progress report of text viewer
56 ///
58 {
59 public:
62 
63  void SetData(shared_ptr<CRootTextItem> mainItem, shared_ptr<CTextPanelContext> context)
64  {
65  m_MainItem = mainItem;
66  m_Context = context;
67  }
68 
69  void GetData(shared_ptr<CRootTextItem>& mainItem, shared_ptr<CTextPanelContext>& context)
70  {
71  mainItem = m_MainItem;
72  context = m_Context;
73  }
74 
75 private:
78 
79  shared_ptr<CRootTextItem> m_MainItem;
80  shared_ptr<CTextPanelContext> m_Context;
81 };
82 
84  public CObjectEx,
85  public CEventHandler
86 {
88 public:
90  virtual ~CTextDataSource();
91 
93  const vector<pair<objects::CBioseq_Handle, string> >& handles);
94  void LoadFasta(CTextPanelContext* context, const objects::CSeq_loc& loc, objects::CScope& scope);
97  const vector<pair<objects::CBioseq_Handle, string> >& handles,
98  const SFlatFileParams& params);
99 
100  void GetFlatFileSeqs(
101  objects::CSeq_entry_Handle& h,
102  const objects::CSubmit_block* submitBlock,
103  const objects::CSeq_loc* seq_loc,
104  objects::CFlatFileConfig::EStyle style);
105 
106  void LoadAsn(CTextPanelContext* context, const CSerialObject& so, objects::CScope& scope);
107  void LoadXml(CTextPanelContext* context, const CSerialObject& so, objects::CScope& scope);
108 
110  objects::CScope& scope,
111  const objects::CSeq_feat& seq_feat,
112  bool getGeneModel,
113  objects::CFlatFileConfig::EMode mode,
114  objects::CFlatFileConfig::EStyle style);
115 
116  bool IsLoading() const;
117 
118  /// CAppJobDispatcher notification handler
119  void OnJobNotification(CEvent* evt);
120 
121 private:
122  void x_CancelJob();
123  void x_SetDataLocker(CJobCancelable& job);
124 
126 
128 };
129 
131 
132 #endif // GUI_WIDGETS_SEQ___FASTA_DS__HPP
CEventHandler.
CEvent - generic event implementation TODO TODO - Attachments.
Definition: event.hpp:86
Base class to build jobs with cancel functionality.
CObjectEx –.
Definition: ncbiobj.hpp:2531
CObject –.
Definition: ncbiobj.hpp:180
namespace ncbi::objects::
Definition: Seq_feat.hpp:58
Base class for all serializable objects.
Definition: serialbase.hpp:150
CSubmit_block –.
CAppJobDispatcher::TJobID m_JobId
Definition: text_ds.hpp:127
CTextPanel & m_TextPanel
Definition: text_ds.hpp:125
void LoadFasta(CTextPanelContext *context, const vector< pair< objects::CBioseq_Handle, string > > &handles)
void LoadFasta(CTextPanelContext *context, const objects::CSeq_loc &loc, objects::CScope &scope)
CTextDataSource(CTextPanel &textPanel)
void LoadFlatFile(CTextPanelContext *context, objects::CScope &scope, const objects::CSeq_feat &seq_feat, bool getGeneModel, objects::CFlatFileConfig::EMode mode, objects::CFlatFileConfig::EStyle style)
void LoadFlatFile(CTextPanelContext *context, const vector< pair< objects::CBioseq_Handle, string > > &handles, const SFlatFileParams &params)
Class to deliver partial results as part of progress report of text viewer.
Definition: text_ds.hpp:58
shared_ptr< CTextPanelContext > m_Context
Definition: text_ds.hpp:80
void SetData(shared_ptr< CRootTextItem > mainItem, shared_ptr< CTextPanelContext > context)
Definition: text_ds.hpp:63
void GetData(shared_ptr< CRootTextItem > &mainItem, shared_ptr< CTextPanelContext > &context)
Definition: text_ds.hpp:69
CTextViewRetrieveResult & operator=(const CTextViewRetrieveResult &)
shared_ptr< CRootTextItem > m_MainItem
Definition: text_ds.hpp:79
virtual ~CTextViewRetrieveResult()
Definition: text_ds.hpp:61
CTextViewRetrieveResult(const CTextViewRetrieveResult &)
#define END_NCBI_SCOPE
End previously defined NCBI scope.
Definition: ncbistl.hpp:103
#define END_SCOPE(ns)
End the previously defined scope.
Definition: ncbistl.hpp:75
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
Definition: ncbistl.hpp:100
#define BEGIN_SCOPE(ns)
Define a new scope.
Definition: ncbistl.hpp:72
#define NCBI_GUIWIDGETS_SEQ_EXPORT
Definition: gui_export.h:539
Defines to provide correct exporting from DLLs in Windows.
mdb_mode_t mode
Definition: lmdb++.h:38
Portable reference counted smart and weak pointers using CWeakRef, CRef, CObject and CObjectEx.
static CS_CONTEXT * context
Definition: will_convert.c:21
Modified on Fri May 24 14:54:54 2024 by modify_doxy.py rev. 669887