1 /* 2 * Copyright 2018-2021, Andrew Lindesay <apl@lindesay.co.nz>. 3 * All rights reserved. Distributed under the terms of the MIT License. 4 */ 5 #ifndef APP_UTILS_H 6 #define APP_UTILS_H 7 8 9 #include "Alert.h" 10 #include "Menu.h" 11 12 13 class AppUtils { 14 15 public: 16 static void NotifySimpleError(const char* title, 17 const char* text, 18 alert_type type = B_INFO_ALERT); 19 20 static status_t MarkItemWithCodeInMenuOrFirst(const BString& code, 21 BMenu* menu); 22 static status_t MarkItemWithCodeInMenu(const BString& code, 23 BMenu* menu); 24 static int32 IndexOfCodeInMenu(const BString& code, BMenu* menu); 25 static status_t GetCodeAtIndexInMenu(BMenu* menu, int32 index, 26 BString* result); 27 28 static status_t GetAppVersionString(BString& result); 29 }; 30 31 32 #endif // APP_UTILS_H 33