API Documentation
Documentation for developing SailfishOS applicationsSimVoiceCallFilter Class
(Sailfish::Mdm::SimVoiceCallFilter)The SimVoiceCallFilter class controls access to voice-call features. More...
Header: | #include <mdm-simvoicecallfilter.h> |
Properties
|
|
Public Functions
SimVoiceCallFilter(QObject *parent = 0) | |
~SimVoiceCallFilter() | |
bool | clearDialRules() |
bool | clearIncomingRules() |
SimFilter::Action | defaultDialAction() const |
SimFilter::Action | defaultIncomingAction() const |
SimFilter::RuleList | dialRules() const |
bool | hasDialRuleForImsi(const QString &imsi) const |
bool | hasIncomingRuleForImsi(const QString &imsi) const |
SimFilter::RuleList | incomingRules() const |
bool | ready() const |
bool | removeDialRule(const QString &imsi) |
bool | removeIncomingRule(const QString &imsi) |
bool | setDefaultDialAction(SimFilter::Action action) |
bool | setDefaultIncomingAction(SimFilter::Action action) |
bool | setDialRule(const SimFilter::Rule &rule) |
bool | setDialRules(const SimFilter::RuleList &rules) |
bool | setIncomingRule(const SimFilter::Rule &rule) |
bool | setIncomingRules(const SimFilter::RuleList &rules) |
Signals
void | defaultDialActionChanged() |
void | defaultIncomingActionChanged() |
void | dialRuleAdded(const Sailfish::Mdm::SimFilter::Rule &rule) |
void | dialRuleRemoved(const QString &imsi) |
void | dialRulesChanged(const Sailfish::Mdm::SimFilter::RuleList &oldRules, const Sailfish::Mdm::SimFilter::RuleList &newRules) |
void | incomingRuleAdded(const Sailfish::Mdm::SimFilter::Rule &rule) |
void | incomingRuleRemoved(const QString &imsi) |
void | incomingRulesChanged(const Sailfish::Mdm::SimFilter::RuleList &oldRules, const Sailfish::Mdm::SimFilter::RuleList &newRules) |
void | readyChanged() |
Detailed Description
The SimVoiceCallFilter class controls access to voice-call features.
Filter rules can be set for incoming and outgoing voice calls.
To use this class, clients must add the following to their qmake project:
CONFIG += link_pkgconfig PKGCONFIG += sailfishmdm
and then #include <mdm-simvoicecallfilter.h>
.
Example of usage:
#include <mdm-simvoicecallfilter.h> int main(int argc, char **argv) { QCoreApplication app(arg, argv); SimVoiceCallFilter *vcFilter = new SimVoiceCallFilter; QObject::connect(vcFilter, &SimVoiceCallFilter::readyChanged, [vcFilter] { qInfo() << vcFilter->dialRules().count() << "outgoing rules and" << vcFilter->incomingRules().count() << "incoming rules are currently set"; SimFilter::Rule rule("123456789", SimFilter::Block); vcFilter->addDialRule(rule); // block outgoing calls from SIM with IMSI 123456789 QObject::connect(vcFilter, &SimVoiceCallFilter::dialRuleAdded, [rule] { qInfo() << "Outcoming call rule added for IMSI" << rule.imsi; app.quit(); }); }); return app.exec(); }
Property Documentation
defaultDialAction : SimFilter::Action
The default action for outgoing voice calls.
Access functions:
SimFilter::Action | defaultDialAction() const |
bool | setDefaultDialAction(SimFilter::Action action) |
Notifier signal:
void | defaultDialActionChanged() |
defaultIncomingAction : SimFilter::Action
The default action for incoming voice calls.
Access functions:
SimFilter::Action | defaultIncomingAction() const |
bool | setDefaultIncomingAction(SimFilter::Action action) |
Notifier signal:
void | defaultIncomingActionChanged() |
dialRules : SimFilter::RuleList
The filter rules for outgoing voice calls.
Access functions:
SimFilter::RuleList | dialRules() const |
bool | setDialRules(const SimFilter::RuleList &rules) |
Notifier signal:
void | dialRulesChanged(const Sailfish::Mdm::SimFilter::RuleList &oldRules, const Sailfish::Mdm::SimFilter::RuleList &newRules) |
incomingRules : SimFilter::RuleList
The filter rules for incoming voice calls.
Access functions:
SimFilter::RuleList | incomingRules() const |
bool | setIncomingRules(const SimFilter::RuleList &rules) |
Notifier signal:
void | incomingRulesChanged(const Sailfish::Mdm::SimFilter::RuleList &oldRules, const Sailfish::Mdm::SimFilter::RuleList &newRules) |
ready : const bool
True when the voice call filter is ready to be used and the property values are valid.
Access functions:
bool | ready() const |
Notifier signal:
void | readyChanged() |
Member Function Documentation
SimVoiceCallFilter::SimVoiceCallFilter(QObject *parent = 0)
Default constructs an instance of SimVoiceCallFilter.
SimVoiceCallFilter::~SimVoiceCallFilter()
Destroys the instance of SimVoiceCallFilter.
bool SimVoiceCallFilter::clearDialRules()
Clears the list of outgoing voice call rules.
This is an asynchronous call. When the call completes, dialRulesChanged() is emitted.
Returns true if the asynchronous call was sent. Returns false and does nothing if there are no existing text rules.
bool SimVoiceCallFilter::clearIncomingRules()
Clears the list of incoming voice call rules.
This is an asynchronous call. When the call completes, dialRulesChanged() is emitted.
Returns true if the asynchronous call was sent. Returns false and does nothing if there are no existing text rules.
[signal]
void SimVoiceCallFilter::dialRuleAdded(const Sailfish::Mdm::SimFilter::Rule &rule)
This signal is emitted when a new outgoing voice call rule is added.
[signal]
void SimVoiceCallFilter::dialRuleRemoved(const QString &imsi)
This signal is emitted when an outgoing voice call rule with the specified imsi is removed.
[signal]
void SimVoiceCallFilter::dialRulesChanged(const Sailfish::Mdm::SimFilter::RuleList &oldRules, const Sailfish::Mdm::SimFilter::RuleList &newRules)
This signal is emitted when the list of outgoing voice call rules changes from oldRules to newRules, due to modifications of the entire list, or individual rules within the list.
Note: Notifier signal for property dialRules.
bool SimVoiceCallFilter::hasDialRuleForImsi(const QString &imsi) const
Returns whether there is an existing outgoing voice call rule for the specified imsi.
bool SimVoiceCallFilter::hasIncomingRuleForImsi(const QString &imsi) const
Returns whether there is an existing incoming voice call rule for the specified imsi.
[signal]
void SimVoiceCallFilter::incomingRuleAdded(const Sailfish::Mdm::SimFilter::Rule &rule)
This signal is emitted when a new incoming voice call rule is added.
[signal]
void SimVoiceCallFilter::incomingRuleRemoved(const QString &imsi)
This signal is emitted when an incoming voice call rule with the specified imsi is removed.
[signal]
void SimVoiceCallFilter::incomingRulesChanged(const Sailfish::Mdm::SimFilter::RuleList &oldRules, const Sailfish::Mdm::SimFilter::RuleList &newRules)
This signal is emitted when the list of incoming voice call rules changes from oldRules to newRules, due to modifications of the entire list, or individual rules within the list.
Note: Notifier signal for property incomingRules.
bool SimVoiceCallFilter::removeDialRule(const QString &imsi)
Removes the rule with the specified imsi from the list of outgoing voice call rules.
This is an asynchronous call. When the call completes, dialRulesChanged() and dialRuleRemoved() are emitted.
Returns true if the asynchronous call was sent. Returns false and does nothing if the IMSI is invalid, or if there is no existing rule for this IMSI.
bool SimVoiceCallFilter::removeIncomingRule(const QString &imsi)
Removes the rule with the specified imsi from the list of incoming voice call rules.
This is an asynchronous call. When the call completes, incomingRulesChanged() and incomingRuleRemoved() are emitted.
Returns true if the asynchronous call was sent. Returns false and does nothing if the IMSI is invalid, or if there is no existing rule for this IMSI.
bool SimVoiceCallFilter::setDialRule(const SimFilter::Rule &rule)
Adds or modifies rule in the list of outgoing voice call rules.
This is an asynchronous call. When the call completes, dialRulesChanged() is emitted. If this is a new rule, dialRuleAdded() is also emitted.
Returns true if the asynchronous call was sent. Returns false and does nothing if the IMSI is invalid, or if there is an existing rule with the same IMSI and action.
bool SimVoiceCallFilter::setDialRules(const SimFilter::RuleList &rules)
Sets the list of outgoing voice call rules to rules.
This is an asynchronous call. When the call completes, dialRulesChanged() is emitted.
Returns true if the asynchronous call was sent. Returns false and does nothing if any IMSI is invalid, or if the given rules match the existing rules.
Note: Setter function for property dialRules.
See also dialRules().
bool SimVoiceCallFilter::setIncomingRule(const SimFilter::Rule &rule)
Adds or modifies rule in the list of incoming voice call rules.
This is an asynchronous call. When the call completes, incomingRulesChanged() is emitted. If this is a new rule, incomingRuleAdded() is also emitted.
Returns true if the asynchronous call was sent. Returns false and does nothing if the IMSI is invalid, or if there is an existing rule with the same IMSI and action.
bool SimVoiceCallFilter::setIncomingRules(const SimFilter::RuleList &rules)
Sets the list of incoming voice call rules to rules.
This is an asynchronous call. When the call completes, incomingRulesChanged() is emitted.
Returns true if the asynchronous call was sent. Returns false and does nothing if any IMSI is invalid, or if the given rules match the existing rules.
Note: Setter function for property incomingRules.
See also incomingRules().