PrevNextUpHome SophiaFramework UNIVERSE 5.3
SFBTimeCtl
Wrapper Class for the ITimeCtl interface.
#include <SFBTimeCtl.h.hpp>
class SFBTimeCtl : public SFBControl;
SFMTYPEDEFWRAPPER(SFBTimeCtl)

Inheritance diagram

 Inheritance diagram of SFBTimeCtlClass

Version

BREW 2.0 BREW 2.1 BREW 3.1 BREW 4.0
O O O O

Reference

BREW API ITimeCtl

Member

Public Functions
Void EnableCommand( Bool enable , UInt16 id )
Enable sending of specified command by the time control object to the AEE Shell upon receiving the event generated by pressing the center key.
Bool GetFont( AEEFont* numFont , AEEFont* letterFont )
Get the time number and letter fonts.
SInt32 GetTime( Void )
Get the time value from the time control object. The time value is in milliseconds.
Void GetTimeString( UInt32 secs , WCharPtr dest , SInt32 size , UInt16 flags )
Convert the time in milliseconds to a string in the specified format.
Void GetTimeString( UInt32 secs , SFXWideStringPtr dest , UInt16 flags )
Convert the time in milliseconds to a string in the specified format.
static
SFBTimeCtlSmp
NewInstance( AEECLSID clsid = AEECLSID_CLOCKCTL , SFCErrorPtr exception = null )
Create a new SFBTimeCtl instance.
Void SetEditField( ITField field )
Set specified field for editing.
Void SetFont( AEEFont numFont , AEEFont letterFont )
Set the title and text fonts.
Void SetIncrement( UInt16 mins )
Set a new time increment value in minutes. The default is 1.
Bool SetTime( SInt32 ms )
Set given time and redraw time string on device screen.
Bool SetTimeEx( SInt32 ms , Bool update )
This function can be used to set a given time and redraw a time string on a device screen.
Void SizeToFit( SFXRectanglePtr rect )
Size the rectangle to the time text.
UInt32 GetProperties( Void ) (inherits from SFBControl)
Return the control-specific properties or flags.
Void GetRect( SFXRectanglePtr rect ) (inherits from SFBControl)
Get the rectangle of the control.
SFXRectangle GetRect( Void ) (inherits from SFBControl)
Get the rectangle of the control.
Bool HandleEvent( AEEEvent event , UInt16 wParam , UInt32 dwParam ) (inherits from SFBControl)
Pass events to a control. The BREW controls process various events to allow a device user to enter a text, time, or date value or choose an item from a menu. Refer to the descriptions of each control for the events it handles. Your applet must pass a control all of the events, unless the control is part of a dialog. Below is an example of an application passing all of the events to the controls of the application.
Bool HandleEvent( SFXEventConstRef event ) (inherits from SFBControl)
Pass events to a control. The BREW controls process various events to allow a device user to enter a text, time, or date value or choose an item from a menu. Refer to the descriptions of each control for the events it handles. Your applet must pass a control all of the events, unless the control is part of a dialog. Below is an example of an application passing all of the events to the controls of the application.
Bool IsActive( Void ) (inherits from SFBControl)
Return the active or focus state of the control.
Bool Redraw( Void ) (inherits from SFBControl)
Instruct the control to redraw its contents.
Void Reset( Void ) (inherits from SFBControl)
Instruct the control to reset (free/delete) its contents and to immediately leave active/focus mode.
Void SetActive( Bool active = true ) (inherits from SFBControl)
Instruct the control to enter/leave focus or selected mode.
Void SetProperties( UInt32 properties ) (inherits from SFBControl)
Set control-specific properties or flags.
Void SetRect( SFXRectangleConstRef rect ) (inherits from SFBControl)
Set the active screen coordinates of the control. This may result in the control redrawing its contents.
Protected Functions
static
SFBBaseSmp
FactoryByCreate( AEECLSID id , SFCErrorPtr exception = null ) (inherits from SFBBase)
Create the instance for the specified ClassID's interface.
static
SFBBaseSmp
FactoryByQuery( SFBQuerySmpConstRef query , AEECLSID id , SFCErrorPtr exception = null ) (inherits from SFBBase)
Create the instance for the specified ClassID's interface using the SFBQuery instance.

SFBTimeCtl::EnableCommand
Enable sending of specified command by the time control object to the AEE Shell upon receiving the event generated by pressing the center key.
[ public ]
Void EnableCommand(
    Bool enable   // boolean value for enable/disable flag
    UInt16 id     // command ID
);

Reference

BREW API ITIMECTL_EnableCommand


SFBTimeCtl::GetFont
Get the time number and letter fonts.
[ public ]
Bool GetFont(
    AEEFont* numFont      // pointer to location to set to number font 
    AEEFont* letterFont   // pointer to location to set to letter (AM/PM) font 
);

Reference

BREW API ITIMECTL_GetFont | AEEFont | SFBTimeCtl::SetFont


SFBTimeCtl::GetTime
Get the time value from the time control object. The time value is in milliseconds.
[ public ]
SInt32 GetTime(Void);

Reference

BREW API ITIMECTL_GetTime


SFBTimeCtl::GetTimeString
Convert the time in milliseconds to a string in the specified format.
[ public ]
Void GetTimeString(
    UInt32 secs     // time in milliseconds to be converted into a string
    WCharPtr dest   // converted time in a string
    SInt32 size     // size Of Dest In Bytes
    UInt16 flags    // bitmap that specifies the time format to use for the string conversion the following are supported: 
                    // GTS_MSECS: use centiseconds, and display 2 digit centiseconds.
                    // GTS_SECS: use seconds.
                    // GTS_AMPM: use AM or PM
);
[ public ]
Void GetTimeString(
    UInt32 secs             // time in milliseconds to be converted into a string
    SFXWideStringPtr dest   // converted time in a string
    UInt16 flags            
);

Reference

BREW API ITIMECTL_GetTimeString


SFBTimeCtl::NewInstance
Create a new SFBTimeCtl instance.
[ public, static ]
SFBTimeCtlSmp NewInstance(
    AEECLSID clsid = AEECLSID_CLOCKCTL   // Class ID for the clock control
    SFCErrorPtr exception = null         // Error
);

Description

The ClassID is set by the type of time control. The available ClassID is as below:

AEECLSID_CLOCKCTL
AEECLSID_COUNTDOWNCTL
AEECLSID_STOPWATCHCTL

The default is AEECLSID_CLOCKCTL.


SFBTimeCtl::SetEditField
Set specified field for editing.
[ public ]
Void SetEditField(
    ITField field   // field to be set for editing. Field can be one of the following: 
                    // ITF_HOUR 
                    // ITF_MIN 
                    // ITF_SEC
        
);

Reference

BREW API ITIMECTL_SetEditField | ITField


SFBTimeCtl::SetFont
Set the title and text fonts.
[ public ]
Void SetFont(
    AEEFont numFont      // font to use for the numbers in the time. 
                         // if this parameter is set to null then default font of AEE_FONT_LARGE will be assumed
    AEEFont letterFont   // font to use for the non-number portions of the time (AM/PM). 
                         // if this parameter is set to null then default font of AEE_FONT_BOLD will be assumed
);

Reference

BREW API ITIMECTL_SetFont | AEEFont | SFBTimeCtl::GetFont


SFBTimeCtl::SetIncrement
Set a new time increment value in minutes. The default is 1.
[ public ]
Void SetIncrement(
    UInt16 mins   // new time increment value in minutes
);

Reference

BREW API ITIMECTL_SetIncrement


SFBTimeCtl::SetTime
Set given time and redraw time string on device screen.
[ public ]
Bool SetTime(
    SInt32 ms   // time in milliseconds expired since 00:00:00. Negative value is ignored
);

Reference

BREW API ITIMECTL_SetTime


SFBTimeCtl::SetTimeEx
This function can be used to set a given time and redraw a time string on a device screen.
[ public ]
Bool SetTimeEx(
    SInt32 ms     // time in milliseconds expired since 00:00:00, where negative values are ignored
    Bool update   // boolean flag: 
		// true means to save the time string in the buffer of time control object and draw on screen. 
		// false means to just draw on screen and don’t save the time string. 
		// whether true or false, the time integer is saved
);

Reference

BREW API ITIMECTL_SetTimeEx


SFBTimeCtl::SizeToFit
Size the rectangle to the time text.
[ public ]
Void SizeToFit(
    SFXRectanglePtr rect   // pointer to location to set to bounding rectangle
);

Reference

BREW API ITIMECTL_SizeToFit | AEERect