LibreOffice Module vcl (master) 1
Public Member Functions | Static Public Member Functions | Private Attributes | List of all members
VclPtr< reference_type > Class Template Reference

A thin wrapper around rtl::Reference to implement the acquire and dispose semantics we want for references to vcl::Window subclasses. More...

#include <vclptr.hxx>

Inheritance diagram for VclPtr< reference_type >:
[legend]
Collaboration diagram for VclPtr< reference_type >:
[legend]

Public Member Functions

 VclPtr ()
 Constructor... More...
 
 VclPtr (reference_type *pBody)
 Constructor... More...
 
 VclPtr (reference_type *pBody, __sal_NoAcquire)
 Constructor... that doesn't take a ref. More...
 
template<class derived_type >
 VclPtr (const VclPtr< derived_type > &rRef, typename std::enable_if< std::is_base_of< reference_type, derived_type >::value, int >::type=0)
 Up-casting conversion constructor: Copies interface reference. More...
 
 ~VclPtr ()
 
 VclPtr (VclPtr const &)=default
 
 VclPtr (VclPtr &&)=default
 
VclPtroperator= (VclPtr const &)=default
 
VclPtroperator= (VclPtr &&)=default
 
reference_type * operator-> () const
 Probably most common used: handle->someBodyOp(). More...
 
reference_type * get () const
 Get the body. More...
 
void set (reference_type *pBody)
 
void reset (reference_type *pBody)
 
template<typename derived_type >
std::enable_if< std::is_base_of< reference_type, derived_type >::value, VclPtr & >::type operator= (VclPtr< derived_type > const &rRef)
 Up-casting copy assignment operator. More...
 
VclPtroperator= (reference_type *pBody)
 
 operator reference_type * () const
 
 operator bool () const
 
void clear ()
 
void reset ()
 
void disposeAndClear ()
 
bool operator< (const VclPtr< reference_type > &handle) const
 Needed to place VclPtr's into STL collection. More...
 

Static Public Member Functions

template<typename... Arg>
static VclPtr< reference_type > Create (Arg &&... arg)
 A construction helper for VclPtr. More...
 

Private Attributes

::rtl::Reference< reference_type > m_rInnerRef
 

Detailed Description

template<class reference_type>
class VclPtr< reference_type >

A thin wrapper around rtl::Reference to implement the acquire and dispose semantics we want for references to vcl::Window subclasses.

For more details on the design please see vcl/README.lifecycle

Parameters
reference_typemust be a subclass of vcl::Window

Definition at line 57 of file vclptr.hxx.

Constructor & Destructor Documentation

◆ VclPtr() [1/6]

template<class reference_type >
VclPtr< reference_type >::VclPtr ( )
inline

Constructor...

Definition at line 69 of file vclptr.hxx.

◆ VclPtr() [2/6]

template<class reference_type >
VclPtr< reference_type >::VclPtr ( reference_type *  pBody)
inline

Constructor...

Definition at line 75 of file vclptr.hxx.

◆ VclPtr() [3/6]

template<class reference_type >
VclPtr< reference_type >::VclPtr ( reference_type *  pBody,
__sal_NoAcquire   
)
inline

Constructor... that doesn't take a ref.

Definition at line 81 of file vclptr.hxx.

◆ VclPtr() [4/6]

template<class reference_type >
template<class derived_type >
VclPtr< reference_type >::VclPtr ( const VclPtr< derived_type > &  rRef,
typename std::enable_if< std::is_base_of< reference_type, derived_type >::value, int >::type  = 0 
)
inline

Up-casting conversion constructor: Copies interface reference.

Does not work for up-casts to ambiguous bases. For the special case of up-casting to Reference< XInterface >, see the corresponding conversion operator.

Parameters
rRefanother reference

Definition at line 94 of file vclptr.hxx.

◆ ~VclPtr()

template<class reference_type >
VclPtr< reference_type >::~VclPtr ( )
inline

Definition at line 104 of file vclptr.hxx.

References vclmain::isAlive(), and VclPtr< reference_type >::m_rInnerRef.

◆ VclPtr() [5/6]

template<class reference_type >
VclPtr< reference_type >::VclPtr ( VclPtr< reference_type > const &  )
default

◆ VclPtr() [6/6]

template<class reference_type >
VclPtr< reference_type >::VclPtr ( VclPtr< reference_type > &&  )
default

Member Function Documentation

◆ clear()

template<class reference_type >
void VclPtr< reference_type >::clear ( )
inline

◆ Create()

template<class reference_type >
template<typename... Arg>
static VclPtr< reference_type > VclPtr< reference_type >::Create ( Arg &&...  arg)
inlinestatic

A construction helper for VclPtr.

Since VclPtr types are created with a reference-count of one - to help fit into the existing code-flow; this helps us to construct them easily.

For more details on the design please see vcl/README.lifecycle

Template Parameters
reference_typemust be a subclass of vcl::Window

Definition at line 127 of file vclptr.hxx.

References Arg.

Referenced by DXF2GDIMetaFile::Convert(), MessageDialog::create_message_area(), SalInstanceComboBox< vcl_type >::create_render_virtual_device(), SalInstanceEntryTreeView::create_render_virtual_device(), SalInstanceBuilder::create_screenshot_window(), SalInstanceWidget::create_virtual_device(), SalInstanceContainer::CreateChildFrame(), AnimationRenderer::draw(), DropdownBox::DropdownBox(), MenuBarUpdateIconManager::GetBubbleWindow(), VclBuilder::handleMenu(), IMPL_LINK(), vcl::RoadmapWizard::implConstruct(), ImplCopyItem(), MenuBar::ImplCreate(), MenuBarWindow::ImplCreatePopup(), OutputDevice::ImplDrawRotateText(), ImplGetDefaultContextWindow(), StatusBar::ImplInit(), TabControl::ImplInit(), ComboBox::ImplInit(), ListBox::ImplInit(), Printer::ImplInitDisplay(), FloatingWindow::ImplInitFloating(), ImplListBox::ImplListBox(), VirtualDevice::ImplSetOutputSizePixel(), ImplShowHelpWindow(), DockingWindow::ImplStartDocking(), ImplDockingWindowWrapper::ImplStartDocking(), ImplToolBoxPrivateData::ImplToolBoxPrivateData(), InterimItemWindow::InterimItemWindow(), VclBuilder::makeObject(), NotebookBarAddonsMerger::MergeNotebookBarAddons(), NotebookBar::NotebookBar(), PriorityMergedHBox::PriorityMergedHBox(), vcl::RoadmapItem::RoadmapItem(), SalInstanceComboBox< vcl_type >::set_item_menu(), ImplBorderWindow::SetNotebookBar(), CalendarField::ShowDropDown(), vcl::Window::StartAutoScroll(), SvInplaceEdit2::SvInplaceEdit2(), TextEngine::TextEngine(), WindowImpl::WindowImpl(), and WMFWriter::WriteWMF().

◆ disposeAndClear()

template<class reference_type >
void VclPtr< reference_type >::disposeAndClear ( )
inline

Definition at line 200 of file vclptr.hxx.

References VclPtr< reference_type >::m_rInnerRef.

Referenced by ToolBox::CalcMinimumWindowSizePixel(), DecoToolBox::calcMinSize(), ImplBorderWindow::CloseNotebookBar(), DXF2GDIMetaFile::Convert(), DeInitVCL(), OpenGLContext::dispose(), InterimItemWindow::dispose(), VclPaned::dispose(), VclExpander::dispose(), VclScrolledWindow::dispose(), NotebookBar::dispose(), OutputDevice::dispose(), Printer::dispose(), TabPage::dispose(), CalendarField::dispose(), ComboBox::dispose(), Edit::dispose(), ListBox::dispose(), SpinField::dispose(), vcl::Window::dispose(), ImplBorderWindow::dispose(), DropdownBox::dispose(), ImplListBox::dispose(), MessageDialog::dispose(), NotebookbarPopup::dispose(), PriorityMergedHBox::dispose(), VerticalTabControl::dispose(), vcl::RoadmapWizard::dispose(), MenuBarWindow::dispose(), ScopedVclPtr< reference_type >::disposeAndReset(), Dialog::disposeOwnedButtons(), SalInstanceWidget::DoRecursivePaint(), AnimationRenderer::draw(), OutputDevice::DrawTransparent(), vcl::Window::EndAutoScroll(), PopupMenu::FinishRun(), Help::HidePopover(), MenuBarWindow::ImplCreatePopup(), ImplDestroyHelpWindow(), ComboBox::Impl::ImplInitComboBoxData(), SpinField::ImplInitSpinFieldData(), vcl::Window::ImplPaintToDevice(), VirtualDevice::ImplSetOutputSizePixel(), DockingWindow::ImplStartDocking(), ImplDockingWindowWrapper::ImplStartDocking(), OpenGLContext::init(), MenuBarWindow::KillActivePopup(), MenuFloatingWindow::KillActivePopup(), vcl::PDFWriterImpl::playMetafile(), MenuBarUpdateIconManager::RemoveBubbleWindow(), vcl::Window::SetBorderStyle(), DockingWindow::SetFloatingMode(), ImplDockingWindowWrapper::SetFloatingMode(), ImplBorderWindow::SetNotebookBar(), Printer::SetPrinterProps(), Edit::SetSubEdit(), Dialog::StartExecuteAsync(), WMFWriter::WriteWMF(), AnimationRenderer::~AnimationRenderer(), ImplToolBoxPrivateData::~ImplToolBoxPrivateData(), ImpVclMEdit::~ImpVclMEdit(), MenuItemData::~MenuItemData(), OpenGLContext::~OpenGLContext(), vcl::RoadmapItem::~RoadmapItem(), SalInstanceBuilder::~SalInstanceBuilder(), SalInstanceMenu::~SalInstanceMenu(), SalInstanceWidget::~SalInstanceWidget(), ScopedVclPtr< reference_type >::~ScopedVclPtr(), SvImpLBox::~SvImpLBox(), SvInplaceEdit2::~SvInplaceEdit2(), SvxIconChoiceCtrl_Impl::~SvxIconChoiceCtrl_Impl(), and TextEngine::~TextEngine().

◆ get()

template<class reference_type >
reference_type * VclPtr< reference_type >::get ( ) const
inline

Get the body.

Can be used instead of operator->(). I.e. handle->someBodyOp() and handle.get()->someBodyOp() are the same.

Definition at line 143 of file vclptr.hxx.

References VclPtr< reference_type >::m_rInnerRef.

Referenced by vcl::WindowOutputDevice::AcquireGraphics(), SalLayoutGlyphsCache::CachedGlyphsKey::CachedGlyphsKey(), VclExpander::calculateRequisition(), MenuButton::CancelMenu(), vcl::Window::CaptureMouse(), MenuBarWindow::ChangeHighlightItem(), GDIMetaFile::Clip(), SvImpLBox::Command(), MessageDialog::create_message_area(), SalInstanceContainer::CreateChildFrame(), Menu::dispose(), vcl::Window::dispose(), ScopedVclPtr< reference_type >::disposeAndReset(), PaintHelper::DoPaint(), DNDEventDispatcher::dragOver(), AnimationRenderer::draw(), AnimationRenderer::drawToIndex(), DNDEventDispatcher::drop(), DNDEventDispatcher::dropActionChanged(), WindowUIObject::dumpHierarchy(), vcl::Window::EndAutoScroll(), MenuFloatingWindow::EndExecute(), vcl::Window::EndTracking(), MenuFloatingWindow::Execute(), ButtonUIObject::execute(), MenuButton::ExecuteMenu(), VclBuilder::get(), SalInstanceDrawingArea::get_accessible_relation_set(), VclEventBox::get_child(), WindowUIObject::get_child(), WindowUIObject::get_children(), SalInstanceTreeView::get_column_title(), SalInstanceTreeView::get_column_width(), SalInstanceTreeView::get_dest_row_at_pos(), MessageDialog::get_message_area(), SalInstanceTreeView::get_sort_indicator(), WindowUIObject::get_state(), WindowUIObject::get_visible_child(), SalInstanceWindow::get_window_state(), GDIMetaFile::GetBoundRect(), NotebookbarPopup::getBox(), IconViewImpl::GetEntrySize(), ImplListBox::GetMainWindow(), SalInstanceMenu::getMenu(), MenuBar::getMenuBarWindow(), vcl::WindowOutputDevice::GetOwnerWindow(), VerticalTabControl::GetPageParent(), MenuButton::GetPopover(), Application::GetTopWindow(), Application::GetTopWindowCount(), VclBuilder::handleChild(), ImpVclMEdit::HandleCommand(), VclBuilder::handleObject(), vcl::Window::HasActiveChildFrame(), SalInstanceWindow::help(), SalInstanceTreeView::hide(), Menu::HighlightItem(), IMPL_LINK(), GDIMetaFile::ImplAddGradientEx(), Menu::ImplCalcSize(), vcl::Window::ImplCallFocusChangeActivate(), ImplCFieldFloatWin::ImplCFieldFloatWin(), TabControl::ImplChangeTabPage(), MenuBarWindow::ImplCreatePopup(), MenuFloatingWindow::ImplCursorUpDown(), ImplDockingWindowWrapper::ImplDockingWindowWrapper(), Menu::ImplFillLayoutData(), ImplFrameData::ImplFrameData(), ImplGetKeyInputWindow(), vcl::Window::ImplGrabFocus(), ImplHandleKey(), ImplHandleMouseEvent(), ToolBox::ImplHideFocus(), ImplDockingWindowWrapper::ImplPreparePopupMode(), Printer::ImplReleaseGraphics(), MenuFloatingWindow::ImplScroll(), ToolBox::ImplShowFocus(), OpenGLContext::init(), MenuButton::InPopupMode(), VclBuilder::insertObject(), Menu::IsHighlighted(), MenuFloatingWindow::KeyInput(), MenuBarWindow::KillActivePopup(), MenuFloatingWindow::KillActivePopup(), MenuBarWindow::LayoutChanged(), TabPage::lcl_Scroll(), UITestLogger::logAction(), UITestLogger::logKeyInput(), VclBuilder::makeObject(), NotebookBarAddonsMerger::MergeNotebookBarAddons(), GDIMetaFile::Move(), vcl::BufferDevice::operator->(), VclPtr< reference_type >::operator=(), ScopedVclPtr< reference_type >::operator=(), operator==(), TabControl::Paint(), IconViewImpl::Paint(), vcl::PDFWriterImpl::playMetafile(), SalInstanceWindow::recursively_unset_default_buttons(), vcl::WindowOutputDevice::ReleaseGraphics(), OutputDevice::RemoveTransparenciesFromMetaFile(), vcl::Window::RemoveUserEvent(), SalInstanceWindow::resize_to_request(), SalInstancePopover::resize_to_request(), GDIMetaFile::Rotate(), PopupMenu::Run(), SalInstanceTreeView::SalInstanceTreeView(), SalInstanceTreeView::set_column_title(), SalInstanceTreeView::set_header_item_width(), SalInstanceLabel::set_mnemonic_widget(), MessageDialog::set_primary_text(), MessageDialog::set_secondary_text(), SalInstanceTreeView::set_sort_indicator(), JSTreeView::set_toggle(), SalInstanceWindow::set_window_state(), VclExpander::setAllocation(), DockingWindow::SetFloatingMode(), ImplDockingWindowWrapper::SetFloatingMode(), vcl::Window::setPosSizePixel(), TabControl::SetTabPage(), vcl::Cursor::SetWindow(), SalInstanceTreeView::show(), Help::ShowPopover(), vcl::Window::StartAutoScroll(), vcl::Window::StartTracking(), ImplStdBorderWindowView::Tracking(), ImplMenuDelData::~ImplMenuDelData(), SalInstanceBuilder::~SalInstanceBuilder(), and SalInstanceTreeView::~SalInstanceTreeView().

◆ operator bool()

template<class reference_type >
VclPtr< reference_type >::operator bool ( ) const
inlineexplicit

Definition at line 185 of file vclptr.hxx.

References VclPtr< reference_type >::m_rInnerRef.

◆ operator reference_type *()

template<class reference_type >
VclPtr< reference_type >::operator reference_type * ( ) const
inline

Definition at line 180 of file vclptr.hxx.

◆ operator->()

template<class reference_type >
reference_type * VclPtr< reference_type >::operator-> ( ) const
inline

Probably most common used: handle->someBodyOp().

Definition at line 134 of file vclptr.hxx.

References VclPtr< reference_type >::m_rInnerRef.

◆ operator<()

template<class reference_type >
bool VclPtr< reference_type >::operator< ( const VclPtr< reference_type > &  handle) const
inline

Needed to place VclPtr's into STL collection.

Definition at line 213 of file vclptr.hxx.

References VclPtr< reference_type >::m_rInnerRef.

◆ operator=() [1/4]

template<class reference_type >
VclPtr & VclPtr< reference_type >::operator= ( reference_type *  pBody)
inline

Definition at line 174 of file vclptr.hxx.

References VclPtr< reference_type >::m_rInnerRef.

◆ operator=() [2/4]

template<class reference_type >
VclPtr & VclPtr< reference_type >::operator= ( VclPtr< reference_type > &&  )
default

◆ operator=() [3/4]

template<class reference_type >
VclPtr & VclPtr< reference_type >::operator= ( VclPtr< reference_type > const &  )
default

◆ operator=() [4/4]

template<class reference_type >
template<typename derived_type >
std::enable_if< std::is_base_of< reference_type, derived_type >::value, VclPtr & >::type VclPtr< reference_type >::operator= ( VclPtr< derived_type > const &  rRef)
inline

Up-casting copy assignment operator.

Does not work for up-casts to ambiguous bases.

Parameters
rRefanother reference

Definition at line 168 of file vclptr.hxx.

References VclPtr< reference_type >::get(), and VclPtr< reference_type >::m_rInnerRef.

◆ reset() [1/2]

template<class reference_type >
void VclPtr< reference_type >::reset ( )
inline

Definition at line 195 of file vclptr.hxx.

References VclPtr< reference_type >::m_rInnerRef.

◆ reset() [2/2]

template<class reference_type >
void VclPtr< reference_type >::reset ( reference_type *  pBody)
inline

◆ set()

template<class reference_type >
void VclPtr< reference_type >::set ( reference_type *  pBody)
inline

Member Data Documentation

◆ m_rInnerRef

template<class reference_type >
::rtl::Reference<reference_type> VclPtr< reference_type >::m_rInnerRef
private

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