LuciadCPillar 2023.1.05
luciad::MgrsGridTextProvider::ICallback Class Referenceabstract

This callback can be used to be notified whenever the currently visible zone/square changes, by giving you its formatted location text. More...

#include <luciad/layers/grids/mgrs/MgrsGridTextProvider.h>

Public Member Functions

virtual ~ICallback ()=default
 
virtual void onTextChanged (const std::string &text)=0
 This method is called after the formatted location text of the currently visible zone/square has changed. More...
 

Static Public Member Functions

static std::shared_ptr< ICallbackcreate (std::function< void(const std::string &text)> onTextChangedFunction)
 Creates a default ICallback instance that delegates to the given function. More...
 

Detailed Description

This callback can be used to be notified whenever the currently visible zone/square changes, by giving you its formatted location text.

You can add or remove this callback from the MgrsGridTextProvider.

Since
2023.1

Constructor & Destructor Documentation

◆ ~ICallback()

virtual luciad::MgrsGridTextProvider::ICallback::~ICallback ( )
virtualdefault

Member Function Documentation

◆ create()

static std::shared_ptr< ICallback > luciad::MgrsGridTextProvider::ICallback::create ( std::function< void(const std::string &text)>  onTextChangedFunction)
static

Creates a default ICallback instance that delegates to the given function.

This is a convenience method that allows to reduce boiler plate code, and use a lambda.

Parameters
onTextChangedFunctionthe function that is called by ICallback::onTextChanged. Cannot be nullptr.
Returns
an ICallback instance based on the given function.
Exceptions
NullArgumentExceptionwhen the function is nullptr.

◆ onTextChanged()

virtual void luciad::MgrsGridTextProvider::ICallback::onTextChanged ( const std::string &  text)
pure virtual

This method is called after the formatted location text of the currently visible zone/square has changed.

Parameters
textthe new text.