29#include <rtl/ustring.hxx>
66 void SetID( sal_Int16 ID );
67 sal_Int16
GetID()
const;
80 void Enable(
bool bEnable );
206 :
Control(_pParent, _nWinStyle)
213 delete m_pImpl->InCompleteHyperLabel;
214 m_pImpl->InCompleteHyperLabel =
nullptr;
217 m_pImpl->m_bPaintInitialized =
true;
241void ORoadmap::dispose()
244 m_pImpl->getHyperLabels().clear();
245 for (
auto const& itemCopy : aItemsCopy)
250 delete m_pImpl->InCompleteHyperLabel;
257 return m_pImpl->getCurItemID();
260RoadmapItem* ORoadmap::GetPreviousHyperLabel(ItemIndex
Index)
262 RoadmapItem* pOldItem =
nullptr;
268RoadmapItem* ORoadmap::InsertHyperLabel(ItemIndex
Index,
const OUString& _sLabel, ItemId RMID,
bool _bEnabled,
bool _bIncomplete)
270 if (
m_pImpl->getItemCount() == 0)
273 RoadmapItem* pItem =
nullptr;
274 RoadmapItem* pOldItem = GetPreviousHyperLabel(
Index );
276 pItem =
new RoadmapItem( *
this,
m_pImpl->getItemSize() );
279 pItem->SetInteractive(
false );
283 pItem->SetInteractive(
m_pImpl->isInteractive() );
286 pItem->SetPosition( pOldItem );
287 pItem->Update(
Index, _sLabel );
288 pItem->SetClickHdl(
LINK(
this, ORoadmap, ImplClickHdl ) );
289 pItem->SetID( RMID );
290 pItem->SetIndex(
Index );
292 pItem->Enable( _bEnabled );
296void ORoadmap::SetRoadmapBitmap(
const BitmapEx& _rBmp)
302void ORoadmap::SetRoadmapInteractive(
bool _bInteractive)
304 m_pImpl->setInteractive( _bInteractive );
307 for (
auto const& item : rItems)
309 item->SetInteractive( _bInteractive );
313bool ORoadmap::IsRoadmapInteractive()
const
315 return m_pImpl->isInteractive();
318void ORoadmap::SetRoadmapComplete(
bool _bComplete)
320 bool bWasComplete =
m_pImpl->isComplete();
321 m_pImpl->setComplete( _bComplete );
324 if (
m_pImpl->InCompleteHyperLabel !=
nullptr)
326 delete m_pImpl->InCompleteHyperLabel;
327 m_pImpl->InCompleteHyperLabel =
nullptr;
330 else if (bWasComplete)
331 m_pImpl->InCompleteHyperLabel = InsertHyperLabel(
m_pImpl->getItemCount(),
"...", -1,
true,
true );
334void ORoadmap::UpdatefollowingHyperLabels(ItemIndex _nIndex)
337 if ( _nIndex <
static_cast<ItemIndex
>(rItems.size()) )
339 for ( HL_Vector::const_iterator i = rItems.begin() + _nIndex;
344 RoadmapItem* pItem = *
i;
346 pItem->SetIndex( _nIndex );
347 pItem->SetPosition( GetPreviousHyperLabel( _nIndex ) );
353 RoadmapItem* pOldItem = GetPreviousHyperLabel(
m_pImpl->getItemCount() );
354 m_pImpl->InCompleteHyperLabel->SetPosition( pOldItem );
355 m_pImpl->InCompleteHyperLabel->Update(
m_pImpl->getItemCount(),
"..." );
359void ORoadmap::ReplaceRoadmapItem(ItemIndex
Index,
const OUString& roadmapItem, ItemId RMID,
bool _bEnabled)
361 RoadmapItem* pItem = GetByIndex(
Index);
362 if ( pItem !=
nullptr )
364 pItem->Update(
Index, roadmapItem );
365 pItem->SetID( RMID );
366 pItem->Enable( _bEnabled );
372 return m_pImpl->getItemCount();
377 const RoadmapItem* pHyperLabel = GetByIndex( _nIndex );
379 return pHyperLabel->GetID();
383void ORoadmap::InsertRoadmapItem(ItemIndex
Index,
const OUString& RoadmapItem, ItemId _nUniqueId,
bool _bEnabled)
385 InsertHyperLabel(
Index, RoadmapItem, _nUniqueId, _bEnabled,
false );
387 UpdatefollowingHyperLabels(
Index + 1 );
390void ORoadmap::DeleteRoadmapItem(ItemIndex
Index)
395 UpdatefollowingHyperLabels(
Index );
399bool ORoadmap::IsRoadmapComplete()
const
404void ORoadmap::EnableRoadmapItem( ItemId _nItemId,
bool _bEnable )
406 RoadmapItem* pItem = GetByID( _nItemId );
407 if ( pItem !=
nullptr )
408 pItem->Enable( _bEnable );
411void ORoadmap::ChangeRoadmapItemLabel( ItemId _nID,
const OUString& _sLabel )
413 RoadmapItem* pItem = GetByID( _nID );
414 if ( pItem ==
nullptr )
417 pItem->Update( pItem->GetIndex(), _sLabel );
421 for (
auto const& item : rItems)
423 item->SetPosition( GetPreviousHyperLabel(nPos) );
428void ORoadmap::ChangeRoadmapItemID(ItemId _nID, ItemId NewID)
430 RoadmapItem* pItem = GetByID( _nID );
431 if ( pItem !=
nullptr )
432 pItem->SetID( NewID );
435RoadmapItem* ORoadmap::GetByID(ItemId _nID)
439 for (
auto const& item : rItems)
441 nLocID = item->GetID();
442 if ( nLocID == _nID )
448const RoadmapItem* ORoadmap::GetByID(ItemId _nID)
const
450 return const_cast< ORoadmap*
>( this )->GetByID( _nID );
453RoadmapItem* ORoadmap::GetByIndex(ItemIndex _nItemIndex)
458 return rItems.at( _nItemIndex );
463const RoadmapItem* ORoadmap::GetByIndex(ItemIndex _nItemIndex)
const
465 return const_cast< ORoadmap*
>( this )->GetByIndex( _nItemIndex );
470 ItemIndex searchIndex = ++_nNewIndex;
471 while ( searchIndex < m_pImpl->getItemCount() )
473 RoadmapItem* pItem = GetByIndex( searchIndex );
474 if ( pItem->IsEnabled() )
475 return pItem->GetID( );
484 ItemIndex searchIndex = --_nNewIndex;
485 while ( searchIndex > -1 )
487 RoadmapItem* pItem = GetByIndex( searchIndex );
488 if ( pItem->IsEnabled() )
489 return pItem->GetID( );
496void ORoadmap::DeselectOldRoadmapItems()
499 for (
auto const& item : rItems)
501 item->ToggleBackgroundColor( COL_TRANSPARENT );
512 return m_pImpl->getSelectHdl();
515void ORoadmap::Select()
517 GetItemSelectHdl().Call(
nullptr );
521void ORoadmap::GetFocus()
523 RoadmapItem* pCurHyperLabel = GetByID( GetCurrentRoadmapItemID() );
524 if ( pCurHyperLabel !=
nullptr )
525 pCurHyperLabel->GrabFocus();
528bool ORoadmap::SelectRoadmapItemByID(ItemId _nNewID,
bool bGrabFocus)
530 DeselectOldRoadmapItems();
531 RoadmapItem* pItem = GetByID( _nNewID );
532 if ( pItem !=
nullptr )
534 if ( pItem->IsEnabled() )
536 const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings();
541 m_pImpl->setCurItemID(_nNewID);
552 if (!
m_pImpl->m_bPaintInitialized)
553 implInit(rRenderContext);
557 if (!
m_pImpl->getPicture().IsEmpty())
559 Size aBitmapSize =
m_pImpl->getPicture().GetSizePixel();
560 Size aMySize(GetOutputSizePixel());
562 Point aBitmapPos(aMySize.Width() - aBitmapSize.
Width(), aMySize.Height() - aBitmapSize.
Height());
569 DrawHeadline(rRenderContext);
581 rRenderContext.
DrawTextLine(aTextPos, aOutputSize.Width(), STRIKEOUT_NONE, LINESTYLE_SINGLE, LINESTYLE_NONE);
587RoadmapItem* ORoadmap::GetByPointer(
vcl::Window const * pWindow)
590 for (
auto const& item : rItems)
592 if ( item->Contains( pWindow ) )
604 RoadmapItem* pItem = GetByPointer( pWindow );
605 if ( pItem !=
nullptr )
614 ItemId nPrevItemID = GetPreviousAvailableItemId( pItem->GetIndex() );
615 if ( nPrevItemID != -1 )
616 return SelectRoadmapItemByID( nPrevItemID );
621 ItemId nNextItemID = GetNextAvailableItemId( pItem->GetIndex() );
622 if ( nNextItemID != -1 )
623 return SelectRoadmapItemByID( nNextItemID );
627 return SelectRoadmapItemByID( pItem->GetID() );
636 SelectRoadmapItemByID( CurHyperLabel->GetID() );
646 const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings();
653 RoadmapItem* pLabelItem = GetByID( curItemID );
654 if (pLabelItem !=
nullptr)
674 : m_aItemPlayground(_rItemPlayground)
720 OUString aIDText = OUString::number( _nIndex + 1 ) +
".";
721 mpID->SetText( aIDText );
740 if ( _pOldItem ==
nullptr )
748 aIDPos = _pOldItem->
mpID->GetPosPixel();
752 mpID->SetPosPixel( aIDPos );
754 sal_Int32 nDescPos = aIDPos.
X() +
mpID->GetSizePixel().Width();
760 mpID->Enable(_bEnable);
766 return mpID->IsEnabled();
772 mpID->SetControlBackground();
774 mpID->SetControlBackground(
mpID->GetSettings().GetStyleSettings().GetHighlightColor() );
783 nIDWidth = ::std::min( nIDWidth, nMaxIDWidth );
789 Size aIDSize( nIDWidth, aDescriptionSize.
Height() );
790 mpID->SetSizePixel( aIDSize );
822 if (GetControlBackground() == COL_TRANSPARENT)
836 const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings();
837 if (GetControlBackground() != COL_TRANSPARENT)
const StyleSettings & GetStyleSettings() const
virtual void dispose() override
This is intended to be used to clear any locally held references to other Window-subclass objects.
DataChangedEventType GetType() const
AllSettingsFlags GetFlags() const
virtual void ApplySettings(vcl::RenderContext &rRenderContext) override
virtual void DataChanged(const DataChangedEvent &rDCEvt) override
const vcl::KeyCode & GetKeyCode() const
const KeyEvent * GetKeyEvent() const
vcl::Window * GetWindow() const
NotifyEventType GetType() const
Some things multiple-inherit from VclAbstractDialog and OutputDevice, so we need to use virtual inher...
Size GetOutputSize() const
void EnableMapMode(bool bEnable=true)
const vcl::Font & GetFont() const
void DrawBitmapEx(const Point &rDestPt, const BitmapEx &rBitmapEx)
void SetFont(const vcl::Font &rNewFont)
SAL_WARN_UNUSED_RESULT Point LogicToLogic(const Point &rPtSource, const MapMode *pMapModeSource, const MapMode *pMapModeDest) const
void SetTextColor(const Color &rColor)
void DrawTextLine(const Point &rPos, tools::Long nWidth, FontStrikeout eStrikeout, FontLineStyle eUnderline, FontLineStyle eOverline, bool bUnderlineAbove=false)
void DrawText(const Point &rStartPt, const OUString &rStr, sal_Int32 nIndex=0, sal_Int32 nLen=-1, std::vector< tools::Rectangle > *pVector=nullptr, OUString *pDisplayText=nullptr, const SalLayoutGlyphs *pLayoutCache=nullptr)
const AllSettings & GetSettings() const
constexpr tools::Long Y() const
tools::Long AdjustY(tools::Long nVertMove)
constexpr tools::Long X() const
constexpr tools::Long Height() const
tools::Long AdjustWidth(tools::Long n)
void setHeight(tools::Long nHeight)
constexpr tools::Long Width() const
const Color & GetFieldTextColor() const
const Color & GetFieldColor() const
const Color & GetHighlightColor() const
const Color & GetHighlightTextColor() const
static VclPtr< reference_type > Create(Arg &&... arg)
A construction helper for VclPtr.
void SetColor(const Color &)
void SetWeight(FontWeight)
void SetUnderline(FontLineStyle)
sal_uInt16 GetCode() const
const Link< LinkParamNone *, void > & getSelectHdl() const
const Size & getItemSize() const
void setComplete(const bool _bComplete)
Link< LinkParamNone *, void > m_aSelectHdl
bool isInteractive() const
void setCurItemID(ItemId i)
const BitmapEx & getPicture() const
void insertHyperLabel(ItemIndex Index, RoadmapItem *_rRoadmapStep)
void setInteractive(const bool _bInteractive)
RoadmapItem * InCompleteHyperLabel
ItemIndex getItemCount() const
RoadmapImpl(const ORoadmap &rAntiImpl)
void setSelectHdl(const Link< LinkParamNone *, void > &_rHdl)
void setPicture(const BitmapEx &_rPic)
const ORoadmap & m_rAntiImpl
ItemId getCurItemID() const
HL_Vector & getHyperLabels()
HL_Vector m_aRoadmapSteps
void removeHyperLabel(ItemIndex Index)
void Update(ItemIndex RMIndex, const OUString &_rText)
RoadmapItem(ORoadmap &_rParent, const Size &_rItemPlayground)
void ToggleBackgroundColor(const Color &_rGBColor)
void SetPosition(RoadmapItem const *OldHyperLabel)
void SetClickHdl(const Link< HyperLabel *, void > &rLink)
ItemIndex GetIndex() const
VclPtr< HyperLabel > mpDescription
void SetInteractive(bool _bInteractive)
void ImplUpdateIndex(const ItemIndex _nIndex)
bool Contains(const vcl::Window *_pWindow) const
void SetIndex(ItemIndex Index)
const Size m_aItemPlayground
void Enable(bool bEnable)
virtual void Paint(vcl::RenderContext &rRenderContext, const tools::Rectangle &rRect)
virtual bool PreNotify(NotifyEvent &rNEvt)
constexpr ::Color COL_TRANSPARENT(ColorTransparency, 0xFF, 0xFF, 0xFF, 0xFF)
constexpr sal_uInt16 KEY_UP
constexpr sal_uInt16 KEY_DOWN
constexpr sal_uInt16 KEY_SPACE
#define LINK(Instance, Class, Member)
constexpr std::enable_if_t< std::is_signed_v< T >, std::make_unsigned_t< T > > make_unsigned(T value)
vcl::Font GetFont(vcl::Font const &rFont, DrawModeFlags nDrawMode, StyleSettings const &rStyleSettings)
IMPL_LINK(ORoadmap, ImplClickHdl, HyperLabel *, CurHyperLabel, void)
std::vector< RoadmapItem * > HL_Vector
constexpr tools::Long ROADMAP_ITEM_DISTANCE_Y
constexpr tools::Long ROADMAP_INDENT_X
constexpr tools::Long LABELBASEMAPHEIGHT
constexpr tools::Long ROADMAP_INDENT_Y
WinBits const WB_NOTABSTOP
WinBits const WB_WORDBREAK