michael@0: /* michael@0: ******************************************************************************* michael@0: * michael@0: * Copyright (C) 2001-2008, International Business Machines michael@0: * Corporation and others. All Rights Reserved. michael@0: * michael@0: ******************************************************************************* michael@0: * file name: casetrn.h michael@0: * encoding: US-ASCII michael@0: * tab size: 8 (not used) michael@0: * indentation:4 michael@0: * michael@0: * created on: 2004sep03 michael@0: * created by: Markus W. Scherer michael@0: * michael@0: * Implementation class for lower-/upper-/title-casing transliterators. michael@0: */ michael@0: michael@0: #ifndef __CASETRN_H__ michael@0: #define __CASETRN_H__ michael@0: michael@0: #include "unicode/utypes.h" michael@0: michael@0: #if !UCONFIG_NO_TRANSLITERATION michael@0: michael@0: #include "unicode/translit.h" michael@0: #include "ucase.h" michael@0: michael@0: U_NAMESPACE_BEGIN michael@0: michael@0: /** michael@0: * A transliterator that performs locale-sensitive michael@0: * case mapping. michael@0: */ michael@0: class CaseMapTransliterator : public Transliterator { michael@0: public: michael@0: /** michael@0: * Constructs a transliterator. michael@0: * @param loc the given locale. michael@0: * @param id the transliterator ID. michael@0: * @param map the full case mapping function (see ucase.h) michael@0: */ michael@0: CaseMapTransliterator(const UnicodeString &id, UCaseMapFull *map); michael@0: michael@0: /** michael@0: * Destructor. michael@0: */ michael@0: virtual ~CaseMapTransliterator(); michael@0: michael@0: /** michael@0: * Copy constructor. michael@0: */ michael@0: CaseMapTransliterator(const CaseMapTransliterator&); michael@0: michael@0: /** michael@0: * Transliterator API. michael@0: * @return a copy of the object. michael@0: */ michael@0: virtual Transliterator* clone(void) const = 0; michael@0: michael@0: /** michael@0: * ICU "poor man's RTTI", returns a UClassID for the actual class. michael@0: */ michael@0: //virtual UClassID getDynamicClassID() const; michael@0: michael@0: /** michael@0: * ICU "poor man's RTTI", returns a UClassID for this class. michael@0: */ michael@0: U_I18N_API static UClassID U_EXPORT2 getStaticClassID(); michael@0: michael@0: protected: michael@0: /** michael@0: * Implements {@link Transliterator#handleTransliterate}. michael@0: * @param text the buffer holding transliterated and michael@0: * untransliterated text michael@0: * @param offset the start and limit of the text, the position michael@0: * of the cursor, and the start and limit of transliteration. michael@0: * @param incremental if true, assume more text may be coming after michael@0: * pos.contextLimit. Otherwise, assume the text is complete. michael@0: */ michael@0: virtual void handleTransliterate(Replaceable& text, michael@0: UTransPosition& offsets, michael@0: UBool isIncremental) const; michael@0: michael@0: const UCaseProps *fCsp; michael@0: UCaseMapFull *fMap; michael@0: michael@0: private: michael@0: /** michael@0: * Assignment operator. michael@0: */ michael@0: CaseMapTransliterator& operator=(const CaseMapTransliterator&); michael@0: michael@0: }; michael@0: michael@0: U_NAMESPACE_END michael@0: michael@0: /** case context iterator using a Replaceable. This must be a C function because it is a callback. */ michael@0: U_CFUNC UChar32 U_CALLCONV michael@0: utrans_rep_caseContextIterator(void *context, int8_t dir); michael@0: michael@0: #endif /* #if !UCONFIG_NO_TRANSLITERATION */ michael@0: michael@0: #endif