LAnnAutomation::EnumerateTextTokenTable

#include "ltwrappr.h"

virtual L_INT LAnnAutomation::EnumerateTextTokenTable()

Lets you examine the contents of the annotation text token table.

Returns

Value Meaning
SUCCESS The function was successful.
< 1 An error occurred. Refer to Return Codes.

Comments

Use this function to examine the contents of the annotation text token table. This function is used with the text annotation objects that support tokens, namely the following:

The LAnnAutomation::EnumTextTokenTableCallBack is called for each token. Note that the tokens cannot be changed with this function. To modify the text token table, use one of the following functions:

Required DLLs and Libraries

Platforms

Win32, x64.

See Also

Functions

Topics

Example

// This sample enumerates all of the tokens in the text token table, // and displays the result

/*<struct>*/ 
#if defined(MyAnnAutomation) 
class MyAnnAutomation: public LAnnAutomation 
{ 
   public: 
      virtual L_INT EnumTextTokenTableCallBack(L_INT nTextTokenCount, L_INT nIndex, pANNTEXTTOKEN pTextToken);  
 
      L_TCHAR m_szMsg[1000];  
 
}; 
#endif 
/*</struct>*/ 
L_INT MyAnnAutomation::EnumTextTokenTableCallBack(L_INT nTextTokenCount, L_INT nIndex, pANNTEXTTOKEN pTextToken)  
{ 
 
   L_TCHAR szTemp[100];  
 
   L_TCHAR *pszType;  
 
 
 
   if (nIndex == 0)  
      wsprintf(m_szMsg, TEXT("Total Tokens: %d\n"), nTextTokenCount);  
 
   pszType = TEXT("Unknown"); 
 
   switch(pTextToken->nTokenType)  
 
   { 
 
      case ANNTOKEN_NONE:  
         pszType = TEXT("ANNTOKEN_NONE"); 
         break;  
      case ANNTOKEN_SEPARATOR:  
         pszType = TEXT("ANNTOKEN_SEPARATOR"); 
         break;  
      case ANNTOKEN_TEXT:  
         pszType = TEXT("ANNTOKEN_TEXT"); 
         break;  
      case ANNTOKEN_DATE_YYYY:  
         pszType = TEXT("ANNTOKEN_DATE_YYYY"); 
         break;  
      case ANNTOKEN_DATE_YY:  
         pszType = TEXT("ANNTOKEN_DATE_YY"); 
         break;  
      case ANNTOKEN_DATE_MM:  
         pszType = TEXT("ANNTOKEN_DATE_MM"); 
         break;  
      case ANNTOKEN_DATE_DD:  
         pszType = TEXT("ANNTOKEN_DATE_DD"); 
         break;  
      case ANNTOKEN_DATE_MONTH_NAME:  
         pszType = TEXT("ANNTOKEN_DATE_MONTH_NAME"); 
         break;  
      case ANNTOKEN_DATE_DAY_OF_WEEK:  
         pszType = TEXT("ANNTOKEN_DATE_DAY_OF_WEEK"); 
         break;  
      case ANNTOKEN_TIME_HH_12:  
         pszType = TEXT("ANNTOKEN_TIME_HH_12"); 
         break;  
      case ANNTOKEN_TIME_HH_24:  
         pszType = TEXT("ANNTOKEN_TIME_HH_24"); 
         break;  
      case ANNTOKEN_TIME_MM:  
         pszType = TEXT("ANNTOKEN_TIME_MM"); 
         break;  
      case ANNTOKEN_TIME_SS:  
         pszType = TEXT("ANNTOKEN_TIME_SS"); 
         break;  
      case ANNTOKEN_TIME_MILLISECONDS:  
         pszType = TEXT("ANNTOKEN_TIME_MILLISECONDS"); 
         break;  
      case ANNTOKEN_AM_PM:  
         pszType = TEXT("ANNTOKEN_AM_PM"); 
         break;  
 
   } 
 
   wsprintf(szTemp, TEXT("[%d]#%c\t%s\t%s\t%s\n"),  
             nIndex, pTextToken->cToken ? pTextToken->cToken : ' ', pTextToken->pszDesc  
             ? pTextToken->pszDesc : TEXT(""), pTextToken->pszTokenString  
             ? pTextToken->pszTokenString : TEXT(""), pszType);  
 
 
 
   return SUCCESS;  
 
} 
 
L_INT LAnnAutomation_EnumerateTextTokenTableExample(MyAnnAutomation *pLAutomation)  
{ 
   L_INT nRet; 
 
   lstrcpy(pLAutomation->m_szMsg, TEXT("")); 
 
   pLAutomation->EnableCallBack(TRUE);  
  
   nRet = pLAutomation->EnumerateTextTokenTable(); 
   if(nRet != SUCCESS) 
      return nRet; 
 
   MessageBox(NULL, pLAutomation->m_szMsg, TEXT("Text Token Table"), MB_OK);  
 
   return SUCCESS; 
} 

Help Version 20.0.2020.4.5
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2020 LEAD Technologies, Inc. All Rights Reserved.

LEADTOOLS Raster Imaging C++ Class Library Help