27#include "../common/sharedStructures.h"
28#include "../common/sharedStructuresQt.h"
29#include "../../common/addInInterface.h"
83 encodingName(
""), displayName(
""), displayNameShort(
""), bom(
""), userDefined(false)
107 static RetVal openGeneralFile(
const QString &generalFileName,
bool openUnknownsWithExternalApp =
true,
bool showMessages =
false, QWidget* parent = NULL,
const char* errorSlotMemberOfParent = NULL,
bool globalNotLocalWorkspace =
true);
109 static RetVal uiExportPyWorkspaceVars(
bool globalNotLocal,
const QStringList &varNames, QVector<int> compatibleParamBaseTypes, QString defaultPath = QString(), QWidget* parent = NULL);
112 static RetVal uiImportPyWorkspaceVars(
bool globalNotLocal,
const IOFilters &IOfilters, QString defaultPath = QString(), QWidget* parent = NULL);
120 static RetVal openUIFile(
const QString &filename, QWidget* parent = NULL,
const char* errorSlotMemberOfParent = NULL);
122 static QString
getFileFilters(
const IOFilters &IOfilters, QStringList *allPatterns = NULL);
128 static QIcon
searchIcon(
const QString &filename,
const SearchFolders &searchFolders =
SFAll,
const QIcon &fallbackIcon = QIcon());
133 static CharsetEncodingItem getDefaultScriptEncoding();
134 static CharsetEncodingItem getEncodingFromAlias(
const QString &alias,
bool* found =
nullptr);
149Q_DECLARE_OPERATORS_FOR_FLAGS(ito::IOHelper::IOFilters)
container for publishing filters provided by any plugin
Definition addInInterface.h:974
This class contains several static methods to load or save various file formats.
Definition IOHelper.h:41
static RetVal uiImportPyWorkspaceVars(bool globalNotLocal, const IOFilters &IOfilters, QString defaultPath=QString(), QWidget *parent=NULL)
open a file load dialog and let the user selected a file that is opened and load to a python workspac...
Definition IOHelper.cpp:479
static QString getFileFilters(const IOFilters &IOfilters, QStringList *allPatterns=NULL)
Returns a list of all file endings that correspond to itom.
Definition IOHelper.cpp:1188
static QList< CharsetEncodingItem > supportedScriptEncodings
Definition IOHelper.h:142
static RetVal openGeneralFile(const QString &generalFileName, bool openUnknownsWithExternalApp=true, bool showMessages=false, QWidget *parent=NULL, const char *errorSlotMemberOfParent=NULL, bool globalNotLocalWorkspace=true)
method to load any supported file
Definition IOHelper.cpp:112
IOFilter
Definition IOHelper.h:50
@ IOOutput
Definition IOHelper.h:52
@ IOAllFiles
Definition IOHelper.h:54
@ IOPlugin
Definition IOHelper.h:53
@ IOMimeAll
Definition IOHelper.h:59
@ IOMimeDataObject
Definition IOHelper.h:56
@ IOMimePolygonMesh
Definition IOHelper.h:58
@ IOWorkspace
Definition IOHelper.h:55
@ IOInput
Definition IOHelper.h:51
@ IOMimePointCloud
Definition IOHelper.h:57
static RetVal openPythonScript(const QString &filename)
open a given python file in a script editor window
Definition IOHelper.cpp:669
static void elideFilepathMiddle(QString &path, int pixelLength)
Shortens paths so that menus can display them without becoming too big.
Definition IOHelper.cpp:1348
static QString getAllItomFilesName()
Definition IOHelper.h:130
static RetVal exportPyWorkspaceVars(const QString &filename, bool globalNotLocal, const QStringList &varNames)
export one or more variables from a python workspace to an idc or mat file
Definition IOHelper.cpp:386
~IOHelper()
Definition IOHelper.h:138
static RetVal uiOpenFileWithFilter(const ito::AddInAlgo::FilterDef *filter, const QString &filename, QWidget *parent=NULL, bool globalNotLocal=true)
open a file using a filter method from an algorithm plugin and shows an import dialog
Definition IOHelper.cpp:845
static RetVal importPyWorkspaceVars(const QString &filename, bool globalNotLocal, QWidget *parent=NULL)
import an idc or mat file and load the content to a python workspace
Definition IOHelper.cpp:531
static QList< CharsetEncodingItem > getSupportedScriptEncodings()
return a list of default encodings, that are officially supported by Qt (as well as Python).
Definition IOHelper.cpp:1483
static QString allItomFilesName
name of set of all itom files (used in file open dialog or file system dialog)
Definition IOHelper.h:141
static RetVal openUIFile(const QString &filename, QWidget *parent=NULL, const char *errorSlotMemberOfParent=NULL)
open ui file in an instance of QtDesigner
Definition IOHelper.cpp:722
SearchFolder
Definition IOHelper.h:68
@ SFAppDir
Definition IOHelper.h:72
@ SFDirect
Definition IOHelper.h:70
@ SFCurrent
Definition IOHelper.h:71
@ SFAppDirQItom
Definition IOHelper.h:73
@ SFResources
Definition IOHelper.h:69
@ SFAll
Definition IOHelper.h:74
static RetVal uiExportPyWorkspaceVars(bool globalNotLocal, const QStringList &varNames, QVector< int > compatibleParamBaseTypes, QString defaultPath=QString(), QWidget *parent=NULL)
export one or more variables from a python workspace
Definition IOHelper.cpp:267
IOHelper(const IOHelper &)
Definition IOHelper.h:139
static bool fileFitsToFileFilters(const QString &filename, const IOFilters &IOfilters)
Checks if a file fits to a filter.
Definition IOHelper.cpp:1311
static RetVal uiSaveFileWithFilter(QSharedPointer< ito::ParamBase > &value, const QString &filename, QWidget *parent=NULL)
save a file using a filter method from an algorithm plugin and shows an export dialog
Definition IOHelper.cpp:1029
static QIcon searchIcon(const QString &filename, const SearchFolders &searchFolders=SFAll, const QIcon &fallbackIcon=QIcon())
search an icon file in different locations, open and return it
Definition IOHelper.cpp:1393
Class for managing status values (like errors or warning)
Definition retVal.h:54
Definition apiFunctionsGraph.cpp:40
CharsetEncodingItem()
Definition IOHelper.h:82
QByteArray bom
false if part of the officially supported list of encodings, else true
Definition IOHelper.h:100
QString displayNameShort
all possible aliases, e.g. in Python scripts (coding=...)
Definition IOHelper.h:94
QString displayName
the short version, e.g. for a status bar
Definition IOHelper.h:91
QString encodingName
the name used as display name in a config dialog
Definition IOHelper.h:88
QStringList aliases
the Byte-Order-Mark used to automatically detect this encoding (or empty, if not used)
Definition IOHelper.h:97