18c1ad886SRyan Leavengood /* 2*4aa63633SAxel Dörfler * Copyright 2003-2011 Haiku Inc. All rights reserved. 38c1ad886SRyan Leavengood * Distributed under the terms of the MIT License. 48c1ad886SRyan Leavengood * 58c1ad886SRyan Leavengood * Authors: 68c1ad886SRyan Leavengood * Michael Pfeiffer, laplace@haiku-os.org 78c1ad886SRyan Leavengood */ 88c1ad886SRyan Leavengood #ifndef SHOW_IMAGE_SETTINGS_H 98c1ad886SRyan Leavengood #define SHOW_IMAGE_SETTINGS_H 10d3046f7dSMichael Pfeiffer 11d3046f7dSMichael Pfeiffer 12d3046f7dSMichael Pfeiffer #include <Locker.h> 13*4aa63633SAxel Dörfler #include <Message.h> 14*4aa63633SAxel Dörfler 15*4aa63633SAxel Dörfler 16*4aa63633SAxel Dörfler class BFile; 17d3046f7dSMichael Pfeiffer 188c1ad886SRyan Leavengood 198c1ad886SRyan Leavengood class ShowImageSettings { 20d3046f7dSMichael Pfeiffer public: 21d3046f7dSMichael Pfeiffer ShowImageSettings(); 22*4aa63633SAxel Dörfler virtual ~ShowImageSettings(); 23d3046f7dSMichael Pfeiffer 24d3046f7dSMichael Pfeiffer bool Lock(); 25*4aa63633SAxel Dörfler void Unlock(); 26*4aa63633SAxel Dörfler 27d3046f7dSMichael Pfeiffer bool GetBool(const char* name, bool defaultValue); 28d3046f7dSMichael Pfeiffer int32 GetInt32(const char* name, int32 defaultValue); 29d3046f7dSMichael Pfeiffer float GetFloat(const char* name, float defaultValue); 30d3046f7dSMichael Pfeiffer BRect GetRect(const char* name, BRect defaultValue); 31*4aa63633SAxel Dörfler bigtime_t GetTime(const char* name, 32*4aa63633SAxel Dörfler bigtime_t defaultValue); 33*4aa63633SAxel Dörfler const char* GetString(const char* name, 34*4aa63633SAxel Dörfler const char* defaultValue); 35*4aa63633SAxel Dörfler 36d3046f7dSMichael Pfeiffer void SetBool(const char* name, bool value); 37d3046f7dSMichael Pfeiffer void SetInt32(const char* name, int32 value); 38d3046f7dSMichael Pfeiffer void SetFloat(const char* name, float value); 39d3046f7dSMichael Pfeiffer void SetRect(const char* name, BRect value); 40*4aa63633SAxel Dörfler void SetTime(const char* name, bigtime_t value); 41d3046f7dSMichael Pfeiffer void SetString(const char* name, const char* value); 42d3046f7dSMichael Pfeiffer 43d3046f7dSMichael Pfeiffer private: 44*4aa63633SAxel Dörfler bool _OpenSettingsFile(BFile* file, bool forReading); 45*4aa63633SAxel Dörfler void _Load(); 46*4aa63633SAxel Dörfler void _Save(); 47d3046f7dSMichael Pfeiffer 48*4aa63633SAxel Dörfler private: 49d3046f7dSMichael Pfeiffer BLocker fLock; 50d3046f7dSMichael Pfeiffer BMessage fSettings; 51*4aa63633SAxel Dörfler bool fUpdated; 52d3046f7dSMichael Pfeiffer }; 53d3046f7dSMichael Pfeiffer 548c1ad886SRyan Leavengood 558c1ad886SRyan Leavengood #endif // SHOW_IMAGE_SETTINGS_H 56