Stellarium  25.3
Public Slots | Signals | Public Member Functions | Properties
StelSkyCultureMgr Class Reference

Manage sky cultures for stellarium. More...

#include <StelSkyCultureMgr.hpp>

Public Slots

QString getCurrentSkyCultureEnglishName () const
 Get the current sky culture English name.
 
QString getCurrentSkyCultureNameI18 () const
 Get the current sky culture translated name.
 
bool setCurrentSkyCultureNameI18 (const QString &cultureName)
 Set the sky culture from i18n name. More...
 
QString getCurrentSkyCultureID () const
 Get the current sky culture ID.
 
bool setCurrentSkyCultureID (const QString &id)
 Set the current sky culture from the ID. More...
 
void reloadSkyCulture ()
 Reload the current sky culture.
 
StelSkyCulture::BoundariesType getCurrentSkyCultureBoundariesType () const
 Get the type of boundaries of the current sky culture Config option: info/boundaries.
 
StelSkyCulture::CLASSIFICATION getCurrentSkyCultureClassificationIdx () const
 Get the classification index for the current sky culture.
 
QString getCurrentSkyCultureHtmlClassification () const
 
QString getCurrentSkyCultureHtmlLicense () const
 
QString getCurrentSkyCultureHtmlRegion () const
 
QString getCurrentSkyCultureHtmlDescription ()
 Returns a localized HTML description for the current sky culture. More...
 
QString getDefaultSkyCultureID ()
 Get the default sky culture ID.
 
bool setDefaultSkyCultureID (const QString &id)
 Set the default sky culture from the ID. More...
 
QStringList getSkyCultureListEnglish (void) const
 Get a list of sky culture names in English. More...
 
QStringList getSkyCultureListI18 (void) const
 Get a list of sky culture names in the current language. More...
 
QStringList getSkyCultureListIDs (void) const
 Get a list of sky culture IDs.
 
QMap< QString, StelSkyCulturegetDirToNameMap () const
 Returns a map from sky culture IDs/folders to sky culture names.
 
static StelObject::CulturalDisplayStyle convertCulturalDisplayStyleFromCSVstring (const QString &csv)
 
static QString convertCulturalDisplayStyleToCSVstring (const StelObject::CulturalDisplayStyle style)
 
StelObject::CulturalDisplayStyle getScreenLabelStyle () const
 Returns the screen labeling setting for the currently active skyculture.
 
QString getScreenLabelStyleString () const
 Scripting version.
 
void setScreenLabelStyle (const StelObject::CulturalDisplayStyle style)
 Sets the screen labeling setting for the currently active skyculture.
 
void setScreenLabelStyle (const QString &style)
 scripting version
 
StelObject::CulturalDisplayStyle getInfoLabelStyle () const
 Returns the InfoString labeling setting for the currently active skyculture.
 
QString getInfoLabelStyleString () const
 Scripting version.
 
void setInfoLabelStyle (const StelObject::CulturalDisplayStyle style)
 sets the InfoString labeling setting for the currently active skyculture
 
void setInfoLabelStyle (const QString &style)
 scripting version
 
StelObject::CulturalDisplayStyle getZodiacLabelStyle () const
 Returns the Zodiac labeling setting for the currently active skyculture.
 
QString getZodiacLabelStyleString () const
 Scripting version.
 
void setZodiacLabelStyle (const StelObject::CulturalDisplayStyle style)
 sets the Zodiac labeling setting for the currently active skyculture
 
void setZodiacLabelStyle (const QString &style)
 scripting version
 
StelObject::CulturalDisplayStyle getLunarSystemLabelStyle () const
 Returns the Lunar_System labeling setting for the currently active skyculture.
 
QString getLunarSystemLabelStyleString () const
 Scripting version.
 
void setLunarSystemLabelStyle (const StelObject::CulturalDisplayStyle style)
 sets the Lunar_System labeling setting for the currently active skyculture
 
void setLunarSystemLabelStyle (const QString &style)
 scripting version
 
bool getFlagOverrideUseCommonNames () const
 Returns whether we ignore SC authors' settings "fallback_to_international_names".
 
void setFlagOverrideUseCommonNames (bool override)
 Set whether we ignore SC authors' settings "fallback_to_international_names".
 
bool getFlagUseAbbreviatedNames () const
 Returns whether we show shortest name as screen label.
 
void setFlagUseAbbreviatedNames (bool b)
 Set whether we ignore SC authors' settings "fallback_to_international_names".
 
bool currentSkycultureUsesCommonNames () const
 Returns whether current skyculture uses (incorporates) common names.
 

Signals

void defaultSkyCultureIDChanged (const QString &id)
 Emitted whenever the default sky culture changed. More...
 
void currentSkyCultureIDChanged (const QString &id)
 Emitted when the current sky culture changes.
 
void currentSkyCultureChanged (const StelSkyCulture &culture)
 Emitted when the current sky culture changes.
 
void infoLabelStyleChanged (const StelObject::CulturalDisplayStyle style)
 Emitted when InfoLabelStyle has changed.
 
void screenLabelStyleChanged (const StelObject::CulturalDisplayStyle style)
 Emitted when ScreenLabelStyle has changed.
 
void zodiacLabelStyleChanged (const StelObject::CulturalDisplayStyle style)
 Emitted when ZodiacLabelStyle has changed.
 
void lunarSystemLabelStyleChanged (const StelObject::CulturalDisplayStyle style)
 Emitted when Lunar_System LabelStyle has changed.
 
void flagOverrideUseCommonNamesChanged (bool override)
 Emitted on flag change.
 
void flagUseAbbreviatedNamesChanged (bool b)
 Emitted on flag change.
 

Public Member Functions

void init ()
 Initialize the StelSkyCultureMgr object. More...
 
QString createCulturalLabel (const StelObject::CulturalName &cName, const StelObject::CulturalDisplayStyle style, const QString &commonNameI18n, const QString &abbrevI18n=QString()) const
 Creates one label from cName. More...
 
- Public Member Functions inherited from StelModule
 StelModule ()
 Constructor. Every derived class MUST call setObjectName(className) in its constructor.
 
virtual void deinit ()
 Called before the module will be deleted, and before the OpenGL context is suppressed. More...
 
virtual QSettings * getSettings ()
 Return module-specific settings. More...
 
virtual void draw (StelCore *core)
 Execute all the drawing functions for this module. More...
 
virtual void update (double deltaTime)
 Update the module with respect to the time. More...
 
virtual QString getModuleVersion () const
 Get the version of the module, default is stellarium main version.
 
virtual QString getAuthorName () const
 Get the name of the module author.
 
virtual QString getAuthorEmail () const
 Get the email address of the module author.
 
virtual void handleMouseClicks (class QMouseEvent *)
 Handle mouse clicks. More...
 
virtual void handleMouseWheel (class QWheelEvent *)
 Handle mouse wheel. More...
 
virtual bool handleMouseMoves (int x, int y, Qt::MouseButtons b)
 Handle mouse moves. More...
 
virtual void handleKeys (class QKeyEvent *e)
 Handle key events. More...
 
virtual bool handlePinch (qreal scale, bool started)
 Handle pinch gesture events. More...
 
virtual double getCallOrder (StelModuleActionName actionName) const
 Return the value defining the order of call for the given action For example if stars.callOrder[ActionDraw] == 10 and constellation.callOrder[ActionDraw] == 11, the stars module will be drawn before the constellations. More...
 
virtual bool configureGui (bool show=true)
 Detect or show the configuration GUI elements for the module. More...
 

Properties

QString currentSkyCultureID
 
QString defaultSkyCultureID
 
StelObject::CulturalDisplayStyle screenLabelStyle
 
StelObject::CulturalDisplayStyle infoLabelStyle
 
StelObject::CulturalDisplayStyle zodiacLabelStyle
 
StelObject::CulturalDisplayStyle lunarSystemLabelStyle
 
bool flagUseAbbreviatedNames
 Replace any detailed cultural label by the short label (from constellation ID) This should be a short string, some skycultures still have numerical IDs here.
 
bool flagOverrideUseCommonNames
 Ignore skyculture dict setting "fallback_to_international_names".
 

Additional Inherited Members

- Public Types inherited from StelModule
enum  StelModuleSelectAction { AddToSelection , ReplaceSelection , RemoveFromSelection }
 Enum used when selecting objects to define whether to add to, replace, or remove from the existing selection list. More...
 
enum  StelModuleActionName {
  ActionDraw , ActionUpdate , ActionHandleMouseClicks , ActionHandleMouseMoves ,
  ActionHandleKeys
}
 Define the possible action for which an order is defined. More...
 
- Protected Member Functions inherited from StelModule
class StelActionaddAction (const QString &id, const QString &groupId, const QString &text, QObject *target, const char *slot, const QString &shortcut="", const QString &altShortcut="")
 convenience methods to add an action (call to slot) to the StelActionMgr object. More...
 
class StelActionaddAction (const QString &id, const QString &groupId, const QString &text, const char *slot, const QString &shortcut="", const QString &altShortcut="")
 convenience methods to add an action (call to own slot) to the StelActionMgr object. More...
 
StelActionaddAction (const QString &id, const QString &groupId, const QString &text, QObject *contextObject, std::function< void()> lambda, const QString &shortcut="", const QString &altShortcut="")
 convenience methods to add an action (call to Lambda functor) to the StelActionMgr object. More...
 

Detailed Description

Manage sky cultures for stellarium.

In the installation data directory and user data directory are the "skycultures" sub-directories containing one sub-directory per sky culture. This sub-directory name is that we refer to as sky culture ID here.

Author
Fabien Chereau

Member Function Documentation

◆ createCulturalLabel()

QString StelSkyCultureMgr::createCulturalLabel ( const StelObject::CulturalName cName,
const StelObject::CulturalDisplayStyle  style,
const QString &  commonNameI18n,
const QString &  abbrevI18n = QString() 
) const

Creates one label from cName.

Parameters
commonNameI18nobject common name in user language.
abbrevI18nstring to use as shortest possible label. If you call this with an actual non-default argument abbrevI18n, you really only want this short label, and style is not evaluated. If abbrevI18n starts with a dot, an empty string is returned.

◆ defaultSkyCultureIDChanged

void StelSkyCultureMgr::defaultSkyCultureIDChanged ( const QString &  id)
signal

Emitted whenever the default sky culture changed.

See also
setDefaultSkyCultureID

◆ getCurrentSkyCultureHtmlClassification

QString StelSkyCultureMgr::getCurrentSkyCultureHtmlClassification ( ) const
slot
Returns
a localized HTML description of the classification for the current sky culture

◆ getCurrentSkyCultureHtmlDescription

QString StelSkyCultureMgr::getCurrentSkyCultureHtmlDescription ( )
slot

Returns a localized HTML description for the current sky culture.

Returns
a HTML description of the current sky culture, suitable for display

◆ getCurrentSkyCultureHtmlLicense

QString StelSkyCultureMgr::getCurrentSkyCultureHtmlLicense ( ) const
slot
Returns
a localized HTML description of the license given in markdown

◆ getCurrentSkyCultureHtmlRegion

QString StelSkyCultureMgr::getCurrentSkyCultureHtmlRegion ( ) const
slot
Returns
a localized HTML description of the region for the current sky culture

◆ getSkyCultureListEnglish

QStringList StelSkyCultureMgr::getSkyCultureListEnglish ( void  ) const
slot

Get a list of sky culture names in English.

Returns
A list of English sky culture names.

◆ getSkyCultureListI18

QStringList StelSkyCultureMgr::getSkyCultureListI18 ( void  ) const
slot

Get a list of sky culture names in the current language.

Returns
A list of translated sky culture names.

◆ init()

void StelSkyCultureMgr::init ( )
virtual

Initialize the StelSkyCultureMgr object.

Gets the default sky culture name from the application's settings, sets that sky culture by calling setCurrentSkyCultureID().

Implements StelModule.

◆ setCurrentSkyCultureID

bool StelSkyCultureMgr::setCurrentSkyCultureID ( const QString &  id)
slot

Set the current sky culture from the ID.

Parameters
idthe sky culture ID.
Returns
true on success; else false.

◆ setCurrentSkyCultureNameI18

bool StelSkyCultureMgr::setCurrentSkyCultureNameI18 ( const QString &  cultureName)
slot

Set the sky culture from i18n name.

Returns
true on success; false and doesn't change if skyculture is invalid.

◆ setDefaultSkyCultureID

bool StelSkyCultureMgr::setDefaultSkyCultureID ( const QString &  id)
slot

Set the default sky culture from the ID.

Parameters
idthe sky culture ID.
Returns
true on success; else false.