前の関連記事:LibreOffice5(141)ツールキットのサービスとインターフェイスの一覧
Transliterationのサービスとインターフェイスの一覧
1 2 3 4 5 6 |
def macro(): ctx = XSCRIPTCONTEXT.getComponentContext() # コンポーネントコンテクストの取得。 smgr = ctx.getServiceManager() # サービスマネージャーの取得。 tcu = smgr.createInstanceWithContext( "pq.Tcu" , ctx) # サービス名か実装名でインスタンス化。 transliteration = smgr.createInstanceWithContext( "com.sun.star.i18n.Transliteration" , ctx) # Transliteration tcu.wtree(transliteration) |
└─.i18n.Transliteration
└─.i18n.XExtendedTransliteration
│ char transliterateChar2Char( [in] char cChar
│ ) raises ( .i18n.MultipleCharsOutputException)
│ string transliterateChar2String( [in] char cChar)
│ string transliterateString2String( [in] string aStr,
│ [in] long nStartPos,
│ [in] long nCount)
└─.i18n.XTransliteration
long compareString( [in] string aStr1,
[in] string aStr2)
long compareSubstring( [in] string aStr1,
[in] long nOff1,
[in] long nLen1,
[in] string aStr2,
[in] long nOff2,
[in] long nLen2)
boolean equals( [in] string aStr1,
[in] long nPos1,
[in] long nCount1,
[out] long rMatch1,
[in] string aStr2,
[in] long nPos2,
[in] long nCount2,
[out] long rMatch2)
string folding( [in] string aInStr,
[in] long nStartPos,
[in] long nCount,
[out] [long] rOffset)
[string] getAvailableModules( [in] .lang.Locale aLocale,
[in] short nType)
string getName()
short getType()
void loadModule( [in] .i18n.TransliterationModules eModType,
[in] .lang.Locale aLocale)
void loadModuleByImplName( [in] string aImplName,
[in] .lang.Locale aLocale)
void loadModuleNew( [in] [.i18n.TransliterationModulesNew] aModType,
[in] .lang.Locale aLocale)
void loadModulesByImplNames( [in] [string] aImplNameList,
[in] .lang.Locale aLocale)
string transliterate( [in] string aInStr,
[in] long nStartPos,
[in] long nCount,
[out] [long] rOffset)
[string] transliterateRange( [in] string aStr1,
[in] string aStr2)
└─.i18n.XExtendedTransliteration
│ char transliterateChar2Char( [in] char cChar
│ ) raises ( .i18n.MultipleCharsOutputException)
│ string transliterateChar2String( [in] char cChar)
│ string transliterateString2String( [in] string aStr,
│ [in] long nStartPos,
│ [in] long nCount)
└─.i18n.XTransliteration
long compareString( [in] string aStr1,
[in] string aStr2)
long compareSubstring( [in] string aStr1,
[in] long nOff1,
[in] long nLen1,
[in] string aStr2,
[in] long nOff2,
[in] long nLen2)
boolean equals( [in] string aStr1,
[in] long nPos1,
[in] long nCount1,
[out] long rMatch1,
[in] string aStr2,
[in] long nPos2,
[in] long nCount2,
[out] long rMatch2)
string folding( [in] string aInStr,
[in] long nStartPos,
[in] long nCount,
[out] [long] rOffset)
[string] getAvailableModules( [in] .lang.Locale aLocale,
[in] short nType)
string getName()
short getType()
void loadModule( [in] .i18n.TransliterationModules eModType,
[in] .lang.Locale aLocale)
void loadModuleByImplName( [in] string aImplName,
[in] .lang.Locale aLocale)
void loadModuleNew( [in] [.i18n.TransliterationModulesNew] aModType,
[in] .lang.Locale aLocale)
void loadModulesByImplNames( [in] [string] aImplNameList,
[in] .lang.Locale aLocale)
string transliterate( [in] string aInStr,
[in] long nStartPos,
[in] long nCount,
[out] [long] rOffset)
[string] transliterateRange( [in] string aStr1,
[in] string aStr2)
getAvailableModules()メソッドの戻り値
Localeをja_JPにしたときのgetAvailableModules()メソッドを取得してみました。
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 |
from com.sun.star.lang import Locale # Struct from com.sun.star.i18n import TransliterationType # 定数 def macro(): ctx = XSCRIPTCONTEXT.getComponentContext() # コンポーネントコンテクストの取得。 smgr = ctx.getServiceManager() # サービスマネージャーの取得。 tcu = smgr.createInstanceWithContext( "pq.Tcu" , ctx) # サービス名か実装名でインスタンス化。 transliteration = smgr.createInstanceWithContext( "com.sun.star.i18n.Transliteration" , ctx) # Transliteration availablemodules = transliteration.getAvailableModules(Locale(Language = "ja" , Country = "JP" ), TransliterationType.NONE) if availablemodules: print ( "NONE" ) print (availablemodules) availablemodules = transliteration.getAvailableModules(Locale(Language = "ja" , Country = "JP" ), TransliterationType.ONE_TO_ONE) if availablemodules: print ( "ONE_TO_ONE" ) print (availablemodules) availablemodules = transliteration.getAvailableModules(Locale(Language = "ja" , Country = "JP" ), TransliterationType.NUMERIC) if availablemodules: print ( "NUMERIC" ) print (availablemodules) availablemodules = transliteration.getAvailableModules(Locale(Language = "ja" , Country = "JP" ), TransliterationType.ONE_TO_ONE_NUMERIC) if availablemodules: print ( "ONE_TO_ONE_NUMERIC" ) print (availablemodules) availablemodules = transliteration.getAvailableModules(Locale(Language = "ja" , Country = "JP" ), TransliterationType.IGNORE) if availablemodules: print ( "IGNORE" ) print (availablemodules) availablemodules = transliteration.getAvailableModules(Locale(Language = "ja" , Country = "JP" ), TransliterationType.CASCADE) if availablemodules: print ( "CASCADE" ) print (availablemodules) |
ONE_TO_ONE ( 'HALFWIDTH_FULLWIDTH' , 'FULLWIDTH_HALFWIDTH' , 'KATAKANA_HIRAGANA' , 'HIRAGANA_KATAKANA' , 'FULLWIDTHKATAKANA_HALFWIDTHKATAKANA' , 'HALFWIDTHKATAKANA_FULLWIDTHKATAKANA' , 'FULLWIDTH_HALFWIDTH_LIKE_ASC' , 'HALFWIDTH_FULLWIDTH_LIKE_JIS' , 'smallToLarge_ja_JP' , 'largeToSmall_ja_JP' ) ONE_TO_ONE_NUMERIC ( 'HALFWIDTH_FULLWIDTH' , 'FULLWIDTH_HALFWIDTH' , 'KATAKANA_HIRAGANA' , 'HIRAGANA_KATAKANA' , 'FULLWIDTHKATAKANA_HALFWIDTHKATAKANA' , 'HALFWIDTHKATAKANA_FULLWIDTHKATAKANA' , 'FULLWIDTH_HALFWIDTH_LIKE_ASC' , 'HALFWIDTH_FULLWIDTH_LIKE_JIS' , 'smallToLarge_ja_JP' , 'largeToSmall_ja_JP' ) IGNORE ( 'IGNORE_WIDTH' , 'ignoreTraditionalKana_ja_JP' , 'ignoreTraditionalKanji_ja_JP' , 'IGNORE_KANA' , 'ignoreMinusSign_ja_JP' , 'ignoreIterationMark_ja_JP' , 'ignoreSeparator_ja_JP' , 'ignoreZiZu_ja_JP' , 'ignoreBaFa_ja_JP' , 'ignoreTiJi_ja_JP' , 'ignoreHyuByu_ja_JP' , 'ignoreSeZe_ja_JP' , 'ignoreIandEfollowedByYa_ja_JP' , 'ignoreKiKuFollowedBySa_ja_JP' , 'ignoreSize_ja_JP' , 'ignoreProlongedSoundMark_ja_JP' , 'ignoreMiddleDot_ja_JP' , 'ignoreSpace_ja_JP' ) |
0 件のコメント:
コメントを投稿