xref: /haiku/src/apps/haikudepot/packagemodel/Language.h (revision 909af08f4328301fbdef1ffb41f566c3b5bec0c7)
1 /*
2  * Copyright 2013-2014, Stephan Aßmus <superstippi@gmx.de>.
3  * Copyright 2016-2023, Andrew Lindesay <apl@lindesay.co.nz>.
4  * All rights reserved. Distributed under the terms of the MIT License.
5  */
6 #ifndef LANGUAGE_H
7 #define LANGUAGE_H
8 
9 
10 #include <Language.h>
11 #include <Referenceable.h>
12 
13 
14 /*! This class represents a language that is supported by the Haiku
15     Depot Server system.  This may differ from the set of languages
16     that are supported in the platform itself.
17 */
18 
19 class Language : public BReferenceable, public BLanguage {
20 public:
21 								Language(const char* language,
22 									const BString& serverName,
23 									bool isPopular);
24 								Language(const Language& other);
25 
26 			status_t			GetName(BString& name,
27 									const BLanguage* displayLanguage = NULL
28 									) const;
29 			bool				IsPopular() const
30 									{ return fIsPopular; }
31 
32 			int					Compare(const Language& language) const;
33 
34 private:
35 			BString				fServerName;
36 			bool				fIsPopular;
37 };
38 
39 
40 typedef BReference<Language> LanguageRef;
41 
42 
43 extern bool IsLanguageBefore(const LanguageRef& l1, const LanguageRef& l2);
44 
45 
46 #endif // LANGUAGE_H
47