309 propConstant = 0x0002,
311 propReadable = 0x0008,
312 propWritable = 0x0010,
313 propResettable = 0x0020
318 errorUiHandleInvalid = 0x1001,
319 errorObjDoesNotExist = 0x1002,
320 errorObjPropWrite = 0x1003,
321 errorObjPropRead = 0x1004,
322 errorObjPropDoesNotExist = 0x1005,
323 errorUnregisteredType = 0x1006,
324 errorSlotDoesNotExist = 0x1007,
325 errorSignalDoesNotExist = 0x1008,
326 errorConnectionError = 0x1009
332 typeMainWindow = 0x0001,
333 typeDockWidget = 0x0002,
334 typeCentralWidget = 0x0003
339 infoShowNoInheritance = 0x0001,
340 infoShowItomInheritance = 0x0002,
341 infoShowInheritanceUpToWidget = 0x0004,
342 infoShowAllInheritance =0x0008
345 typedef QList<ClassInfoContainer> ClassInfoContainerList;
350 void showDialog(QWidget *parent);
351 inline QObject *getPluginReference(
unsigned int objectID) {
return getWeakObjectReference(objectID); }
353 static inline void parseUiDescription(
int uiDescription,
int* uiType = NULL,
int* buttonBarType = NULL,
bool* childOfMainWindow = NULL,
bool* deleteOnClose = NULL,
int* dockWidgetArea = NULL)
355 if(uiType) *uiType = (uiDescription & 0x000000FF);
356 if(buttonBarType) *buttonBarType = ((uiDescription & 0x0000FF00) >> 8);
357 if(childOfMainWindow) *childOfMainWindow = ((uiDescription & 0x000F0000) > 0);
358 if(deleteOnClose) *deleteOnClose = ((uiDescription & 0x00F00000) > 0);
359 if(dockWidgetArea) *dockWidgetArea = ((uiDescription & 0xFF000000) >> 24);
362 static inline int createUiDescription(
int uiType,
int buttonBarType,
bool childOfMainWindow,
bool deleteOnClose,
int dockWidgetArea)
364 int v = uiType & 0x000000FF;
365 v += (buttonBarType << 8);
366 if(childOfMainWindow) v += (1 << 16);
367 if(deleteOnClose) v+= (1 << 20);
368 v += (dockWidgetArea << 24);
373 RetVal getNewPluginWindow(
const QString &pluginName,
unsigned int &objectID, QWidget** newWidget, QWidget *parent = NULL);
375 QWidget* loadDesignerPluginWidget(
const QString &name, RetVal &retValue, AbstractFigure::WindowMode winMode, QWidget *parent = NULL);
377 QWidget*
createWidget(
const QString &className, RetVal &retValue, QWidget *parent = NULL,
const QString &objectName = QString());
380 QWidget* loadUiFile(
const QString &filename, RetVal &retValue, QWidget *parent = NULL,
const QString &objectNameSuffix = QString());
388 void startGarbageCollectorTimer();
390 RetVal addWidgetToOrganizer(QWidget *widget,
int uiDescription,
const StringMap &dialogButtons,
391 QSharedPointer<unsigned int>dialogHandle,
392 QSharedPointer<unsigned int> objectID,
393 QSharedPointer<QByteArray> className);
399 QObject *getWeakObjectReference(
unsigned int objectID);
401 QByteArray getReadableMethodSignature(
const QMetaMethod &method,
bool pythonNotCStyle, QByteArray *methodName = NULL,
bool *valid = NULL);
402 QByteArray getReadableParameter(
const QByteArray ¶meter,
bool pythonNotCStyle,
bool *valid = NULL);
403 ito::UiOrganizer::ClassInfoContainerList::Iterator parseMetaPropertyForEnumerationTypes(
const QMetaProperty &meth, ClassInfoContainerList ¤tPropList);
417 void setApiPointersToWidgetAndChildren(QWidget *widget);
420 QUiLoader *m_pUiLoader;
421 QHash<QString, QTranslator*> m_transFiles;
427 void pythonKeyboardInterrupt(
bool checked);
429 RetVal loadPluginWidget(
void* algoWidgetFunc,
int uiDescription,
const StringMap &dialogButtons, QVector<ito::ParamBase> *paramsMand, QVector<ito::ParamBase> *paramsOpt, QSharedPointer<unsigned int>dialogHandle, QSharedPointer<unsigned int> objectID, QSharedPointer<QByteArray> className,
ItomSharedSemaphore *semaphore = NULL);
430 RetVal createNewDialog(
const QString &filename,
int uiDescription,
const StringMap &dialogButtons, QSharedPointer<unsigned int> dialogHandle, QSharedPointer<unsigned int> objectID, QSharedPointer<QByteArray> className,
ItomSharedSemaphore *semaphore = NULL);
432 RetVal showDialog(
unsigned int handle,
int modalLevel, QSharedPointer<int> retCodeIfModal,
ItomSharedSemaphore *semaphore = NULL);
434 RetVal setAttribute(
unsigned int handle, Qt::WidgetAttribute attribute,
bool on =
true,
ItomSharedSemaphore *semaphore = NULL);
438 UiContainer* getUiDialogByHandle(
unsigned int uiHandle);
443 RetVal showInputDialogGetDouble(
unsigned int objectID,
const QString &title,
const QString &label,
double defaultValue, QSharedPointer<bool> ok, QSharedPointer<double> value,
double min = -2147483647,
double max = 2147483647,
int decimals = 1,
ItomSharedSemaphore *semaphore = NULL );
444 RetVal showInputDialogGetInt(
unsigned int objectID,
const QString &title,
const QString &label,
int defaultValue, QSharedPointer<bool> ok, QSharedPointer<int> value,
int min = -2147483647,
int max = 2147483647,
int step = 1,
ItomSharedSemaphore *semaphore = NULL );
445 RetVal showInputDialogGetItem(
unsigned int objectID,
const QString &title,
const QString &label,
const QStringList &stringList, QSharedPointer<bool> ok, QSharedPointer<QString> value,
int currentIndex = 0,
bool editable =
false,
ItomSharedSemaphore *semaphore = NULL );
446 RetVal showInputDialogGetText(
unsigned int objectID,
const QString &title,
const QString &label,
const QString &defaultString, QSharedPointer<bool> ok, QSharedPointer<QString> value,
ItomSharedSemaphore *semaphore = NULL );
447 RetVal showMessageBox(
unsigned int objectID,
int type,
const QString &title,
const QString &text,
int buttons,
int defaultButton, QSharedPointer<int> retButton, QSharedPointer<QString> retButtonText,
ItomSharedSemaphore *semaphore = NULL );
449 RetVal showFileDialogExistingDir(
unsigned int objectID,
const QString &caption, QSharedPointer<QString> directory,
int options = QFileDialog::ShowDirsOnly,
ItomSharedSemaphore *semaphore = NULL);
450 RetVal showFileOpenDialog(
unsigned int objectID,
const QString &caption,
const QString &directory,
const QString &filter, QSharedPointer<QString> file,
int selectedFilterIndex = 0,
int options = 0,
ItomSharedSemaphore *semaphore = NULL);
451 RetVal showFilesOpenDialog(
unsigned int objectID,
const QString &caption,
const QString &directory,
const QString &filter, QSharedPointer<QStringList> files,
int selectedFilterIndex = 0,
int options = 0,
ItomSharedSemaphore *semaphore = NULL);
452 RetVal showFileSaveDialog(
unsigned int objectID,
const QString &caption,
const QString &directory,
const QString &filter, QSharedPointer<QString> file,
int selectedFilterIndex = 0,
int options = 0,
ItomSharedSemaphore *semaphore = NULL);
455 RetVal getPropertyInfos(
unsigned int objectID, QSharedPointer<QVariantMap> retPropertyMap,
ItomSharedSemaphore *semaphore = NULL);
456 RetVal readProperties(
unsigned int objectID, QSharedPointer<QVariantMap> properties,
ItomSharedSemaphore *semaphore = NULL);
458 RetVal readProperties(
unsigned int handle,
const QString &widgetName, QSharedPointer<QVariantMap> properties,
ItomSharedSemaphore *semaphore = NULL);
459 RetVal writeProperties(
unsigned int handle,
const QString &widgetName,
const QVariantMap &properties,
ItomSharedSemaphore *semaphore = NULL);
460 RetVal getAttribute(
unsigned int objectID,
int attributeNumber, QSharedPointer<bool> value,
ItomSharedSemaphore *semaphore = NULL);
464 RetVal widgetMetaObjectCounts(
unsigned int objectID, QSharedPointer<int> classInfoCount, QSharedPointer<int> enumeratorCount, QSharedPointer<int> methodCount, QSharedPointer<int> propertyCount,
ItomSharedSemaphore *semaphore = NULL );
466 RetVal getChildObject(
unsigned int uiHandle,
const QString &objectName, QSharedPointer<unsigned int> objectID,
ItomSharedSemaphore *semaphore = NULL);
467 RetVal getChildObject2(
unsigned int parentObjectID,
const QString &objectName, QSharedPointer<unsigned int> objectID,
ItomSharedSemaphore *semaphore = NULL);
468 RetVal getChildObject3(
unsigned int parentObjectID,
const QString &objectName, QSharedPointer<unsigned int> objectID, QSharedPointer<QByteArray> widgetClassName,
ItomSharedSemaphore *semaphore = NULL);
469 RetVal getLayout(
unsigned int objectID, QSharedPointer<unsigned int> layoutObjectID, QSharedPointer<QByteArray> layoutClassName, QSharedPointer<QString> layoutObjectName,
ItomSharedSemaphore *semaphore = NULL);
470 RetVal getSignalIndex(
unsigned int objectID,
const QByteArray &signalSignature, QSharedPointer<int> signalIndex, QSharedPointer<QObject*> objPtr, QSharedPointer<IntList> argTypes,
ItomSharedSemaphore *semaphore = NULL);
471 RetVal callSlotOrMethod(
bool slotNotMethod,
unsigned int objectID,
int slotOrMethodIndex, QSharedPointer<FctCallParamContainer> args,
ItomSharedSemaphore *semaphore = NULL);
473 RetVal getObjectInfo(
const QString &classname,
bool pythonNotCStyle, ito::UiOrganizer::ClassInfoContainerList *objectInfo,
ItomSharedSemaphore *semaphore = NULL);
474 RetVal getObjectInfo(
const QObject *obj,
int type,
bool pythonNotCStyle, ito::UiOrganizer::ClassInfoContainerList* objectInfo,
ItomSharedSemaphore *semaphore = NULL);
476 inline RetVal getObjectInfo(
unsigned int objectID,
int type,
bool pythonNotCStyle, ito::UiOrganizer::ClassInfoContainerList *objectInfo,
ItomSharedSemaphore *semaphore = NULL)
478 return getObjectInfo(getWeakObjectReference(objectID), type, pythonNotCStyle, objectInfo, semaphore);
481 RetVal getObjectAndWidgetName(
unsigned int objectID, QSharedPointer<QByteArray> objectName, QSharedPointer<QByteArray> widgetClassName,
ItomSharedSemaphore *semaphore = NULL);
482 RetVal getObjectChildrenInfo(
unsigned int objectID,
bool recursive, QSharedPointer<QStringList> objectNames, QSharedPointer<QStringList> classNames,
ItomSharedSemaphore *semaphore = NULL);
486 RetVal connectWithKeyboardInterrupt(
unsigned int objectID,
const QByteArray &signalSignature,
ItomSharedSemaphore *semaphore = NULL);
487 RetVal connectProgressObserverInterrupt(
unsigned int objectID,
const QByteArray &signalSignature, QPointer<QObject> progressObserver,
ItomSharedSemaphore *semaphore = NULL);
488 RetVal getMethodDescriptions(
unsigned int objectID, QSharedPointer<MethodDescriptionList> methodList,
ItomSharedSemaphore *semaphore = NULL);
490 RetVal createFigure(QSharedPointer< QSharedPointer<unsigned int> > guardedFigureHandle, QSharedPointer<unsigned int> objectID, QSharedPointer<int> rows, QSharedPointer<int> cols, QPoint offset = QPoint(), QSize size = QSize(),
ItomSharedSemaphore *semaphore = NULL);
491 RetVal getSubplot(QSharedPointer<unsigned int> figHandle,
unsigned int subplotIndex, QSharedPointer<unsigned int> objectID, QSharedPointer<QByteArray> objectName, QSharedPointer<QByteArray> widgetClassName,
ItomSharedSemaphore *semaphore = NULL);
494 RetVal figureLiveImage(
AddInDataIO* dataIO, QSharedPointer<unsigned int> figHandle, QSharedPointer<unsigned int> objectID,
int areaRow,
int areaCol, QString className, QVariantMap properties,
ItomSharedSemaphore *semaphore = NULL);
495 RetVal figureDesignerWidget(QSharedPointer<unsigned int> figHandle, QSharedPointer<unsigned int> objectID,
int areaRow,
int areaCol, QString className, QVariantMap properties,
ItomSharedSemaphore *semaphore = NULL);
502 RetVal figurePickPoints(
unsigned int objectID, QSharedPointer<QVector<ito::Shape> > shapes,
int maxNrPoints,
ItomSharedSemaphore *semaphore);
503 RetVal figureDrawGeometricShapes(
unsigned int objectID, QSharedPointer<QVector<ito::Shape> > shapes,
int shapeType,
int maxNrElements,
ItomSharedSemaphore *semaphore);
504 RetVal figurePickPointsInterrupt(
unsigned int objectID);
507 RetVal getPlotWindowTitlebyHandle(
const unsigned int& objectID, QSharedPointer<QString> title,
ItomSharedSemaphore * semaphore = NULL);
509 RetVal connectWidgetsToProgressObserver(
bool hasProgressBar,
unsigned int progressBarObjectID,
bool hasLabel,
unsigned int labelObjectID, QSharedPointer<ito::FunctionCancellationAndObserver> progressObserver,
ItomSharedSemaphore *semaphore);
517 void figureDestroyed(QObject *obj);
520 void watcherThreadFinished();