class IO2GMessageTableRow

Parents
IO2GMessageRow

Brief

The class provides access to the message information.

Details

The class represents a single row of the Messages table.

Prerequisites

The class is available only through the use of the IO2GTableManager. An IO2GTableManager object must have the O2GTableManagerStatus.TablesLoaded status.
For complete instructions on the table manager usage, see the How to use table manager in ForexConnect API section.
After tables are loaded, you must obtain an instance of the IO2GMessagesTable class. For example,

O2GMessagesTable messagesTable = (O2GMessagesTable)tableManager.getTable(O2GTable::Messages);

Instantiating the class

If you need access to the current message information, you can get an instance of the class by calling any of the following methods of the IO2GMessagesTable class:

IO2GMessagesTable method

Syntax example

getRow

IO2GMessageTableRow *message = messagesTable->getRow(i);

findRow

IO2GMessageTableRow *message = NULL;
bool bFound = messagesTable->findRow(mTradeID, message);

getNextRow

IO2GMessageTableRow *message = NULL;
bool bFound = messagesTable->getNextRow(mIterator, message);

getNextRowByColumnValue

IO2GMessageTableRow *message = NULL;
bool bFound = messagesTable->getNextRowByColumnValue("OfferID", (void *)mOfferID, mIterator, message);

getNextRowByColumnValues

IO2GMessageTableRow *message = NULL;
const void *values[] = {(void *)"1", (void *)"2"};
bool bFound = messagesTable->getNextRowByColumnValues("Type", 2, values, mIterator, message);

getNextRowByMultiColumnValues

IO2GMessageTableRow *message = NULL;
const char *names[] = {"Feature", "From"};
const void *values[] = {(void *)mFeature, (void *)mFrom};
bool bFound = messagesTable->getNextRowByMultiColumnValues(2, names, values, mIterator, message);

If you want to track incoming messages, your application must have a listener class that implements the IO2GTableListener interface. An instance of the listener class must be subscribed to the table update with the O2GTableUpdateType.Insert type. Before the logout, you must unsubscribe the listener from this update type. The examples of subscription/unsubscription syntax are listed below.

IO2GTableListener method

Subscribe syntax

Unsubscribe syntax

onAdded

messagesTable.subscribeUpdate(O2GTableUpdateType.INSERT, tableListener);

messagesTable.unsubscribeUpdate(O2GTableUpdateType.INSERT, tableListener);

To instantiate the O2MessageTableRow class, you must cast the rowData parameter of the above onAdded method to the O2GMessageTableRow type. For example,

O2MessageTableRow row = (O2GMessageTableRow)(rowData);

Example

Get message sender and text [show]

Public Methods

columns

Gets the columns of the table.

getCell

Gets value of a table cell.

getFeature

Gets the type of the message content.

getFrom

Gets the login of the message sender.

getHTMLFragmentFlag

Gets the flag indicating whether the message is in the HTML format or not.

getMsgID

Gets the unique identification number of the message.

getSubject

Gets the subject of the message.

getTableType

Gets the type of the table.

getText

Gets a text body of the message.

getTime

Gets the date and time when the recipient receives the message.

getType

Gets the message container.

isCellChanged

Gets a flag indicating whether the value of the cell is changed.

back