API Documentation

Documentation for developing SailfishOS applications

PolicyValue Class

(Sailfish::PolicyValue)

The PolicyValue class controls the value of a specific access policy. More...

Header: #include <policyvalue.h>
Instantiated By: PolicyValue

Public Types

enum PolicyType { Unknown, CameraEnabled, LocationSettingsEnabled, OsUpdatesEnabled, ..., BrowserEnabled }

Properties

Public Functions

PolicyValue(QObject *parent = 0)
virtual ~PolicyValue()
QString key() const
int policyType() const
void setKey(const QString &newKey)
void setPolicyType(int type)
bool setValue(const QVariant &value)
QVariant value() const

Signals

Static Public Members

bool enforcePolicy(int type, bool value)
bool enforcePolicy(const QString &key, bool value)
QVariant keyValue(const QString &key)
QVariant keyValue(int type)
bool setKeyValue(const QString &key, const QVariant &value)
bool setKeyValue(int type, const QVariant &value)

Detailed Description

The PolicyValue class controls the value of a specific access policy.

This is useful to the MDM application if it wants to "lock" the settings related to some subset of system functionality, so that some specific configuration is maintained.

Member Type Documentation

enum PolicyValue::PolicyType

Describes the available policy types for controlling access to various features.

ConstantValueDescription
Sailfish::PolicyValue::UnknownPolicyTypes::UnknownNo policy type
Sailfish::PolicyValue::CameraEnabledPolicyTypes::CameraEnabledDevice camera
Sailfish::PolicyValue::LocationSettingsEnabledPolicyTypes::LocationSettingsEnabledLocation settings
Sailfish::PolicyValue::OsUpdatesEnabledPolicyTypes::OsUpdatesEnabledSystem operating system update
Sailfish::PolicyValue::SideLoadingSettingsEnabledPolicyTypes::SideLoadingSettingsEnabledSide-loading of untrusted software
Sailfish::PolicyValue::DeveloperModeSettingsEnabledPolicyTypes::DeveloperModeSettingsEnabledDeveloper mode settings
Sailfish::PolicyValue::ApplicationInstallationEnabledPolicyTypes::ApplicationInstallationEnabledInstallation of applications
Sailfish::PolicyValue::WlanToggleEnabledPolicyTypes::WlanToggleEnabledWLAN on/off
Sailfish::PolicyValue::InternetSharingEnabledPolicyTypes::InternetSharingEnabledInternet sharing (tethering)
Sailfish::PolicyValue::DeviceResetEnabledPolicyTypes::DeviceResetEnabledReset device to factory defaults
Sailfish::PolicyValue::ScreenshotEnabledPolicyTypes::ScreenshotEnabledTake screenshots
Sailfish::PolicyValue::MobileNetworkSettingsEnabledPolicyTypes::MobileNetworkSettingsEnabledMobile network settings
Sailfish::PolicyValue::UsbMassStorageEnabledPolicyTypes::UsbMassStorageEnabledUSB mass storage
Sailfish::PolicyValue::UsbDeveloperModeEnabledPolicyTypes::UsbDeveloperModeEnabledUSB developer mode
Sailfish::PolicyValue::UsbMtpEnabledPolicyTypes::UsbMtpEnabledUSB MTP
Sailfish::PolicyValue::UsbHostEnabledPolicyTypes::UsbHostEnabledUSB Host
Sailfish::PolicyValue::UsbConnectionSharingEnabledPolicyTypes::UsbConnectionSharingEnabled 
Sailfish::PolicyValue::UsbDiagnosticModeEnabledPolicyTypes::UsbDiagnosticModeEnabledUSB diagnostic mode
Sailfish::PolicyValue::UsbAdbEnabledPolicyTypes::UsbAdbEnabledUSB Android Debug Bridge (ADB)
Sailfish::PolicyValue::DateTimeSettingsEnabledPolicyTypes::DateTimeSettingsEnabledSystem date and time
Sailfish::PolicyValue::MicrophoneEnabledPolicyTypes::MicrophoneEnabledSystem microphone
Sailfish::PolicyValue::FlightModeToggleEnabledPolicyTypes::FlightModeToggleEnabledFlight mode on/off
Sailfish::PolicyValue::NetworkProxySettingsEnabledPolicyTypes::NetworkProxySettingsEnabledNetwork proxy settings
Sailfish::PolicyValue::NetworkDataCounterSettingsEnabledPolicyTypes::NetworkDataCounterSettingsEnabledNetwork data counter settings
Sailfish::PolicyValue::CallStatisticsSettingsEnabledPolicyTypes::CallStatisticsSettingsEnabledCall statistics settings
Sailfish::PolicyValue::CellularTechnologySettingsEnabledPolicyTypes::CellularTechnologySettingsEnabledCellular radio technology selection settings
Sailfish::PolicyValue::MobileDataAccessPointSettingsEnabledPolicyTypes::MobileDataAccessPointSettingsEnabledMobile data access point name (APN) settings
Sailfish::PolicyValue::VpnConnectionSettingsEnabledPolicyTypes::VpnConnectionSettingsEnabledVPN connection status
Sailfish::PolicyValue::VpnConfigurationSettingsEnabledPolicyTypes::VpnConfigurationSettingsEnabledVPN configuration management (create/remove/modify)
Sailfish::PolicyValue::BrowserEnabledPolicyTypes::BrowserEnabledWeb browsing

Property Documentation

key : QString

This property holds the policy type key which this value exposes.

Note that there is a one-to-one mapping between a supported policy type and a policy key.

Access functions:

QString key() const
void setKey(const QString &newKey)

Notifier signal:

void keyChanged()

policyType : int

This property holds the policy type which this value exposes.

Note that there is a one-to-one mapping between a supported policy type and a policy key.

Access functions:

int policyType() const
void setPolicyType(int type)

Notifier signal:

void policyTypeChanged()

value : const QVariant

This property holds the policy value associated with the policy type (or key).

Access functions:

QVariant value() const

Notifier signal:

void valueChanged()

Member Function Documentation

PolicyValue::PolicyValue(QObject *parent = 0)

Creates a PolicyValue with the given parent.

[virtual] PolicyValue::~PolicyValue()

Destroys the instance of PolicyValue. The destructor is virtual.

[static] bool PolicyValue::enforcePolicy(int type, bool value)

Enforces operating system level changes for the policy type to be value. Returns true on success; otherwise false.

This method must be called when setKeyValue or setValue is not used for writing policy type.

[static] bool PolicyValue::enforcePolicy(const QString &key, bool value)

Enforces operating system level changes for the policy key. Returns true on success; otherwise false.

This method must to be called when setKeyValue or setValue is not used for writing policy key.

[static] QVariant PolicyValue::keyValue(const QString &key)

Returns the policy value associated with the specified policy key.

See also setKeyValue().

[static] QVariant PolicyValue::keyValue(int type)

Returns the policy value associated with the specified policy type.

[static] bool PolicyValue::setKeyValue(const QString &key, const QVariant &value)

Sets the policy value associated with the given policy key to value. Returns true on success; otherwise false.

See also keyValue().

[static] bool PolicyValue::setKeyValue(int type, const QVariant &value)

Sets the policy value associated with the given policy type to value. Returns true on success; otherwise false.

bool PolicyValue::setValue(const QVariant &value)

Sets the policy value associated with this policy to value. Returns true on success; otherwise false.

See also value().

We use cookies to improve your user experience and to help us to develop our services. By continuing to browse the site, you approve of our use of cookies.