#pragma once #include "gui/button.hpp" #include "graphics/font_desc.hpp" #include "storage/index.hpp" #include "geometry/point2d.hpp" #include "geometry/rect2d.hpp" #include "base/timer.hpp" #include "std/shared_ptr.hpp" namespace location { class State; } class Drawer; namespace gui { class Button; class Controller; class CachedTextView; } class Framework; class CountryStatusDisplay; class CompassArrow; class Ruler; /// Class, which displays additional information on the primary layer like: /// rules, coordinates, GPS position and heading, compass, Download button, etc. class InformationDisplay { Framework * m_framework; graphics::FontDesc m_fontDesc; shared_ptr m_ruler; gui::Controller * m_controller; shared_ptr m_countryStatusDisplay; shared_ptr m_compassArrow; shared_ptr m_locationState; shared_ptr m_debugLabel; shared_ptr m_copyrightLabel; void InitRuler(Framework * fw); void InitDebugLabel(); void InitLocationState(Framework * fw); void InitCompassArrow(Framework * fw); void InitCountryStatusDisplay(Framework * fw); void InitCopyright(Framework * fw); public: enum class WidgetType { Ruler = 0, CopyrightLabel, CountryStatusDisplay, CompassArrow, DebugLabel }; InformationDisplay(Framework * framework); void setController(gui::Controller * controller); /*! * \brief SetWidgetPivotsByDefault sets the default pivot points for all the widgets on the map. * The pivot points can be overridden by a call of SetWidgetPivot() * after Framework::OnSize() call. */ void SetWidgetPivotsByDefault(int screenWidth, int screenHeight); void setVisualScale(double visualScale); bool isCopyrightActive() const; void enableCopyright(bool doEnable); void enableRuler(bool doEnable); bool isRulerEnabled() const; void enableDebugInfo(bool doEnable); void setDebugInfo(double frameDuration, int currentScale); void measurementSystemChanged(); void enableCompassArrow(bool doEnable); bool isCompassArrowEnabled() const; void setCompassArrowAngle(double angle); shared_ptr const & locationState() const; void setEmptyCountryIndex(storage::TIndex const & idx); shared_ptr const & countryStatusDisplay() const; void ResetRouteMatchingInfo(); void SetWidgetPivot(WidgetType widget, m2::PointD const & pivot); m2::PointD GetWidgetSize(WidgetType widget) const; };