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

Go to the SVN repository for this file.

1 #ifndef GUI_WIDGETS_WX__IBIOSEQ_EDITOR__HPP
2 #define GUI_WIDGETS_WX__IBIOSEQ_EDITOR__HPP
3 
4 /* $Id: ibioseq_editor.hpp 44907 2020-04-14 13:03:07Z 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: Andrey Yazhuk
30  *
31  * File Description:
32  *
33  */
34 
35 #include <corelib/ncbistd.hpp>
36 
38 #include <objmgr/scope.hpp>
39 
41 
42 #include <wx/clntdata.h>
43 #include <wx/event.h>
44 #include <wx/string.h>
45 
46 class wxMenu;
47 
49 
50 class ICommandProccessor;
51 
52 class CTitleEdit : public CObject
53 {
54 public:
55  void SetTitle(const string& title) { m_Title = title; }
56  string GetTitle() const { return m_Title; }
57 
58 private:
59  string m_Title;
60 };
61 
63 {
64 public:
66  CEditObject(const CObject& obj, const objects::CSeq_entry_Handle& seh)
67  : m_Obj(&obj), m_SEH(seh) {}
68  CEditObject(const CObject& obj, objects::CScope& scope)
69  : m_Obj(&obj), m_Scope(&scope) {}
70 
72  objects::CSeq_entry_Handle m_SEH;
74 };
75 
76 typedef vector<CEditObject> TEditObjectList;
77 typedef vector<CConstRef<objects::IFlatItem> > TFlatItemList;
78 
80 {
81 public:
82  virtual ~IBioseqEditorCB() {}
83 
84  virtual void GetItemSelection(TFlatItemList&) = 0; // FlaFile view returns it's selection here
85  virtual void GetCurrentSelection(TEditObjectList&) = 0; // ASN.1 view returns it's selection here
86  virtual objects::CBioseq_Handle GetCurrentBioseq() = 0; // only FlaFile view implements it
87  virtual wxString GetWorkDir() const = 0; // folder in which original edited file resides (if available)
88  virtual bool MayCreateFeatures() const { return true; } // override it in CSeqGraphicWidget
89 };
90 
92  eCmdEditObjects = 29000,
95 };
96 
97 /////////////////////////////////////////////////////////////////////////////
98 /// IBioseqEditor
99 /////////////////////////////////////////////////////////////////////////////
100 
101 class IBioseqEditor : public wxEvtHandler
102 {
103 public:
104  enum {
106  kObjectDeletable = 2
107  };
108 
109  virtual void SetCallBack(IBioseqEditorCB* cb) = 0;
110 
111  virtual wxMenu* CreateContextMenu(bool shorter = false) const = 0;
112  virtual wxMenu* CreateBioseqMenu() const = 0;
113  virtual void EditSelection() = 0;
114 
115  virtual int GetEditFlags(CEditObject& editObj) const = 0; // called from ASN.1 view
116  virtual int GetEditFlags(const objects::IFlatItem& item) const = 0; // called from FlatFile view
117 };
118 
120 
121 #endif //GUI_WIDGETS_WX__IBIOSEQ_EDITOR__HPP
CRef< objects::CScope > m_Scope
objects::CSeq_entry_Handle m_SEH
CEditObject(const CObject &obj, const objects::CSeq_entry_Handle &seh)
CEditObject(const CObject &obj, objects::CScope &scope)
CConstRef< CObject > m_Obj
CObject –.
Definition: ncbiobj.hpp:180
void SetTitle(const string &title)
string GetTitle() const
virtual objects::CBioseq_Handle GetCurrentBioseq()=0
virtual void GetCurrentSelection(TEditObjectList &)=0
virtual ~IBioseqEditorCB()
virtual bool MayCreateFeatures() const
virtual wxString GetWorkDir() const =0
virtual void GetItemSelection(TFlatItemList &)=0
IBioseqEditor.
virtual void SetCallBack(IBioseqEditorCB *cb)=0
virtual wxMenu * CreateContextMenu(bool shorter=false) const =0
virtual wxMenu * CreateBioseqMenu() const =0
virtual void EditSelection()=0
virtual int GetEditFlags(CEditObject &editObj) const =0
virtual int GetEditFlags(const objects::IFlatItem &item) const =0
Undo/Redo interface for editing operations.
Include a standard set of the NCBI C++ Toolkit most basic headers.
#define END_NCBI_SCOPE
End previously defined NCBI scope.
Definition: ncbistl.hpp:103
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
Definition: ncbistl.hpp:100
vector< CEditObject > TEditObjectList
EBioseqEditBaseCommands
@ eBioseqEditBaseCommandsEnd
@ eCmdEditObjects
@ eCmdDeleteObjects
vector< CConstRef< objects::IFlatItem > > TFlatItemList
Modified on Wed Jun 19 17:08:08 2024 by modify_doxy.py rev. 669887