diff -r 4816d766a08a -r f345bda72bc4 Symbian3/PDK/Source/GUID-F892D93D-0B59-592A-9DA5-AD4243F607E3.dita --- a/Symbian3/PDK/Source/GUID-F892D93D-0B59-592A-9DA5-AD4243F607E3.dita Tue Mar 30 11:42:04 2010 +0100 +++ b/Symbian3/PDK/Source/GUID-F892D93D-0B59-592A-9DA5-AD4243F607E3.dita Tue Mar 30 11:56:28 2010 +0100 @@ -1,89 +1,90 @@ - - - - - -Monitoring -a System-Wide PropertyA component with appropriate platform security capabilities can -request a change to a system-wide property value. The SSM distributes notifications -of the changing of system-wide property values to components that have requested -notifications. -

System-wide properties are attributes of a device that have system-wide -significance. It allows components to be aware of the device state. They are -defined by system-wide property policies within a SSM plug-in that can be -customized by licensees. These policies determine the set of properties, their -permissible values and transitions, and the tasks that are performed when -each value changes.

Follow the steps given below to monitor a system-wide -property:

- - -Connect to the specified system-wide property that must be monitored. - RSsmSystemWideProperty class is used to monitor a -system-wide property as shown in the code snippet. - -RSsmSystemWideProperty diskStatus; - -User::LeaveIfError( diskStatus.Connect ( ESystemDriveSpace ) ); - - -Subscribe for change notifications, when the value of the connected -system-wide property changes as shown in the code snippet. - -TRequestStatus status; -diskStatus.Subscribe( status ); - - -Depending on the value of the property, user defines certain actions -that must be performed. - - -Close the system-wide property that is handled. - - -

The system-wide property is monitored.

- Example

The following example code shows how a -while loop is used to remove cache files from disk when the ESystemDriveSpace (one -of the system-wide property) property becomes ELow or ECritical.

Note: The ESystemDriveSpace property is an example property and is not part of a defined API to be delivered -by Symbian platform as part of the System State Management Architecture

void RunCacheLoopL() - { - RSsmSystemWideProperty diskStatus; - User::LeaveIfError( diskStatus.Connect( ESystemDriveSpace ) ); - TRequestStatus status; - diskStatus.Subscribe( status ); - while( ETrue ) - { - User::WaitForRequest( status ); - if( status != KErrNone ) - { - // Handle error - } - - // Re-subscribe before you read so that you do not miss any notifications - diskStatus.Subscribe( status ); - TInt value = diskStatus.GetValue(); - switch ( value ) - { - case ENormal: - EnableDiskCache(); - break; - case ELow: // Fall through - case ECritical: - DisableDiskCache(); - RemoveDiskCache(); - break; - } - } - } -
-
-System-wide -Properties -Creating -a System-wide Property Policy Plug-in + + + + + +Monitoring +a System-Wide PropertyA component with appropriate platform security capabilities can +request a change to a system-wide property value. The SSM distributes notifications +of the changing of system-wide property values to components that have requested +notifications. +

System-wide properties are attributes of a device that have system-wide +significance. It allows components to be aware of the device state. They are +defined by system-wide property policies within a SSM plug-in that can be +customized by licensees. These policies determine the set of properties, their +permissible values and transitions, and the tasks that are performed when +each value changes.

Follow the steps given below to monitor a system-wide +property:

+ + +Connect to the specified system-wide property that must be monitored. + RSsmSystemWideProperty class is used to monitor a +system-wide property as shown in the code snippet. + +RSsmSystemWideProperty diskStatus; + +User::LeaveIfError( diskStatus.Connect ( ESystemDriveSpace ) ); + + +Subscribe for change notifications, when the value of the connected +system-wide property changes as shown in the code snippet. + +TRequestStatus status; +diskStatus.Subscribe( status ); + + +Depending on the value of the property, user defines certain actions +that must be performed. + + +Close the system-wide property that is handled. + + +

The system-wide property is monitored.

+ Example

The following example code shows how a +while loop is used to remove cache files from disk when the ESystemDriveSpace (one +of the system-wide property) property becomes ELow or ECritical.

Note: The ESystemDriveSpace property is an example property and is not part of a defined API to be delivered +by the Symbian platform as part of the System State Management +Architecture

void RunCacheLoopL() + { + RSsmSystemWideProperty diskStatus; + User::LeaveIfError( diskStatus.Connect( ESystemDriveSpace ) ); + TRequestStatus status; + diskStatus.Subscribe( status ); + while( ETrue ) + { + User::WaitForRequest( status ); + if( status != KErrNone ) + { + // Handle error + } + + // Re-subscribe before you read so that you do not miss any notifications + diskStatus.Subscribe( status ); + TInt value = diskStatus.GetValue(); + switch ( value ) + { + case ENormal: + EnableDiskCache(); + break; + case ELow: // Fall through + case ECritical: + DisableDiskCache(); + RemoveDiskCache(); + break; + } + } + } +
+
+System-wide +Properties +Creating +a System-wide Property Policy Plug-in
\ No newline at end of file