Medical Imaging Interaction Toolkit
2023.04.00
Medical Imaging Interaction Toolkit
berryISelectionListener.h
Go to the documentation of this file.
1
/*============================================================================
2
3
The Medical Imaging Interaction Toolkit (MITK)
4
5
Copyright (c) German Cancer Research Center (DKFZ)
6
All rights reserved.
7
8
Use of this source code is governed by a 3-clause BSD license that can be
9
found in the LICENSE file.
10
11
============================================================================*/
12
13
#ifndef BERRYISELECTIONLISTENER_H_
14
#define BERRYISELECTIONLISTENER_H_
15
16
#include <
berryMessage.h
>
17
18
#include <
org_blueberry_ui_qt_Export.h
>
19
20
#include "
berryIWorkbenchPart.h
"
21
#include "
berryISelection.h
"
22
23
namespace
berry
24
{
25
38
struct
BERRY_UI_QT
ISelectionListener
39
{
40
41
struct
Events
42
{
43
44
Message2<const IWorkbenchPart::Pointer&, const ISelection::ConstPointer&>
45
selectionChanged
;
46
47
void
AddListener(
ISelectionListener
* listener);
48
void
RemoveListener(
ISelectionListener
* listener);
49
50
typedef
MessageDelegate2
<
ISelectionListener
,
const
IWorkbenchPart::Pointer
&,
51
const
ISelection::ConstPointer
&>
Delegate
;
52
};
53
54
virtual
~
ISelectionListener
();
55
70
virtual
void
SelectionChanged(
const
IWorkbenchPart::Pointer
& part,
71
const
ISelection::ConstPointer
& selection) = 0;
72
};
73
99
template
<
typename
R>
100
struct
SelectionChangedAdapter
:
public
ISelectionListener
101
{
102
103
typedef
R
Listener
;
104
typedef
void
105
(R::*
Callback
)(
const
IWorkbenchPart::Pointer
&,
const
ISelection::ConstPointer
&);
106
107
SelectionChangedAdapter
(R* l,
Callback
c) :
108
listener(l), callback(c)
109
{
110
poco_assert(listener);
111
poco_assert(callback);
112
}
113
114
void
SelectionChanged
(
const
IWorkbenchPart::Pointer
& part,
const
ISelection::ConstPointer
& selection)
override
115
{
116
(listener->*callback)(part, selection);
117
}
118
119
private
:
120
121
Listener
* listener;
122
Callback
callback;
123
};
124
125
}
126
127
#endif
/*BERRYISELECTIONLISTENER_H_*/
berry::ISelectionListener
Definition:
berryISelectionListener.h:38
org_blueberry_ui_qt_Export.h
berry::SelectionChangedAdapter::Callback
void(R::* Callback)(const IWorkbenchPart::Pointer &, const ISelection::ConstPointer &)
Definition:
berryISelectionListener.h:105
berry::SmartPointer< Self >
berryMessage.h
berry::ISelectionListener::Events
Definition:
berryISelectionListener.h:41
berry::ISelectionListener::Events::Delegate
MessageDelegate2< ISelectionListener, const IWorkbenchPart::Pointer &, const ISelection::ConstPointer & > Delegate
Definition:
berryISelectionListener.h:51
berry::Message2< const IWorkbenchPart::Pointer &, const ISelection::ConstPointer & >
berry::SelectionChangedAdapter::SelectionChangedAdapter
SelectionChangedAdapter(R *l, Callback c)
Definition:
berryISelectionListener.h:107
BERRY_UI_QT
#define BERRY_UI_QT
Definition:
org_blueberry_ui_qt_Export.h:26
berryIWorkbenchPart.h
berry::MessageDelegate2
Definition:
berryMessage.h:216
berry::Object::ConstPointer
berry::SmartPointer< const Self > ConstPointer
Definition:
berryObject.h:83
berry::SelectionChangedAdapter
Definition:
berryISelectionListener.h:100
berry::SelectionChangedAdapter::SelectionChanged
void SelectionChanged(const IWorkbenchPart::Pointer &part, const ISelection::ConstPointer &selection) override
Definition:
berryISelectionListener.h:114
berry::ISelectionListener::Events::selectionChanged
Message2< const IWorkbenchPart::Pointer &, const ISelection::ConstPointer & > selectionChanged
Definition:
berryISelectionListener.h:45
berry::SelectionChangedAdapter::Listener
R Listener
Definition:
berryISelectionListener.h:103
berry
Definition:
QmitkPropertyItemModel.h:24
berryISelection.h
src
MITK
Plugins
org.blueberry.ui.qt
src
berryISelectionListener.h
Generated on Wed May 17 2023 16:26:02 for Medical Imaging Interaction Toolkit by
1.8.17