michael@0: /* michael@0: ******************************************************************************* michael@0: * Copyright (C) 2008-2013, International Business Machines Corporation and michael@0: * others. All Rights Reserved. michael@0: ******************************************************************************* michael@0: * michael@0: * michael@0: * File GENDER.H michael@0: * michael@0: * Modification History:* michael@0: * Date Name Description michael@0: * michael@0: ******************************************************************************** michael@0: */ michael@0: michael@0: #ifndef _GENDER michael@0: #define _GENDER michael@0: michael@0: #include "unicode/utypes.h" michael@0: michael@0: #if !UCONFIG_NO_FORMATTING michael@0: michael@0: #include "unicode/locid.h" michael@0: #include "unicode/ugender.h" michael@0: #include "unicode/uobject.h" michael@0: michael@0: class GenderInfoTest; michael@0: michael@0: U_NAMESPACE_BEGIN michael@0: michael@0: // Forward Declaration michael@0: void GenderInfo_initCache(UErrorCode &status); michael@0: michael@0: /** michael@0: * GenderInfo computes the gender of a list as a whole given the gender of michael@0: * each element. michael@0: * @stable ICU 50 michael@0: */ michael@0: class U_I18N_API GenderInfo : public UObject { michael@0: public: michael@0: michael@0: /** michael@0: * Provides access to the predefined GenderInfo object for a given michael@0: * locale. michael@0: * michael@0: * @param locale The locale for which a GenderInfo object is michael@0: * returned. michael@0: * @param status Output param set to success/failure code on exit, which michael@0: * must not indicate a failure before the function call. michael@0: * @return The predefined GenderInfo object pointer for michael@0: * this locale. The returned object is immutable, so it is michael@0: * declared as const. Caller does not own the returned michael@0: * pointer, so it must not attempt to free it. michael@0: * @stable ICU 50 michael@0: */ michael@0: static const GenderInfo* U_EXPORT2 getInstance(const Locale& locale, UErrorCode& status); michael@0: michael@0: /** michael@0: * Determines the gender of a list as a whole given the gender of each michael@0: * of the elements. michael@0: * michael@0: * @param genders the gender of each element in the list. michael@0: * @param length the length of gender array. michael@0: * @param status Output param set to success/failure code on exit, which michael@0: * must not indicate a failure before the function call. michael@0: * @return the gender of the whole list. michael@0: * @stable ICU 50 michael@0: */ michael@0: UGender getListGender(const UGender* genders, int32_t length, UErrorCode& status) const; michael@0: michael@0: /** michael@0: * Destructor. michael@0: * michael@0: * @stable ICU 50 michael@0: */ michael@0: virtual ~GenderInfo(); michael@0: michael@0: private: michael@0: int32_t _style; michael@0: michael@0: /** michael@0: * Copy constructor. One object per locale invariant. Clients michael@0: * must never copy GenderInfo objects. michael@0: */ michael@0: GenderInfo(const GenderInfo& other); michael@0: michael@0: /** michael@0: * Assignment operator. Not applicable to immutable objects. michael@0: */ michael@0: GenderInfo& operator=(const GenderInfo&); michael@0: michael@0: GenderInfo(); michael@0: michael@0: static const GenderInfo* getNeutralInstance(); michael@0: michael@0: static const GenderInfo* getMixedNeutralInstance(); michael@0: michael@0: static const GenderInfo* getMaleTaintsInstance(); michael@0: michael@0: static const GenderInfo* loadInstance(const Locale& locale, UErrorCode& status); michael@0: michael@0: friend class ::GenderInfoTest; michael@0: friend void GenderInfo_initCache(UErrorCode &status); michael@0: }; michael@0: michael@0: U_NAMESPACE_END michael@0: michael@0: #endif /* #if !UCONFIG_NO_FORMATTING */ michael@0: michael@0: #endif // _GENDER michael@0: //eof