Medical Imaging Interaction Toolkit  2016.11.0
Medical Imaging Interaction Toolkit
berry::Shell Class Referenceabstract

#include <berryShell.h>

Inheritance diagram for berry::Shell:
Collaboration diagram for berry::Shell:

Public Member Functions

 berryObjectMacro (Shell) Shell()
 
Object::Pointer GetData (const QString &id="") const
 
void SetData (const Object::Pointer &data, const QString &id="")
 
IShellListenerGetExtraShellListener () const
 
void SetExtraShellListener (IShellListener *l)
 
void SetBounds (int x, int y, int width, int height)
 
virtual void SetBounds (const QRect &bounds)=0
 
virtual QRect GetBounds () const =0
 
virtual void SetLocation (int x, int y)=0
 
virtual QPoint ComputeSize (int wHint, int hHint, bool changed)=0
 
virtual QString GetText () const =0
 
virtual void SetText (const QString &text)=0
 
virtual bool IsVisible () const =0
 
virtual void SetVisible (bool visible)=0
 
virtual QWidget * GetControl () const =0
 
virtual void SetImages (const QList< QIcon > &images)=0
 
virtual bool GetMaximized () const =0
 
virtual bool GetMinimized () const =0
 
virtual void SetMinimized (bool minimized)=0
 
virtual void SetMaximized (bool maximized)=0
 
virtual void AddShellListener (IShellListener *listener)=0
 
virtual void RemoveShellListener (IShellListener *listener)=0
 
virtual void Open (bool block=false)=0
 
virtual void Close ()=0
 
virtual void SetActive ()=0
 
virtual QList< Shell::PointerGetShells ()=0
 
virtual Qt::WindowFlags GetStyle () const =0
 
- Public Member Functions inherited from berry::Object
virtual QString GetClassName () const
 
virtual Reflection::TypeInfo GetTypeInfo () const
 
virtual QList< Reflection::TypeInfoGetSuperclasses () const
 
virtual void Delete ()
 
QDebug Print (QDebug os, Indent Indent=0) const
 
virtual QString ToString () const
 
virtual uint HashCode () const
 
virtual bool operator< (const Object *) const
 
void Register () const
 
void UnRegister (bool del=true) const
 
int GetReferenceCount () const
 
void SetReferenceCount (int)
 
void AddDestroyListener (const MessageAbstractDelegate<> &delegate) const
 
void RemoveDestroyListener (const MessageAbstractDelegate<> &delegate) const
 
virtual bool operator== (const Object *) const
 

Additional Inherited Members

- Public Types inherited from berry::Object
typedef Object Self
 
typedef berry::SmartPointer< SelfPointer
 
typedef berry::SmartPointer< const SelfConstPointer
 
typedef berry::WeakPointer< SelfWeakPtr
 
typedef berry::WeakPointer< const SelfConstWeakPtr
 
- Static Public Member Functions inherited from berry::Object
static const char * GetStaticClassName ()
 
static Reflection::TypeInfo GetStaticTypeInfo ()
 
static QList< Reflection::TypeInfoGetStaticSuperclasses ()
 
- Protected Member Functions inherited from berry::Object
 Object ()
 
virtual ~Object ()
 
virtual QDebug PrintSelf (QDebug os, Indent indent) const
 
virtual QDebug PrintHeader (QDebug os, Indent indent) const
 
virtual QDebug PrintTrailer (QDebug os, Indent indent) const
 
- Protected Attributes inherited from berry::Object
QAtomicInt m_ReferenceCount
 
QMutex m_ReferenceCountLock
 

Detailed Description

Instances of this class represent the "windows" which the desktop or "window manager" is managing. Instances that do not have a parent (that is, they are built using the constructor, which takes a Display as the argument) are described as top level shells. Instances that do have a parent are described as secondary or dialog shells.

Instances are always displayed in one of the maximized, minimized or normal states:

  • When an instance is marked as maximized, the window manager will typically resize it to fill the entire visible area of the display, and the instance is usually put in a state where it can not be resized (even if it has style RESIZE) until it is no longer maximized.
  • When an instance is in the normal state (neither maximized or minimized), its appearance is controlled by the style constants which were specified when it was created and the restrictions of the window manager (see below).
  • When an instance has been marked as minimized, its contents (client area) will usually not be visible, and depending on the window manager, it may be "iconified" (that is, replaced on the desktop by a small simplified representation of itself), relocated to a distinguished area of the screen, or hidden. Combinations of these changes are also possible.

The modality of an instance may be specified using style bits. The modality style bits are used to determine whether input is blocked for other shells on the display. The PRIMARY_MODAL style allows an instance to block input to its parent. The APPLICATION_MODAL style allows an instance to block input to every other shell in the display. The SYSTEM_MODAL style allows an instance to block input to all shells, including shells belonging to different applications.

Note: The styles supported by this class are treated as HINTs, since the window manager for the desktop on which the instance is visible has ultimate control over the appearance and behavior of decorations and modality. For example, some window managers only support resizable windows and will always assume the RESIZE style, even if it is not set. In addition, if a modality style is not supported, it is "upgraded" to a more restrictive modality style that is supported. For example, if PRIMARY_MODAL is not supported, it would be upgraded to APPLICATION_MODAL. A modality style may also be "downgraded" to a less restrictive style. For example, most operating systems no longer support SYSTEM_MODAL because it can freeze up the desktop, so this is typically downgraded to APPLICATION_MODAL.

Styles:
BORDER, CLOSE, MIN, MAX, NO_TRIM, RESIZE, TITLE, ON_TOP, TOOL APPLICATION_MODAL, MODELESS, PRIMARY_MODAL, SYSTEM_MODAL
Events:
Activate, Close, Deactivate, Deiconify, Iconify

Class SWT provides two "convenience constants" for the most commonly required style combinations:

SHELL_TRIM
the result of combining the constants which are required to produce a typical application top level shell: (that is, CLOSE | TITLE | MIN | MAX | RESIZE)
DIALOG_TRIM
the result of combining the constants which are required to produce a typical application dialog shell: (that is, TITLE | CLOSE | BORDER)

Note: Only one of the styles APPLICATION_MODAL, MODELESS, PRIMARY_MODAL and SYSTEM_MODAL may be specified.

IMPORTANT: This class is not intended to be subclassed.

Definition at line 122 of file berryShell.h.

Member Function Documentation

virtual void berry::Shell::AddShellListener ( IShellListener listener)
pure virtual

Adds the listener to the collection of listeners who will be notified when operations are performed on the receiver, by sending the listener one of the messages defined in the IShellListener interface.

Parameters
listenerthe listener which should be notified
See also
IShellListener
RemoveShellListener
berry::Shell::berryObjectMacro ( Shell  )
virtual void berry::Shell::Close ( )
pure virtual

Requests that the window manager close the receiver in the same way it would be closed when the user clicks on the "close box" or performs some other platform specific key or mouse combination that indicates the window should be removed.

virtual QPoint berry::Shell::ComputeSize ( int  wHint,
int  hHint,
bool  changed 
)
pure virtual
virtual QRect berry::Shell::GetBounds ( ) const
pure virtual
virtual QWidget* berry::Shell::GetControl ( ) const
pure virtual
Object::Pointer berry::Shell::GetData ( const QString &  id = "") const

Definition at line 28 of file berryShell.cpp.

IShellListener * berry::Shell::GetExtraShellListener ( ) const

Definition at line 40 of file berryShell.cpp.

virtual bool berry::Shell::GetMaximized ( ) const
pure virtual

Returns true if the receiver is currently maximized, and false otherwise.

Returns
the maximized state
See also
SetMaximized
virtual bool berry::Shell::GetMinimized ( ) const
pure virtual

Returns true if the receiver is currently minimized, and false otherwise.

Returns
the minimized state
See also
SetMinimized
virtual QList<Shell::Pointer> berry::Shell::GetShells ( )
pure virtual

Returns an array containing all shells which are descendants of the receiver.

Returns
the dialog shells
Exceptions
SWTException
  • ERROR_WIDGET_DISPOSED - if the receiver has been disposed
  • ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
virtual Qt::WindowFlags berry::Shell::GetStyle ( ) const
pure virtual

Returns the receiver's style information.

Note that the value which is returned by this method may not match the value which was provided to the constructor when the receiver was created. This can occur when the underlying operating system does not support a particular combination of requested styles. For example, if the platform widget used to implement a particular SWT widget always has scroll bars, the result of calling this method would always have the SWT.H_SCROLL and SWT.V_SCROLL bits set.

Returns
the style bits
Exceptions
SWTException
  • ERROR_WIDGET_DISPOSED - if the receiver has been disposed
  • ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
virtual QString berry::Shell::GetText ( ) const
pure virtual

Returns the receiver's text, which is the string that the window manager will typically display as the receiver's title. If the text has not previously been set, returns an empty string.

Returns
the text
virtual bool berry::Shell::IsVisible ( ) const
pure virtual
virtual void berry::Shell::Open ( bool  block = false)
pure virtual

Moves the receiver to the top of the drawing order for the display on which it was created (so that all other shells on that display, which are not the receiver's children will be drawn behind it), marks it visible, sets the focus and asks the window manager to make the shell active.

virtual void berry::Shell::RemoveShellListener ( IShellListener listener)
pure virtual

Removes the listener from the collection of listeners who will be notified when operations are performed on the receiver.

Parameters
listenerthe listener which should no longer be notified
See also
IShellListener
AddShellListener
virtual void berry::Shell::SetActive ( )
pure virtual

If the receiver is visible, moves it to the top of the drawing order for the display on which it was created (so that all other shells on that display, which are not the receiver's children will be drawn behind it) and asks the window manager to make the shell active.

void berry::Shell::SetBounds ( int  x,
int  y,
int  width,
int  height 
)

Definition at line 50 of file berryShell.cpp.

virtual void berry::Shell::SetBounds ( const QRect &  bounds)
pure virtual
void berry::Shell::SetData ( const Object::Pointer data,
const QString &  id = "" 
)

Definition at line 35 of file berryShell.cpp.

void berry::Shell::SetExtraShellListener ( IShellListener l)

Definition at line 45 of file berryShell.cpp.

virtual void berry::Shell::SetImages ( const QList< QIcon > &  images)
pure virtual
virtual void berry::Shell::SetLocation ( int  x,
int  y 
)
pure virtual
virtual void berry::Shell::SetMaximized ( bool  maximized)
pure virtual

Sets the maximized state of the receiver. If the argument is true causes the receiver to switch to the maximized state, and if the argument is false and the receiver was previously maximized, causes the receiver to switch back to either the minimized or normal states.

Note: The result of intermixing calls to setMaximized(true) and setMinimized(true) will vary by platform. Typically, the behavior will match the platform user's expectations, but not always. This should be avoided if possible.

Parameters
maximizedthe new maximized state
See also
SetMinimized
virtual void berry::Shell::SetMinimized ( bool  minimized)
pure virtual

Sets the minimized stated of the receiver. If the argument is true causes the receiver to switch to the minimized state, and if the argument is false and the receiver was previously minimized, causes the receiver to switch back to either the maximized or normal states.

Note: The result of intermixing calls to setMaximized(true) and setMinimized(true) will vary by platform. Typically, the behavior will match the platform user's expectations, but not always. This should be avoided if possible.

Parameters
minimizedthe new maximized state
See also
SetMaximized
virtual void berry::Shell::SetText ( const QString &  text)
pure virtual

Sets the receiver's text, which is the string that the window manager will typically display as the receiver's title, to the argument.

virtual void berry::Shell::SetVisible ( bool  visible)
pure virtual

The documentation for this class was generated from the following files: