28#include <simgear/misc/sg_path.hxx>
29#include <simgear/nasal/cppbind/NasalHash.hxx>
30#include <simgear/nasal/naref.h>
31#include <simgear/props/props.hxx>
32#include <simgear/structure/SGReferenced.hxx>
63 std::string
getUrl()
const;
64 void setUrl(
const std::string& url);
67 void setDetail(
const std::string& detail);
78class Addon :
public SGReferenced
83 Addon(std::string
id, AddonVersion version = AddonVersion(),
84 SGPath basePath = SGPath(), std::string minFGVersionRequired =
"",
85 std::string maxFGVersionRequired =
"",
86 SGPropertyNode* addonNode =
nullptr);
96 return ptr_traits::makeStrongRef(
fromAddonDir(addonPath));
99 std::string
getId()
const;
102 void setName(
const std::string& addonName);
108 void setAuthors(
const std::vector<AuthorRef>& addonAuthors);
111 void setMaintainers(
const std::vector<MaintainerRef>& addonMaintainers);
128 std::vector<std::string>
getTags()
const;
129 void setTags(
const std::vector<std::string>& addonTags);
144 std::string
resourcePath(
const std::string& relativePath)
const;
156 void setHomePage(
const std::string& addonHomePage);
185 std::multimap<UrlType, QualifiedUrl>
getUrls()
const;
189 void setMenubarNodes(
const std::vector<SGPropertyNode_ptr>& menubarNodes);
194 std::string
str()
const;
196 static void setupGhost(nasal::Hash& addonsModule);
205 class MetadataParser;
208 static SGPath getMetadataFile(
const SGPath& addonPath);
209 SGPath getMetadataFile()
const;
212 static std::vector<SGPropertyNode_ptr>
213 readMenubarItems(
const SGPath& menuFile);
217 const std::string _id;
224 std::vector<AuthorRef> _authors;
225 std::vector<MaintainerRef> _maintainers;
228 std::string _shortDescription;
229 std::string _longDescription;
231 std::string _licenseDesignation;
233 std::string _licenseUrl;
235 std::vector<std::string> _tags;
238 const SGPath _storagePath;
241 std::string _minFGVersionRequired;
243 std::string _maxFGVersionRequired;
245 std::string _homePage;
246 std::string _downloadUrl;
247 std::string _supportUrl;
248 std::string _codeRepositoryUrl;
251 SGPropertyNode_ptr _addonNode;
254 std::string _triggerProperty;
256 int _loadSequenceNumber = -1;
258 std::vector<SGPropertyNode_ptr> _menubarNodes;
Addon(std::string id, AddonVersion version=AddonVersion(), SGPath basePath=SGPath(), std::string minFGVersionRequired="", std::string maxFGVersionRequired="", SGPropertyNode *addonNode=nullptr)
void retranslate()
update string values (description, etc) based on the active locale
SGPropertyNode_ptr getLoadedFlagNode() const
void setLicenseFile(const SGPath &addonLicenseFile)
naRef getAddonPropsNode() const
void setLongDescription(const std::string &addonLongDescription)
void setSupportUrl(const std::string &addonSupportUrl)
void setCodeRepositoryUrl(const std::string &addonCodeRepositoryUrl)
void setBasePath(const SGPath &addonBasePath)
void setLicenseUrl(const std::string &addonLicenseUrl)
Addon(std::string id, AddonVersion version=AddonVersion(), SGPath basePath=SGPath(), std::string minFGVersionRequired="", std::string maxFGVersionRequired="", SGPropertyNode *addonNode=nullptr)
std::string getMaxFGVersionRequired() const
void setLoadSequenceNumber(int num)
void setMaintainers(const std::vector< MaintainerRef > &addonMaintainers)
std::string getSupportUrl() const
std::string getShortDescription() const
std::string getMinFGVersionRequired() const
void setMinFGVersionRequired(const std::string &minFGVersionRequired)
void setAddonNode(SGPropertyNode *addonNode)
void setTriggerProperty(const std::string &addonTriggerProperty)
int getLoadSequenceNumber() const
void setName(const std::string &addonName)
SGPath getStoragePath() const
void setMaxFGVersionRequired(const std::string &maxFGVersionRequired)
static T fromAddonDir(const SGPath &addonPath)
SGPath getBasePath() const
std::multimap< UrlType, QualifiedUrl > getUrls() const
void setDownloadUrl(const std::string &addonDownloadUrl)
static Addon fromAddonDir(const SGPath &addonPath)
std::string getTriggerProperty() const
std::string getHomePage() const
SGPath getLicenseFile() const
void setVersion(const AddonVersion &addonVersion)
void addToFGMenubar() const
std::string getDownloadUrl() const
AddonVersionRef getVersion() const
std::vector< AuthorRef > getAuthors() const
std::vector< MaintainerRef > getMaintainers() const
std::vector< SGPropertyNode_ptr > getMenubarNodes() const
std::string getName() const
std::string getLicenseUrl() const
std::string getId() const
std::string getLongDescription() const
void setAuthors(const std::vector< AuthorRef > &addonAuthors)
SGPropertyNode_ptr getAddonNode() const
static void setupGhost(nasal::Hash &addonsModule)
std::string resourcePath(const std::string &relativePath) const
void setHomePage(const std::string &addonHomePage)
void setTags(const std::vector< std::string > &addonTags)
void setLicenseDesignation(const std::string &addonLicenseDesignation)
SGPath createStorageDir() const
std::string getLicenseDesignation() const
std::string getCodeRepositoryUrl() const
std::vector< std::string > getTags() const
void setShortDescription(const std::string &addonShortDescription)
void setMenubarNodes(const std::vector< SGPropertyNode_ptr > &menubarNodes)
std::string getUrl() const
QualifiedUrl(UrlType type, std::string url, std::string detail="")
void setUrl(const std::string &url)
void setDetail(const std::string &detail)
void setType(UrlType type)
std::string getDetail() const
std::ostream & operator<<(std::ostream &os, const Addon &addon)
SGSharedPtr< AddonVersion > AddonVersionRef
FlightPlan.hxx - defines a full flight-plan object, including departure, cruise, arrival information ...