1 /* 2 * Copyright 2018-2024, 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 MarkItemWithKeyValueInMenuOrFirst(BMenu* menu, 21 const BString& key, const BString& value); 22 static status_t MarkItemWithKeyValueInMenu(BMenu* menu, 23 const BString& key, const BString& value); 24 static int32 IndexOfKeyValueInMenu(BMenu* menu, 25 const BString& key, const BString& value); 26 static status_t GetValueForKeyAtIndexInMenu(BMenu* menu, int32 index, 27 const BString& key, BString* result); 28 29 static status_t GetAppVersionString(BString& result); 30 }; 31 32 33 #endif // APP_UTILS_H 34