rero.client.output
Class ChatCapabilities

java.lang.Object
  extended by rero.client.Feature
      extended by rero.client.output.ChatCapabilities

public class ChatCapabilities
extends Feature


Field Summary
protected  DataDCC dccData
           
protected  OutputCapabilities output
           
protected  SocketConnection sock
           
 
Fields inherited from class rero.client.Feature
abilities
 
Constructor Summary
ChatCapabilities()
           
 
Method Summary
 void init()
           
 void sendAction(java.lang.String target, java.lang.String message)
           
 void sendMessage(java.lang.String nickname, java.lang.String message)
           
 void sendNotice(java.lang.String target, java.lang.String message)
           
 void sendReply(java.lang.String target, java.lang.String type, java.lang.String parms)
           
 void sendRequest(java.lang.String target, java.lang.String type, java.lang.String parms)
           
protected static java.lang.String wrapLine(java.lang.String line, java.lang.String newline, int wrapColumn)
          Wraps a single line of text.
static java.lang.String[] wrapMessageToStringsArray(java.lang.String message, int length)
           
static java.lang.String wrapText(java.lang.String inString, java.lang.String newline, int wrapColumn)
          Takes a block of text which might have long lines in it and wraps the long lines based on the supplied wrapColumn parameter.
 
Methods inherited from class rero.client.Feature
cleanup, getCapabilities, installCapabilities, storeDataStructures
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

sock

protected SocketConnection sock

output

protected OutputCapabilities output

dccData

protected DataDCC dccData
Constructor Detail

ChatCapabilities

public ChatCapabilities()
Method Detail

init

public void init()
Specified by:
init in class Feature

sendMessage

public void sendMessage(java.lang.String nickname,
                        java.lang.String message)

sendNotice

public void sendNotice(java.lang.String target,
                       java.lang.String message)

sendAction

public void sendAction(java.lang.String target,
                       java.lang.String message)

sendRequest

public void sendRequest(java.lang.String target,
                        java.lang.String type,
                        java.lang.String parms)

sendReply

public void sendReply(java.lang.String target,
                      java.lang.String type,
                      java.lang.String parms)

wrapMessageToStringsArray

public static java.lang.String[] wrapMessageToStringsArray(java.lang.String message,
                                                           int length)

wrapText

public static java.lang.String wrapText(java.lang.String inString,
                                        java.lang.String newline,
                                        int wrapColumn)
Takes a block of text which might have long lines in it and wraps the long lines based on the supplied wrapColumn parameter. It was initially implemented for use by VelocityEmail. If there are tabs in inString, you are going to get results that are a bit strange, since tabs are a single character but are displayed as 4 or 8 spaces. Remove the tabs.

Parameters:
inString - Text which is in need of word-wrapping.
newline - The characters that define a newline.
wrapColumn - The column to wrap the words at.
Returns:
The text with all the long lines word-wrapped.

wrapLine

protected static java.lang.String wrapLine(java.lang.String line,
                                           java.lang.String newline,
                                           int wrapColumn)
Wraps a single line of text. Called by wrapText(). I can't think of any good reason for exposing this to the public, since wrapText should always be used AFAIK.

Parameters:
line - A line which is in need of word-wrapping.
newline - The characters that define a newline.
wrapColumn - The column to wrap the words at.
Returns:
A line with newlines inserted.