Example #1
0
void SystemUser::write(QJsonObject &jsonObject) const {
    jsonObject["ID"] = static_cast<qint64>(id());
    jsonObject["USERNAME"] = mUsername;
    jsonObject["PASSWORD"] = mPassword;
    jsonObject["FIRST_NAME"] = mFirstName;
    jsonObject["LAST_NAME"] = mLastName;
    jsonObject["EMAIL"] = mEmail;
    jsonObject["ROLE"] = roleToString(mRole);
}
JSStringRef AccessibilityUIElement::role()
{
    AtkRole role = atk_object_get_role(ATK_OBJECT(m_element));
    if (!role)
        return JSStringCreateWithCharacters(0, 0);

    String roleString = roleToString(role);
    return JSStringCreateWithUTF8CString(roleString.utf8().data());
}
Example #3
0
QVariantMap SystemUser::toVariantMap() const {
    auto retVal = Entity::toVariantMap();
    retVal.insert("USERNAME", mUsername);
    retVal.insert("PASSWORD", mPassword);
    retVal.insert("FIRST_NAME", mFirstName);
    retVal.insert("LAST_NAME", mLastName);
    retVal.insert("EMAIL", mEmail);
    retVal.insert("ROLE", roleToString(mRole));

    return retVal;
}
JSRetainPtr<JSStringRef> AccessibilityUIElement::role()
{
    if (!ATK_IS_OBJECT(m_element.get()))
        return JSStringCreateWithCharacters(0, 0);

    AtkRole role = atk_object_get_role(ATK_OBJECT(m_element.get()));
    if (!role)
        return JSStringCreateWithCharacters(0, 0);

    GOwnPtr<char> roleStringWithPrefix(g_strdup_printf("AXRole: %s", roleToString(role)));
    return JSStringCreateWithUTF8CString(roleStringWithPrefix.get());
}
Example #5
0
JSRetainPtr<JSStringRef> AccessibilityUIElement::role()
{
    if (!m_element || !ATK_IS_OBJECT(m_element.get()))
        return JSStringCreateWithCharacters(0, 0);

    AtkRole role = atk_object_get_role(ATK_OBJECT(m_element.get()));
    if (!role)
        return JSStringCreateWithCharacters(0, 0);

    GOwnPtr<gchar> axRole(g_strdup(roleToString(role)));
    return JSStringCreateWithUTF8CString(axRole.get());
}
void BrainCloudGroup::approveGroupJoinRequest(const char * in_groupId, const char * in_profileId, eGroupMember::Role role, const std::string& in_jsonAttributes, IServerCallback * in_callback)
{
    Json::Value message;
    message[OperationParam::GroupId.getValue()] = in_groupId;
    message[OperationParam::GroupProfileId.getValue()] = in_profileId;
    if (role != eGroupMember::UNKNOWN)
        message[OperationParam::GroupRole.getValue()] = roleToString(role);
    if (StringUtil::IsOptionalParameterValid(in_jsonAttributes))
        message[OperationParam::GroupAttributes.getValue()] = JsonUtil::jsonStringToValue(in_jsonAttributes);

    ServerCall * sc = new ServerCall(ServiceName::Group, ServiceOperation::ApproveGroupJoinRequest, message, in_callback);
    m_client->getBrainCloudComms()->addToQueue(sc);
}
Example #7
0
static String attributesOfElement(AccessibilityUIElement* element)
{
    StringBuilder builder;

    builder.append(String::format("%s\n", element->role()->string().utf8().data()));

    // For the parent we print its role and its name, if available.
    builder.append("AXParent: ");
    AccessibilityUIElement parent = element->parentElement();
    if (AtkObject* atkParent = parent.platformUIElement()) {
        builder.append(roleToString(atk_object_get_role(atkParent)));
        const char* parentName = atk_object_get_name(atkParent);
        if (parentName && g_utf8_strlen(parentName, -1))
            builder.append(String::format(": %s", parentName));
    } else
        builder.append("(null)");
    builder.append("\n");

    builder.append(String::format("AXChildren: %d\n", element->childrenCount()));
    builder.append(String::format("AXPosition: { %f, %f }\n", element->x(), element->y()));
    builder.append(String::format("AXSize: { %f, %f }\n", element->width(), element->height()));

    String title = element->title()->string();
    if (!title.isEmpty())
        builder.append(String::format("%s\n", title.utf8().data()));

    String description = element->description()->string();
    if (!description.isEmpty())
        builder.append(String::format("%s\n", description.utf8().data()));

    String value = element->stringValue()->string();
    if (!value.isEmpty())
        builder.append(String::format("%s\n", value.utf8().data()));

    builder.append(String::format("AXFocusable: %d\n", element->isFocusable()));
    builder.append(String::format("AXFocused: %d\n", element->isFocused()));
    builder.append(String::format("AXSelectable: %d\n", element->isSelectable()));
    builder.append(String::format("AXSelected: %d\n", element->isSelected()));
    builder.append(String::format("AXMultiSelectable: %d\n", element->isMultiSelectable()));
    builder.append(String::format("AXEnabled: %d\n", element->isEnabled()));
    builder.append(String::format("AXExpanded: %d\n", element->isExpanded()));
    builder.append(String::format("AXRequired: %d\n", element->isRequired()));
    builder.append(String::format("AXChecked: %d\n", element->isChecked()));

    // We append the ATK specific attributes as a single line at the end.
    builder.append("AXPlatformAttributes: ");
    builder.append(getAtkAttributeSetAsString(element->platformUIElement()));

    return builder.toString();
}
Example #8
0
QSqlQuery SystemUser::insertQuery(const QSqlDatabase &database,
                                  const SystemUser &user) {
    QSqlQuery query(database);
    query.prepare("INSERT INTO SYSTEM_USER (USERNAME, PASSWORD, FIRST_NAME, "
                  "LAST_NAME, EMAIL, ROLE) VALUES (:username, :password, "
                  ":first_name, :last_name, :email, :role) RETURNING ID");
    query.bindValue(":username", user.username());
    query.bindValue(":password", user.password());
    query.bindValue(":first_name", user.firstName());
    query.bindValue(":last_name", user.lastName());
    query.bindValue(":email", user.email());
    query.bindValue(":role", roleToString(user.role()));
    return query;
}
Example #9
0
QSqlQuery SystemUser::updateQuery(const QSqlDatabase &database,
                                  const SystemUser &user) {
    QSqlQuery query(database);
    query.prepare("UPDATE SYSTEM_USER SET USERNAME = :username, PASSWORD = "******":password, FIRST_NAME = :first_name, LAST_NAME = "
                  ":last_name, EMAIL = :email, ROLE = :role WHERE ID = :id");
    query.bindValue(":id", user.id());
    query.bindValue(":username", user.username());
    query.bindValue(":password", user.password());
    query.bindValue(":first_name", user.firstName());
    query.bindValue(":last_name", user.lastName());
    query.bindValue(":email", user.email());
    query.bindValue(":role", roleToString(user.role()));
    return query;
}
Example #10
0
QVariant SystemUser::value(const QString &property) const {
    if (property == "USERNAME") {
        return mUsername;
    } else if (property == "PASSWORD") {
        return mPassword;
    } else if (property == "FIRST_NAME") {
        return mFirstName;
    } else if (property == "LAST_NAME") {
        return mLastName;
    } else if (property == "EMAIL") {
        return mEmail;
    } else if (property == "ROLE") {
        return roleToString(mRole);
    }

    return Entity::value(property);
}