Wed, 31 Dec 2014 06:09:35 +0100
Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.
michael@0 | 1 | /* |
michael@0 | 2 | ******************************************************************************* |
michael@0 | 3 | * Copyright (C) 2008-2013, International Business Machines Corporation and |
michael@0 | 4 | * others. All Rights Reserved. |
michael@0 | 5 | ******************************************************************************* |
michael@0 | 6 | * |
michael@0 | 7 | * |
michael@0 | 8 | * File GENDER.H |
michael@0 | 9 | * |
michael@0 | 10 | * Modification History:* |
michael@0 | 11 | * Date Name Description |
michael@0 | 12 | * |
michael@0 | 13 | ******************************************************************************** |
michael@0 | 14 | */ |
michael@0 | 15 | |
michael@0 | 16 | #ifndef _GENDER |
michael@0 | 17 | #define _GENDER |
michael@0 | 18 | |
michael@0 | 19 | #include "unicode/utypes.h" |
michael@0 | 20 | |
michael@0 | 21 | #if !UCONFIG_NO_FORMATTING |
michael@0 | 22 | |
michael@0 | 23 | #include "unicode/locid.h" |
michael@0 | 24 | #include "unicode/ugender.h" |
michael@0 | 25 | #include "unicode/uobject.h" |
michael@0 | 26 | |
michael@0 | 27 | class GenderInfoTest; |
michael@0 | 28 | |
michael@0 | 29 | U_NAMESPACE_BEGIN |
michael@0 | 30 | |
michael@0 | 31 | // Forward Declaration |
michael@0 | 32 | void GenderInfo_initCache(UErrorCode &status); |
michael@0 | 33 | |
michael@0 | 34 | /** |
michael@0 | 35 | * GenderInfo computes the gender of a list as a whole given the gender of |
michael@0 | 36 | * each element. |
michael@0 | 37 | * @stable ICU 50 |
michael@0 | 38 | */ |
michael@0 | 39 | class U_I18N_API GenderInfo : public UObject { |
michael@0 | 40 | public: |
michael@0 | 41 | |
michael@0 | 42 | /** |
michael@0 | 43 | * Provides access to the predefined GenderInfo object for a given |
michael@0 | 44 | * locale. |
michael@0 | 45 | * |
michael@0 | 46 | * @param locale The locale for which a <code>GenderInfo</code> object is |
michael@0 | 47 | * returned. |
michael@0 | 48 | * @param status Output param set to success/failure code on exit, which |
michael@0 | 49 | * must not indicate a failure before the function call. |
michael@0 | 50 | * @return The predefined <code>GenderInfo</code> object pointer for |
michael@0 | 51 | * this locale. The returned object is immutable, so it is |
michael@0 | 52 | * declared as const. Caller does not own the returned |
michael@0 | 53 | * pointer, so it must not attempt to free it. |
michael@0 | 54 | * @stable ICU 50 |
michael@0 | 55 | */ |
michael@0 | 56 | static const GenderInfo* U_EXPORT2 getInstance(const Locale& locale, UErrorCode& status); |
michael@0 | 57 | |
michael@0 | 58 | /** |
michael@0 | 59 | * Determines the gender of a list as a whole given the gender of each |
michael@0 | 60 | * of the elements. |
michael@0 | 61 | * |
michael@0 | 62 | * @param genders the gender of each element in the list. |
michael@0 | 63 | * @param length the length of gender array. |
michael@0 | 64 | * @param status Output param set to success/failure code on exit, which |
michael@0 | 65 | * must not indicate a failure before the function call. |
michael@0 | 66 | * @return the gender of the whole list. |
michael@0 | 67 | * @stable ICU 50 |
michael@0 | 68 | */ |
michael@0 | 69 | UGender getListGender(const UGender* genders, int32_t length, UErrorCode& status) const; |
michael@0 | 70 | |
michael@0 | 71 | /** |
michael@0 | 72 | * Destructor. |
michael@0 | 73 | * |
michael@0 | 74 | * @stable ICU 50 |
michael@0 | 75 | */ |
michael@0 | 76 | virtual ~GenderInfo(); |
michael@0 | 77 | |
michael@0 | 78 | private: |
michael@0 | 79 | int32_t _style; |
michael@0 | 80 | |
michael@0 | 81 | /** |
michael@0 | 82 | * Copy constructor. One object per locale invariant. Clients |
michael@0 | 83 | * must never copy GenderInfo objects. |
michael@0 | 84 | */ |
michael@0 | 85 | GenderInfo(const GenderInfo& other); |
michael@0 | 86 | |
michael@0 | 87 | /** |
michael@0 | 88 | * Assignment operator. Not applicable to immutable objects. |
michael@0 | 89 | */ |
michael@0 | 90 | GenderInfo& operator=(const GenderInfo&); |
michael@0 | 91 | |
michael@0 | 92 | GenderInfo(); |
michael@0 | 93 | |
michael@0 | 94 | static const GenderInfo* getNeutralInstance(); |
michael@0 | 95 | |
michael@0 | 96 | static const GenderInfo* getMixedNeutralInstance(); |
michael@0 | 97 | |
michael@0 | 98 | static const GenderInfo* getMaleTaintsInstance(); |
michael@0 | 99 | |
michael@0 | 100 | static const GenderInfo* loadInstance(const Locale& locale, UErrorCode& status); |
michael@0 | 101 | |
michael@0 | 102 | friend class ::GenderInfoTest; |
michael@0 | 103 | friend void GenderInfo_initCache(UErrorCode &status); |
michael@0 | 104 | }; |
michael@0 | 105 | |
michael@0 | 106 | U_NAMESPACE_END |
michael@0 | 107 | |
michael@0 | 108 | #endif /* #if !UCONFIG_NO_FORMATTING */ |
michael@0 | 109 | |
michael@0 | 110 | #endif // _GENDER |
michael@0 | 111 | //eof |