ArnLib  4.0.x
Active Registry Network
ArnQml.cpp
Go to the documentation of this file.
1 // Copyright (C) 2010-2022 Michael Wiklund.
2 // All rights reserved.
3 // Contact: arnlib@wiklunden.se
4 //
5 // This file is part of the ArnLib - Active Registry Network.
6 // Parts of ArnLib depend on Qt and/or other libraries that have their own
7 // licenses. Usage of these other libraries is subject to their respective
8 // license agreements.
9 //
10 // GNU Lesser General Public License Usage
11 // This file may be used under the terms of the GNU Lesser General Public
12 // License version 2.1 as published by the Free Software Foundation and
13 // appearing in the file LICENSE_LGPL.txt included in the packaging of this
14 // file. In addition, as a special exception, you may use the rights described
15 // in the Nokia Qt LGPL Exception version 1.1, included in the file
16 // LGPL_EXCEPTION.txt in this package.
17 //
18 // GNU General Public License Usage
19 // Alternatively, this file may be used under the terms of the GNU General Public
20 // License version 3.0 as published by the Free Software Foundation and appearing
21 // in the file LICENSE_GPL.txt included in the packaging of this file.
22 //
23 // Other Usage
24 // Alternatively, this file may be used in accordance with the terms and conditions
25 // contained in a signed written agreement between you and Michael Wiklund.
26 //
27 // This program is distributed in the hope that it will be useful, but WITHOUT ANY
28 // WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
29 // PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
30 //
31 
32 #include "ArnInc/ArnQml.hpp"
33 #include "ArnInc/ArnQmlMSystem.hpp"
34 #include "ArnInc/ArnQmlMQt.hpp"
35 #include "ArnInc/ArnInterface.hpp"
36 #include "ArnInc/ArnM.hpp"
37 #include "ArnInc/ArnLib.hpp"
38 #include "ArnInc/XStringMap.hpp"
39 #include "ArnInc/MQFlags.hpp"
40 #include <QTimerEvent>
41 #include <QThread>
42 #include <QDebug>
43 
44 using namespace Arn;
45 
46 
47 ArnQml::ArnQml()
48  : QObject( arnNullptr)
49 {
50  _arnRootPath = "/";
51  _arnNetworkAccessManagerFactory = new ArnNetworkAccessManagerFactory;
52 }
53 
54 ArnQml::~ArnQml()
55 {
56  delete _arnNetworkAccessManagerFactory;
57 }
58 
59 
61 {
62  return instance()._arnRootPath;
63 }
64 
65 
66 void ArnQml::setArnRootPath( const QString& path)
67 {
68  instance()._arnRootPath = path;
69 }
70 
71 
72 QObject* ArnQml::constructorArnInterface( QML_ENGINE* engine, QJSEngine* scriptEngine)
73 {
74  Q_UNUSED(engine)
75  Q_UNUSED(scriptEngine)
76 
77  ArnInterface *arnIterface = new ArnInterface();
78  return arnIterface;
79 }
80 
81 
82 void ArnQml::setup( QML_ENGINE* qmlEngine, ArnQml::UseFlags flags)
83 {
84  ArnQml& in = ArnQml::instance();
85  flags.set( flags.ArnLib); // Always include ArnLib
86 
87  if (flags.is( flags.ArnLib) && !in._regedUse.is( flags.ArnLib)) {
88  in._regedUse.set( flags.ArnLib);
89  qmlRegisterType<ArnItemQml>( "ArnLib", 1, 0, "ArnItem");
90  qmlRegisterType<ArnMonitorQml>("ArnLib", 1, 0, "ArnMonitor");
91  qmlRegisterType<ArnSapiQml>( "ArnLib", 1, 0, "ArnSapi");
92  qmlRegisterType<XStringMapQml>("ArnLib", 1, 0, "XStringMap");
93 #ifdef QML_Qt4
94  qmlRegisterType<ArnInterface>( "ArnLib", 1, 0, "Arn");
95 #else
96  qmlRegisterSingletonType<ArnInterface>("ArnLib", 1, 0, "Arn", constructorArnInterface);
97 #endif
98  }
99  if (flags.is( flags.MSystem) && !in._regedUse.is( flags.MSystem)) {
100  in._regedUse.set( flags.MSystem);
101  qmlRegisterType<QmlMFileIO>("MSystem", 1, 0, "MFileIO");
102  }
103  if (flags.is( flags.MQt) && !in._regedUse.is( flags.MQt)) {
104  in._regedUse.set( flags.MQt);
105  qmlRegisterType<QmlMQtObject>("MQtQml", 1, 0, "MQtObject");
106  }
107 
108  if (qmlEngine) {
109  qmlEngine->setNetworkAccessManagerFactory( in._arnNetworkAccessManagerFactory);
110 
111  // For compatibility to Qt4 QML
112  qmlEngine->rootContext()->setContextProperty("arn", new ArnInterface( qmlEngine));
113 
114  qmlEngine->rootContext()->setContextProperty("mSys", new QmlMSys( qmlEngine));
115  }
116 }
117 
118 
120 {
121  static ArnQml ins;
122 
123  return ins;
124 }
125 
126 
128 
129 ArnItemQml::ArnItemQml( QObject* parent)
130  : ArnItem( parent)
131 {
132  _isCompleted = false;
133  _useUuid = false;
134 
135  setIgnoreSameValue( true);
136 }
137 
138 
139 QString ArnItemQml::variantType() const
140 {
141  if (!_variantType) return QString();
142 
143  const char* typeName = QMetaType::typeName(_variantType);
144  if (!typeName) return QString();
145 
146  return typeName;
147 }
148 
149 
150 void ArnItemQml::setVariantType( const QString& typeName)
151 {
152  if (typeName.isEmpty()) {
153  _variantType = 0;
154  }
155  else {
156  int type = QMetaType::type( typeName.toLatin1().constData());
157  if (!type) {
158  qWarning() << "ItemQml setVariantType, Unknown: type=" + typeName + " path=" + path();
159  return;
160  }
161 
162  _variantType = type;
163  }
164 
165  emit variantTypeChanged();
166 }
167 
168 
169 QString ArnItemQml::path() const
170 {
171  return _path;
172 }
173 
174 
175 void ArnItemQml::setPath( const QString& path)
176 {
177  _path = path;
178  if (_isCompleted) {
179  QString arnPath = Arn::changeBasePath("/", ArnQml::arnRootPath(), path);
180  if (_useUuid)
181  openUuid( arnPath);
182  else
183  open( arnPath);
184 
185  if (ArnItem::type() != Arn::DataType::Null) // Value already present ...
186  emit valueChanged();
187  }
188 
189  emit pathChanged();
190 }
191 
192 
193 void ArnItemQml::setVariant( const QVariant& value)
194 {
195  if (!_variantType) // No variantType, no conversion
196  ArnItem::setValue( value);
197  else { // Use variantType
198  QVariant val = value;
199  if (val.convert( QVariant::Type( _variantType))) {
200  ArnItem::setValue( val);
201  }
202  else {
203  qWarning() << "ItemQml setVariant, Can't convert: type="
204  << _variantType << " path=" + path();
205  }
206  }
207 }
208 
209 
210 void ArnItemQml::setBiDirMode( bool isBiDirMode)
211 {
212  if (isBiDirMode)
214 }
215 
216 
217 void ArnItemQml::setPipeMode( bool isPipeMode)
218 {
219  if (isPipeMode)
221 }
222 
223 
224 void ArnItemQml::setMaster( bool isMaster)
225 {
226  if (isMaster)
228 }
229 
230 
231 void ArnItemQml::setAutoDestroy( bool isAutoDestroy)
232 {
233  if (isAutoDestroy)
235 }
236 
237 
238 void ArnItemQml::setSaveMode( bool isSaveMode)
239 {
240  if (isSaveMode)
242 }
243 
244 
245 void ArnItemQml::setAtomicOpProvider( bool isAtomicOpPv)
246 {
247  if (isAtomicOpPv)
249 }
250 
251 
252 bool ArnItemQml::useUuid() const
253 {
254  return _useUuid;
255 }
256 
257 
258 void ArnItemQml::setUseUuid( bool useUuid)
259 {
260  _useUuid = useUuid;
261 }
262 
263 
264 void ArnItemQml::classBegin()
265 {
266 }
267 
268 
269 void ArnItemQml::componentComplete()
270 {
271  _isCompleted = true;
272  if (!_path.isEmpty())
273  setPath( _path);
274 }
275 
276 
277 void ArnItemQml::itemUpdated( const ArnLinkHandle& handleData, const QByteArray* value)
278 {
279  ArnItem::itemUpdated( handleData, value);
280 
281  if (delayTimerId() == 0) // No delay timer used
282  emit valueChanged();
283 }
284 
285 
286 void ArnItemQml::itemCreatedBelow( const QString& path)
287 {
288  QString qmlPath = Arn::changeBasePath( ArnQml::arnRootPath(), "/", path);
289  emit arnItemCreated( qmlPath);
290 }
291 
292 
293 void ArnItemQml::itemModeChangedBelow( const QString& path, uint linkId, ObjectMode mode)
294 {
295  QString qmlPath = Arn::changeBasePath( ArnQml::arnRootPath(), "/", path);
296  emit arnModeChanged( qmlPath, linkId, mode);
297 }
298 
299 
300 void ArnItemQml::timerEvent( QTimerEvent* ev)
301 {
302  if (ev->timerId() == delayTimerId()) {
303  // qDebug() << "ArnItemQml delay doUpdate: path=" << path();
304  emit valueChanged();
305  }
306 
307  return ArnItem::timerEvent( ev);
308 }
309 
310 
312 
313 ArnMonitorQml::ArnMonitorQml( QObject* parent)
314  : ArnMonitor( parent)
315 {
316  _isCompleted = false;
317 }
318 
319 
321 {
323 }
324 
325 
326 void ArnMonitorQml::setClientId( const QString& id)
327 {
328  _clientId = id;
329  setClient( id);
330 }
331 
332 
333 QString ArnMonitorQml::clientId() const
334 {
335  return _clientId;
336 }
337 
338 
339 void ArnMonitorQml::setMonitorPath( const QString& path)
340 {
341  _path = path;
342  if (_isCompleted) {
343  this->start( path);
344  }
345 
346  emit pathChanged();
347 }
348 
349 
350 QString ArnMonitorQml::monitorPath() const
351 {
352  return _path;
353 }
354 
355 
356 void ArnMonitorQml::classBegin()
357 {
358 }
359 
360 
361 void ArnMonitorQml::componentComplete()
362 {
363  _isCompleted = true;
364  if (!_path.isEmpty())
365  setMonitorPath( _path);
366 }
367 
368 
369 QString ArnMonitorQml::outPathConvert(const QString& path)
370 {
372 }
373 
374 
375 QString ArnMonitorQml::inPathConvert(const QString& path)
376 {
378 }
379 
380 
382 
383 ArnSapiQml::ArnSapiQml( QObject* parent)
384  : ArnRpc( parent)
385 {
386  _isCompleted = false;
387  _providerPrefix = "pv_";
388  _requesterPrefix = "rq_";
389 }
390 
391 
392 void ArnSapiQml::setPipePath( const QString& path)
393 {
394  _path = path;
395 
396  if (_isCompleted) {
397  setConvVariantPar( true);
398  if (!receiver())
399  ArnRpc::setReceiver( this->parent(), false);
400 
401  QString receivePrefix;
403  receivePrefix = _providerPrefix;
404  _sendPrefix = _requesterPrefix;
405  }
406  else {
407  receivePrefix = _requesterPrefix;
408  _sendPrefix = _providerPrefix;
409  }
410  ArnRpc::setMethodPrefix( receivePrefix);
412 
413  QString arnPath = Arn::changeBasePath("/", ArnQml::arnRootPath(), path);
414  open( arnPath);
415  }
416 
417  emit pathChanged();
418 }
419 
420 
421 QString ArnSapiQml::pipePath() const
422 {
423  return _path;
424 }
425 
426 
427 void ArnSapiQml::classBegin()
428 {
429 }
430 
431 
432 void ArnSapiQml::componentComplete()
433 {
434  _isCompleted = true;
435  if (!_path.isEmpty())
436  setPipePath( _path);
437 }
438 
439 
440 
442 
443 XStringMapQml::XStringMapQml( QObject* parent)
444  : QObject( parent)
445 {
446  _isCompleted = false;
447 }
448 
449 
450 QObject* XStringMapQml::add( QObject* other)
451 {
452  XStringMapQml* xstringMapQml = qobject_cast<XStringMapQml*>( other);
453  if (xstringMapQml) {
454  XStringMap::add( *xstringMapQml);
455  }
456  return this;
457 }
458 
459 
460 void XStringMapQml::classBegin()
461 {
462 }
463 
464 
465 void XStringMapQml::componentComplete()
466 {
467  _isCompleted = true;
468 }
469 
470 
471 
473 
474 namespace Arn {
475 
476 QVariantMap QmlMSys::xstringToEnum( const QString& xstring)
477 {
478  EnumTxt etxt;
479  XStringMap xsm;
480  QVariantMap retMap;
481 
482  etxt.loadBitSet( xstring);
484  etxt.addSubEnumPlainTo( xsm, 0, true);
485 
487  for (int i = 0; i < xsm.size(); ++i) {
488  int enumValue = 0;
489  QByteArray key = xsm.key(i);
490  bool isOk = true;
491  uchar bitPos = EnumTxt::strToBitpos( key, &isOk);
492  if (isOk) {
493  enumValue = 1 << bitPos;
494  }
495  else {
496  enumValue = EnumTxt::strToNum( key, &isOk);
497  }
498  if (!isOk) continue;
499 
500  QString enumerator = xsm.valueString(i);
501  retMap.insert( enumerator, QVariant( enumValue ) );
502  }
503  return retMap;
504 }
505 
506 
507 QmlMSys::QmlMSys( QObject* parent)
508  : QObject( parent)
509 {
510 }
511 
512 
514 {
515  return QML_QUICK_TYPE;
516 }
517 
518 }
519 
520 
522 
523 ArnNetworkReply::ArnNetworkReply( QObject* parent)
524  : QNetworkReply( parent)
525 {
526  _readPos = 0;
527  _isFinished = false;
528 }
529 
530 
531 bool ArnNetworkReply::isFinished() const
532 {
533  return _isFinished;
534 }
535 
536 
537 qint64 ArnNetworkReply::bytesAvailable() const
538 {
539  return QNetworkReply::bytesAvailable() + _data.size() - _readPos;
540 }
541 
542 
543 bool ArnNetworkReply::isSequential() const
544 {
545  return true;
546 }
547 
548 
549 qint64 ArnNetworkReply::size() const
550 {
551  return _data.size();
552 }
553 
554 
555 qint64 ArnNetworkReply::readData( char* data, qint64 maxlen)
556 {
557  int len = qMin( _data.size() - _readPos, int(maxlen));
558  if (len > 0) {
559  memcpy( data, _data.constData() + _readPos, size_t( len));
560  _readPos += len;
561  }
562 
563  if ((len == 0) && (bytesAvailable() == 0)) {
564  return -1; // Everything has been read
565  }
566 
567  return len;
568 }
569 
570 
571 void ArnNetworkReply::abort()
572 {
573  close();
574 }
575 
576 
577 QByteArray ArnNetworkReply::data() const
578 {
579  return _data;
580 }
581 
582 
583 void ArnNetworkReply::setup( const QString& path)
584 {
585  _arnPath = path;
586  _isFinished = false;
587 
588  QByteArray arnVal;
589  if (path.endsWith("/qmldir"))
590  arnVal = "";
591  else {
593  if (Arn::debugQmlNetwork) qDebug() << "ArnQmlNetw. reply setup later path="
594  << path;
595  QMetaObject::invokeMethod( this, "postSetup", Qt::QueuedConnection);
596  return;
597  }
598 
600  if (Arn::debugQmlNetwork) qDebug() << "ArnQmlNetw. reply setup now path="
601  << path;
602  setData( arnVal);
603 }
604 
605 
606 void ArnNetworkReply::postSetup()
607 {
608  if (Arn::debugQmlNetwork) qDebug() << "ArnQmlNetw. reply postSetup path="
609  << _arnPath;
610  bool wasLocalExist = ArnM::exist( _arnPath);
611  if (Arn::debugQmlNetwork) qDebug() << "ArnQmlNetw. reply postSetup 2";
612 
613  _arnItem.open( _arnPath);
614  if (Arn::debugQmlNetwork) qDebug() << "ArnQmlNetw. reply postSetup 3";
615 
616  if (!wasLocalExist && (_arnItem.type() == Arn::DataType::Null)) {
617  // Note: Open can have resulted in a persistent loading of the item.
618  if (Arn::debugQmlNetwork) qDebug() << "ArnQmlNetw. wait for data: path=" << _arnPath;
619  connect( &_arnItem, SIGNAL(changed()), this, SLOT(dataArived()));
620  return;
621  }
622 
623  if (Arn::debugQmlNetwork) qDebug() << "ArnQmlNetw. direct using data: path=" << _arnPath;
624  setData( _arnItem.toByteArray());
625 }
626 
627 
628 void ArnNetworkReply::dataArived()
629 {
630  disconnect( &_arnItem, SIGNAL(changed()), this, SLOT(dataArived()));
631 
632  if (Arn::debugQmlNetwork) qDebug() << "ArnQmlNetw. data arived: path=" << _arnPath;
633  setData( _arnItem.toByteArray());
634 }
635 
636 
637 void ArnNetworkReply::setData( const QByteArray& data)
638 {
639  _data = data;
640  _readPos = 0;
641  _isFinished = true;
642  open( ReadOnly);
643 
644 #ifndef QML_Qt4
645  int posStart = _data.indexOf("import QtQuick 1.");
646  if (posStart >= 0) {
647  int posEnd = _data.indexOf('\n', posStart);
648  if (posEnd >= 0) {
649  _data.replace( posStart, posEnd - posStart, "import QtQuick 2.3");
650  }
651  }
652 #endif
653 
654  QMetaObject::invokeMethod (this, "downloadProgress", Qt::QueuedConnection,
655  Q_ARG( qint64, _data.size()),
656  Q_ARG( qint64, _data.size()));
657  QMetaObject::invokeMethod( this, "readyRead", Qt::QueuedConnection);
658  QMetaObject::invokeMethod( this, "finished", Qt::QueuedConnection);
659 }
660 
661 
662 
664 
665 ArnNetworkAccessManager::ArnNetworkAccessManager( QObject* parent)
666  : QNetworkAccessManager( parent)
667 {
668 }
669 
670 
671 QNetworkReply* ArnNetworkAccessManager::createRequest( QNetworkAccessManager::Operation op,
672  const QNetworkRequest& request,
673  QIODevice* outgoingData)
674 {
675  QUrl url = request.url();
676  if (url.scheme() != "arn")
677  return QNetworkAccessManager::createRequest( op, request, outgoingData);
678 
679  if (Arn::debugQmlNetwork) qDebug() << "ArnQmlNetw. Create request url="
680  << url.toString();
681  ArnNetworkReply* reply = new ArnNetworkReply;
682  // QNetworkRequest mRequest = request;
683  // mRequest.setAttribute( QNetworkRequest::CacheSaveControlAttribute, false);
684  // mRequest.setAttribute( QNetworkRequest::CacheLoadControlAttribute, QNetworkRequest::AlwaysNetwork);
685  reply->setRequest( request);
686  reply->setOperation( op);
687  reply->setUrl( url);
688 
689  switch (op) {
690  case GetOperation:
691  {
692  QString path = url.path();
693  QString arnPath = Arn::changeBasePath("/", ArnQml::arnRootPath(), path);
694  arnPath = Arn::convertPath( arnPath, Arn::NameF::EmptyOk);
695  reply->setup( arnPath);
696  break;
697  }
698  default:
699  qWarning() << "ArnNetworkAccessManager: Operation not supported op=" << op;
700  break;
701  }
702 
703  return reply;
704 }
705 
706 
708 
709 QNetworkAccessManager* ArnNetworkAccessManagerFactory::create( QObject* parent)
710 {
711  return new ArnNetworkAccessManager( parent);
712 }
void setMethodPrefix(const QString &prefix)
Definition: ArnRpc.cpp:337
Mode mode() const
Get the mode.
Definition: ArnRpc.cpp:386
static uchar strToBitpos(const QByteArray &str, bool *isOk=arnNullptr)
Definition: MQFlags.cpp:765
void addSubEnumPlainTo(Arn::XStringMap &xsm, quint16 nameSpace=0, bool neverHumanize=false) const
Adds all sub enum plain and shifted to a XStringMap.
Definition: MQFlags.cpp:281
void reStart()
The monitor is restarted.
Definition: ArnMonitor.cpp:222
bool setReceiver(QObject *receiver, bool useTrackRpcSender=true)
Definition: ArnRpc.cpp:300
void setValue(const ArnItem &other, int ignoreSame=Arn::SameValue::DefaultAction)
Assign the value of an other ArnItem to an Arn Data Object
Definition: ArnItem.hpp:440
static ArnQml & instance()
Definition: ArnQml.cpp:119
ArnItem & setAutoDestroy()
Set client session sync mode as AutoDestroy for this ArnItem.
Definition: ArnItem.hpp:258
void addSenderSignals(QObject *sender, const QString &prefix)
Definition: ArnRpc.cpp:440
bool isMaster() const
Definition: ArnItem.hpp:251
static void setup(QML_ENGINE *qmlEngine, UseFlags flags=UseFlags::ArnLib)
Add ArnLib support to a Qml instance.
Definition: ArnQml.cpp:82
Path: "/@/test" ==> "//test", Item: "@" ==> "".
Definition: Arn.hpp:189
ArnItem & setPipeMode()
Set general mode as Pipe for this Arn Data Object
Definition: ArnItem.hpp:211
QString path
The path of this ArnItem.
Definition: ArnQml.hpp:301
Class Enum text.
Definition: MQFlags.hpp:212
static bool exist(const QString &path)
Definition: ArnM.cpp:402
Container class with string representation for serialized data.
Definition: XStringMap.hpp:107
void setMonitorPath(const QString &path, ArnClient *client=arnNullptr)
Set the path to be monitored.
Definition: ArnMonitor.cpp:134
Arn::DataType type() const
The type stored in the Arn Data Object
Definition: ArnItem.hpp:135
void setClient(ArnClient *client)
Set the client to be used.
Definition: ArnMonitor.cpp:101
int quickTypeRun
Definition: ArnQml.hpp:739
bool useUuid
Select to use ArnItem::openUuid()
Definition: ArnQml.hpp:299
bool debugQmlNetwork
Definition: ArnLib.cpp:47
void addFlagsTo(Arn::XStringMap &xsm, const IncludeMode &incMode, quint16 nameSpace=0, bool neverHumanize=false) const
Adds enum flags to a XStringMap.
Definition: MQFlags.cpp:193
Note: ArnLib is always included.
Definition: ArnQml.hpp:190
QVariantMap xstringToEnum(const QString &xstring)
Definition: ArnQml.cpp:476
ArnItem & setMaster()
Set client session sync mode as Master for this ArnItem.
Definition: ArnItem.hpp:244
bool isBiDirMode() const
Definition: ArnItem.hpp:203
Remote Procedure Call.
Definition: ArnRpc.hpp:156
ArnItem & setBiDirMode()
Set general mode as Bidirectional for this Arn Data Object
Definition: ArnItem.hpp:195
QString monitorPath() const
Get the monitored path
Definition: ArnMonitor.cpp:214
void setAtomicOpProvider()
Set this Arn Data Object as Atomic Operator Provider
Include some system fuctions like file-io.
Definition: ArnQml.hpp:192
static QString arnRootPath()
Gives current ARN root path for all qml instances.
Definition: ArnQml.cpp:60
bool start(const QString &path, ArnClient *client)
Starts the monitoring.
Definition: ArnMonitor.cpp:142
bool isSaveMode() const
Definition: ArnItem.hpp:236
QString changeBasePath(const QString &oldBasePath, const QString &newBasePath, const QString &path)
Change the base (start) of a path.
Definition: Arn.cpp:114
bool open(const QString &path)
Open a handle to an Arn Data Object
Definition: ArnItemB.cpp:91
QObject * receiver() const
Definition: ArnRpc.cpp:329
Provider side (opposed to requester)
Definition: ArnRpc.hpp:91
Definition: Arn.cpp:43
QString convertPath(const QString &path, Arn::NameF nameF)
Convert a path to a specific format.
Definition: Arn.cpp:148
ArnItem & setSaveMode()
Set general mode as Save for this Arn Data Object
Definition: ArnItem.hpp:228
QString path(Arn::NameF nameF=Arn::NameF::EmptyOk) const
Path of the Arn Data Object
QString pipePath() const
Get the path for the used pipe
Definition: ArnRpc.cpp:226
bool loadBitSet(const Arn::XStringMap &xsm, const QString &name=QString())
Loads the instance by an bit set (flags) XStringMap.
Definition: MQFlags.cpp:625
void arnItemCreated(const QString &path)
Signal emitted when an Arn Data Object is created in the tree below.
QString valueString(int i, const QString &def=QString()) const
static void setArnRootPath(const QString &path)
Change ARN root path for all qml instances.
Definition: ArnQml.cpp:66
Include some Qt extensions like MQtObject.
Definition: ArnQml.hpp:194
QByteArray key(int i, const char *def=arnNullptr) const
#define QML_QUICK_TYPE
Definition: ArnQml.hpp:61
QString variantType
The type used inside the variant, e.g. QString.
Definition: ArnQml.hpp:297
bool isAutoDestroy() const
Definition: ArnItem.hpp:264
uint linkId() const
Get the id for this Arn Data Object
ARN QML.
Definition: ArnQml.hpp:183
bool isPipeMode() const
Definition: ArnItem.hpp:219
#define QML_ENGINE
Definition: ArnQml.hpp:62
XStringMap & add(const char *key, const QByteArray &val)
static uint strToNum(const QByteArray &str, bool *isOk=arnNullptr)
Definition: MQFlags.cpp:754
void reStart()
Restart the monitor.
Definition: ArnQml.cpp:320
int size() const
Definition: XStringMap.hpp:121
void arnModeChanged(const QString &path, uint linkId, Arn::ObjectMode mode)
Signal emitted when an Arn Data Object in the tree below has a general mode change.
bool open(const QString &pipePath)
Definition: ArnRpc.cpp:236
A client remote monitor to detect changes at server.
Definition: ArnMonitor.hpp:65
QString clientId() const
Get the id name of the used client
Definition: ArnMonitor.cpp:117
Handle for an Arn Data Object.
Definition: ArnItem.hpp:72
bool openUuid(const QString &path)
Open a handle to an Arn Object with a unique uuid name.
Definition: ArnItem.hpp:103