Back to index

im-sdk  12.3.91
Public Types | Public Member Functions | Private Attributes
IIIMInputContextPrivate Class Reference

List of all members.

Public Types

typedef
IIIMInputContext::IIIMICLIST 
IIIMICLIST
typedef
IIIMInputContext::IIIMICLISTITR 
IIIMICLISTITR
typedef
IIIMInputContext::IIIMInputContextID 
IIIMInputContextID

Public Member Functions

 IIIMInputContextPrivate (IIIMInputContext *iiimqc)
bool getLookupChoiceItems (QStringList &slist, int *psize, int *pfirst_index, int *plast_index, int *pcurrent_index)
bool getLookupTitle (QString &title)

Private Attributes

IIIMInputContext * _iiimqc

Detailed Description

Definition at line 51 of file iiimqccontext.cpp.


Member Typedef Documentation

typedef IIIMInputContext::IIIMICLIST IIIMInputContextPrivate::IIIMICLIST

Definition at line 54 of file iiimqccontext.cpp.

typedef IIIMInputContext::IIIMICLISTITR IIIMInputContextPrivate::IIIMICLISTITR

Definition at line 55 of file iiimqccontext.cpp.

Definition at line 56 of file iiimqccontext.cpp.


Constructor & Destructor Documentation

IIIMInputContextPrivate::IIIMInputContextPrivate ( IIIMInputContext *  iiimqc)

Definition at line 69 of file iiimqccontext.cpp.

{
  if (iiimqc)
    _iiimqc = iiimqc;
  else
    _iiimqc = 0;
}

Member Function Documentation

bool IIIMInputContextPrivate::getLookupChoiceItems ( QStringList &  slist,
int *  psize,
int *  pfirst_index,
int *  plast_index,
int *  pcurrent_index 
)

Definition at line 78 of file iiimqccontext.cpp.

{
  IIIMCF_context context;
  IIIMCF_lookup_choice lookup_choice;
  IIIMF_status st;
  QString *qlabel;
  QString *qcandidate;
 
  int size = 0;
  int index_of_first_candidate = 0;
  int index_of_last_candidate = 0;
  int index_of_current_candidate = 0;

  IIIMCF_text acandidate;
  IIIMCF_text alabel;
  int flag;
  IIIMICLISTITR itr = _iiimqc->_curic;
  context = (*itr)._c;
 
  if(!context)
       return FALSE;
 
  st = iiimcf_get_lookup_choice (context, &lookup_choice);
  if(st != IIIMF_STATUS_SUCCESS)
  {
       DEBUG_DO(qDebug("**IIIMQCF: iiimcf_get_lookup_choice(): error\n"));    
       return FALSE;
  }    
  
  if(!lookup_choice)
  {
       DEBUG_DO(qDebug("**IIIMQCF: iiimcf_get_lookup_choice(): error\n"));    
       return FALSE;
  }
     
  st = iiimcf_get_lookup_choice_size (lookup_choice,
                             &size,
                             &index_of_first_candidate,
                             &index_of_last_candidate,
                             &index_of_current_candidate);
  if( st != IIIMF_STATUS_SUCCESS)
  {
       DEBUG_DO(qDebug("**IIIMQCF: iiimcf_get_lookup_choice_size(): error\n"));
       return FALSE;
  }     
  
  if (psize)
    *psize = size;
  if (pfirst_index)
    *pfirst_index = index_of_first_candidate;
  if (plast_index)
    *plast_index = index_of_last_candidate;
  if (pcurrent_index)
    *pcurrent_index = index_of_current_candidate;
  
  for (int idx = 0; idx < size; idx++){
    const IIIMP_card16 *u16text;
    const IIIMP_card16 *u16label;
    int thelength; int labellength;

    st = iiimcf_get_lookup_choice_item (lookup_choice, idx,
                               &acandidate, &alabel,
                               &flag);
    if( st != IIIMF_STATUS_SUCCESS )
    {
       DEBUG_DO(qDebug("**IIIMQCF: iiimcf_get_lookup_choice_item(): error, idx is %d\n", idx));
       continue;
    }  

    st = iiimcf_get_text_utf16string (acandidate, &u16text);
    if (st != IIIMF_STATUS_SUCCESS)
      continue;
  
    st = iiimcf_get_text_length (acandidate, &thelength);
    if (st != IIIMF_STATUS_SUCCESS)
      continue;

        
    st = iiimcf_get_text_utf16string (alabel, &u16label);
    if (st != IIIMF_STATUS_SUCCESS)
      continue;
  
    st = iiimcf_get_text_length (alabel, &labellength);
    if (st != IIIMF_STATUS_SUCCESS)
      continue;
  
    qlabel = new QString((const QChar *)u16label, labellength);
    qcandidate = new QString((const QChar *)u16text, thelength);
    
    DEBUG_DO(qDebug("**IIIMQCF: label: %s.\n", (const char*)qlabel->utf8())); 
    DEBUG_DO(qDebug ("**IIIMQCF: candidate:%s.\n", (const char *)qcandidate->utf8()));
    if(qlabel->isEmpty() || *qlabel == " ")
       qstrlist.append(*qcandidate);
     else
       qstrlist.append (*qlabel + " " +  *qcandidate);
   
    delete qlabel;
    delete qcandidate;                                  
  }

  return TRUE;
}

Here is the call graph for this function:

bool IIIMInputContextPrivate::getLookupTitle ( QString &  title)

Definition at line 186 of file iiimqccontext.cpp.

{
  IIIMF_status st;
  IIIMCF_text text;
  const IIIMP_card16 *u16text;
  int thelength;
  IIIMCF_lookup_choice lookup_choice;
  IIIMCF_context context;
  IIIMICLISTITR itr = _iiimqc->_curic;
 
  title = QString::null;

  context = (*itr)._c;
  if(!context)
       return FALSE;

  st = iiimcf_get_lookup_choice (context, &lookup_choice);
  if(st != IIIMF_STATUS_SUCCESS)
  {
        DEBUG_DO(qDebug("**IIIMQCF: iiimcf_get_lookup_choice(): error\n"));
        return FALSE;
  }

  if(!lookup_choice)
  {
        DEBUG_DO(qDebug("**IIIMQCF: iiimcf_get_lookup_choice(): error\n"));
        return FALSE;
  }
  

  st = iiimcf_get_lookup_choice_title (lookup_choice, &text);
  if (st != IIIMF_STATUS_SUCCESS)
  {
      DEBUG_DO(qDebug("**IIIMQCF: Failed to get lookup choice title"));
      return FALSE;
  }
  
  st = iiimcf_get_text_utf16string (text, &u16text);
  if (st != IIIMF_STATUS_SUCCESS)
     return FALSE;

  st = iiimcf_get_text_length (text, &thelength);
  if (st != IIIMF_STATUS_SUCCESS)
     return FALSE;
 
   QString *tmp = new QString((const QChar *)u16text, thelength);
   title.append(*tmp);
   delete tmp;
 
    return TRUE;
}

Here is the call graph for this function:


Member Data Documentation

IIIMInputContext* IIIMInputContextPrivate::_iiimqc [private]

Definition at line 66 of file iiimqccontext.cpp.


The documentation for this class was generated from the following file: