Geometrize  1.0
An application for geometrizing images into geometric primitives
taskutil.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include <string>
4 
5 #include <QStringList>
6 
8 
9 class QImage;
10 class QString;
11 
12 namespace chaiscript
13 {
14 class ChaiScript;
15 }
16 
17 namespace geometrize
18 {
19 
20 namespace util
21 {
22 
23 void openTask(const QString& urlStr, bool addToRecents);
24 
25 void openTasks(const QStringList& urls, bool addToRecents);
26 
27 bool openTemplate(chaiscript::ChaiScript& engine, const std::string& templateFolder);
28 
29 TemplateManifest getTemplateManifest(const std::string& templateFolder);
30 
31 }
32 
33 }
geometrize::util::openTemplate
bool openTemplate(chaiscript::ChaiScript &engine, const std::string &templateFolder)
Definition: taskutil.cpp:65
geometrize::util::openTask
void openTask(const QString &urlStr, bool addToRecents)
Definition: taskutil.cpp:31
geometrize::util::getTemplateManifest
TemplateManifest getTemplateManifest(const std::string &templateFolder)
Definition: taskutil.cpp:98
geometrize::util::getFirstFileWithExtensions
std::string getFirstFileWithExtensions(const std::string &dirPath, const std::vector< std::string > &extensions)
getFirstFileWithExtensions Gets the absolute file path to the first file with one of the given extens...
Definition: util.cpp:224
imagetaskcreator.h
geometrize::util::directoryContainsFile
bool directoryContainsFile(const std::string &dirPath, const std::string &fileName)
directoryContainsFile Checks if the directory contains the given file, returns true if it does.
Definition: util.cpp:135
geometrize::util::getScriptsForPath
std::vector< std::string > getScriptsForPath(const std::string &dirPath)
getScriptsForPath Gets the absolute file paths to the script files (*.chai) for the given directory,...
Definition: util.cpp:236
geometrize::task::createImageTaskAndWindow
ImageTask * createImageTaskAndWindow(const std::string &displayName, const std::string &taskUrl, const std::optional< geometrize::preferences::ImageTaskPreferences > &prefs)
createImageTaskAndWindow Creates an image task, and immediately creates a graphical window for manipu...
Definition: imagetaskcreator.cpp:52
geometrize::util::readFileAsString
std::string readFileAsString(const std::string &filePath)
readFileAsString Reads a file, returning a string containing the contents.
Definition: util.cpp:155
geometrize::network::completionhandlers::onWebpageDownloadComplete
void onWebpageDownloadComplete(network::Downloader *self, const QNetworkReply::NetworkError error)
onWebpageDownloadComplete A callback when a webpage download completes.
Definition: completionhandlers.cpp:53
geometrize::network::downloadImage
void downloadImage(const QUrl &url, const std::function< void(network::Downloader *self, QNetworkReply::NetworkError error)> &onComplete)
downloadImage Downloads an image over the network.
Definition: networkactions.cpp:13
chaiscript
Definition: commandlineedit.h:11
geometrize::format::getReadableImageFileExtensions
std::vector< std::string > getReadableImageFileExtensions(const bool includeDotPrefix)
getReadableImageFileExtensions Gets the lower-case image file extensions that have read support.
Definition: formatsupport.cpp:11
geometrize::preferences::ImageTaskPreferences
The ImageTaskPreferences class models the preferences associated with an image task.
Definition: imagetaskpreferences.h:29
taskutil.h
geometrize::getRecentItems
RecentItems & getRecentItems()
getRecentItems Gets a reference to the recent files list.
Definition: recentitems.cpp:206
scriptrunner.h
searchpaths.h
networkactions.h
geometrize
Definition: commandlineparser.cpp:73
geometrize::script::runScript
void runScript(const std::string &code, chaiscript::ChaiScript &runner)
runScript Evaluates the provided script code.
Definition: scriptrunner.cpp:16
templatemanifest.h
imagetask.h
downloader.h
geometrize::RecentItems::add
void add(const QString &itemId, const QString &itemDisplayName)
add Adds an item to the recent items.
Definition: recentitems.cpp:177
formatsupport.h
recentitems.h
geometrize::network::completionhandlers::onImageDownloadComplete
void onImageDownloadComplete(network::Downloader *self, const QNetworkReply::NetworkError error)
onImageDownloadComplete A callback when an image download completes.
Definition: completionhandlers.cpp:26
util.h
geometrize::searchpaths::getDefaultTaskSettingsFilename
std::string getDefaultTaskSettingsFilename()
getTaskSettingsFilename Gets the default name of a task settings file that is manually saved by the u...
Definition: searchpaths.cpp:31
geometrize::format::getSupportedTemplateManifestFileExtensions
std::vector< std::string > getSupportedTemplateManifestFileExtensions()
getSupportedTemplateManifestFileExtensions Gets the supported template manifest file extensions for s...
Definition: formatsupport.cpp:28
completionhandlers.h
geometrize::util::openTasks
void openTasks(const QStringList &urls, const bool addToRecents)
Definition: taskutil.cpp:58
geometrize::TemplateManifest
The TemplateManifest class represents the metadata for a task template.
Definition: templatemanifest.h:14
geometrize::network::downloadWebpage
void downloadWebpage(const QUrl &url, const std::function< void(network::Downloader *self, QNetworkReply::NetworkError error)> &onComplete)
downloadWebpage Downloads a whole webpage over the network.
Definition: networkactions.cpp:18