API Documentation
Documentation for developing SailfishOS applicationsPolicyValue 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
- key : QString
- policyType : int
- value : const QVariant
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
void | keyChanged() |
void | policyTypeChanged() |
void | valueChanged() |
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.
Constant | Value | Description |
---|---|---|
Sailfish::PolicyValue::Unknown | PolicyTypes::Unknown | No policy type |
Sailfish::PolicyValue::CameraEnabled | PolicyTypes::CameraEnabled | Device camera |
Sailfish::PolicyValue::LocationSettingsEnabled | PolicyTypes::LocationSettingsEnabled | Location settings |
Sailfish::PolicyValue::OsUpdatesEnabled | PolicyTypes::OsUpdatesEnabled | System operating system update |
Sailfish::PolicyValue::SideLoadingSettingsEnabled | PolicyTypes::SideLoadingSettingsEnabled | Side-loading of untrusted software |
Sailfish::PolicyValue::DeveloperModeSettingsEnabled | PolicyTypes::DeveloperModeSettingsEnabled | Developer mode settings |
Sailfish::PolicyValue::ApplicationInstallationEnabled | PolicyTypes::ApplicationInstallationEnabled | Installation of applications |
Sailfish::PolicyValue::WlanToggleEnabled | PolicyTypes::WlanToggleEnabled | WLAN on/off |
Sailfish::PolicyValue::InternetSharingEnabled | PolicyTypes::InternetSharingEnabled | Internet sharing (tethering) |
Sailfish::PolicyValue::DeviceResetEnabled | PolicyTypes::DeviceResetEnabled | Reset device to factory defaults |
Sailfish::PolicyValue::ScreenshotEnabled | PolicyTypes::ScreenshotEnabled | Take screenshots |
Sailfish::PolicyValue::MobileNetworkSettingsEnabled | PolicyTypes::MobileNetworkSettingsEnabled | Mobile network settings |
Sailfish::PolicyValue::UsbMassStorageEnabled | PolicyTypes::UsbMassStorageEnabled | USB mass storage |
Sailfish::PolicyValue::UsbDeveloperModeEnabled | PolicyTypes::UsbDeveloperModeEnabled | USB developer mode |
Sailfish::PolicyValue::UsbMtpEnabled | PolicyTypes::UsbMtpEnabled | USB MTP |
Sailfish::PolicyValue::UsbHostEnabled | PolicyTypes::UsbHostEnabled | USB Host |
Sailfish::PolicyValue::UsbConnectionSharingEnabled | PolicyTypes::UsbConnectionSharingEnabled | |
Sailfish::PolicyValue::UsbDiagnosticModeEnabled | PolicyTypes::UsbDiagnosticModeEnabled | USB diagnostic mode |
Sailfish::PolicyValue::UsbAdbEnabled | PolicyTypes::UsbAdbEnabled | USB Android Debug Bridge (ADB) |
Sailfish::PolicyValue::DateTimeSettingsEnabled | PolicyTypes::DateTimeSettingsEnabled | System date and time |
Sailfish::PolicyValue::MicrophoneEnabled | PolicyTypes::MicrophoneEnabled | System microphone |
Sailfish::PolicyValue::FlightModeToggleEnabled | PolicyTypes::FlightModeToggleEnabled | Flight mode on/off |
Sailfish::PolicyValue::NetworkProxySettingsEnabled | PolicyTypes::NetworkProxySettingsEnabled | Network proxy settings |
Sailfish::PolicyValue::NetworkDataCounterSettingsEnabled | PolicyTypes::NetworkDataCounterSettingsEnabled | Network data counter settings |
Sailfish::PolicyValue::CallStatisticsSettingsEnabled | PolicyTypes::CallStatisticsSettingsEnabled | Call statistics settings |
Sailfish::PolicyValue::CellularTechnologySettingsEnabled | PolicyTypes::CellularTechnologySettingsEnabled | Cellular radio technology selection settings |
Sailfish::PolicyValue::MobileDataAccessPointSettingsEnabled | PolicyTypes::MobileDataAccessPointSettingsEnabled | Mobile data access point name (APN) settings |
Sailfish::PolicyValue::VpnConnectionSettingsEnabled | PolicyTypes::VpnConnectionSettingsEnabled | VPN connection status |
Sailfish::PolicyValue::VpnConfigurationSettingsEnabled | PolicyTypes::VpnConfigurationSettingsEnabled | VPN configuration management (create/remove/modify) |
Sailfish::PolicyValue::BrowserEnabled | PolicyTypes::BrowserEnabled | Web 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().