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

Go to the SVN repository for this file.

1 #ifndef GUI_UTILS___VIEW_EVENT__HPP
2 #define GUI_UTILS___VIEW_EVENT__HPP
3 
4 /* $Id: view_event.hpp 40289 2018-01-19 19:02:37Z 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 CAnyType 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 CAnyType particular
23  * purpose.
24  *
25  * Please cite the author in any work or product based on this material.
26  *
27  * ===========================================================================
28  *
29  * Authors: Vladimir Tereshkov
30  *
31  * File Description:
32  * Event object for view communications
33  */
34 
35 #include <gui/utils/event.hpp>
36 #include <gui/objutils/objects.hpp>
38 
40 
41 class CViewEvent : public CEvent
42 {
43 public:
44  enum EEventType {
46 
47  /// general notification that selections have changed
48  /// This is to be packaged in a CSelectionEvent.
50  eProjectChanged, /// general data update notification
51  eViewAttached, /// a view has been initialized and ready
52  eViewReleased, /// a view has been destroyed
53 
54  /// notification from child to parent that a selection has changed
56 
57  /// notification from child to parent that the visible range has changed
59 
60  /// notification from child to parent that the underlying data has changed
62 
67  };
68 
69  /// default ctor
71  : CEvent()
72  {
73  }
74 
75  /// create an event for a given event ID, with event class Unknown
77  : CEvent(eid)
78  {
79  }
80 
81  /// create an event for a specific event class and ID
83  : CEvent(ecl, eid)
84  {
85  }
86 
87  EEventType GetType() const { return (EEventType)GetID(); }
88 };
89 
91 {
92 public:
93  COpenGraphicViewEvent(const SConstScopedObject& object, const objects::CUser_object* params)
94  : CEvent(CViewEvent::eOpenGraphicalViewEvent), m_Object(object), m_Params(params) {}
95 
97  const objects::CUser_object* GetParams() const { return m_Params; }
98 
99 private:
102 };
103 
105 
106 #endif // GUI_UTILS___VIEW_EVENT__HPP
CEvent - generic event implementation TODO TODO - Attachments.
Definition: event.hpp:86
SConstScopedObject & GetObject()
Definition: view_event.hpp:96
SConstScopedObject m_Object
Definition: view_event.hpp:100
COpenGraphicViewEvent(const SConstScopedObject &object, const objects::CUser_object *params)
Definition: view_event.hpp:93
CConstRef< objects::CUser_object > m_Params
Definition: view_event.hpp:101
const objects::CUser_object * GetParams() const
Definition: view_event.hpp:97
CViewEvent(TEventID eid)
create an event for a given event ID, with event class Unknown
Definition: view_event.hpp:76
CViewEvent(EEventClass ecl, TEventID eid)
create an event for a specific event class and ID
Definition: view_event.hpp:82
@ eWidgetSelectionChanged
a view has been destroyed
Definition: view_event.hpp:55
@ eViewReleased
a view has been initialized and ready
Definition: view_event.hpp:52
@ eOpenGraphicalViewEvent
Definition: view_event.hpp:66
@ eWidgetDataChanged
notification from child to parent that the underlying data has changed
Definition: view_event.hpp:61
@ eWidgetItemActivated
Definition: view_event.hpp:65
@ eEditSelectedObjects
Definition: view_event.hpp:63
@ eDeleteSelectedObjects
Definition: view_event.hpp:64
@ eViewAttached
general data update notification
Definition: view_event.hpp:51
@ eSelectionChanged
general notification that selections have changed This is to be packaged in a CSelectionEvent.
Definition: view_event.hpp:49
@ eWidgetRangeChanged
notification from child to parent that the visible range has changed
Definition: view_event.hpp:58
CViewEvent()
default ctor
Definition: view_event.hpp:70
EEventType GetType() const
Definition: view_event.hpp:87
const TEventID GetID(void) const
Inline Implementation.
Definition: event.hpp:164
Int4 TEventID
Definition: event.hpp:90
EEventClass
default event classes
Definition: event.hpp:98
#define END_NCBI_SCOPE
End previously defined NCBI scope.
Definition: ncbistl.hpp:103
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
Definition: ncbistl.hpp:100
Modified on Sat Feb 24 07:46:33 2024 by modify_doxy.py rev. 669887