AbstractConfigurationStorage.h 3.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. /******************************************************************************
  2. |* THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
  3. |* ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
  4. |* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
  5. |* PARTICULAR PURPOSE.
  6. |*
  7. |* Copyright 1995-2005 Nero AG. All Rights Reserved.
  8. |*-----------------------------------------------------------------------------
  9. |* NeroSDK / NeroRobo
  10. |*
  11. |* PROGRAM: AbstractConfigurationStorage.h
  12. |*
  13. |* PURPOSE: Interface for saving/query robot configuration settings
  14. ******************************************************************************/
  15. /* This file describes an abstract interface to some settings management facility for external
  16. * modules. It is currently used by the robo driver. */
  17. #ifndef ABSTRACTCONFIGURATIONSTORAGE_H
  18. #define ABSTRACTCONFIGURATIONSTORAGE_H
  19. #include <windows.h>
  20. /* Implement this interface if you want to stay uptodate about your configuration informations
  21. * and also to make your dialog dynamic */
  22. class IUserDialogWatchdog
  23. {
  24. public:
  25. virtual void ValueChanged(const char *szName) = 0;
  26. };
  27. /* NOTE: current Nero implementation of IUserDialogFactory, which derives IConfigurationStorage to save
  28. * configuration data in registry, uses unique robo driver ID as key, which consists of port type ID
  29. * the robo is connected to, port number, SCSI adapter host ID of recorder the driver ist assigned to,
  30. * SCSI target ID of the same recorder and the robo name. This is in case, there are multiple recorders on
  31. * system with the same name.
  32. * If we have only one recorder or multiple, different recorder names the implementation of IConfigurationStorage
  33. * in Nero will use this recorder name to create registry key for configuration storage. */
  34. class IConfigurationStorage
  35. {
  36. public:
  37. /* Register watchdog handler, which should receive value change notifications */
  38. virtual void InstallWatchdog(IUserDialogWatchdog *pDialogWatchdog) = 0;
  39. /* This method should be called if value change notifications should not be received anymore. */
  40. virtual void UninstallWatchdog(IUserDialogWatchdog *pDialogWatchdog) = 0;
  41. /* Will be called by the appropriate UI, if some named values changed, to inform all
  42. * watch dogs. */
  43. virtual void SendNotification(const char *szName) const = 0;
  44. /* Get different configuration value types (string, bool, int). If there is not appropriate
  45. * value already set, the default value will be returned. */
  46. virtual const char *GetConfigurationValue(const char *szName, const char *szDefault) = 0;
  47. virtual BOOL GetConfigurationValueBOOL(const char *szName, BOOL bDefault) = 0;
  48. virtual int GetConfigurationValueINT(const char *szName, int iDefault ) = 0;
  49. /* Set different configuration value types (string, bool, int). */
  50. virtual void SetConfigurationValue(const char *szName, const char *szValue) = 0;
  51. virtual void SetConfigurationValueBOOL(const char *szName, BOOL bValue) = 0;
  52. virtual void SetConfigurationValueINT(const char *szName, int iValue) = 0;
  53. };
  54. #endif // ABSTRACTCONFIGURATIONSTORAGE