Hs::HsException Class Reference

Link against: hswidgetpublisher.lib


#include <
hsexception.h>

Detailed Description

Class used to encapsulate error information thrown in exceptions by the Homescreen Publishing Api.
 ObserverClass* dataObserver = new ObserverClass();
 try 
 {
     HsWidgetPublisher* hsPublisher = new HsWidgetPublisher( dataObserver );
     if ( hsPublisher )
     {
         HsWidget& widget =  hsPublisher->createHsWidget( 
             "templateName", "widgetName", "uniqueIdentifier" );
         //attempt to create the widget again (with the same information) 
         //will cause an exception
         hsPublisher->createHsWidget( 
             "templateName", "widgetName", "uniqueIdentifier" );
     }
 }
 catch (HsException& exception)
 {
     int errReason = exception.getReason();
     //if the exception is thrown, becasue the widget attempted to
     //be created already exists the errReason will be KErrAlreadyExists
 }

Public Member Functions

IMPORT_C HsException (int aLeaveCode)
 Constructor of the HsException.
virtual IMPORT_C ~HsException ()
 Destructor of the HsException.
IMPORT_C int getReason ()
 Method retrieves the error information contained in the excpetion object.

Constructor & Destructor Documentation

IMPORT_C Hs::HsException::HsException int  aLeaveCode  ) 
 

Constructor of the HsException.

virtual IMPORT_C Hs::HsException::~HsException  )  [virtual]
 

Destructor of the HsException.


Member Function Documentation

IMPORT_C int Hs::HsException::getReason  ) 
 

Method retrieves the error information contained in the excpetion object.

 ObserverClass* dataObserver = new ObserverClass();
 try 
 {
     HsWidgetPublisher* hsPublisher = new HsWidgetPublisher(dataObserver);
     hsPublisher->createHsWidget( 
         "templateName", "widgetName", "uniqueIdentifier" );
 }
 catch (HsException& exception)
 {
      int errReason = exception.getReason();
 }
Returns:
Error code.

The documentation for this class was generated from the following file:

Copyright © Nokia Corporation 2001-2007
Back to top