#include #include #include namespace libbible { struct text { int chapter; int verse; std::string book; std::string bookShort; std::string text; std::vector modifiers; // e.g., paragraph, line indent0, divineName, wordsOfJesus }; struct passage { std::string modName; std::string book; std::string bookShort; int chapterStart; int verseStart; int chapterEnd; int verseEnd; }; /* * @return Map of modName to supported books */ std::map> getModules(void); /* * @return Vector of valid single full-chapter passages for a book */ std::vector getPassages(std::string modName, std::string book); /* * @param modName the module to use for determining the passage * @param reference a human-readable reference, e.g., "gen 1:26-27" * @return the passage matching the reference */ passage getPassage(std::string modName, std::string reference); /* * @return Text for a passage */ std::vector getText(struct passage pass); /************************** * Methods dealing with mods ***************************/ class Status { public: virtual void update(unsigned long totalBytes, unsigned long completedBytes, std::string message) {} }; /** * @param status Status update method is called asynchronously as download progresses */ void setStatusReporter(Status& status); /** * @return A mapping from language to bible version names */ std::map> downloadModsAvailable(); /** * Cancel an in-progress download */ void terminateDownload(void); /** * @param language The language of the mod to install as provided from downloadModsAvailable * @param name The name of the bible version as provided from downloadModsAvailable * @see downloadModsAvailable() * @return true on success, false otherwise */ bool installModFromInternet(std::string language, std::string name); /** * @param filename Path to the .zip compressed module to be installed * @return true on success, false otherwise */ bool installModFromZip(std::string filename); /** * @param modname The name of the module to be removed */ void uninstallMod(std::string modname); /****************************** * Methods dealing with settings *******************************/ /* * From already established code, valid and useful values are: * int fontsize: the last used size of the font * string passage: the last looked-up passage * string module: the last used module */ void settingsWrite(std::string key, std::string value); std::string settingsRead(std::string key); void settingsWriteInt(std::string key, int value); int settingsReadInt(std::string key); }