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

Go to the SVN repository for this file.

1 #ifndef GUI_WIDGETS_SEQ___FLAT_FILE_CONTEXT__HPP
2 #define GUI_WIDGETS_SEQ___FLAT_FILE_CONTEXT__HPP
3 
4 /* $Id: flat_file_context.hpp 41060 2018-05-16 18:11:00Z katargir $
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 
43 class wxFileArtProvider;
44 
46 
47 BEGIN_SCOPE(objects) // namespace ncbi::objects::
48 class IFormatter;
49 class CBioseq_Handle;
50 class CFlatItem;
51 class CSeqdesc;
52 class CSeq_feat_Handle;
54 
55 class ITextItem;
56 class CUICommandRegistry;
57 class CFlatFileTextItem;
58 
60  : public CTextPanelContext, public IBioseqEditorCB
61 {
62  DECLARE_EVENT_TABLE()
63 public:
64  CFlatFileViewContext(objects::IFormatter& formatter,
65  objects::CScope& scope,
66  const CSerialObject* so,
67  IBioseqEditor* bioseqEditor);
69 
70  static void RegisterCommands(CUICommandRegistry& cmd_reg, wxFileArtProvider& provider);
71 
72  virtual int GetLeftMargin() const;
73 
74  virtual void RootInitialized();
75 
76  objects::IFormatter& GetFormatter() { return *m_Formatter; }
77 
78  virtual wxMenu* CreateMenu() const;
79 
80  virtual void SetPanel(CTextItemPanel* panel);
82 
83  void OnEditBioseq(objects::CBioseq_Handle& bh, wxPoint pos);
84 
85  /// @name IBioseqEditorCB interface implementation
86  /// @{
87  virtual void GetItemSelection(TFlatItemList& itemList);
89  virtual objects::CBioseq_Handle GetCurrentBioseq();
90  virtual wxString GetWorkDir() const;
91  /// @}
92 
93  virtual void EditItem(ITextItem* item, bool controlDown, bool shiftDown);
94 
95  virtual bool IsEditingEnabled() const { return m_BioseqEditor; }
96 
97  virtual bool FindSequence(const wxString& text);
98  virtual void InitDrawStream(CDrawTextOStream& stream, int startLine);
99 
100  bool ShowEditIcons() const;
101 
102  CEditObject GetEditObject(CFlatFileTextItem& ffItem);
103 
104 protected:
105  typedef pair<const objects::CSeqdesc*, objects::CBioseqContext*> TEditDesc;
106  typedef pair<objects::CSeq_feat_Handle, objects::CBioseqContext*> TEditFeat;
107 
109 
110  void OnExpandAllFeatures(wxCommandEvent& event);
111  void OnCollapseAllFeatures(wxCommandEvent& event);
112  void OnExpandSeqBlocks(wxCommandEvent& event);
113  void OnCollapseSeqBlocks(wxCommandEvent& event);
114 
115  void OnCollapseSequences(wxCommandEvent& event);
116  void OnExpandAll(wxCommandEvent& event);
117 
118  objects::CBioseq_Handle m_CurBioseq;
120 
122 };
123 
125 
126 #endif // GUI_WIDGETS_SEQ___FLAT_FILE_CONTEXT__HPP
CBioseq_Handle –.
objects::IFormatter & GetFormatter()
objects::CBioseq_Handle m_CurBioseq
virtual bool IsEditingEnabled() const
pair< objects::CSeq_feat_Handle, objects::CBioseqContext * > TEditFeat
pair< const objects::CSeqdesc *, objects::CBioseqContext * > TEditDesc
CRef< objects::IFormatter > m_Formatter
CIRef< IBioseqEditor > m_BioseqEditor
CSeq_feat_Handle –.
Base class for all serializable objects.
Definition: serialbase.hpp:150
virtual void GetVisibleObjects(TConstScopedObjects &)
virtual void InitDrawStream(CDrawTextOStream &, int)
virtual bool FindSequence(const wxString &)
virtual wxMenu * CreateMenu() const
virtual void EditItem(ITextItem *item, bool controlDown, bool shiftDown)
virtual int GetLeftMargin() const
virtual void RootInitialized()
virtual void SetPanel(CTextItemPanel *panel)
CUICommandRegistry is a centralized registry where all application commands should be registered.
Definition: ui_command.hpp:146
virtual objects::CBioseq_Handle GetCurrentBioseq()=0
virtual void GetCurrentSelection(TEditObjectList &)=0
virtual wxString GetWorkDir() const =0
virtual void GetItemSelection(TFlatItemList &)=0
IBioseqEditor.
vector< SConstScopedObject > TConstScopedObjects
Definition: objects.hpp:65
#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.
vector< CEditObject > TEditObjectList
vector< CConstRef< objects::IFlatItem > > TFlatItemList
static void text(MDB_val *v)
Definition: mdb_dump.c:62
Portable reference counted smart and weak pointers using CWeakRef, CRef, CObject and CObjectEx.
Modified on Wed Jul 17 13:21:57 2024 by modify_doxy.py rev. 669887