API Reference | developer.brewmp.com API Reference | developer.brewmp.com

Developer

API Reference

AEECLSID_TIMEZONE

Brew Release
Brew MP 1.0.2
See Also
Description
Implementation of the ITimeZone interface. This class provides a way to obtain information about any given timezone.
To obtain or set the currently active timezone, use ISettings APIs in conjunction with the "/timezone/active/tzid" settings key. Any active timezone change notifications are also provided via ISettings for this key.
Sample code for obtaining active timezone (proper error handling is left as an exercise for the reader):

   ISettings* piSettings = 0;
   ITimeZone* piTimeZone = 0;
   int nErr;
   
   // Assumption: piEnv is a valid IEnv pointer
   nErr = IEnv_CreateInstance(piEnv, AEECLSID_TimeZone, (void **)&piTimeZone);
   if (AEE_SUCCESS != nErr) {
      // Handle error here.
   }
   
   nErr = IEnv_CreateInstance(piEnv, AEECLSID_SettingsReg, (void **)&piSettings);
   if (AEE_SUCCESS != nErr) {
      // Handle error here.
   }

   // Assumption: 'name' is a character buffer with sufficient allocated space to hold 
   // the output from ISetting_Get()
   nErr = ISettings_Get(piSettings, "/timezone/active/tzid", name, nameLen, &nameLenReq);
   if (AEE_SUCCESS != nErr) {
      // Handle error here.
   }
   
   // Use the 'name' in any ITimeZone API to obtain information about the timezone.
   // Assumption: latitude and longitude are defined properly
   nErr = ITimeZone_GetLocation(piTimeZone, name, &latitude, &longitude);
   if (AEE_SUCCESS != nErr) {
      // Handle error here.
   }
   
   //Release the objects we created
   IQI_RELEASEIF(piSettings);
   IQI_RELEASEIF(piTimeZone);

Default Interface Name