Packagecom.adobe.rtc.pods
Classpublic class SimpleChat
InheritanceSimpleChat Inheritance mx.core.UIComponent
ImplementsISessionSubscriber

The SimpleChat component is a high-level pod component which allows multiple users to chat in a way that is similar to an instant messenger client. In the model-view-controller sense, SimpleChat is the view and controller to the SimpleChatModel's model since it consumes user events, drives them to the model, accepts model events, and updates the view.

In general, users with a viewer role and higher can add and view messages.

See also

com.adobe.rtc.sharedModel.SimpleChatModel


Public Properties
 PropertyDefined by
  connectSession : IConnectSession
The IConnectSession with which this component is associated.
SimpleChat
  groupName : String
Components (pods) are assigned to a group via groupName; if not specified, the component is assigned to the default, public group (the room at large).
SimpleChat
  historyFontSize : uint
Specifies the font size of the chat history.
SimpleChat
  htmlText : String
[read-only] Returns the entire chat history as a string.
SimpleChat
  isSynchronized : Boolean
[read-only] Determines whether the chat is connected and fully synchronized with the service.
SimpleChat
  model : SimpleChatModel
[read-only] Returns the model for this chat pod.
SimpleChat
  newMessageColor : uint
Specifies the color of incoming messages.
SimpleChat
  sessionDependent : Boolean
Specifies whether the chat should be cleared upon the end of the session (true) or whether it should persist on the service (false).
SimpleChat
  sharedID : String
Defines the logical location of the component on the service, usually the sharedID of the collectionNode the component uses.
SimpleChat
  useExternalContextMenu : Boolean = false
Specifies whether the contextMenu is supplied by the developer or should be generated by the component.
SimpleChat
Public Methods
 MethodDefined by
  
SimpleChat
  
close():void
Disposes all listeners to the network and framework classes.
SimpleChat
  
getUserRole(p_userID:String):int
Returns the role of a given user for the chat.
SimpleChat
  
setUserRole(p_userID:String, p_userRole:int):void
Sets the role of a given user for the chat.
SimpleChat
  
subscribe():void
Tells the component to begin synchronizing with the service.
SimpleChat
Protected Methods
 MethodDefined by
  
preventTyping(p_event:TextEvent):void
SimpleChat
Events
 EventSummaryDefined by
   Dispatched when the chat pod goes in and out of sync.SimpleChat
Property detail
connectSessionproperty
connectSession:IConnectSession  [read-write]

The IConnectSession with which this component is associated. Note that this may only be set once before subscribe is called; re-sessioning of components is not supported. Defaults to the first IConnectSession created in the application.

Implementation
    public function get connectSession():IConnectSession
    public function set connectSession(value:IConnectSession):void
groupNameproperty 
groupName:String  [read-write]

Components (pods) are assigned to a group via groupName; if not specified, the component is assigned to the default, public group (the room at large). Groups are like separate conversations within the room, but each conversation could employ one or more pods; for example, one "conversation" may use a web camera, chat, and whiteboard pod, with each pod using different access and publish models. Users are members of and can only see components within the group they are assigned. Room hosts can see all the groups and all the members in those groups.

Implementation
    public function get groupName():String
    public function set groupName(value:String):void
historyFontSizeproperty 
historyFontSize:uint  [read-write]

Specifies the font size of the chat history.

Implementation
    public function get historyFontSize():uint
    public function set historyFontSize(value:uint):void
htmlTextproperty 
htmlText:String  [read-only]

Returns the entire chat history as a string.

Implementation
    public function get htmlText():String
isSynchronizedproperty 
isSynchronized:Boolean  [read-only]

Determines whether the chat is connected and fully synchronized with the service.

This property can be used as the source for data binding.

Implementation
    public function get isSynchronized():Boolean
modelproperty 
model:SimpleChatModel  [read-only]

Returns the model for this chat pod. Most events and APIs for the chat are exposed through the model.

Implementation
    public function get model():SimpleChatModel
newMessageColorproperty 
newMessageColor:uint  [read-write]

Specifies the color of incoming messages.

Implementation
    public function get newMessageColor():uint
    public function set newMessageColor(value:uint):void
sessionDependentproperty 
sessionDependent:Boolean  [read-write]

Specifies whether the chat should be cleared upon the end of the session (true) or whether it should persist on the service (false).

The default value is true.

Implementation
    public function get sessionDependent():Boolean
    public function set sessionDependent(value:Boolean):void
sharedIDproperty 
sharedID:String  [read-write]

Defines the logical location of the component on the service, usually the sharedID of the collectionNode the component uses. sharedIDs should be unique within a room if they're expressing two unique locations. Note that this can only be assigned once and it is assigned before subscribe() is called. For components with an id property, sharedID defaults to that value.

Implementation
    public function get sharedID():String
    public function set sharedID(value:String):void
useExternalContextMenuproperty 
public var useExternalContextMenu:Boolean = false

Specifies whether the contextMenu is supplied by the developer or should be generated by the component.

Constructor detail
SimpleChat()constructor
public function SimpleChat()
Method detail
close()method
public function close():void

Disposes all listeners to the network and framework classes. Recommended for proper garbage collection of the component.

getUserRole()method 
public function getUserRole(p_userID:String):int

Returns the role of a given user for the chat.

Parameters
p_userID:String — The user ID for the user being queried.

Returns
int
preventTyping()method 
protected function preventTyping(p_event:TextEvent):voidParameters
p_event:TextEvent
setUserRole()method 
public function setUserRole(p_userID:String, p_userRole:int):void

Sets the role of a given user for the chat.

Parameters
p_userID:String — The role value to set on the specified user.
 
p_userRole:int — The ID of the user whose role should be set.
subscribe()method 
public function subscribe():void

Tells the component to begin synchronizing with the service. For UIComponent-based components such as this one, subscribe() is called automatically upon being added to the displayList. For "headless" components, this method must be called explicitly.

Event detail
synchronizationChangeevent 
Event object type: com.adobe.rtc.events.CollectionNodeEvent

Dispatched when the chat pod goes in and out of sync.





 

Send me an e-mail when comments are added to this page | Comment Report

Current page: http://livedocs.adobe.com/labs/acrobatcom/com/adobe/rtc/pods/SimpleChat.html