×
Namespaces

Variants
Actions
Revision as of 08:03, 26 July 2012 by hamishwillee (Talk | contribs)

SystemAPI

From Nokia Developer Wiki
Jump to: navigation, search
Article Metadata
Article
Created: Diego Soares Lopes (09 Feb 2009)
Last edited: hamishwillee (26 Jul 2012)

Overview

The SystemAPI was developed to facilitate access to informations about battery’s level and signal’s strength on Symbian OS devices, without the Symbian/C++ code conventions. It's very useful for Qt and OpenC/C++ programmers.

Header

 //SystemAPI header
#include "SystemAPI.h"
 
class Example: public SystemAPIObserver
{
public:
 
/**
* C++ default constructor
*/

Example();
 
/**
* Example virtual destructor
*/

virtual ~Example();
 
/**
* callback functions for receiving data events,
* Inherited from SystemAPIObserver interface
*/

void batteryLevelCheck(BatteryInfo battery, int err) ;
void signalStatusCheck( SignalInfo signal, int err );
 
private: //ATRIBUTES
 
SystemAPI* system; //Provide access to SystemAPI methods
BatteryInfo battery; //struct with battery info
SignalInfo signal; // struct with signal info
 
 
};

Source

//CPP FILE
 
//Example header file
#include "Example.h"
 
Example::Example()
{
system = SystemAPI::create();
 
system->notifyBatteryChange(this);
system->notifySignalChange(this);
}
 
Example::~Example()
{
 
if(system)
{
delete system; //delete system pointer
system = NULL;
}
}
34 page views in the last 30 days.