1 /* 2 * Copyright 2019-2020, Andrew Lindesay <apl@lindesay.co.nz>. 3 * All rights reserved. Distributed under the terms of the MIT License. 4 */ 5 #ifndef LANGUAGE_MENU_UTILS_H 6 #define LANGUAGE_MENU_UTILS_H 7 8 9 #include <Menu.h> 10 11 #include "Model.h" 12 #include "PackageInfo.h" 13 14 15 class LanguageMenuUtils { 16 17 public: 18 static void AddLanguagesToMenu( 19 const LanguageModel* languagesModel, 20 BMenu* menu); 21 static void MarkLanguageInMenu( 22 const BString& languageCode, 23 BMenu* menu); 24 25 private: 26 static int32 _AddLanguagesToMenu( 27 const LanguageModel* languagesModel, 28 BMenu* menu, bool isPopular); 29 static void _AddLanguageToMenu( 30 const LanguageRef& language, 31 BMenu* menu); 32 static void _AddLanguageToMenu( 33 const BString& code, 34 const BString& name, BMenu* menu); 35 }; 36 37 38 #endif // LANGUAGE_MENU_UTILS_H 39