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