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

Go to the SVN repository for this file.

1 #ifndef PKG_SEQUENCE_EDIT___SEQUIN_DESKTOP_VIEW__HPP
2 #define PKG_SEQUENCE_EDIT___SEQUIN_DESKTOP_VIEW__HPP
3 
4 /* $Id: sequin_desktop_view.hpp 37865 2017-02-23 21:52:38Z 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 
39 
43 
45 
47 
48 class CSeqDesktopPanel;
49 
50 /** @addtogroup GUI_PKG_SEQUENCE
51  *
52  * @{
53  */
54 
55 ///////////////////////////////////////////////////////////////////////////////
56 /// CSequinDesktopView
58  , public IGuiWidgetHost
59 {
62 
63 public:
66 
67  /// @name IGuiWidgetHost implementation
68  /// @{
69  virtual void CloseWidget();
70  virtual void WidgetSelectionChanged();
71  virtual void WidgetActivated();
72  virtual void GetAppSelection(TConstObjects& objects);
73  virtual void OnWidgetCommand(const string& command);
74  virtual void ShowView(const string& viewName, FWindowFactory widgetFactory, TConstScopedObjects& objects, bool bFloat);
75  /// @}
76 
77  /// @name IWMClient interface implementation
78  /// @{
79  virtual wxWindow* GetWindow();
80  virtual wxEvtHandler* GetCommandHandler();
81  /// @}
82 
83  /// @name IMenuContributor interface implementation
84  /// @{
85  virtual const wxMenu* GetMenu();
86  /// @}
87 
88 
89  /// @name IView implementation
90  /// @(
91  virtual const CViewTypeDescriptor& GetTypeDescriptor() const;
92  virtual void CreateViewWindow(wxWindow* parent);
93  virtual void DestroyViewWindow();
94  /// @}
95 
96  /// @name IProjectView implementation
97  /// @{
98  virtual bool InitView(TConstScopedObjects& objects, const objects::CUser_object* params);
99  virtual void OnProjectChanged(CProjectViewEvent& evt);
100  /// @}
101 
102  /// @name ISelectionClient Implementation
103  /// @{
104  virtual void GetSelection(CSelectionEvent& evt) const;
105  virtual void GetSelection(TConstScopedObjects& objs) const;
106  virtual void GetMainObject(TConstScopedObjects& objs) const;
107  /// @}
108 
109  /// @addtogroup CProjectViewBase overridables
110  /// @{
111  virtual void GetCompatibleToolBars(vector<string>& names);
112  virtual const CObject* x_GetOrigObject() const;
113  /// @}
114 
115 protected:
116  virtual void x_OnSetSelection(CSelectionEvent& evt);
117 
118  void x_OnRefreshData(CEvent* event);
119  /// Scrolls to the corresponding item in the Flat File View and selects it
120  void x_OnSingleMouseClick(CEvent* event);
121 
122 private:
123 
125 };
126 
127 
128 ///////////////////////////////////////////////////////////////////////////////
129 /// CSequinDesktopViewFactory
131  public CObject,
132  public IExtension,
133  public IProjectViewFactory
134 {
135 public:
136  /// @name IExtension interface implementation
137  /// @{
138  virtual string GetExtensionIdentifier() const;
139  virtual string GetExtensionLabel() const;
140  /// @}
141 
142  /// @name IProjectViewFactory interface implementation
143  /// @{
144  virtual IView* CreateInstance() const;
145  virtual IView* CreateInstanceByFingerprint(const TFingerprint& fingerprint) const;
146  virtual void RegisterIconAliases(wxFileArtProvider& provider);
147  virtual void RegisterCommands(CUICommandRegistry& cmd_reg, wxFileArtProvider& provider);
148 
151  /// @}
152 
153 protected:
154  /// @name COpenViewManager implementation
155  /// @{
156  virtual string GetTargetType() const
157  { return "BioSeq"; }
158  virtual bool AllowMerge() const { return false; }
159  /// @}
160 };
161 
162 
163 /* @} */
164 
166 
167 #endif // PKG_SEQUENCE_EDIT___SEQUIN_DESKTOP_VIEW__HPP
CEvent - generic event implementation TODO TODO - Attachments.
Definition: event.hpp:86
CObject –.
Definition: ncbiobj.hpp:180
virtual void OnProjectChanged()
CProjectViewEvent.
Definition: document.hpp:62
CProjectViewTypeDescriptor - holds description of a project view type.
CProjectView.
CSelectionEvent CSelectionEvent is used for broadcasting selection between views.
Definition: obj_event.hpp:68
CSequinDesktopViewFactory.
CSequinDesktopView.
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
CFingerprint identifies an instance of IWMClient and is used for labeling layout positions.
Definition: wm_client.hpp:58
static const struct name_t names[]
virtual void GetCompatibleToolBars(vector< string > &names)
returns the names of toolbars compatible with this class (toolbars that are relevant and useful in th...
virtual const CObject * x_GetOrigObject() const
virtual void DestroyViewWindow()
destroy Window corresponding to the view
virtual void RegisterIconAliases(wxFileArtProvider &provider)
called by the framework to give Factory a chance to register images used by view
virtual wxEvtHandler * GetCommandHandler()
IWMClient implementation.
void x_OnSingleMouseClick(CEvent *event)
Scrolls to the corresponding item in the Flat File View and selects it.
virtual int TestInputObjects(TConstScopedObjects &objects)
tests input objects (not using object conversion) and returns a combination of ETestResult flags bett...
virtual void WidgetActivated()
virtual string GetExtensionIdentifier() const
CSequinDesktopViewFactory.
virtual void ShowView(const string &viewName, FWindowFactory widgetFactory, TConstScopedObjects &objects, bool bFloat)
virtual bool AllowMerge() const
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 RegisterCommands(CUICommandRegistry &cmd_reg, wxFileArtProvider &provider)
called by the framework to give Factory a chance to register commands used by view
virtual void GetSelection(CSelectionEvent &evt) const
get selection for broadcasting
virtual const wxMenu * GetMenu()
returns a menu (must be deleted by the caller) menu injections should follow a separator named "Contr...
virtual void CreateViewWindow(wxWindow *parent)
create Window corresponding to the view
virtual void WidgetSelectionChanged()
virtual IView * CreateInstanceByFingerprint(const TFingerprint &fingerprint) const
if fingerprint is recognized - creates and returns a new instance
virtual void GetAppSelection(TConstObjects &objects)
virtual string GetExtensionLabel() const
returns a displayable label for this extension ( please capitalize the key words - "My Extension" )
virtual void CloseWidget()
IGuiWidgetHost implementation.
CSeqDesktopPanel * m_Window
virtual const CProjectViewTypeDescriptor & GetProjectViewTypeDescriptor() const
returns a Descriptor for the View Type supported by the Factory
virtual void GetMainObject(TConstScopedObjects &objs) const
Adds the main data objects represented by the client to "objects".
virtual string GetTargetType() const
virtual wxWindow * GetWindow()
returns a pointer to the wxWindow representing the client
virtual const CViewTypeDescriptor & GetTypeDescriptor() const
return an object providing meta information about thei view type
void x_OnRefreshData(CEvent *event)
virtual void x_OnSetSelection(CSelectionEvent &evt)
override in derived classes in order to handle selection broadcast
virtual void OnWidgetCommand(const string &command)
virtual IView * CreateInstance() const
creates a view instance
vector< CConstRef< CObject > > TConstObjects
Definition: objects.hpp:64
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
wxWindow *(* FWindowFactory)(wxWindow *)
Definition: gui_widget.hpp:45
Portable reference counted smart and weak pointers using CWeakRef, CRef, CObject and CObjectEx.
const char * command
Modified on Fri Sep 20 14:58:09 2024 by modify_doxy.py rev. 669887