1 #ifndef CHARACTER_SET_ROSTER_H
2 #define CHARACTER_SET_ROSTER_H
4 #include <SupportDefs.h>
10 * @file BCharacterSetRoster.h
11 * @author Andrew Bachmann
12 * @brief Defines BCharacterSetRoster
14 * @see BCharacterSet.h
19 class BCharacterSetRoster
{
21 * @class BCharacterSetRoster
22 * @brief An object for finding or enumerating character sets
26 * @brief initialize the roster to the first character set
28 BCharacterSetRoster();
29 virtual ~BCharacterSetRoster();
32 * @brief get the next available character set
33 * @return B_NO_ERROR if it's valid, B_BAD_VALUE if it is not
35 status_t
GetNextCharacterSet(BCharacterSet
* charset
);
37 * @brief resets the iterator to the first character set
38 * @return B_NO_ERROR if it's valid, B_BAD_VALUE if it is not
40 status_t
RewindCharacterSets();
43 * @brief register BMessenger to receive notifications of character set events
44 * @return B_NO_ERROR if watching was okay, B_BAD_VALUE if poorly formed BMessenger
46 static status_t
StartWatching(BMessenger target
);
48 * @brief stop sending notifications to BMessenger
49 * @return B_NO_ERROR if stopping went okay, B_BAD_VALUE if poorly formed BMessenger
51 static status_t
StopWatching(BMessenger target
);
54 * @brief return the character set with the given font id, or NULL if none exists
55 * This function executes in constant time.
56 * @return the character set with the given font id, or NULL if none exists
58 static const BCharacterSet
* GetCharacterSetByFontID(uint32 id
);
60 * @brief return the character set with the given conversion id, or NULL if none exists
61 * This function executes in constant time.
62 * @return the character set with the given conversion id, or NULL if none exists
64 static const BCharacterSet
* GetCharacterSetByConversionID(uint32 id
);
66 * @brief return the character set with the given MIB enum, or NULL if none exists
67 * This function executes in constant time.
68 * @return the character set with the given MIB enum, or NULL if none exists
70 static const BCharacterSet
* GetCharacterSetByMIBenum(uint32 MIBenum
);
73 * @brief return the character set with the given print name, or NULL if none exists
74 * This function executes in linear time.
75 * @return the character set with the given print name, or NULL if none exists
77 static const BCharacterSet
* FindCharacterSetByPrintName(const char * name
);
79 * @brief return the character set with the given name, or NULL if none exists
80 * This function will match aliases as well.
81 * This function executes in linear time.
82 * @return the character set with the given name, or NULL if none exists
84 static const BCharacterSet
* FindCharacterSetByName(const char * name
);
86 uint32 index
; //! the state variable for iteration
91 #endif // CHARACTER_SET_ROSTER_H