LibreOffice Module forms (master) 1
|
#include <richtextimplcontrol.hxx>
Classes | |
struct | GrantAccess |
Public Member Functions | |
EditView * | getView (const GrantAccess &) const |
RichTextEngine * | getEngine (const GrantAccess &) const |
vcl::Window * | getViewport (const GrantAccess &) const |
RichTextControlImpl (Control *_pAntiImpl, RichTextEngine *_pEngine, ITextAttributeListener *_pTextAttrListener, ITextSelectionListener *_pSelectionListener) | |
virtual | ~RichTextControlImpl () |
void | updateAllAttributes () |
updates the cache with the state of all attribute values from the given set, notifies the listener if the state changed More... | |
void | updateAttribute (AttributeId _nAttribute) |
updates the cache with the state of the attribute given by which id, notifies the listener if the state changed More... | |
void | enableAttributeNotification (AttributeId _nAttributeId, ITextAttributeListener *_pListener) |
enables the callback for a particular attribute More... | |
void | disableAttributeNotification (AttributeId _nAttributeId) |
disables the change notifications for a particular attribute More... | |
bool | executeAttribute (const SfxItemSet &_rCurrentAttribs, SfxItemSet &_rNewAttribs, AttributeId _nAttribute, const SfxPoolItem *_pArgument, SvtScriptType _nForScriptType) |
executes a toggle of the given attribute More... | |
AttributeState | getAttributeState (AttributeId _nAttributeId) const |
retrieves the state of the given attribute from the cache More... | |
void | normalizeScriptDependentAttribute (SvxScriptSetItem &_rScriptSetItem) |
normalizes the given item so that the state of script dependent attributes is correct considering the current script type More... | |
SvtScriptType | getSelectedScriptType () const |
void | layoutWindow () |
re-arranges the view and the scrollbars More... | |
void | notifyStyleChanged () |
to be called when the style of our window changed More... | |
void | notifyZoomChanged () |
to be called when the zoom of our window changed More... | |
void | notifyInitShow () |
to be called when the StateChangedType::InitShow event arrives More... | |
void | SetBackgroundColor () |
void | SetBackgroundColor (const Color &_rColor) |
void | SetReadOnly (bool _bReadOnly) |
bool | IsReadOnly () const |
void | SetHideInactiveSelection (bool _bHide) |
bool | GetHideInactiveSelection () const |
void | Draw (OutputDevice *_pDev, const Point &_rPos, const Size &_rSize) |
draws the control onto a given output device More... | |
bool | HandleCommand (const CommandEvent &_rEvent) |
handles command events arrived at the anti-impl control More... | |
virtual void | EditEngineStatusChanged (const EditStatus &_rStatus)=0 |
Private Types | |
typedef ::std::map< AttributeId, AttributeState > | StateCache |
typedef ::std::map< AttributeId, ::rtl::Reference< AttributeHandler > > | AttributeHandlerPool |
typedef ::std::map< AttributeId, ITextAttributeListener * > | AttributeListenerPool |
Private Member Functions | |
void | implUpdateAttribute (const AttributeHandlerPool::const_iterator &_pHandler) |
void | implCheckUpdateCache (AttributeId _nAttribute, const AttributeState &_rState) |
void | updateScrollbars () |
bool | windowHasAutomaticLineBreak () |
void | ensureScrollbars () |
hides or shows our scrollbars, according to the current WinBits of the window More... | |
void | ensureLineBreakSetting () |
ensures that our "automatic line break" setting matches the current WinBits of the window More... | |
bool | hasVScrollBar () const |
bool | hasHScrollBar () const |
virtual void | EditEngineStatusChanged (const EditStatus &_rStatus) override |
DECL_LINK (OnInvalidateAllAttributes, LinkParamNone *, void) | |
DECL_LINK (OnHScroll, weld::Scrollbar &, void) | |
DECL_LINK (OnVScroll, weld::Scrollbar &, void) | |
Additional Inherited Members | |
Protected Member Functions inherited from frm::IEngineStatusListener | |
~IEngineStatusListener () | |
Definition at line 42 of file richtextimplcontrol.hxx.
|
private |
Definition at line 45 of file richtextimplcontrol.hxx.
|
private |
Definition at line 46 of file richtextimplcontrol.hxx.
|
private |
Definition at line 44 of file richtextimplcontrol.hxx.
frm::RichTextControlImpl::RichTextControlImpl | ( | Control * | _pAntiImpl, |
RichTextEngine * | _pEngine, | ||
ITextAttributeListener * | _pTextAttrListener, | ||
ITextSelectionListener * | _pSelectionListener | ||
) |
Definition at line 44 of file richtextimplcontrol.cxx.
References VclPtr< class reference_type >::Create(), ensureScrollbars(), OutputDevice::GetMapMode(), EditEngine::GetRefDevice(), EditEngine::InsertView(), LINK, m_pAntiImpl, m_pEngine, m_pView, m_pViewport, and frm::RichTextEngine::registerEngineStatusListener().
|
virtual |
Definition at line 86 of file richtextimplcontrol.cxx.
References VclPtr< class reference_type >::disposeAndClear(), m_pEngine, m_pHScroll, m_pView, m_pViewport, m_pVScroll, EditEngine::RemoveView(), and frm::RichTextEngine::revokeEngineStatusListener().
|
private |
|
private |
|
private |
void frm::RichTextControlImpl::disableAttributeNotification | ( | AttributeId | _nAttributeId | ) |
disables the change notifications for a particular attribute
Definition at line 201 of file richtextimplcontrol.cxx.
References m_aAttributeHandlers, and m_aAttributeListeners.
void frm::RichTextControlImpl::Draw | ( | OutputDevice * | _pDev, |
const Point & | _rPos, | ||
const Size & | _rSize | ||
) |
draws the control onto a given output device
Definition at line 550 of file richtextimplcontrol.cxx.
References tools::Rectangle::AdjustBottom(), tools::Rectangle::AdjustRight(), EditEngine::Draw(), OutputDevice::DrawRect(), vcl::FILLCOLOR, OutputDevice::GetMapMode(), MapMode::GetMapUnit(), MapMode::GetOrigin(), EditEngine::GetRefDevice(), MapMode::GetScaleX(), MapMode::GetScaleY(), Size::Height(), vcl::LINECOLOR, OutputDevice::LogicToLogic(), m_pAntiImpl, m_pEngine, vcl::MAPMODE, OutputDevice::PixelToLogic(), OutputDevice::Pop(), OutputDevice::Push(), OutputDevice::SetFillColor(), OutputDevice::SetLineColor(), OutputDevice::SetMapMode(), WB_BORDER, and Size::Width().
|
overrideprivatevirtual |
Implements frm::IEngineStatusListener.
Definition at line 267 of file richtextimplcontrol.cxx.
References EditEngine::GetPaperSize(), EditStatus::GetStatusWord(), EditEngine::GetTextHeight(), m_pEngine, m_pHScroll, m_pView, m_pVScroll, EditEngine::SetPaperSize(), updateScrollbars(), Size::Width(), and windowHasAutomaticLineBreak().
void frm::RichTextControlImpl::enableAttributeNotification | ( | AttributeId | _nAttributeId, |
ITextAttributeListener * | _pListener | ||
) |
enables the callback for a particular attribute
Definition at line 178 of file richtextimplcontrol.cxx.
References EditEngine::GetEmptyItemSet(), frm::AttributeHandlerFactory::getHandlerFor(), SfxItemSet::GetPool(), m_aAttributeHandlers, m_aAttributeListeners, m_pEngine, SAL_WARN_IF, and updateAttribute().
|
private |
ensures that our "automatic line break" setting matches the current WinBits of the window
Definition at line 357 of file richtextimplcontrol.cxx.
References EMPTY_PAPER_SIZE, layoutWindow(), m_pEngine, EditEngine::SetPaperSize(), and windowHasAutomaticLineBreak().
Referenced by notifyStyleChanged().
|
private |
hides or shows our scrollbars, according to the current WinBits of the window
Definition at line 322 of file richtextimplcontrol.cxx.
References VclPtr< class reference_type >::Create(), VclPtr< class reference_type >::disposeAndClear(), hasHScrollBar(), hasVScrollBar(), layoutWindow(), LINK, m_pAntiImpl, m_pHScroll, m_pVScroll, WB_HSCROLL, and WB_VSCROLL.
Referenced by notifyStyleChanged(), and RichTextControlImpl().
bool frm::RichTextControlImpl::executeAttribute | ( | const SfxItemSet & | _rCurrentAttribs, |
SfxItemSet & | _rNewAttribs, | ||
AttributeId | _nAttribute, | ||
const SfxPoolItem * | _pArgument, | ||
SvtScriptType | _nForScriptType | ||
) |
executes a toggle of the given attribute
Definition at line 165 of file richtextimplcontrol.cxx.
References m_aAttributeHandlers.
AttributeState frm::RichTextControlImpl::getAttributeState | ( | AttributeId | _nAttributeId | ) | const |
retrieves the state of the given attribute from the cache
Definition at line 153 of file richtextimplcontrol.cxx.
References frm::eIndetermined, and m_aLastKnownStates.
|
inline |
Definition at line 67 of file richtextimplcontrol.hxx.
References m_pEngine.
bool frm::RichTextControlImpl::GetHideInactiveSelection | ( | ) | const |
Definition at line 630 of file richtextimplcontrol.cxx.
References m_pViewport.
SvtScriptType frm::RichTextControlImpl::getSelectedScriptType | ( | ) | const |
Definition at line 258 of file richtextimplcontrol.cxx.
References SvtLanguageOptions::GetScriptTypeOfLanguage(), Application::GetSettings(), and m_pView.
Referenced by normalizeScriptDependentAttribute().
|
inline |
Definition at line 66 of file richtextimplcontrol.hxx.
References m_pView.
|
inline |
Definition at line 68 of file richtextimplcontrol.hxx.
References m_pViewport.
bool frm::RichTextControlImpl::HandleCommand | ( | const CommandEvent & | _rEvent | ) |
handles command events arrived at the anti-impl control
Definition at line 536 of file richtextimplcontrol.cxx.
References CommandEvent::GetCommand(), m_pAntiImpl, m_pHScroll, and m_pVScroll.
|
inlineprivate |
Definition at line 168 of file richtextimplcontrol.hxx.
References m_pHScroll.
Referenced by ensureScrollbars().
|
inlineprivate |
Definition at line 167 of file richtextimplcontrol.hxx.
References m_pVScroll.
Referenced by ensureScrollbars().
|
private |
Definition at line 230 of file richtextimplcontrol.cxx.
References m_aAttributeListeners, m_aLastKnownStates, m_pTextAttrListener, and frm::ITextAttributeListener::onAttributeStateChanged().
Referenced by implUpdateAttribute().
|
private |
Definition at line 96 of file richtextimplcontrol.cxx.
References implCheckUpdateCache(), m_pView, and normalizeScriptDependentAttribute().
Referenced by updateAllAttributes(), and updateAttribute().
bool frm::RichTextControlImpl::IsReadOnly | ( | ) | const |
Definition at line 519 of file richtextimplcontrol.cxx.
References m_pView.
void frm::RichTextControlImpl::layoutWindow | ( | ) |
re-arranges the view and the scrollbars
Definition at line 365 of file richtextimplcontrol.cxx.
References vcl::FONT, vcl::Font::GetFontSize(), StyleSettings::GetScrollBarSize(), EditEngine::GetStandardFont(), EditEngine::GetTextHeight(), Size::Height(), m_bHasEverBeenShown, m_pAntiImpl, m_pEngine, m_pHScroll, m_pView, m_pViewport, m_pVScroll, Size::setHeight(), EditEngine::SetPaperSize(), Size::setWidth(), updateScrollbars(), Size::Width(), and windowHasAutomaticLineBreak().
Referenced by ensureLineBreakSetting(), ensureScrollbars(), notifyInitShow(), and notifyZoomChanged().
void frm::RichTextControlImpl::normalizeScriptDependentAttribute | ( | SvxScriptSetItem & | _rScriptSetItem | ) |
normalizes the given item so that the state of script dependent attributes is correct considering the current script type
There are some attributes which are script dependent, e.g. the CharPosture. This means that in real, there are 3 attributes for this, one for every possible script type (latin, asian, complex). However, to the out world, we behave as if there is only one attribute: E.g., if the outer world asks for the state of the "CharPosture" attribute, we return the state of either CharPostureLatin, CharPostureAsian, or CharPostureComplex, depending on the script type of the current selection. (In real, it may be more complex since the current selection may contain more than one script type.)
This method normalizes a script dependent attribute, so that it's state takes into account the currently selected script type.
Definition at line 215 of file richtextimplcontrol.cxx.
References SfxPoolItem::CloneSetWhich(), SvxScriptSetItem::GetItemOfScript(), getSelectedScriptType(), and m_pView.
Referenced by implUpdateAttribute().
void frm::RichTextControlImpl::notifyInitShow | ( | ) |
to be called when the StateChangedType::InitShow event arrives
Definition at line 474 of file richtextimplcontrol.cxx.
References layoutWindow(), and m_bHasEverBeenShown.
void frm::RichTextControlImpl::notifyStyleChanged | ( | ) |
to be called when the style of our window changed
Definition at line 484 of file richtextimplcontrol.cxx.
References ensureLineBreakSetting(), and ensureScrollbars().
void frm::RichTextControlImpl::notifyZoomChanged | ( | ) |
to be called when the zoom of our window changed
Definition at line 491 of file richtextimplcontrol.cxx.
References layoutWindow(), m_pAntiImpl, m_pViewport, MapMode::SetScaleX(), and MapMode::SetScaleY().
void frm::RichTextControlImpl::SetBackgroundColor | ( | ) |
Definition at line 610 of file richtextimplcontrol.cxx.
References Application::GetSettings(), and SetBackgroundColor().
Referenced by SetBackgroundColor().
void frm::RichTextControlImpl::SetBackgroundColor | ( | const Color & | _rColor | ) |
Definition at line 616 of file richtextimplcontrol.cxx.
References m_pAntiImpl, and m_pViewport.
void frm::RichTextControlImpl::SetHideInactiveSelection | ( | bool | _bHide | ) |
Definition at line 624 of file richtextimplcontrol.cxx.
References m_pViewport.
void frm::RichTextControlImpl::SetReadOnly | ( | bool | _bReadOnly | ) |
Definition at line 513 of file richtextimplcontrol.cxx.
References m_pView.
void frm::RichTextControlImpl::updateAllAttributes | ( | ) |
updates the cache with the state of all attribute values from the given set, notifies the listener if the state changed
Definition at line 130 of file richtextimplcontrol.cxx.
References implUpdateAttribute(), m_aAttributeHandlers, m_aLastKnownSelection, m_pSelectionListener, m_pView, and frm::ITextSelectionListener::onSelectionChanged().
void frm::RichTextControlImpl::updateAttribute | ( | AttributeId | _nAttribute | ) |
updates the cache with the state of the attribute given by which id, notifies the listener if the state changed
Definition at line 122 of file richtextimplcontrol.cxx.
References implUpdateAttribute(), and m_aAttributeHandlers.
Referenced by enableAttributeNotification().
|
private |
Definition at line 455 of file richtextimplcontrol.cxx.
References EditEngine::CalcTextWidth(), EMPTY_PAPER_SIZE, EditEngine::GetPaperSize(), EditEngine::GetTextHeight(), m_pEngine, m_pHScroll, m_pView, m_pVScroll, and Size::Width().
Referenced by EditEngineStatusChanged(), and layoutWindow().
|
private |
Definition at line 507 of file richtextimplcontrol.cxx.
References m_pAntiImpl, and WB_WORDBREAK.
Referenced by EditEngineStatusChanged(), ensureLineBreakSetting(), and layoutWindow().
|
private |
Definition at line 49 of file richtextimplcontrol.hxx.
Referenced by disableAttributeNotification(), enableAttributeNotification(), executeAttribute(), updateAllAttributes(), and updateAttribute().
|
private |
Definition at line 50 of file richtextimplcontrol.hxx.
Referenced by disableAttributeNotification(), enableAttributeNotification(), and implCheckUpdateCache().
|
private |
Definition at line 52 of file richtextimplcontrol.hxx.
Referenced by updateAllAttributes().
|
private |
Definition at line 48 of file richtextimplcontrol.hxx.
Referenced by getAttributeState(), and implCheckUpdateCache().
|
private |
Definition at line 62 of file richtextimplcontrol.hxx.
Referenced by layoutWindow(), and notifyInitShow().
Definition at line 54 of file richtextimplcontrol.hxx.
Referenced by Draw(), ensureScrollbars(), HandleCommand(), layoutWindow(), notifyZoomChanged(), RichTextControlImpl(), SetBackgroundColor(), and windowHasAutomaticLineBreak().
|
private |
Definition at line 58 of file richtextimplcontrol.hxx.
Referenced by Draw(), EditEngineStatusChanged(), enableAttributeNotification(), ensureLineBreakSetting(), getEngine(), layoutWindow(), RichTextControlImpl(), updateScrollbars(), and ~RichTextControlImpl().
|
private |
Definition at line 56 of file richtextimplcontrol.hxx.
Referenced by EditEngineStatusChanged(), ensureScrollbars(), HandleCommand(), hasHScrollBar(), layoutWindow(), updateScrollbars(), and ~RichTextControlImpl().
|
private |
Definition at line 61 of file richtextimplcontrol.hxx.
Referenced by updateAllAttributes().
|
private |
Definition at line 60 of file richtextimplcontrol.hxx.
Referenced by implCheckUpdateCache().
|
private |
Definition at line 59 of file richtextimplcontrol.hxx.
Referenced by EditEngineStatusChanged(), getSelectedScriptType(), getView(), implUpdateAttribute(), IsReadOnly(), layoutWindow(), normalizeScriptDependentAttribute(), RichTextControlImpl(), SetReadOnly(), updateAllAttributes(), updateScrollbars(), and ~RichTextControlImpl().
|
private |
Definition at line 55 of file richtextimplcontrol.hxx.
Referenced by GetHideInactiveSelection(), getViewport(), layoutWindow(), notifyZoomChanged(), RichTextControlImpl(), SetBackgroundColor(), SetHideInactiveSelection(), and ~RichTextControlImpl().
|
private |
Definition at line 57 of file richtextimplcontrol.hxx.
Referenced by EditEngineStatusChanged(), ensureScrollbars(), HandleCommand(), hasVScrollBar(), layoutWindow(), updateScrollbars(), and ~RichTextControlImpl().