Namespace sh::scriptingΒΆ

namespace sh::scripting

The Shallot scripting interface.

Typedefs

using StringMap = QMap<QString, V>
class Api
#include <api.h>

Interoperation layer between the Shallot core and a plugin interpreter.

Public Functions

Api()
~Api()
QStringList classes()
QStringList rootMembers()
ApiClass *getClass(QString name)
ApiClass *getClassByTypeIdName(QString typeidName)
void *rootMember(QString name)
ApiClass *rootMemberClass(QString name)

Private Functions

void registerClass(QString name, ApiClass **apiclass, const std::type_info &nativeType)
void registerMethod(ApiClass *apiclass, QString name)
void registerRootObjectMember(QString name, ApiClass *cls, void *member)

Private Members

QHash<QString, ApiClass*> _classes
QHash<QString, ApiClass*> _classesByNativeType
QHash<QString, void*> _rootMembers
QHash<QString, ApiClass*> _rootMembersClasses
class ApiClass
#include <api.h>

Data structure for one api-aware core class.

Public Functions

ApiClass(QString name)

Constructed only indirectly.

~ApiClass()
QString name()
QStringList methods()
void addMethod(ApiMethod *m)
ApiMethod *getMethod(QString name)

Private Members

QString _name
QHash<QString, ApiMethod*> _methods
class ApiMethod
#include <api.h>

Data structure for one api-aware core method.

Public Functions

ApiMethod(QString name)

Constructed only indirectly.

QString name()
class PythonScriptInterpreter : public sh::scripting::ScriptInterpreter, public sh::base::Singleton
#include <pythonscriptinterpreter.h>

Integration of the Python language for scripting.

Find also the scripting manual for all details about the scripting interface.

Public Functions

~PythonScriptInterpreter()
bool isAvailable()
void initializeInterpreter()
QString filesuffix()
void execute(QString script)
void doInitialize()

Executes singleton initialization.

void shutdown()

Shutdown down this singleton.

bool isAlive()

Returns if this singleton is alive (true until its shutdown begins).

Public Members

PyObject *_Exception
PyObject *_CancelException
PyObject *_ThreadAbortException

Public Static Functions

void registerMethod(sh::scripting::ApiClass *clss, QString name, PyCFunction fctptr)
void throwNativeExceptionFromPythonTraceback()

Public Static Attributes

QHash<void*, PyObject*> _buddies
QHash<void*, std::weak_ptr<void>> _natives

Private Functions

PythonScriptInterpreter()

Private Static Functions

PyObject *getApiModuleDef()

Private Static Attributes

void *apiModuleDef
sh::scripting::Api *api = new sh::scripting::Api()
QHash<QString, PyCFunction> _methods
PyObject *modtraceback
class ScriptingEngine : public QObject, public sh::base::Singleton
#include <scriptingengine.h>

The Scripting engine loads scripts by means of the registered interpreters.

Public Functions

void loadScript(QString script)

Loads a plugin script from file.

void doShutdown()

Executes singleton shutdown.

void shutdown()

Shutdown down this singleton.

bool isAlive()

Returns if this singleton is alive (true until its shutdown begins).

Private Functions

ScriptingEngine()
void registerInterpreter(std::shared_ptr<sh::scripting::ScriptInterpreter> interpreter)

Private Members

QMap<QString, std::shared_ptr<sh::scripting::ScriptInterpreter>> _interpreters

Private Static Attributes

std::shared_ptr<sh::configuration::ConfigurationValue> cfgvalLastStartupFailed = sh::configuration::ConfigurationManager::instance()->registerConfigValue("sh::scripting::ScriptingEngine.LastStartupFailed", false, sh::configuration::ConfigurationValue::valueTypeBoolean())
class ActionPluginLoadCrashedAgain : public sh::actions::ActionActionItem

Public Functions

ActionPluginLoadCrashedAgain(QString path, QMutex *mutex)
void execute()

Executes this action.

void execute(sh::actions::ActionExecutionInfo *info)

Executes this action.

QKeySequence shortcuthint()

Returns the keyboard shortcut for triggering this action.

bool shortcuthintTriggersOnCurrentDirectory()

Checks if using the keyboard shortcut shall trigger the action on the current directory (or on the entry selection).

void setShortcuthint(QKeySequence shortcut, bool triggersOnCurrentDirectory = false)

Sets the keyboard shortcut for triggering this action.

QString text()

Returns the displayed text for this action.

QString icon()

Returns the icon for this action.

bool enabled()

Checks if this action is enabled.

bool isChecked()

Checks if this action is checked (has a cross in the ui).

bool isCheckable()

Checks if this action is checkable (can have a cross in the ui).

int defaultActionPrecedence() const

Returns the precedence for becoming the default action of a parent submenu.

This e.g. leads to a bold label.

The action with the highest value becomes the default. Only values >0 will be considered. See ActionDefaultPrecedenceValues for reference values.

void setText(QString text)

Sets the displayed text.

void setIcon(QString icon)

Sets the icon.

void setEnabled(bool enabled)

Sets if the item is enabled.

void setChecked(bool checked)

Sets if the item is checked (has a cross in the ui).

void setVisible(bool visible)

Sets the visibility of this item.

bool visible()

Checks the visibility of this item (non-recursively).

std::weak_ptr<AbstractActionItem> parentAction()

Returns the parent action, if it is added to a container.

void _setParentAction(std::shared_ptr<AbstractActionItem> parent)

Sets the parent action. .

void initializeAsync(std::function<void()> oninitialized = 0)

Asynchonously initializes the action.

void initializeSync()

Synchonously initializes the action.

bool isInitialized()

Checks if this action is initialized.

bool isInitializing()

Checks if this action is initializing.

Signals

void changed()

Emits when some data changed.

class ScriptedException : public sh::exceptions::Exception
#include <scriptingengine.h>

Exception for errors within the scripting engine and interpreters.

Public Functions

ScriptedException(sh::exceptions::ExceptionData data)
QString message() const
QString name() const
QString classes() const
QString details() const
QString callstack() const
QString auxiliary() const
QString customValue(QString key) const
bool isRuntimeException() const
bool isProgramException() const
bool isRetryable() const
bool isResumeable() const
bool isDetailsAreInteresting() const
int autoRetryRecommendedIn() const
void setResumeable(bool v)
void setReTryable(bool v)
void setCustomValue(QString key, QString value)
bool isClass(QString classname)
sh::exceptions::ExceptionData data()

Public Static Functions

template<class Handler>
std::shared_ptr<RegisterHandler<Handler>> createRegisterHandler(Handler handler, QStack<Handler> *stack)
void executeGuarded(std::function<void()> fctint flags = 0, )

Executes some code with some standard exection handling around.

Parameters
  • fct: The code to execute guarded.

  • flags: Flags of ExecuteGuardFlag for choosing the behavior.

void executeGuarded_errorpanel(std::function<void()> fctint flags = 0, )
QString _demangle(QString l)
void exceptionDialog(sh::exceptions::Exception &e, bool *doRetry)

Public Static Attributes

const QString UNDEFINED_ERROR_OCCURRED = QObject::tr("An unspecified error occurred.")
const QString SHALLOT_MUST_CLOSE_TEXT = QObject::tr("Your Shallot process is disturbed by an error and needs to be closed now. You can try if starting Shallot again solves the issue. If you are interested in technical details, please take a look at the log.")
const QString Value_isShallotException = "_isShallotException"
class ScriptInterpreter
#include <scriptingengine.h>

The base class for integration of a script language.

Subclassed by sh::scripting::PythonScriptInterpreter

Public Functions

bool isAvailable()
void initializeInterpreter()
QString filesuffix()
void execute(QString)
~ScriptInterpreter()
struct shallot_ShallotObject

A wrapper around a native object for the Python world.

Public Members

PyObject_HEAD void * nativeObject
std::shared_ptr<void> sharedNativeObject
bool isReallyShared
namespace api

Adapter functions and classes for interaction with scripting.

Some programming interfaces in the core are not directly usable for the scripting api. Scripting-friendly surrogates for them are here.

class ApiActionActionItem : public sh::actions::ActionActionItem
#include <apiaction.h>

Public Functions

ApiActionActionItem(QString text, bool enabled, QString icon, int defaultActionPrecedence)
void _execute()
void _initializeSync()
void action(sh::actions::ActionExecutionInfo *info) override

The action implementation, i.e. what the actions should actually do.

void initialize() override

Initialize the action. This should make the time-consuming parts, e.g. for determining a label or enabled state.

void execute()

Executes this action.

void execute(sh::actions::ActionExecutionInfo *info)

Executes this action.

QKeySequence shortcuthint()

Returns the keyboard shortcut for triggering this action.

bool shortcuthintTriggersOnCurrentDirectory()

Checks if using the keyboard shortcut shall trigger the action on the current directory (or on the entry selection).

void setShortcuthint(QKeySequence shortcut, bool triggersOnCurrentDirectory = false)

Sets the keyboard shortcut for triggering this action.

QString text()

Returns the displayed text for this action.

QString icon()

Returns the icon for this action.

bool enabled()

Checks if this action is enabled.

bool isChecked()

Checks if this action is checked (has a cross in the ui).

bool isCheckable()

Checks if this action is checkable (can have a cross in the ui).

int defaultActionPrecedence() const

Returns the precedence for becoming the default action of a parent submenu.

This e.g. leads to a bold label.

The action with the highest value becomes the default. Only values >0 will be considered. See ActionDefaultPrecedenceValues for reference values.

void setText(QString text)

Sets the displayed text.

void setIcon(QString icon)

Sets the icon.

void setEnabled(bool enabled)

Sets if the item is enabled.

void setChecked(bool checked)

Sets if the item is checked (has a cross in the ui).

void setVisible(bool visible)

Sets the visibility of this item.

bool visible()

Checks the visibility of this item (non-recursively).

std::weak_ptr<AbstractActionItem> parentAction()

Returns the parent action, if it is added to a container.

void _setParentAction(std::shared_ptr<AbstractActionItem> parent)

Sets the parent action. .

void initializeAsync(std::function<void()> oninitialized = 0)

Asynchonously initializes the action.

void initializeSync()

Synchonously initializes the action.

bool isInitialized()

Checks if this action is initialized.

bool isInitializing()

Checks if this action is initializing.

Public Members

std::function<void()> _initialize
std::function<void(sh::actions::ActionExecutionInfo*)> _action

Signals

void changed()

Emits when some data changed.

class ApiActionFactory : public sh::actions::AbstractActionFactory
#include <apipredicatedactionfactory.h>

Public Functions

ApiActionFactory(QString category, QList<std::shared_ptr<actions::Predicate>> predicates)
std::shared_ptr<sh::actions::AbstractActionItem> construct(QList<std::shared_ptr<sh::filesystem::FilesystemNode>> nodes)
std::shared_ptr<ActionInstantiation> actionAvailable(ActionInstantiation *instantiation)

Public Members

std::function< std::shared_ptr< sh::actions::AbstractActionItem >QList< std::shared_ptr< sh::filesystem::FilesystemNode > > nodes)> _construct
class ApiDetailColumn : public sh::filesystem::DetailColumn
#include <apidetailcolumn.h>

Public Functions

ApiDetailColumn(QString name, QString displayName, int displayIndex, bool sort_doTypediff, int defaultWidth, bool isRightAligned)
QVariant determineValue(std::shared_ptr<sh::filesystem::FilesystemNode> node, sh::filesystem::Operation *op)
void applyValue(std::shared_ptr<const sh::filesystem::Eurl> eurl, sh::filesystem::Operation *op, QVariant value)
QString name()

The internal unique name.

QString displayName()

The display name.

bool isValueAvailable(std::shared_ptr<FilesystemNode> node)

Checks if a value for this detail is available for one given node.

QVariant value(std::shared_ptr<FilesystemNode> node, bool ignoreAged = false)

Returns the value for this detail for one given node.

Parameters
  • ignoreAged: If no value should be returned which is older than the last request (not useful for nearly all cases).

QString displayValue(std::shared_ptr<FilesystemNode> node, const sh::filesystem::FilesystemModelFileviewProxy *viewmodel)

Returns the stringified value for this details for one given node considering the configuration of a view.

bool isVisible()

If this detail shall be a visible column in the view.

QVariant requestValue(std::shared_ptr<FilesystemNode> node, sh::filesystem::Operation *op = 0, bool withNodeValues = false, bool withOperationsCache = true)

Requests to determine the value for this detail for one given node. Blocks until the value is available. Get it with the value method afterwards.

bool sort_doTypediff()

If sorting should separate files and directories.

int sort_order(std::shared_ptr<FilesystemNode> n1, std::shared_ptr<FilesystemNode> n2)

The sorting order.

uint displayIndex()

Controls which place this column should get in the user interface.

QVariant computeValue(std::shared_ptr<FilesystemNode> node, sh::filesystem::Operation *op)

Returns a freshly determined value for this column and the given node. It neither asks nor populates any caches or storages.

int defaultWidth()
bool isRightAligned()
void applyValueByEurl(std::shared_ptr<const sh::filesystem::Eurl> eurl, sh::filesystem::Operation *op, QVariant value)

Applies the detail value to a given eurl (without using any caches).

Used for transferring some details when a file transfer occurs.

Optionally implement the one of the applyValueBy… methods and register the instance with sh::filesystem::FilesystemOperation::addTransferrableDetailColumn. For performance reasons, you should decide to implement applyValueByEurl.

void applyValueByNode(std::shared_ptr<FilesystemNode> node, sh::filesystem::Operation *op, QVariant value)

Applies the detail value to a given node (without using any caches).

Used for transferring some details when a file transfer occurs.

Optionally implement the one of the applyValueBy… methods and register the instance with sh::filesystem::FilesystemOperation::addTransferrableDetailColumn. For performance reasons, you should decide to implement applyValueByEurl.

Public Members

std::function<QString(std::shared_ptr<sh::filesystem::FilesystemNode>, sh::filesystem::Operation*)> _determineValue
std::function<void(std::shared_ptr<sh::filesystem::Eurl>, sh::filesystem::Operation*, QString)> _applyValue

Public Static Functions

QVariant VALUE_UNAVAILABLE()

A special value expressing that the value is not yet available.

void registerKnownDetailColumn(QString name, std::shared_ptr<DetailColumn> column)
std::shared_ptr<DetailColumn> findKnownDetailColumn(QString name)

Public Static Attributes

const uint DISPLAYINDEX_CORE = 10000
const uint DISPLAYINDEX_INTERESTING = 20000
const uint DISPLAYINDEX_EXOTIC = 30000
class ApiFilePropertyDialogTab : public sh::ui::FilePropertyDialogTab
#include <apifilepropertydialogtab.h>

Public Functions

ApiFilePropertyDialogTab(QString title, QList<PropertyConfig> properties)
QString title() override

The tab title. .

QList<QString> properties() override

Returns the list of property labels (one entry for each widget).

Each property is displayed with a header and a widget (created in createWidget) with some content (populated in updateWidget).

void populateWidget(int i, sh::ui::FilePropertyDialogTabActionsView *widget) override

Populates the tab widget for the i-th property.

Typically uses the FilePropertyDialog::create* methods to create sub-widgets.

See also dialog().

void updateWidget(int i, sh::ui::FilePropertyDialogTabActionsView *widget, sh::filesystem::Operation *op) override

Populates the widget for the i-th property with actual content. .

QString titleWithoutMnemonic()

The tab title without mnemonic.

void refresh()

Refreshes the complete content.

Typically called after some user actions in a property widget require that all the other content must be refreshed.

QList<std::shared_ptr<sh::filesystem::FilesystemNode>> nodes()

The nodes to show.

FilePropertyDialogTabActionsView *widgetAt(int i)

Returns the widget for the i-th property.

int widgetCount()

Returns the number of widgets.

std::shared_ptr<FilePropertyDialog> dialog()

Returns the associated dialog.

Public Members

std::function< QList< QString >int, sh::filesystem::Operation *, qintptr)> _updateWidget
std::function<void(QString)> _buttonTriggered

Public Static Attributes

const int PROPERTY_TYPE_STRING = 1
const int PROPERTY_TYPE_STRINGMAP = 2
const int PROPERTY_TYPE_ICONTEXTBANNER = 3

Private Types

typedef QPair<QString, QString> StringPair

Private Members

QString _title
QList<PropertyConfig> _properties
class PropertyConfig
#include <apifilepropertydialogtab.h>

Public Types

typedef QPair<QString, QString> ButtonConfig

Public Functions

PropertyConfig(QString title, int propertytype, QList<ButtonConfig> buttons)

Public Members

QString title
int propertytype
QList<ButtonConfig> buttons
class ApiFilePropertyDialogTabFactory : public sh::ui::FilePropertyDialogTabFactory
#include <apifilepropertydialogtab.h>

Public Functions

ApiFilePropertyDialogTabFactory()
std::shared_ptr<sh::ui::FilePropertyDialogTab> construct(std::shared_ptr<sh::ui::FilePropertyDialog> dialog)
std::shared_ptr<sh::ui::FilePropertyDialogTab> construct(std::shared_ptr<sh::ui::FilePropertyDialog> dialog) = 0

Constructs a fresh instance of a FilePropertyDialogTab implementation. .

Public Members

std::function< std::shared_ptr< sh::scripting::api::ApiFilePropertyDialogTab >)> _construct

Public Static Attributes

const int REGISTER_FILEPROPERTYDIALOGTAB_INDEX_CORE = 10000

Base value for display indexes of core (i.e. maximum important) tabs.

Used in FilePropertyDialog::addTabFactory.

const int REGISTER_FILEPROPERTYDIALOGTAB_INDEX_VERYIMPORTANT = 20000

Base value for display indexes of very important tabs.

Used in FilePropertyDialog::addTabFactory.

const int REGISTER_FILEPROPERTYDIALOGTAB_INDEX_IMPORTANT = 30000

Base value for display indexes of important tabs.

Used in FilePropertyDialog::addTabFactory.

const int REGISTER_FILEPROPERTYDIALOGTAB_INDEX_NORMAL = 40000

Base value for display indexes of tabs with medium importance.

Used in FilePropertyDialog::addTabFactory.

const int REGISTER_FILEPROPERTYDIALOGTAB_INDEX_EXOTIC = 50000

Base value for display indexes of exotic (i.e. less important) tabs.

Used in FilePropertyDialog::addTabFactory.

class ApiFilesystemHandler : public sh::filesystem::FilesystemHandler
#include <apifilesystemhandler.h>

Public Functions

ApiFilesystemHandler(sh::filesystem::FilesystemModel *model)
void itemlist(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl, sh::filesystem::FilesystemNodeType type, sh::filesystem::FilesystemNodeListEditor *list)
void configureItems(sh::filesystem::Operation *op, QList<std::shared_ptr<sh::filesystem::FilesystemNode>> nodes)
sh::filesystem::FilesystemNodeType getType(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl)
qint64 getSize(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl)
QDateTime getMtime(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl)
void setMtime(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl, QDateTime time)
QString getMimetype(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl)
QString getLinkTarget(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl)
QList<QString> listExtendedAttributes(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl)
quint64 getExtendedAttributeSize(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl, QString attribute)
QByteArray getExtendedAttribute(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl, QString attribute)
void setExtendedAttribute(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl, QString attribute, QByteArray value)
void removeExtendedAttribute(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl, QString attribute)
QMap<QString, QString> getCustomAttributes(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl)
void setCustomAttribute(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl, QString attribute, QString value)
bool canGetFileContent(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl)
std::shared_ptr<QIODevice> getFileContent(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl)
bool canCreateDirectory(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl)
void createDirectory(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl)
bool canCreateLink(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl)
void createLink(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl, QString target)
bool canCreateFile(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl)
void createFile(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl, QIODevice *content, HandlerTransfer *handlertransfer)
bool canDeleteItem(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl)
void deleteItem(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl)
bool canRenameItem(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> src)
void renameItem(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> src, QString destpath)
QList<std::shared_ptr<sh::actions::AbstractActionItem>> getActions(const QList<std::shared_ptr<const sh::filesystem::Eurl>> eurls)
void itemlist(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl, sh::filesystem::FilesystemNodeType type, sh::filesystem::FilesystemNodeListEditor *list) = 0

Determine a list of subelements in a certain directory.

void configureItems(sh::filesystem::Operation *op, QList<std::shared_ptr<FilesystemNode>> nodes)

Configure newly created nodes (e.g. setting another icon or changing the display name).

sh::filesystem::FilesystemNodeType getType(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl) = 0

Determine if a file is regular, or a dir, or a link, …

qint64 getSize(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl) = 0

Determine the size of a file.

QDateTime getMtime(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl) = 0

Determine the mtime of a file.

void setMtime(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl, QDateTime time) = 0

Set the mtime of a file.

QString getMimetype(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl) = 0

Determine mime type of a file.

QString getLinkTarget(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl) = 0

Resolve a link.

QList<QString> listExtendedAttributes(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl)

Fetches the list of available extended attributes for an entry.

quint64 getExtendedAttributeSize(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl, QString attribute)

Returns the site of value for one extended attribute for an entry.

QByteArray getExtendedAttribute(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl, QString attribute)

Returns the value for one extended attribute for an entry.

void setExtendedAttribute(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl, QString attribute, QByteArray value)

Sets the value for one extended attribute for an entry.

void removeExtendedAttribute(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl, QString attribute)

Removes one extended attributes for an entry.

QMap<QString, QString> getCustomAttributes(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl)

Returns the custom attributes for an entry.

In contrast to extended attributes, the custom attributes are not directly stored in the filesystem this way, but handle implementation specific aspects (like permissions).

void setCustomAttribute(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl, QString attribute, QString value)

Sets the value for one custom attribute for an entry.

See also getCustomAttributes.

bool canGetFileContent(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl) = 0

Returns if it is allowed to get the content of a certain file.

std::shared_ptr<QIODevice> getFileContent(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl) = 0

Get the content of a file.

bool canCreateDirectory(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl) = 0

Returns if it is allowed to create subdirectories in a certain directory.

void createDirectory(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl) = 0

Create a directory.

bool canCreateLink(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl) = 0

Returns if it is allowed to create a link in a certain directory.

void createLink(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl, QString target) = 0

Create a link.

bool canCreateFile(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl) = 0

Returns if it is allowed to create files in a certain directory.

void createFile(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl, QIODevice *content, HandlerTransfer *handlertransfer) = 0

Creates a file with some content.

It may use handlertransfer for some better integration, like cancel support and progress monitoring.

bool canDeleteItem(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl) = 0

Returns if it is allowed to delete a certain file/directory/link/….

void deleteItem(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl) = 0

Delete a file/directory/link/…

void deleteDirectoryIfEmpty(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl)

Deletes a directory only of it is empty.

bool canRenameItem(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> src) = 0

Returns if it is allowed to rename a certain file, directory, link, … (see renameItem).

void renameItem(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> src, QString destpath) = 0

Renames an item to another path.

It can be a simple filename change or also changes in the deeper path segments.

QList<std::shared_ptr<sh::actions::AbstractActionItem>> getActions(const QList<std::shared_ptr<const sh::filesystem::Eurl>> eurls) = 0

Returns a list of actions (see former example) for showing for certain files.

bool requiresResolvedLinks()

Returns if this handler requires to be used by the engine with resolved links.

void viewEnteredDirectory(std::shared_ptr<const sh::filesystem::Eurl>)

Callback for preparing stuff when the view entered some directory (e.g. for enabling watchers). See also viewLeftDirectory.

void viewLeftDirectory(std::shared_ptr<const sh::filesystem::Eurl>)

Callback for preparing stuff when the view left some directory. See also viewEnteredDirectory.

bool isWellKnownScheme()

Returns if the scheme for this handler is a well known one (which external programs typically would understand).

void search(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl, std::function<void(std::shared_ptr<const sh::filesystem::Eurl>, QList<std::shared_ptr<sh::search::SearchCriterion>>, sh::filesystem::FilesystemNodeType ftype)> addfile, std::function<void(std::shared_ptr<const sh::filesystem::Eurl>)> visitdir, QList<std::shared_ptr<sh::search::SearchCriterion>> criteria, )

Helps searching for files.

Override this method with a behavior identical to the default, if a specialized implementation can be much faster than the default one.

void customizeUi(std::shared_ptr<sh::filesystem::FilesystemNode> node, bool *showSearchPanel)

Creates a custom gui, which becomes part of the fileview.

sh::filesystem::FilesystemModel *model()

A convenience shortcut to the sh::filesystem::FilesystemModel (a singleton).

Public Members

std::function<int(sh::filesystem::Operation *op, std::shared_ptr<sh::filesystem::Eurl> eurl)> _getType
std::function<qint64(sh::filesystem::Operation *op, std::shared_ptr<sh::filesystem::Eurl> eurl)> _getSize
std::function<double(sh::filesystem::Operation *op, std::shared_ptr<sh::filesystem::Eurl> eurl)> _getMtime
std::function<void(sh::filesystem::Operation *op, std::shared_ptr<sh::filesystem::Eurl> eurl, double)> _setMtime
std::function<QString(sh::filesystem::Operation *op, std::shared_ptr<sh::filesystem::Eurl> eurl)> _getLinkTarget
std::function< QList< QString >sh::filesystem::Operation *op, std::shared_ptr< sh::filesystem::Eurl > eurl)> _listExtendedAttributes
std::function<quint64(sh::filesystem::Operation *op, std::shared_ptr<sh::filesystem::Eurl> eurl, QString attribute)> _getExtendedAttributeSize
std::function<QByteArray(sh::filesystem::Operation *op, std::shared_ptr<sh::filesystem::Eurl> eurl, QString attribute)> _getExtendedAttribute
std::function<void(sh::filesystem::Operation *op, std::shared_ptr<sh::filesystem::Eurl> eurl, QString attribute, QByteArray value)> _setExtendedAttribute
std::function<void(sh::filesystem::Operation *op, std::shared_ptr<sh::filesystem::Eurl> eurl, QString attribute)> _removeExtendedAttribute
std::function< QList< QString >sh::filesystem::Operation *op, std::shared_ptr< sh::filesystem::Eurl > eurl)> _getCustomAttributes
std::function<void(sh::filesystem::Operation *op, std::shared_ptr<sh::filesystem::Eurl> eurl, QString attribute, QString value)> _setCustomAttribute
std::function<QString(sh::filesystem::Operation *op, std::shared_ptr<sh::filesystem::Eurl> eurl)> _getMimetype
std::function<bool(sh::filesystem::Operation *op, std::shared_ptr<sh::filesystem::Eurl> eurl)> _canCreateDirectory
std::function<void(sh::filesystem::Operation *op, std::shared_ptr<sh::filesystem::Eurl> eurl)> _createDirectory
std::function<bool(sh::filesystem::Operation *op, std::shared_ptr<sh::filesystem::Eurl> eurl)> _canCreateLink
std::function<void(sh::filesystem::Operation *op, std::shared_ptr<sh::filesystem::Eurl> eurl, QString target)> _createLink
std::function<bool(sh::filesystem::Operation *op, std::shared_ptr<sh::filesystem::Eurl> eurl)> _canCreateFile
std::function<bool(sh::filesystem::Operation *op, std::shared_ptr<sh::filesystem::Eurl> eurl)> _canDeleteItem
std::function<void(sh::filesystem::Operation *op, std::shared_ptr<sh::filesystem::Eurl> eurl)> _deleteItem
std::function<bool(sh::filesystem::Operation *op, std::shared_ptr<sh::filesystem::Eurl> src)> _canRenameItem
std::function<void(sh::filesystem::Operation *op, std::shared_ptr<sh::filesystem::Eurl> src, QString destpath)> _renameItem
std::function<void(sh::filesystem::Operation *op, std::shared_ptr<sh::filesystem::Eurl> eurl, int type, sh::filesystem::FilesystemNodeListEditor *list)> _itemlist
std::function<void(sh::filesystem::Operation *op, QList<std::shared_ptr<sh::filesystem::FilesystemNode>>)> _configureItems
std::function<bool(sh::filesystem::Operation *op, std::shared_ptr<sh::filesystem::Eurl> eurl)> _canGetFileContent
std::function< std::shared_ptr< QIODevice >sh::filesystem::Operation *op, std::shared_ptr< sh::filesystem::Eurl > eurl)> _getFileContent
std::function<void(sh::filesystem::Operation *op, std::shared_ptr<sh::filesystem::Eurl> eurl, QIODevice *content, HandlerTransfer *handlertransfer)> _createFile
std::function< QList< std::shared_ptr< sh::actions::AbstractActionItem > >QList< std::shared_ptr< sh::filesystem::Eurl > > eurls)> _getActions
class ApiFilesystemOperationProgressMonitor : public sh::filesystem::FilesystemOperationProgressMonitor
#include <apifilesystemoperationprogressmonitor.h>

Public Functions

ApiFilesystemOperationProgressMonitor(sh::actions::ActionExecutionInfo *actionExecution)
bool hasItemInfo()

Checks if this progress monitor provides information about how many items of a certain total number are transferred so far.

quint64 doneItems()

Checks how many items are transferred so far.

quint64 allItems()

Checks how many items are to be transferred in total (as predicted in the current moment).

bool hasBytesInfo()

Checks if this progress monitor provides information about how many byte of a certain total number are transferred so far.

quint64 doneBytes()

Checks how many bytes are transferred so far.

quint64 allBytes()

Checks how many bytes are to be transferred in total (as predicted in the current moment).

QString getItemInfoFrom()

Returns the current source of transfer (as textual information).

QString getItemInfoTo()

Returns the current destination of transfer (as textual information).

QString estimation()

Returns the current performance and time estimation (as textual information).

Public Members

std::function<void()> _changed
std::function<bool(QList<sh::filesystem::FilesystemOperationTransfers::OperationStep*>)> _resolveConflicts
class ApiGlobalObject : public sh::base::Singleton
#include <apiglobalobject.h>

Public Functions

std::shared_ptr<const sh::filesystem::Eurl> getEurlFromString(QString eurl)
void logDebug(QString msg)
void logInfo(QString msg)
void logWarning(QString msg)
void logError(QString msg)
int filesystemnodetype_file()
int filesystemnodetype_directory()
int filesystemnodetype_link()
int filesystemnodetype_unknown()
int filesystemnodetype_firsttype()
int filesystemnodetype_lastphysicaltype()
int filesystemnodetype_none()
int filesystemnodetype_specialtreeonlydirectory()
int filesystemnodetype_lasttype()
int actiondefaultprecedencevalues_openfile()
int actiondefaultprecedencevalues_builtinspecialopen()
int messageboxbutton_ok()
int messageboxbutton_continue()
int messageboxbutton_cancel()
int messageboxbutton_retry()
int messageboxbutton_yes()
int messageboxbutton_no()
int displayindex_core()
int displayindex_interesting()
int displayindex_exotic()
int configurationcategory_gui()
int configurationcategory_behavior()
int configurationcategory_externaltools()
int settinggroup_global()
int settinggroup_gui()
int settinggroup_filehandling()
int settinggroup_dataview()
int settinggroup_behavior()
int settinggroup_special()
int paneldetail_positionindex_veryinteresting()
int paneldetail_positionindex_interesting()
int paneldetail_positionindex_exotic()
int operationstep_conflictresolution_mergedirectories()
int operationstep_conflictresolution_overwritedestination()
int operationstep_conflictresolution_renamedestinationbefore()
int operationstep_conflictresolution_skip()
int operationstep_conflictresolution_unresolved()
int operationstep_conflictresolution_indirect()
int operationstep_conflictresolution_usedifferentdestinationname()
int filepropertydialogtab_index_core()
int filepropertydialogtab_index_veryimportant()
int filepropertydialogtab_index_important()
int filepropertydialogtab_index_normal()
int filepropertydialogtab_index_exotic()
int filepropertydialogtab_propertytype_string()
int filepropertydialogtab_propertytype_stringmap()
int filepropertydialogtab_propertytype_icontextbanner()
int searchcriterionfactory_index_core()
int searchcriterionfactory_index_normal()
int searchcriterionfactory_index_exotic()
int thumbnailprovider_index_core()
int thumbnailprovider_index_normal()
int thumbnailprovider_index_exotic()
int thumbnailprovider_index_fallback()
void register_predicatedactionfactory(std::shared_ptr<sh::scripting::api::ApiActionFactory> f)
bool isDebugBuild()
std::shared_ptr<sh::scripting::api::ApiFilesystemHandler> create_FilesystemHandler()
std::shared_ptr<sh::scripting::api::ApiActionActionItem> create_ActionActionItem(QString text, bool enabled, QString icon, int defaultActionPrecedence)
std::shared_ptr<sh::scripting::api::ApiSubmenuActionItem> create_SubmenuActionItem(QString text, bool enabled, QString icon, int defaultActionPrecedence)
std::shared_ptr<sh::scripting::api::ApiDetailColumn> create_DetailColumn(QString name, QString displayName, int displayIndex, bool sort_doTypediff, int defaultWidth, bool isRightAligned)
std::shared_ptr<sh::scripting::api::ApiFilePropertyDialogTab> create_FilePropertyDialogTab(QString title, QList<QString> properties)
std::shared_ptr<sh::scripting::api::ApiFilePropertyDialogTabFactory> create_FilePropertyDialogTabFactory()
std::shared_ptr<sh::scripting::api::ApiActionFactory> create_ActionFactory(QString category, QList<std::shared_ptr<actions::Predicate>> predicates)
std::shared_ptr<sh::scripting::api::ApiPanelDetailFactorySingle> create_DetailFactorySingle(int position, int valueWidthHint)
std::shared_ptr<sh::scripting::api::ApiPanelDetailFactoryMulti> create_DetailFactoryMulti(int position, int valueWidthHint)
std::shared_ptr<sh::scripting::api::ApiFilesystemOperationProgressMonitor> create_FilesystemOperationProgressMonitor(sh::actions::ActionExecutionInfo *actionExecution)
std::shared_ptr<sh::filesystem::FilesystemNode> _createFilesystemNode(std::shared_ptr<sh::filesystem::Eurl> eurl, sh::scripting::api::ApiFilesystemHandler *handler, int nodetype, std::shared_ptr<sh::filesystem::FilesystemNode> parent, bool doinsert, bool showInitialLoadingLabel, bool isHidden)
std::shared_ptr<sh::scripting::api::ApiThumbnailProvider> create_ThumbnailProvider()
std::shared_ptr<sh::filesystem::FilesystemNode> _getOrCreateFilesystemNode(std::shared_ptr<sh::filesystem::Eurl> eurl, sh::scripting::api::ApiFilesystemHandler *handler, int nodetype, std::shared_ptr<sh::filesystem::FilesystemNode> parent, bool doinsert, bool showInitialLoadingLabel, bool isHidden)
void _register_FilesystemHandler(std::shared_ptr<sh::scripting::api::ApiFilesystemHandler> handler, QString scheme)
std::shared_ptr<sh::filesystem::FilesystemNode> modelRootNode()
QList<std::shared_ptr<sh::filesystem::FilesystemNode>> _findFilesystemNodesForEurl(std::shared_ptr<const sh::filesystem::Eurl> eurl)
QList<std::shared_ptr<sh::filesystem::FilesystemNode>> _tryGetFilesystemNodesForEurl(std::shared_ptr<const sh::filesystem::Eurl> eurl)
void refreshData(std::shared_ptr<const sh::filesystem::Eurl> eurl, bool forceFindParent, bool withDetails)
std::shared_ptr<filesystem::Eurl> createEurl(QString scheme, QString hostname, QString path)
std::shared_ptr<sh::filesystem::Operation> createOperation()
sh::scripting::StringMap<QString> createArgumentException()
sh::scripting::StringMap<QString> createIOException()
sh::scripting::StringMap<QString> createRuntimeException()
sh::scripting::StringMap<QString> createProgramException()
sh::scripting::StringMap<QString> createException()
std::shared_ptr<sh::scripting::api::ApiReadDataDevice> _createReadDataDevice()
std::shared_ptr<ApiSetting> createSetting(QString name, QString description, int group, bool isAdvancedSetting, bool isGlobal, bool isPerFileview)
std::shared_ptr<sh::scripting::api::ApiThread> create_Thread()
std::shared_ptr<sh::scripting::api::ApiTimer> create_Timer()
std::shared_ptr<sh::scripting::api::ApiSearchCriterion> create_SearchCriterion(std::shared_ptr<sh::scripting::api::ApiSearchCriterionFactory> factory)
std::shared_ptr<sh::scripting::api::ApiSearchCriterionFactory> create_SearchCriterionFactory(QString key, QString description)
sh::ui::MainWindow *mainwindow()
void registerPanelDetailFactorySingle(std::shared_ptr<sh::scripting::api::ApiPanelDetailFactorySingle>)
void registerPanelDetailFactoryMulti(std::shared_ptr<sh::scripting::api::ApiPanelDetailFactoryMulti>)
void registerSetting(std::shared_ptr<sh::settings::Setting> setting)
void openItems(QList<std::shared_ptr<const sh::filesystem::Eurl>> eurls)
void registerFilePropertyDialogTabFactory(int index, std::shared_ptr<sh::scripting::api::ApiFilePropertyDialogTabFactory>)
void registerThumbnailProvider(int idx, std::shared_ptr<sh::scripting::api::ApiThumbnailProvider> thumbnailprovider)
void registerSearchCriterionFactory(int idx, std::shared_ptr<ApiSearchCriterionFactory> apicrit)
std::shared_ptr<sh::configuration::ConfigurationValue> register_ConfigurationValueInt(QString name, int deflt, QString desc, int category, QString longdesc, QString changehint)
std::shared_ptr<sh::configuration::ConfigurationValue> register_ConfigurationValueFloat(QString name, int deflt, QString desc, int category, QString longdesc, QString changehint)
std::shared_ptr<sh::configuration::ConfigurationValue> register_ConfigurationValueBool(QString name, bool deflt, QString desc, int category, QString longdesc, QString changehint)
std::shared_ptr<sh::configuration::ConfigurationValue> register_ConfigurationValueString(QString name, QString deflt, QString desc, int category, QString longdesc, QString changehint)
void registerTransferrableDetailColumn(int i, std::shared_ptr<sh::filesystem::DetailColumn> detailColumn)
std::shared_ptr<sh::filesystem::DetailColumn> findDetailColumnByName(QString name)
QString shallotDataDir()
QString shallotBuiltinPluginDir()
QString shallotSystemPluginDir()
QString shallotUserPluginDir()
QString shallotLanguage()
sh::tools::BookmarkManager *bookmarkManager()
std::shared_ptr<sh::actions::Predicate> create_OnDirectoriesPredicate()
std::shared_ptr<sh::actions::Predicate> create_OnFilesPredicate()
std::shared_ptr<sh::actions::Predicate> create_OnLinksPredicate()
std::shared_ptr<sh::actions::Predicate> create_OnSingleEntrySelectionPredicate()
std::shared_ptr<sh::actions::Predicate> create_DontResolveLinksPredicate()
std::shared_ptr<sh::actions::Predicate> create_HideOnCurrentDirectoryLevelPredicate()
std::shared_ptr<sh::actions::Predicate> create_HideOnSelectionLevelPredicate()
std::shared_ptr<sh::actions::Predicate> create_ByRegExpPredicate(QString pattern)
std::shared_ptr<sh::actions::Predicate> create_KeyShortcutPredicate(QString shortcut, bool triggersOnCurrentDirectoryLevel)
std::shared_ptr<sh::actions::Predicate> create_PositionIndexPredicate(int index)
void doInitialize()

Executes singleton initialization.

void doShutdown()

Executes singleton shutdown.

void shutdown()

Shutdown down this singleton.

bool isAlive()

Returns if this singleton is alive (true until its shutdown begins).

Private Functions

ApiGlobalObject()
class ApiHelperMethods
#include <apihelpermethods.h>

Public Static Functions

QByteArray QIODevice_read(QIODevice *self)
QByteArray QIODevice_readall(QIODevice *self)
QByteArray ApiReadDataDevice_read(sh::scripting::api::ApiReadDataDevice *self)
QByteArray ApiReadDataDevice_readall(sh::scripting::api::ApiReadDataDevice *self)
void FilesystemNodeList_resetItems(sh::filesystem::FilesystemNodeList *self, int type, QList<std::shared_ptr<sh::filesystem::FilesystemNode>> list)
void FilesystemNode_addDetail(filesystem::FilesystemNode *self, std::shared_ptr<sh::filesystem::DetailColumn> col)
void FilesystemNode_setIcon(sh::filesystem::FilesystemNode *self, QString icon)
void FilesystemNode_setDisplayName(filesystem::FilesystemNode *self, QString displayname)
bool FilesystemNode_isHidden(filesystem::FilesystemNode *self)
void FilesystemNode_setHidden(filesystem::FilesystemNode *self, bool v)
void ConfigurationValue_setConfigValueInt(sh::configuration::ConfigurationValue *self, int v)
void ConfigurationValue_setConfigValueFloat(sh::configuration::ConfigurationValue *self, double v)
void ConfigurationValue_setConfigValueBool(sh::configuration::ConfigurationValue *self, bool v)
void ConfigurationValue_setConfigValueString(sh::configuration::ConfigurationValue *self, QString v)
QList<std::shared_ptr<sh::filesystem::Eurl>> FilesystemOperation_itemlist(sh::filesystem::FilesystemOperation *self, std::shared_ptr<const sh::filesystem::Eurl> eurl)
QList<std::shared_ptr<sh::filesystem::Eurl>> FilesystemOperation_itemlistByType(sh::filesystem::FilesystemOperation *self, std::shared_ptr<const sh::filesystem::Eurl> eurl, int ntype)
int FilesystemOperation_getType(sh::filesystem::FilesystemOperation *self, std::shared_ptr<const sh::filesystem::Eurl> eurl)
void FilesystemOperation_createFile(sh::filesystem::FilesystemOperation *self, std::shared_ptr<const sh::filesystem::Eurl> eurl, sh::scripting::api::ApiReadDataDevice *content, std::shared_ptr<filesystem::FilesystemOperationProgressMonitor> progressmon)
QList<std::shared_ptr<sh::filesystem::FilesystemNode>> FilesystemOperation_resolveNodeLink(sh::filesystem::FilesystemOperation *self, std::shared_ptr<sh::filesystem::FilesystemNode> node)
std::shared_ptr<sh::filesystem::Eurl> FilesystemOperation_resolveEurlLink(sh::filesystem::FilesystemOperation *self, std::shared_ptr<const sh::filesystem::Eurl> eurl)
void PanelDetail_setRow(sh::paneldetails::PanelDetail *self, QString key, QList<QString> value)
void MainWindow_jumpToEurl(sh::ui::MainWindow *self, std::shared_ptr<const sh::filesystem::Eurl> eurl)
std::shared_ptr<sh::filesystem::FilesystemNode> MainWindow_getCurrentDirectoryNode(sh::ui::MainWindow *self)
void ApiActionActionItem_setEnabled(sh::scripting::api::ApiActionActionItem *self, bool enabled)
bool ApiActionActionItem_enabled(sh::scripting::api::ApiActionActionItem *self)
void ApiActionActionItem_setVisible(sh::scripting::api::ApiActionActionItem *self, bool visible)
bool ApiActionActionItem_visible(sh::scripting::api::ApiActionActionItem *self)
void ApiSubmenuActionItem_setSubitems(sh::scripting::api::ApiSubmenuActionItem *self, QList<std::shared_ptr<actions::AbstractActionItem>> subitems)
void ApiSubmenuActionItem_setEnabled(sh::scripting::api::ApiSubmenuActionItem *self, bool enabled)
bool ApiSubmenuActionItem_enabled(sh::scripting::api::ApiSubmenuActionItem *self)
void ApiSubmenuActionItem_setVisible(sh::scripting::api::ApiSubmenuActionItem *self, bool visible)
bool ApiSubmenuActionItem_visible(sh::scripting::api::ApiSubmenuActionItem *self)
int OperationStep_conflictResolution(filesystem::FilesystemOperationTransfers::OperationStep *self)
bool FilesystemOperationProgressMonitor_hasItemInfo(sh::scripting::api::ApiFilesystemOperationProgressMonitor *self)
quint64 FilesystemOperationProgressMonitor_doneItems(sh::scripting::api::ApiFilesystemOperationProgressMonitor *self)
quint64 FilesystemOperationProgressMonitor_allItems(sh::scripting::api::ApiFilesystemOperationProgressMonitor *self)
bool FilesystemOperationProgressMonitor_hasBytesInfo(sh::scripting::api::ApiFilesystemOperationProgressMonitor *self)
quint64 FilesystemOperationProgressMonitor_doneBytes(sh::scripting::api::ApiFilesystemOperationProgressMonitor *self)
quint64 FilesystemOperationProgressMonitor_allBytes(sh::scripting::api::ApiFilesystemOperationProgressMonitor *self)
QString FilesystemOperationProgressMonitor_getItemInfoFrom(sh::scripting::api::ApiFilesystemOperationProgressMonitor *self)
QString FilesystemOperationProgressMonitor_getItemInfoTo(sh::scripting::api::ApiFilesystemOperationProgressMonitor *self)
QString FilesystemOperationProgressMonitor_estimation(sh::scripting::api::ApiFilesystemOperationProgressMonitor *self)
QList<std::shared_ptr<sh::filesystem::FilesystemNode>> ApiFilePropertyDialogTab_nodes(sh::scripting::api::ApiFilePropertyDialogTab *self)
int ActionExecutionUserFeedback_messageBox(sh::actions::ActionExecutionUserFeedback *self, QString m, QList<QString> l, QString s, int i, int j)
QString ActionExecutionUserFeedback_simpleInputBox(sh::actions::ActionExecutionUserFeedback *self, QString text, QString deflt)
int FilePropertyDialogTab_selectedIndexForProperty(ApiFilePropertyDialogTab *self, qintptr widget)
void FilePropertyDialogTab_refresh(ApiFilePropertyDialogTab *self)
class ApiPanelDetailFactoryMulti : public sh::paneldetails::PanelDetailFactoryForFunctionMulti
#include <apipaneldetailfactory.h>

Public Functions

ApiPanelDetailFactoryMulti(int position, int valueWidthHint)
void setvalue(std::shared_ptr<sh::paneldetails::PanelDetail> detail, QList<std::shared_ptr<sh::filesystem::FilesystemNode>> nodes, filesystem::Operation *op)
void linktriggered(QList<std::shared_ptr<sh::filesystem::FilesystemNode>> nodes, QString linktarget)
std::shared_ptr<PanelDetail> construct(QList<std::shared_ptr<sh::filesystem::FilesystemNode>> nodes, sh::filesystem::Operation *op)

Public Members

std::function<void(sh::paneldetails::PanelDetail*, QList<std::shared_ptr<sh::filesystem::FilesystemNode>>, sh::filesystem::Operation *op)> _setvalue
std::function<void(QList<std::shared_ptr<sh::filesystem::FilesystemNode>>, QString)> _linktriggered
class ApiPanelDetailFactorySingle : public sh::paneldetails::PanelDetailFactoryForFunctionSingle
#include <apipaneldetailfactory.h>

Public Functions

ApiPanelDetailFactorySingle(int position, int valueWidthHint)
void setvalue(std::shared_ptr<sh::paneldetails::PanelDetail>, std::shared_ptr<sh::filesystem::FilesystemNode> node, filesystem::Operation *op)
void linktriggered(std::shared_ptr<sh::filesystem::FilesystemNode> node, QString linktarget)
std::shared_ptr<PanelDetail> construct(QList<std::shared_ptr<sh::filesystem::FilesystemNode>> nodes, sh::filesystem::Operation *op)

Public Members

std::function<void(sh::paneldetails::PanelDetail*, std::shared_ptr<sh::filesystem::FilesystemNode>, sh::filesystem::Operation *op)> _setvalue
std::function<void(std::shared_ptr<sh::filesystem::FilesystemNode>, QString)> _linktriggered
class ApiReadDataDevice : public sh::tools::ReadDataDevice
#include <apireaddatadevice.h>

Public Functions

ApiReadDataDevice()
QByteArray getdata()

This method returns the next available chunk of data. It may return empty arrays whenever temporarily no data is available. Returning a null array (with QByteArray::isNull()==true) marks the end of the stream. .

void _ended()

Public Members

std::function<QByteArray()> _getdata

Private Members

bool isended
class ApiSearchCriterion : public sh::search::criteria::AbstractActionDrivenSearchCriterion
#include <apisearchcriterion.h>

Public Functions

ApiSearchCriterion(std::shared_ptr<sh::search::SearchCriterionFactory> factory)
bool match2(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl)
QList<QString> getsearchspec()
bool match(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> eurl)

Checks if a given file (by eurl) matches this criterion. .

QString valuedescription()

Returns a human readable text describing the current criterion shortly and precisely. .

QString serialize()

Serializes this criterion to a string. See also SearchCriterion::deserialize.

std::shared_ptr<sh::search::SearchCriterionFactory> factory()

Returns the factory this criterion has created (provides some more metadata).

Public Members

std::function<void(sh::actions::ActionExecutionInfo*)> _configure
std::function<bool(sh::filesystem::Operation *op, std::shared_ptr<sh::filesystem::Eurl> eurl)> _match
QStringList searchspec

Public Static Functions

void _createEditor(std::shared_ptr<sh::search::SearchCriterion> cfg, sh::ui::SearchPanelConfiguration *panelcfg)
void _editorUpdateConfiguration(sh::ui::SearchPanelConfiguration *panelcfg, std::shared_ptr<sh::search::SearchCriterion> c)
std::shared_ptr<sh::search::SearchCriterion> deserialize(QString s)

Deserializes this criterion from a string. See also SearchCriterion::serialize.

class ApiSearchCriterionFactory : public sh::search::SearchCriterionFactory
#include <apisearchcriterion.h>

Public Functions

ApiSearchCriterionFactory(QString key, QString description)
QString key()

Returns the string key for the associated search criterion class. .

QString description()

Returns the description string for the associated search criterion class. .

void editor(std::shared_ptr<sh::search::SearchCriterion> c, sh::ui::SearchPanelConfiguration *panelcfg)
void editorupdateconfig(sh::ui::SearchPanelConfiguration *panelcfg, std::shared_ptr<sh::search::SearchCriterion> c)
std::shared_ptr<sh::search::SearchCriterion> construct()

Constructs an instance of the associated search criterion class. .

bool isVisibleFor(sh::filesystem::Operation *op, std::shared_ptr<sh::filesystem::FilesystemNode> node)

Checks if the associated search criterion class should be offered to the user for a given node. .

void editor(std::shared_ptr<sh::search::SearchCriterion> c, sh::ui::SearchPanelConfiguration *panelcfg) = 0

Builds the search config ui in a search panel.

Takes the data from c and populates panelcfg with it.

void editorupdateconfig(sh::ui::SearchPanelConfiguration *panelcfg, std::shared_ptr<sh::search::SearchCriterion> c) = 0

Updates own data with the content from the search config ui in a search panel.

Takes the data from panelcfg and updates c with it.

Public Members

std::function<QString(QList<QString>)> _getsearchspecdesc
std::function< std::shared_ptr< sh::search::SearchCriterion >)> _construct
std::function<bool(sh::filesystem::Operation*, std::shared_ptr<sh::filesystem::FilesystemNode>)> _isVisibleFor
class ApiSetting : public sh::settings::Setting
#include <apisetting.h>

Public Functions

ApiSetting(QString name, QString description, sh::settings::SettingGroup group, bool isAdvancedSetting, bool isGlobal, bool isPerFileview)
QString name()

Gets the internal name.

QString description()

Gets the description text.

sh::settings::SettingGroup group()

Gets the group;.

bool isAdvancedSetting()

Is this an advanced setting?

void setValue(QString value)

Called from Shallot core when the value was set (for a not-per-fileview setting).

void setValue(sh::ui::FileView *filelist, QString value)

Called from Shallot core when the value was set (for a per-fileview setting).

QString getValue(sh::ui::FileView *filelist)

Get the currently set value.

bool isGlobal()

Does this setting apply globally or just for a certain subtree of nodes?

bool isPerFileview()

Does this setting apply for each fileview individually or for the complete main window?

QString valueDescription(QString value)

Gets a human readable description text for a value.

Public Members

std::function<void(QString)> _setValue1
std::function<void(int, QString)> _setValue2
std::function<QString(int)> _getValue
std::function<QString(QString)> _valueDescription
QString _name
QString _description
sh::settings::SettingGroup _group
bool _isAdvancedSetting
bool _isGlobal
bool _isPerFileview

Public Static Functions

QString getGroupDescription(int g)

Low-level function which gets the description text of a group.

class ApiSubmenuActionItem : public sh::actions::SubmenuActionItem
#include <apiaction.h>

Public Functions

ApiSubmenuActionItem(QString text, bool enabled, QString icon, int defaultActionPrecedence)
void initialize() override

Initialize the action. This should make the time-consuming parts, e.g. for determining a label or enabled state.

const QList<std::shared_ptr<sh::actions::AbstractActionItem>> subitems()

Returns the list of subitems from this submenu.

void setSubitems(const QList<std::shared_ptr<sh::actions::AbstractActionItem>> subitems)

Sets the subitems.

QString text()

Returns the displayed text for this action.

QString icon()

Returns the icon for this action.

bool enabled()

Checks if this action is enabled.

bool isChecked()

Checks if this action is checked (has a cross in the ui).

bool isCheckable()

Checks if this action is checkable (can have a cross in the ui).

int defaultActionPrecedence() const

Returns the precedence for becoming the default action of a parent submenu.

This e.g. leads to a bold label.

The action with the highest value becomes the default. Only values >0 will be considered. See ActionDefaultPrecedenceValues for reference values.

void setText(QString text)

Sets the displayed text.

void setIcon(QString icon)

Sets the icon.

void setEnabled(bool enabled)

Sets if the item is enabled.

void setChecked(bool checked)

Sets if the item is checked (has a cross in the ui).

void setVisible(bool visible)

Sets the visibility of this item.

bool visible()

Checks the visibility of this item (non-recursively).

std::weak_ptr<AbstractActionItem> parentAction()

Returns the parent action, if it is added to a container.

void _setParentAction(std::shared_ptr<AbstractActionItem> parent)

Sets the parent action. .

void initializeAsync(std::function<void()> oninitialized = 0)

Asynchonously initializes the action.

void initializeSync()

Synchonously initializes the action.

bool isInitialized()

Checks if this action is initialized.

bool isInitializing()

Checks if this action is initializing.

Public Members

std::function<void()> _initialize

Signals

void subitemsChanged()

Emits when the list of subitems changed.

void changed()

Emits when some data changed.

class ApiThread : public std::enable_shared_from_this<ApiThread>
#include <apithread.h>

Public Functions

ApiThread()
void start()

Public Members

std::function<void()> _run
class ApiThumbnailProvider : public sh::tools::ThumbnailProvider
#include <apithumbnailprovider.h>

Public Functions

ApiThumbnailProvider()
void getThumbnail(sh::filesystem::Operation *operation, std::shared_ptr<sh::filesystem::FilesystemNode> node, QString contentType, int width, int height, QIcon *icon)

Public Members

std::function<QByteArray(sh::filesystem::Operation*, std::shared_ptr<sh::filesystem::FilesystemNode>, QString, int, int)> _getThumbnail
class ApiTimer : public std::enable_shared_from_this<ApiTimer>
#include <apitimer.h>

Public Functions

ApiTimer()
void start(int interval)
void stop()

Public Members

std::function<void()> _run

Private Members

QMutex _mutex
QTimer _timer
bool _isexecuting = false
QList<std::shared_ptr<ApiTimer>> _runningTimers
namespace pythoninterop

Interoperation layer between the Shallot core (C++) and Python plugins.

Typedefs

using StringMap = QMap<QString, V>

Functions

PyObject *getPyNone()
bool isPyNone(PyObject *o)
void *getPointerFromShallotPyObject(PyObject *o)
std::shared_ptr<void> getSharedPointerFromShallotPyObject(PyObject *o)
PyObject *getShallotPyObjectFromPointer(void *o, sh::scripting::ApiClass *apiclass)
PyObject *getShallotPyObjectFromSharedPointer(std::shared_ptr<void> o, sh::scripting::ApiClass *apiclass)
sh::scripting::ApiClass *getApiClass(QString typeIdName)
PyObject *PyTupleGetItem(PyObject *o, int itm)
PyObject *PyListGetItem(PyObject *o, int itm)
int PyTupleCount(PyObject *o)
int PyListCount(PyObject *o)
bool PyIsTuple(PyObject *o)
bool PyIsList(PyObject *o)
bool PyIsUnicode(PyObject *o)
bool PyIsBytes(PyObject *o)
bool PyIsDict(PyObject *o)
bool PyIsBool(PyObject *o)
bool PyIsFloat(PyObject *o)
bool PyIsLong(PyObject *o)
void PyIncRef(PyObject *o)
void PyDecRef(PyObject *o)
void PyTupleSetItem(PyObject *o, int itm, PyObject *val)
PyObject *PyObjectCall(PyObject *fct, PyObject *args)
PyObject *PyTupleNew(int cnt)
PyObject *PyDictNew()
PyObject *PyDictKeys(PyObject *o)
PyObject *PyDictGetItem(PyObject *dict, PyObject *key)
void PyDictSetItem(PyObject *dict, PyObject *key, PyObject *val)
bool PythonToC_ExecuteGuarded(std::function<void()> fct)
void invokePython(std::function<void()> fct)
template<typename R, typename T, typename ...ArgsF, typename ...ArgsT>
R CallNativeFunctionWithTuple(T *pObj, R (T::* f)(ArgsF...), std::tuple<ArgsT...> const &t, )
template<typename R, typename T, typename ...ArgsF, typename ...ArgsT>
R CallNativeHelperFunctionWithTuple(T *pObj, R (*f)(T*, ArgsF...), std::tuple<ArgsT...> const &t, )
template<int pos, class ...Args>
class _PyObjectFunctionToNativeFunction_SetTupleValue
#include <pythonscriptinterpreter.h>
template<int pos>
class _PyObjectFunctionToNativeFunction_SetTupleValue<pos>
#include <pythonscriptinterpreter.h>

Public Static Functions

void setTupleValue(PyObject*)
template<int pos, class Arg, class ...Args>
class _PyObjectFunctionToNativeFunction_SetTupleValue<pos, Arg, Args...>
#include <pythonscriptinterpreter.h>

Public Static Functions

void setTupleValue(PyObject *tup, Arg arg, Args... args)
template<int pos, class ...Args>
class _PyObjectFunctionToNativeFunction_TupleValueSetter
#include <pythonscriptinterpreter.h>

This class is a workaround for gcc<4.9 bug 55914. It was not able to call …::setTupleValue directly from within the invokePython lambda

Public Functions

_PyObjectFunctionToNativeFunction_TupleValueSetter(Args... args)
void set(PyObject *tuple)

Private Members

std::function<void(PyObject*)> _set

Private Static Functions

void __set(Args... args, PyObject *tuple)
template<typename T, T>
struct CallNativeHelperMethodWithPyObjectArguments
#include <pythonscriptinterpreter.h>
template<typename T, typename R, typename ... Args, R(*)(T *, Args...) MF> CallNativeHelperMethodWithPyObjectArguments< R(*)(T *, Args...), MF >
#include <pythonscriptinterpreter.h>

Public Static Functions

PyObject *call(PyObject *a, PyObject *b)
template<typename T, typename ... Args, void(*)(T *, Args...) MF> CallNativeHelperMethodWithPyObjectArguments< void(*)(T *, Args...), MF >
#include <pythonscriptinterpreter.h>

Public Static Functions

PyObject *call(PyObject *a, PyObject *b)
template<typename T, T>
struct CallNativeMethodWithPyObjectArguments
#include <pythonscriptinterpreter.h>
template<typename T, typename R, typename ... Args, R(T::*)(Args...) const MF> *)(Args...) const, MF >
#include <pythonscriptinterpreter.h>

Public Static Functions

PyObject *call(PyObject *a, PyObject *b)
template<typename T, typename R, typename ... Args, R(T::*)(Args...) MF> *)(Args...), MF >
#include <pythonscriptinterpreter.h>

Public Static Functions

PyObject *call(PyObject *a, PyObject *b)
template<typename T, typename ... Args, void(T::*)(Args...) const MF> *)(Args...) const, MF >
#include <pythonscriptinterpreter.h>

Public Static Functions

PyObject *call(PyObject *a, PyObject *b)
template<typename T, typename ... Args, void(T::*)(Args...) MF> *)(Args...), MF >
#include <pythonscriptinterpreter.h>

Public Static Functions

PyObject *call(PyObject *a, PyObject *b)
class Converters
#include <pythonscriptinterpreter.h>

Public Static Functions

QString getStringFromPyObject(PyObject *o)
QVariant getVariantFromPyObject(PyObject *o)
int getIntFromPyObject(PyObject *o)
double getDoubleFromPyObject(PyObject *o)
qint64 getInt64FromPyObject(PyObject *o)
quint64 getUint64FromPyObject(PyObject *o)
bool getBoolFromPyObject(PyObject *o)
QByteArray getByteArrayFromPyObject(PyObject *o)
void *getPointerFromPyObject(PyObject *o)
std::shared_ptr<void> getSharedPointerFromPyObject(PyObject *o)
PyObject *getPyObjectFromString(QString v)
PyObject *getPyObjectFromVariant(QVariant v)
PyObject *getPyObjectFromInt(int v)
PyObject *getPyObjectFromDouble(double v)
PyObject *getPyObjectFromInt64(qint64 v)
PyObject *getPyObjectFromUint64(quint64 v)
PyObject *getPyObjectFromBool(bool v)
PyObject *getPyObjectFromByteArray(QByteArray v)
template<int mode, uint N>
struct FunctionBindTuple
#include <pythonscriptinterpreter.h>
template<>
struct FunctionBindTuple<0, 0>
#include <pythonscriptinterpreter.h>

Public Static Functions

template<typename R, typename T, typename ...ArgsF, typename ...ArgsT, typename ...Args>
R applyTuple(T *pObj, R (T::* f)(ArgsF...), const std::tuple<ArgsT...>&, Args... args, )
template<uint N>
struct FunctionBindTuple<0, N>
#include <pythonscriptinterpreter.h>

Public Static Functions

template<typename R, typename T, typename ...ArgsF, typename ...ArgsT, typename ...Args>
R applyTuple(T *pObj, R (T::* f)(ArgsF...), const std::tuple<ArgsT...> &t, Args... args, )
template<>
struct FunctionBindTuple<1, 0>
#include <pythonscriptinterpreter.h>

Public Static Functions

template<typename R, typename T, typename ...ArgsF, typename ...ArgsT, typename ...Args>
R applyTuple(T *pObj, R (*f)(T*, ArgsF...), const std::tuple<ArgsT...>&, Args... args, )
template<uint N>
struct FunctionBindTuple<1, N>
#include <pythonscriptinterpreter.h>

Public Static Functions

template<typename R, typename T, typename ...ArgsF, typename ...ArgsT, typename ...Args>
R applyTuple(T *pObj, R (*f)(T*, ArgsF...), const std::tuple<ArgsT...> &t, Args... args, )
template<class V>
class NativeToPyObject
#include <pythonscriptinterpreter.h>

Helps to return a Python object from a native c++ value (with reference ownership)

template<>
class NativeToPyObject<bool>
#include <pythonscriptinterpreter.h>

Public Static Functions

PyObject *toPyObject(bool v)
template<>
class NativeToPyObject<double>
#include <pythonscriptinterpreter.h>

Public Static Functions

PyObject *toPyObject(double v)
template<>
class NativeToPyObject<int>
#include <pythonscriptinterpreter.h>

Public Static Functions

PyObject *toPyObject(int v)
template<>
class NativeToPyObject<QByteArray>
#include <pythonscriptinterpreter.h>

Public Static Functions

PyObject *toPyObject(QByteArray v)
template<>
class NativeToPyObject<qint64>
#include <pythonscriptinterpreter.h>

Public Static Functions

PyObject *toPyObject(qint64 v)
template<typename V>
class NativeToPyObject<QList<V>>
#include <pythonscriptinterpreter.h>

Public Static Functions

PyObject *toPyObject(QList<V> v)
template<typename V>
class NativeToPyObject<QMap<QString, V>>
#include <pythonscriptinterpreter.h>

Public Static Functions

PyObject *toPyObject(QMap<QString, V> v)
template<>
class NativeToPyObject<QString>
#include <pythonscriptinterpreter.h>

Public Static Functions

PyObject *toPyObject(QString v)
template<>
class NativeToPyObject<quint64>
#include <pythonscriptinterpreter.h>

Public Static Functions

PyObject *toPyObject(quint64 v)
template<>
class NativeToPyObject<QVariant>
#include <pythonscriptinterpreter.h>

Public Static Functions

PyObject *toPyObject(QVariant v)
template<class V> shared_ptr< const V > >
#include <pythonscriptinterpreter.h>

Public Static Functions

PyObject *toPyObject(std::shared_ptr<const V> v)
template<class V> shared_ptr< V > >
#include <pythonscriptinterpreter.h>

Public Static Functions

PyObject *toPyObject(std::shared_ptr<V> v)
template<class V>
class NativeToPyObject<V*>
#include <pythonscriptinterpreter.h>

Public Static Functions

PyObject *toPyObject(V *v)
template<class R, class ...Args>
class PyObjectFunctionToNativeFunction
#include <pythonscriptinterpreter.h>

Public Static Functions

std::function<R(Args...)> toNativeFunction(PyObject *self, PyObject *fct)
template<class ...Args>
class PyObjectFunctionToNativeFunction<void, Args...>
#include <pythonscriptinterpreter.h>

Public Static Functions

std::function<void(Args...)> toNativeFunction(PyObject *self, PyObject *fct)
template<class V>
class PyObjectToNative
#include <pythonscriptinterpreter.h>

Helps to return a c++ value from a Python object (borrows the reference)

template<>
class PyObjectToNative<bool>
#include <pythonscriptinterpreter.h>

Public Static Functions

bool toNative(PyObject*, PyObject *o)
template<>
class PyObjectToNative<double>
#include <pythonscriptinterpreter.h>

Public Static Functions

double toNative(PyObject*, PyObject *o)
template<>
class PyObjectToNative<int>
#include <pythonscriptinterpreter.h>

Public Static Functions

int toNative(PyObject*, PyObject *o)
template<>
class PyObjectToNative<QByteArray>
#include <pythonscriptinterpreter.h>

Public Static Functions

QByteArray toNative(PyObject*, PyObject *o)
template<>
class PyObjectToNative<qint64>
#include <pythonscriptinterpreter.h>

Public Static Functions

qint64 toNative(PyObject*, PyObject *o)
template<class V>
class PyObjectToNative<QList<V>>
#include <pythonscriptinterpreter.h>

Public Static Functions

QList<V> toNative(PyObject *a, PyObject *o)
template<>
class PyObjectToNative<QString>
#include <pythonscriptinterpreter.h>

Public Static Functions

QString toNative(PyObject*, PyObject *o)
template<>
class PyObjectToNative<quint64>
#include <pythonscriptinterpreter.h>

Public Static Functions

qint64 toNative(PyObject*, PyObject *o)
template<>
class PyObjectToNative<QVariant>
#include <pythonscriptinterpreter.h>

Public Static Functions

QVariant toNative(PyObject*, PyObject *o)
template<class V, class ... Args> function< V(Args...)> >
#include <pythonscriptinterpreter.h>

Public Static Functions

std::function<V(Args...)> toNative(PyObject *self, PyObject *io)
template<class V> shared_ptr< V > >
#include <pythonscriptinterpreter.h>

Public Static Functions

std::shared_ptr<V> toNative(PyObject*, PyObject *o)
template<class V>
class PyObjectToNative<StringMap<V>>
#include <pythonscriptinterpreter.h>

Public Static Functions

StringMap<V> toNative(PyObject *a, PyObject *o)
template<class V>
class PyObjectToNative<V*>
#include <pythonscriptinterpreter.h>

Public Static Functions

V *toNative(PyObject*, PyObject *o)
template<int pos, typename ...Args>
struct PyObjectTupleToNativeTuple
#include <pythonscriptinterpreter.h>
template<int pos>
struct PyObjectTupleToNativeTuple<pos>
#include <pythonscriptinterpreter.h>

Public Static Functions

std::tuple toNativeTuple(PyObject*, PyObject*)
template<int pos, class T, class ...Args>
struct PyObjectTupleToNativeTuple<pos, T, Args...>
#include <pythonscriptinterpreter.h>

Public Static Functions

std::tuple<T, Args...> toNativeTuple(PyObject *a, PyObject *b)
template<typename D, typename T, T>
struct ScriptedMethodProxy
#include <pythonscriptinterpreter.h>
template<typename T, typename R, typename ... Args, std::function< R(Args...)> T::* MF> *, MF >
#include <pythonscriptinterpreter.h>

Public Static Functions

void setImplementation(T *inst, std::function<R(Args...)> vfct)
PyObject *pyObjectFunctionSetImplementation(PyObject *a, PyObject *b)