Utils.h 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. /*
  2. * Copyright 2009-2011, Pier Luigi Fiorini. All rights reserved.
  3. * Copyright 2014, Funky Idea Software
  4. * Copyright 2021, Jaidyn Levesque
  5. * Distributed under the terms of the MIT License.
  6. */
  7. #ifndef _APP_UTILS_H
  8. #define _APP_UTILS_H
  9. #include <image.h>
  10. #include <GraphicsDefs.h>
  11. #include <Mime.h>
  12. #include <Resources.h>
  13. #include "AppConstants.h"
  14. #include "Server.h"
  15. class BMenu;
  16. // For display purposes
  17. const char* UserStatusToString(UserStatus status);
  18. // For use with the ImageCache
  19. const char* UserStatusToImageKey(UserStatus status);
  20. bool IsCommand(BString line);
  21. BString CommandName(BString line);
  22. BString CommandArgs(BString line);
  23. BResources ChatResources();
  24. const char* SettingsPath();
  25. const char* AccountsPath();
  26. const char* AccountPath(const char* signature, const char* subsignature);
  27. const char* CachePath();
  28. const char* AccountCachePath(const char* accountName);
  29. const char* RoomsCachePath(const char* accountName);
  30. const char* RoomCachePath(const char* accountName, const char* roomIdentifier);
  31. const char* UserCachePath(const char* accountName, const char* userIdentifier);
  32. const char* ContactCachePath(const char* accountName, const char* userIdentifier);
  33. rgb_color TintColor(rgb_color color, int severity);
  34. rgb_color ForegroundColor(rgb_color background);
  35. // Borrowed from BePodder's own libfunky. Groovy B)
  36. status_t ReadAttributeData(BNode* node, const char* name, char** buffer, int32 *size);
  37. status_t WriteAttributeMessage(BNode* node, const char* name, BMessage* data);
  38. status_t ReadAttributeMessage(BNode* node, const char* name, BMessage* data);
  39. extern "C" status_t our_image(image_info& image);
  40. #endif // _APP_UTILS_H