SECAgentCharacterExPtr Class

class SECAgentCharacterExPtr: public IAgentCharacterExPtr

SECAgentCharacterExPtr is a subclass of the IAgentCharacterExPtr smart pointer that in-turn encapsulates the IAgentCharacterEx interface. This class creates and registers a default notification sink for the underlying character. You can enable a pre-created command "Change Default Character" using which users can change the character at any time. It provides APIs that instructs the underlying character to prompt at a Window or Rectangle. Using the MessageBox API, you can display a message box accompanied by the Agent reading out the text from it. It also provides an elaborate framework to enclose character actions within Act objects. Take a look at SECAgentCharAct for more information.

Defined in: ot_agent.h

Class Members

Construction

void  UnloadChar(IAgentExPtr& ptrAgent)

Unloads the underlying character object

virtual BOOL  CreateNotifySink(IAgentExPtr& ptrAgent)

Creates a notification sink for the underlying character object

virtual void  ReleaseNotifySink(IAgentExPtr& ptrAgent)

Release the notification sink for the underlying character object

Attributes

BOOL  IsBusy(UINT nActType)

This state tells you whether the character is busy playing a type of Act.

void  EnableCharChangeCommand(BOOL bEnable = TRUE)

Enable/Disable the "Change Default Character" Command

SECAgentCharAct*  GetAct(long lActID)

Get Act object for the corresponding ID.

Operations

void  PromptAt(CWnd* pWnd, const CString& strText, UINT nType = NonCritical, long* lActID = NULL)

Prompt at the window

void  PromptAt(HWND hWnd, const CString& strText, UINT nType = NonCritical, long* lActID = NULL)

Prompt at the window

virtual void  PromptAt(HWND hWnd, BSTR bstrText, UINT nType = NonCritical, long* lActID = NULL)

Prompt at the window

CPoint*  GetOptimalPosAdjacentTo(HWND hWnd, CPoint& pt)

Get the optimal position for the character to move to beside the window

void  PromptAt(CRect& rect, const CString& strText, UINT nType = NonCritical, long* lActID = NULL)

Prompt at the rect

virtual void  PromptAt(CRect& rect, BSTR bstrText, UINT nType = NonCritical, long* lActID = NULL)

Prompt at the rect

virtual void  Speak(BSTR bstrText, UINT nType = NonCritical, long* lActID = NULL)

Speak out the text

virtual void  InterruptAct(long nActID)

Interrupt a particular or all Acts

virtual int  MessageBox( LPCTSTR lpszPrompt, UINT nType = MB_OK, UINT nIDHelp = 0, UINT nInterruptType = CharReadOut)

Display an Agent enabled message box.

void  AddAct(SECAgentCharAct* pAct)

Add this act to the Acts list

void  RunActs()

Run pending acts in the Act list.

virtual notifications

virtual HRESULT  OnCommand(long dwCommandID, IUnknown * punkUserInput)

Command notification from the sink.

virtual void  DefaultInterruptAction()

The default interrupt action.

virtual BOOL  OnBeginAct(SECAgentCharAct* pAct)

Notification to indicate beginning of the act.

virtual void  OnEndAct(SECAgentCharAct* pAct)

Notification to indicate the end of the act.