Cisco Cisco Computer Telephony Integration Option 9.0 Developer's Guide

Page of 640
 
Chapter 4      Building Your Application
Working with Calls
4-58
CTI OS Developer’s Guide for Cisco ICM/IPCC Enterprise & Hosted Editions Release 7.0(0)
The following example shows this in Java:
void OnButtonEnablementChange(Arguments rArguments) {
 m_appFrame.LogEvent("OnButtonEnablementChange", rArguments);
 // Get mask from message
 Long LMask = rArguments.GetValueUIntObj(CTIOS_ENABLEMENTMASK);
 if (null==LMask)
   return;
 
 final long bitMask = LMask.longValue();
 
 /* Transfer modification of the GUI objects to the     
 
EventDispatchThread or we could have a thread sync issue.  We're 
currently on the CtiOsSession's event thread.*/
 SwingUtilities.invokeLater(new Runnable() {
   public void run() {
 /* Enable a button if it's bit is 
turned on.  Disable it if not.*/
 m_appFrame.m_btnAnswer.setEnabled (((bitMask & ENABLE_ANSWER) > 0));
 m_appFrame.m_btnConference.setEnabled 
       (((bitMask & ENABLE_CONFERENCE_COMPLETE) > 0));
 m_appFrame.m_btnCCConference.setEnabled
       (((bitMask & ENABLE_CONFERENCE_INIT) > 0));
 m_appFrame.m_btnHold.setEnabled (((bitMask & ENABLE_HOLD) > 0));
 m_appFrame.m_btnLogin.setEnabled (((bitMask & ENABLE_LOGIN)> 0));
 m_appFrame.m_btnLogout.setEnabled 
      (((bitMask & (ENABLE_LOGOUT | 
        CtiOs_Enums.ButtonEnablement.ENABLE_LOGOUT_WITH_REASON)) >    
 
            0));
 m_appFrame.m_btnMakeCall.setEnabled 
       (((bitMask & ENABLE_MAKECALL) > 0));
 m_appFrame.m_btnNotReady.setEnabled(((bitMask & (ENABLE_NOTREADY | 
 
        ENABLE_NOTREADY_WITH_REASON)) > 0));
 m_appFrame.m_btnReady.setEnabled(((bitMask & ENABLE_READY) > 0));
 m_appFrame.m_btnRelease.setEnabled(((bitMask & ENABLE_RELEASE)> 0));
 m_appFrame.m_btnRetrieve.setEnabled 
 
       (((bitMask & ENABLE_RETRIEVE) > 0));
 m_appFrame.m_btnSSTransfer.setEnabled
       (((bitMask & ENABLE_SINGLE_STEP_TRANSFER)> 0));
 m_appFrame.m_btnSSConference.setEnabled
        (((bitMask & ENABLE_SINGLE_STEP_CONFERENCE) > 0));
 m_appFrame.m_btnTransfer.setEnabled 
 
        (((bitMask & ENABLE_TRANSFER_COMPLETE)> 0));
  m_appFrame.m_btnCCTransfer.setEnabled 
 
      (((bitMask & ENABLE_TRANSFER_INIT) > 0));