Files
UnrealEngineUWP/Engine/Source/Editor/IntroTutorials/Private/TutorialHyperlinkRun.h
Thomas Sarkanen 8011ba0c1b Adding external link indicator to tutorial hyperlinks
Slate changes:
Allowed hyperlink decorator and hyperlink run to be more easily derived from by moving some functions/variables to protected.

Added new run & decorator for hyperlinks in tutorials that add an icon to the end of the run if required.
Only use icon-style run if in display mode (not in edit mode).

reviewed by Jamie.Dale

[CL 2322460 by Thomas Sarkanen in Main branch]
2014-10-08 06:07:52 -04:00

39 lines
1.9 KiB
C++

// Copyright 1998-2014 Epic Games, Inc. All Rights Reserved.
#pragma once
class FTutorialHyperlinkRun : public FSlateHyperlinkRun
{
public:
static TSharedRef< FTutorialHyperlinkRun > Create( const FRunInfo& InRunInfo, const TSharedRef< const FString >& InText, const FHyperlinkStyle& InStyle, FOnClick NavigateDelegate, FOnGenerateTooltip InTooltipDelegate, FOnGetTooltipText InTooltipTextDelegate );
static TSharedRef< FTutorialHyperlinkRun > Create( const FRunInfo& InRunInfo, const TSharedRef< const FString >& InText, const FHyperlinkStyle& InStyle, FOnClick NavigateDelegate, FOnGenerateTooltip InTooltipDelegate, FOnGetTooltipText InTooltipTextDelegate, const FTextRange& InRange );
public:
virtual ~FTutorialHyperlinkRun() {}
/** FSlateHyperlinkRun implementation */
virtual FVector2D Measure( int32 StartIndex, int32 EndIndex, float Scale ) const override;
virtual TSharedRef< ILayoutBlock > CreateBlock( int32 StartIndex, int32 EndIndex, FVector2D Size, const TSharedPtr< IRunRenderer >& Renderer ) override;
private:
FTutorialHyperlinkRun( const FRunInfo& InRunInfo, const TSharedRef< const FString >& InText, const FHyperlinkStyle& InStyle, FOnClick InNavigateDelegate, FOnGenerateTooltip InTooltipDelegate, FOnGetTooltipText InTooltipTextDelegate );
FTutorialHyperlinkRun( const FRunInfo& InRunInfo, const TSharedRef< const FString >& InText, const FHyperlinkStyle& InStyle, FOnClick InNavigateDelegate, FOnGenerateTooltip InTooltipDelegate, FOnGetTooltipText InTooltipTextDelegate, const FTextRange& InRange );
FTutorialHyperlinkRun( const FTutorialHyperlinkRun& Run );
private:
// check whether our metadata makes us a browser link
bool CheckIsBrowserLink() const;
private:
/** Whether we are an external (browser) link or not */
bool bIsBrowserLink;
/** The brush we use to display external links */
const FSlateBrush* LinkBrush;
};