1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/intl/icu/source/i18n/titletrn.h Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,90 @@ 1.4 +/* 1.5 +********************************************************************** 1.6 +* Copyright (C) 2001-2007, International Business Machines 1.7 +* Corporation and others. All Rights Reserved. 1.8 +********************************************************************** 1.9 +* Date Name Description 1.10 +* 05/24/01 aliu Creation. 1.11 +********************************************************************** 1.12 +*/ 1.13 +#ifndef TITLETRN_H 1.14 +#define TITLETRN_H 1.15 + 1.16 +#include "unicode/utypes.h" 1.17 + 1.18 +#if !UCONFIG_NO_TRANSLITERATION 1.19 + 1.20 +#include "unicode/translit.h" 1.21 +#include "ucase.h" 1.22 +#include "casetrn.h" 1.23 + 1.24 +U_NAMESPACE_BEGIN 1.25 + 1.26 +/** 1.27 + * A transliterator that converts all letters (as defined by 1.28 + * <code>UCharacter.isLetter()</code>) to lower case, except for those 1.29 + * letters preceded by non-letters. The latter are converted to title 1.30 + * case using <code>u_totitle()</code>. 1.31 + * @author Alan Liu 1.32 + */ 1.33 +class TitlecaseTransliterator : public CaseMapTransliterator { 1.34 + public: 1.35 + 1.36 + /** 1.37 + * Constructs a transliterator. 1.38 + * @param loc the given locale. 1.39 + */ 1.40 + TitlecaseTransliterator(); 1.41 + 1.42 + /** 1.43 + * Destructor. 1.44 + */ 1.45 + virtual ~TitlecaseTransliterator(); 1.46 + 1.47 + /** 1.48 + * Copy constructor. 1.49 + */ 1.50 + TitlecaseTransliterator(const TitlecaseTransliterator&); 1.51 + 1.52 + /** 1.53 + * Transliterator API. 1.54 + * @return a copy of the object. 1.55 + */ 1.56 + virtual Transliterator* clone(void) const; 1.57 + 1.58 + /** 1.59 + * ICU "poor man's RTTI", returns a UClassID for the actual class. 1.60 + */ 1.61 + virtual UClassID getDynamicClassID() const; 1.62 + 1.63 + /** 1.64 + * ICU "poor man's RTTI", returns a UClassID for this class. 1.65 + */ 1.66 + U_I18N_API static UClassID U_EXPORT2 getStaticClassID(); 1.67 + 1.68 +protected: 1.69 + 1.70 + /** 1.71 + * Implements {@link Transliterator#handleTransliterate}. 1.72 + * @param text the buffer holding transliterated and 1.73 + * untransliterated text 1.74 + * @param offset the start and limit of the text, the position 1.75 + * of the cursor, and the start and limit of transliteration. 1.76 + * @param incremental if true, assume more text may be coming after 1.77 + * pos.contextLimit. Otherwise, assume the text is complete. 1.78 + */ 1.79 + virtual void handleTransliterate(Replaceable& text, UTransPosition& offset, 1.80 + UBool isIncremental) const; 1.81 + 1.82 +private: 1.83 + /** 1.84 + * Assignment operator. 1.85 + */ 1.86 + TitlecaseTransliterator& operator=(const TitlecaseTransliterator&); 1.87 +}; 1.88 + 1.89 +U_NAMESPACE_END 1.90 + 1.91 +#endif /* #if !UCONFIG_NO_TRANSLITERATION */ 1.92 + 1.93 +#endif