app.hpp Example File
invokeclient/src/app.hpp
#ifndef APP_HPP
#define APP_HPP
#include <bb/cascades/GroupDataModel>
#include <bb/system/CardDoneMessage>
#include <bb/system/InvokeManager>
#include <bb/system/SystemDialog.hpp>
#include <bb/cascades/Invocation>
#include <bb/cascades/InvokeQuery>
#include <QObject>
class App: public QObject {
Q_OBJECT
Q_PROPERTY(int targetType READ targetType WRITE setTargetType NOTIFY targetTypeChanged)
Q_PROPERTY(QString action READ action WRITE setAction NOTIFY actionChanged)
Q_PROPERTY(QString mimeType READ mimeType WRITE setMimeType NOTIFY mimeTypeChanged)
Q_PROPERTY(QString uri READ uri WRITE setUri NOTIFY uriChanged)
Q_PROPERTY(QString data READ data WRITE setData NOTIFY dataChanged)
Q_PROPERTY(QString target READ target WRITE setTarget NOTIFY targetChanged)
Q_PROPERTY(bb::cascades::GroupDataModel* model READ model CONSTANT)
Q_PROPERTY(QString errorMessage READ errorMessage NOTIFY errorMessageChanged)
Q_PROPERTY(QString statusMessage READ statusMessage NOTIFY statusMessageChanged)
public:
App(QObject *parent = 0);
public Q_SLOTS:
void invoke();
void query();
void platformInvoke();
void invokeTarget(const QString &target);
void clearError();
void showErrorDialog();
Q_SIGNALS:
void targetTypeChanged();
void actionChanged();
void mimeTypeChanged();
void uriChanged();
void dataChanged();
void targetChanged();
void errorMessageChanged();
void statusMessageChanged();
void queryFinished();
void closeQueryResults();
private Q_SLOTS:
void processInvokeReply();
void processQueryReply();
void peekStarted(bb::system::CardPeek::Type);
void peekEnded();
void childCardDone(const bb::system::CardDoneMessage&);
void onArmed();
private:
int targetType() const;
void setTargetType(int targetType);
QString action() const;
void setAction(const QString &action);
QString mimeType() const;
void setMimeType(const QString &mimeType);
QString uri() const;
void setUri(const QString &uri);
QString data() const;
void setData(const QString &data);
QString target() const;
void setTarget(const QString &target);
bb::cascades::GroupDataModel* model() const;
QString errorMessage() const;
QString statusMessage() const;
int m_targetType;
QString m_action;
QString m_mimeType;
QString m_uri;
QString m_data;
QString m_target;
bb::cascades::GroupDataModel* m_model;
QString m_errorMessage;
QString m_statusMessage;
bb::system::SystemDialog* m_dialog;
bb::system::InvokeManager* m_invokeManager;
bb::cascades::Invocation* m_invocation;
};
#endif