WARNING: USE THIS SOFTWARE AT YOUR OWN RISK! THIS IS EXPERIMENTAL SOFTWARE NOT INTENDED FOR PRODUCTION USE! Zuble is currently an early stage prototype. As such Zuble is minimally tested and inherently unstable. It is provided for experimental, development, and demonstration purposes only. Zuble QML Types   |  Zuble C++ Classes   |  Zuble Overview
Zuble  0.1
Zuble Framework C++/QML extension API
ZApplication.h
Go to the documentation of this file.
1 /*
2  * Zuble - A run-time system for QML/Javascript applications
3  * Copyright (C) 2013, 2014 Bob Dinitto
4  *
5  * ZApplication.h
6  *
7  * Created on: Feb 3, 2013
8  * Author: Bob Dinitto bob@ninzo.com
9  *
10  * Zuble is free software; you can redistribute it and/or
11  * modify it under the terms of the GNU Lesser General Public
12  * License as published by the Free Software Foundation; either
13  * version 2.1 of the License, or (at your option) any later version.
14  *
15  * This library is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18  * Lesser General Public License for more details.
19  *
20  * You should have received a copy of the GNU Lesser General Public
21  * License along with this library; if not, write to the Free Software
22  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
23  *
24 */
25 
26 
27 #ifndef ZAPPLICATION_H
28 #define ZAPPLICATION_H
29 
30 #include <QtQuick/QQuickView>
31 #include "zblcore_global.h"
32 #include "zglobal.h"
33 #include "ZblError.h"
34 #include "ZTextFeed.h"
35 #include "Zblcore.h"
36 
37 #define zApp (Zbl::Zblcore::zApplication())
38 
39 namespace Zbl
40 {
41 
42 class ZblApp;
43 
54 class ZBLCORESHARED_EXPORT ZApplication : public QObject
55 {
56  Q_OBJECT
57 
58 public:
59 
68  typedef enum zAppDataTag
69  {
76  appLibraryPath
77 
78  } appDataTag;
79 
80 
81 
86  ZApplication(QObject * parent = nullptr);
87 
88 
100  bool zInit();
101 
114  static QString resolvePath( const QString& path,
115  bool includeUrlScheme = true);
116 
131  static QString resolvePath(
132  const QString& prefix,
133  const QString& root,
134  const QString& path,
135  bool includeUrlScheme = true);
136 
137 
143  static QString getPathScheme(const QString& path);
144 
150  static QString removePathScheme(const QString& path);
151 
170  static bool hasPathScheme(const QString& path);
171 
172 
179  static QString getRootPath();
180 
187  static QString getMainQmlPath();
188 
196  static QString getDataPath();
197 
204  static QString getAppName();
205 
212  static QString getOrganization();
213 
219  static QString getCurrentThreadAddress();
220 
226  static QString getObjectThreadAddress(QObject* object);
227 
232  static void debugObjectThreadAddress(const char* label, QObject* obj);
233 
239  static void debugCompareThreadAddress(const char* label, QObject* obj);
240 
245  static void debugCurrentThreadAddress(const char* label);
246 
252  static void debugGuiThreadAddress(const char* label);
253 
260  void addThreadApp(ZblApp* appObject);
261 
268  void removeThreadApp(ZblApp* appObject);
269 
270 
271 
279  ZTextFeed& zStatus();
280 
303  Q_INVOKABLE QVariant getAppData(int tag);
304 
305 
306 
307 public slots:
308 
309 signals:
310 
317  void settingsBundleAvailable(QString bundleId);
318 
319 
320 
321 protected:
322 
331  bool initDefaultApplicationSettings();
332 
333 public:
334 
335 
340  static const QString m_appPathPrefix;
341 
346  static const QString m_homePathPrefix;
347 
352  static const QString m_dataPathPrefix;
353 
358  static const QString m_fileUrlPrefix;
359 
364  static const QString m_resourcePathPrefix;
365 
366 
367 private:
368 
369  static QList<ZblApp*> m_zappObjects;
370 
371 
384 
385  // constant strings for platform-independent persistent application settings
386 
391  static const QString m_defaultOrganization;
392 
397  static const QString m_defaultApplication;
398 
403  static const QString m_defaultSettingsID;
404 
409  static const QString m_defaultZubleAppSettings;
410 
411 
416  static const QString m_settingMetadataFileName;
417 
423  static const QString m_settingMetadataInitName;
424 
425 
426  //static const QString m_queryProlog;
427 
429 
430 };
431 
432 } // Zbl
433 
434 #endif // ZAPPLICATION_H
enum Zbl::ZApplication::zAppDataTag appDataTag
static const QString m_settingMetadataInitName
Name of default settings metadata file in user&#39;s home directory, created if no metadata file found in...
Definition: ZApplication.h:423
static const QString m_defaultSettingsID
The Zuble application settings application name.
Definition: ZApplication.h:403
#define ZBLCORESHARED_EXPORT
static ZTextFeed m_status
The main application status text feed.
Definition: ZApplication.h:383
#define ZBL_DECLARE_LOGGED_OBJECT
Definition: zglobal.h:94
static const QString m_settingMetadataFileName
Name of default settings metadata file in Zuble application directory.
Definition: ZApplication.h:416
This class provides a means of directing a text stream to listeners.
Definition: ZTextFeed.h:50
static const QString m_fileUrlPrefix
URL scheme used to specify local file location: "file://".
Definition: ZApplication.h:358
static const QString m_dataPathPrefix
URL scheme used to specify user&#39;s Zuble data directory location: "data://".
Definition: ZApplication.h:352
static const QString m_defaultApplication
The Zuble application default application name.
Definition: ZApplication.h:397
static const QString m_appPathPrefix
URL scheme used to specify Zuble app directory location: "zbl://".
Definition: ZApplication.h:340
static const QString m_resourcePathPrefix
URL scheme used to specify Qt binary resource location: "qrc://".
Definition: ZApplication.h:364
static const QString m_defaultOrganization
The Zuble application default organization name, "zuble".
Definition: ZApplication.h:391
static const QString m_homePathPrefix
URL scheme used to specify user&#39;s home directory location: "home://".
Definition: ZApplication.h:346
static const QString m_defaultZubleAppSettings
Settings metadata to use when no other settings data can be found.
Definition: ZApplication.h:409
Definition: ZAndGate.cpp:6
The primary QML API to the Zuble plugin library. Zuble applications access this object through the ja...
Definition: ZblApp.h:81
Zuble&#39;s Singleton Application Object.
Definition: ZApplication.h:54
static QList< ZblApp * > m_zappObjects
Definition: ZApplication.h:369