1 /* 2 * Copyright 2024, Andrew Lindesay <apl@lindesay.co.nz>. 3 * All rights reserved. Distributed under the terms of the MIT License. 4 */ 5 #ifndef SHARED_ICONS_H 6 #define SHARED_ICONS_H 7 8 9 #include "BitmapHolder.h" 10 11 12 class SharedIcons 13 { 14 15 public: 16 static void UnsetAllIcons(); 17 18 // icons from application resources 19 static BitmapHolderRef IconStarBlue16Scaled(); 20 static BitmapHolderRef IconStarGrey16Scaled(); 21 static BitmapHolderRef IconInstalled16Scaled(); 22 static BitmapHolderRef IconArrowLeft22Scaled(); 23 static BitmapHolderRef IconArrowRight22Scaled(); 24 25 // icons from mime types 26 static BitmapHolderRef IconHTMLPackage16Scaled(); 27 28 private: 29 static BitmapHolderRef _CreateIconForResource(int32 resourceID, uint32 size); 30 static BitmapHolderRef _CreateIconForMimeType(const char* mimeType, uint32 size); 31 32 static status_t _CreateIconForResourceChecked(int32 resourceID, uint32 size, 33 BitmapHolderRef* bitmapHolderRef); 34 static status_t _CreateIconForMimeTypeChecked(const char* mimeTypeStr, uint32 size, 35 BitmapHolderRef* bitmapHolderRef); 36 37 private: 38 static BitmapHolderRef sIconStarBlue16Scaled; 39 static BitmapHolderRef sIconStarGrey16Scaled; 40 static BitmapHolderRef sIconInstalled16Scaled; 41 static BitmapHolderRef sIconArrowLeft22Scaled; 42 static BitmapHolderRef sIconArrowRight22Scaled; 43 static BitmapHolderRef sIconHTMLPackage16Scaled; 44 45 }; 46 47 48 #endif // SHARED_ICONS_H 49