Copyright © 2009 Collabora Ltd. Copyright © 2009 Nokia Corporation

This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.

(as stable API)

In many real-time communication services the user can pay for certain services, typically calls to the PSTN, in advance. In (at least) Skype, it's possible to query the current balance in a machine-readable way.

An amount of money in a specified currency. For example, 3.21 British pounds would conventionally be represented by (Amount = 321, Scale = 2, Currency = "GBP"), but could be represented by (Amount = 3210, Scale = 3, Currency = "GBP") in a service that records balance in units of 0.001 pounds.

As a special case, if Amount = 0, Scale = 2**32 - 1 (i.e. the largest possible 32-bit unsigned integer) and Currency = "", this indicates an unknown amount.

The amount, expressed as a fixed-point number with decimal scale defined by the Scale field; for instance, an Amount value of 1234 with Scale of 2 represents 12.34 in the currency unit given by the Currency field.

The decimal scale for the fixed point value of the Amount field, defining the number of rightmost decimal digits from the integer value which form the fractional part of the resulting currency value.

As well as defining the interpretation of Amount, user interfaces may use this value to determine the precision with which to display the amount.

The currency code represented by this amount, which SHOULD be an international currency code such as "EUR", "USD", or "JPY" if possible. An empty string can be used to indicate that the currency is not known.

The user's balance on the account corresponding to this Connection. A negative amount may be possible on some services, and indicates that the user owes money to the service provider.

On initial connection, this property may have an unknown value, represented by Amount = 0, Scale = 2**32 - 1 (the largest possible 32-bit unsigned integer) and Currency = "".

A URI the user may visit via the web browser to manage and top-up their account balance. This property is not guaranteed to be well-defined until the connection becomes Connected; there is no change notification. Different protocols and even servers or gateways (e.g. SIP and XMPP PSTN gateways) will have a different website used to manage a user's account balance. This property enables the client to provide that to the user. A Connection Manager MAY set this itself (because it is static or discoverable), or expose it as a connection parameter.

Emitted when the user's balance has changed.

The new value of the AccountBalance property.