Home | History | Annotate | Download | only in unicode
      1 /*
      2 *****************************************************************************************
      3 * Copyright (C) 2010-2012, International Business Machines
      4 * Corporation and others. All Rights Reserved.
      5 *****************************************************************************************
      6 */
      7 
      8 #ifndef UGENDER_H
      9 #define UGENDER_H
     10 
     11 #include "unicode/utypes.h"
     12 
     13 #if !UCONFIG_NO_FORMATTING
     14 
     15 #include "unicode/localpointer.h"
     16 
     17 /**
     18  * \file
     19  * \brief C API: The purpose of this API is to compute the gender of a list as a
     20  * whole given the gender of each element.
     21  *
     22  */
     23 
     24 /**
     25  * Genders
     26  * @draft ICU 50
     27  */
     28 enum UGender {
     29     /**
     30      * Male gender.
     31      * @draft ICU 50
     32      */
     33     UGENDER_MALE,
     34     /**
     35      * Female gender.
     36      * @draft ICU 50
     37      */
     38     UGENDER_FEMALE,
     39     /**
     40      * Neutral gender.
     41      * @draft ICU 50
     42      */
     43     UGENDER_OTHER
     44 };
     45 /**
     46  * @draft ICU 50
     47  */
     48 typedef enum UGender UGender;
     49 
     50 /**
     51  * Opaque UGenderInfo object for use in C programs.
     52  * @draft ICU 50
     53  */
     54 struct UGenderInfo;
     55 typedef struct UGenderInfo UGenderInfo;
     56 
     57 /**
     58  * Opens a new UGenderInfo object given locale.
     59  * @param locale The locale for which the rules are desired.
     60  * @return A UGenderInfo for the specified locale, or NULL if an error occurred.
     61  * @draft ICU 50
     62  */
     63 U_STABLE const UGenderInfo* U_EXPORT2
     64 ugender_getInstance(const char *locale, UErrorCode *status);
     65 
     66 
     67 /**
     68  * Given a list, returns the gender of the list as a whole.
     69  * @param genderInfo pointer that ugender_getInstance returns.
     70  * @param genders the gender of each element in the list.
     71  * @param size the size of the list.
     72  * @param status A pointer to a UErrorCode to receive any errors.
     73  * @return The gender of the list.
     74  * @draft ICU 50
     75  */
     76 U_DRAFT UGender U_EXPORT2
     77 ugender_getListGender(const UGenderInfo* genderinfo, const UGender *genders, int32_t size, UErrorCode *status);
     78 
     79 #endif /* #if !UCONFIG_NO_FORMATTING */
     80 
     81 #endif
     82