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

Go to the SVN repository for this file.

1 #ifndef GUI_PKG_ALIGNMENT___MP_CROSS_ALIGN_VIEW__HPP
2 #define GUI_PKG_ALIGNMENT___MP_CROSS_ALIGN_VIEW__HPP
3 
4 /* $Id: mp_cross_align_view.hpp 33102 2015-05-26 19:26:09Z 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 
38 
40 
41 
42 class wxSplitterWindow;
43 
45 
46 /** @addtogroup GUI_PKG_ALIGNMENT
47  *
48  * @{
49  */
50 
51 ///////////////////////////////////////////////////////////////////////////////
52 /// CMPCrossAlignView
54 {
56 public:
58 
59  /// @name IVisibleRangeService interface implementation
60  /// @{
63  virtual void BroadcastVisibleRange(const CVisibleRange& vrange,
65  /// @}
66 
67  /// @name IWMClient interface implementation
68  /// @{
69  virtual wxWindow* GetWindow();
70  /// @}
71 
72  /// @name IView interface implementation
73  /// @{
74  virtual const CViewTypeDescriptor& GetTypeDescriptor() const;
75  virtual void CreateViewWindow(wxWindow* parent);
76  virtual void DestroyViewWindow();
77  virtual void SetWorkbench(IWorkbench* workbench);
78  /// @}
79 
80  /// @name IProjectView implementation
81  /// @{
82  virtual void DestroyView();
83  virtual bool InitView(TConstScopedObjects& objects, const objects::CUser_object* params);
84  virtual void OnProjectChanged();
85  /// @}
86 
87  /// @name ISelectionClient Implementation
88  /// @{
89  virtual void SetSelection(CSelectionEvent& evt);
90  virtual void GetSelection(CSelectionEvent& evt) const;
91  virtual void GetSelection(TConstScopedObjects& objs) const;
92  virtual void GetMainObject(TConstScopedObjects& objs) const;
93  /// @}
94 
95  /// @name CProjectViewBase overridables
96  /// @{
97  virtual void GetVisibleRanges(CVisibleRange& vrange) const;
98  /// @}
99 
100  /// @name IVisibleRangeClient interface implementation
101  /// @{
102  virtual void OnVisibleRangeChanged (const CVisibleRange& vrange,
104  /// @}
105 
106 protected:
107  virtual void x_CreateMenuBarMenu();
108 
109  virtual void x_OnSetSelection(CSelectionEvent& evt);
110 
111  const CObject* x_GetOrigObject() const;
112 
113 private:
114  typedef vector< CIRef<IProjectView> > TViews;
115  /// original data object passed to the view
119 
120  wxSplitterWindow* m_MainSplitter;
122 
124 };
125 
126 
127 ///////////////////////////////////////////////////////////////////////////////
128 /// CMPCrossAlignViewFactory
130  public CObject,
131  public IExtension,
132  public IProjectViewFactory
133 {
134 public:
135  /// @name IExtension interface implementation
136  /// @{
137  virtual string GetExtensionIdentifier() const;
138  virtual string GetExtensionLabel() const;
139  /// @}
140 
141  /// @name IProjectViewFactory interface implementation
142  /// @{
143  virtual IView* CreateInstance() const;
144  virtual IView* CreateInstanceByFingerprint(const TFingerprint& fingerprint) const;
145  virtual void RegisterIconAliases(wxFileArtProvider& provider);
146  virtual void RegisterCommands(CUICommandRegistry& cmd_reg, wxFileArtProvider& provider);
147 
148  virtual const CProjectViewTypeDescriptor& GetProjectViewTypeDescriptor() const;
149  virtual int TestInputObjects( TConstScopedObjects& objects );
150  virtual bool IsCompatibleWith( const CObject& object, objects::CScope& scope );
151  /// @}
152 };
153 
154 
155 /* @} */
156 
158 
159 #endif // GUI_PKG_ALIGNMENT___MP_CROSS_ALIGN_VIEW__HPP
CMPCrossAlignViewFactory.
CMPCrossAlignView.
CObject –.
Definition: ncbiobj.hpp:180
virtual void OnProjectChanged()
virtual void x_CreateMenuBarMenu()
initializes m_MenuBarMenu; override in derived classes
virtual void DestroyView()
disconnects view from the project and associated data
virtual void DestroyViewWindow()=0
destroy Window corresponding to the view
virtual const CViewTypeDescriptor & GetTypeDescriptor() const =0
return an object providing meta information about thei view type
virtual void CreateViewWindow(wxWindow *parent)=0
create Window corresponding to the view
virtual wxWindow * GetWindow()=0
returns a pointer to the wxWindow representing the client
virtual const CObject * x_GetOrigObject() const
CProjectViewTypeDescriptor - holds description of a project view type.
CProjectView.
virtual void SetSelection(CSelectionEvent &evt)
handles selection broadcast received from Selection Service this function acts as a shell,...
virtual void OnVisibleRangeChanged(const CVisibleRange &, IVisibleRangeClient *)
virtual void GetMainObject(TConstScopedObjects &buf) const
Adds the main data objects represented by the client to "objects".
void BroadcastVisibleRange(CVisibleRange::EBasicPolicy bp)
fire a non-recursive visible range changed event
virtual void GetSelection(TConstScopedObjects &buf) const
shall return data objects representing selected things, return one data object for every selected thi...
virtual void x_OnSetSelection(CSelectionEvent &evt)
override in derived classes in order to handle selection broadcast
virtual void SetWorkbench(IWorkbench *workbench)
IView implementation.
virtual bool InitView(TConstScopedObjects &objects, const objects::CUser_object *params)
initialize view with data, inside this function the view must call CProjectService::AttachView to con...
virtual void GetVisibleRanges(CVisibleRange &vrange) const
populate a visible range event for broadcasting
CSelectionEvent CSelectionEvent is used for broadcasting selection between views.
Definition: obj_event.hpp:68
CUICommandRegistry is a centralized registry where all application commands should be registered.
Definition: ui_command.hpp:146
CViewTypeDescriptor - holds description of a view type.
Definition: view.hpp:98
IExtension IExtension interface represents an abstract pluggable component.
Definition: extension.hpp:57
IProjectViewFactory.
IView - represents a standard visual part of Workbench UI.
Definition: view.hpp:73
IVisibleRangeClient - represents an object that wants notifications about visible range changes.
IVisibleRangeService - an interface.
CFingerprint identifies an instance of IWMClient and is used for labeling layout positions.
Definition: wm_client.hpp:58
IWorkbench is the central interface in the application framework.
Definition: workbench.hpp:113
static CProjectViewTypeDescriptor m_TypeDescr
CConstRef< CSeq_align > m_OrigAlign
CIRef< ICrossAlnDataSource > m_DataSource
virtual void DetachClient(IVisibleRangeClient *)
wxSplitterWindow * m_MainSplitter
vector< CIRef< IProjectView > > TViews
virtual void AttachClient(IVisibleRangeClient *)
CConstRef< CSeq_annot > m_OrigAnnot
original data object passed to the view
vector< SConstScopedObject > TConstScopedObjects
Definition: objects.hpp:65
#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_GUIVIEW_ALIGN_EXPORT
Definition: gui_export.h:544
const CharType(& source)[N]
Definition: pointer.h:1149
Modified on Thu Apr 25 08:22:03 2024 by modify_doxy.py rev. 669887