The JUCE cross-platform C++ framework, with DISTRHO/KXStudio specific changes
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

89 lines
3.7KB

  1. /*
  2. ==============================================================================
  3. This file is part of the JUCE library - "Jules' Utility Class Extensions"
  4. Copyright 2004-11 by Raw Material Software Ltd.
  5. ------------------------------------------------------------------------------
  6. JUCE can be redistributed and/or modified under the terms of the GNU General
  7. Public License (Version 2), as published by the Free Software Foundation.
  8. A copy of the license is included in the JUCE distribution, or can be found
  9. online at www.gnu.org/licenses.
  10. JUCE is distributed in the hope that it will be useful, but WITHOUT ANY
  11. WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
  12. A PARTICULAR PURPOSE. See the GNU General Public License for more details.
  13. ------------------------------------------------------------------------------
  14. To release a closed-source product which uses JUCE, commercial licenses are
  15. available: visit www.rawmaterialsoftware.com/juce for more information.
  16. ==============================================================================
  17. */
  18. #ifndef __JUCE_WINDOWSREGISTRY_JUCEHEADER__
  19. #define __JUCE_WINDOWSREGISTRY_JUCEHEADER__
  20. #if JUCE_WINDOWS || DOXYGEN
  21. /**
  22. Contains some static helper functions for manipulating the MS Windows registry
  23. (Only available on Windows, of course!)
  24. */
  25. class WindowsRegistry
  26. {
  27. public:
  28. //==============================================================================
  29. /** Returns a string from the registry.
  30. The path is a string for the entire path of a value in the registry,
  31. e.g. "HKEY_CURRENT_USER\Software\foo\bar"
  32. */
  33. static String getValue (const String& regValuePath,
  34. const String& defaultValue = String::empty);
  35. /** Sets a registry value as a string.
  36. This will take care of creating any groups needed to get to the given
  37. registry value.
  38. */
  39. static void setValue (const String& regValuePath,
  40. const String& value);
  41. /** Returns true if the given value exists in the registry. */
  42. static bool valueExists (const String& regValuePath);
  43. /** Deletes a registry value. */
  44. static void deleteValue (const String& regValuePath);
  45. /** Deletes a registry key (which is registry-talk for 'folder'). */
  46. static void deleteKey (const String& regKeyPath);
  47. /** Creates a file association in the registry.
  48. This lets you set the executable that should be launched by a given file extension.
  49. @param fileExtension the file extension to associate, including the
  50. initial dot, e.g. ".txt"
  51. @param symbolicDescription a space-free short token to identify the file type
  52. @param fullDescription a human-readable description of the file type
  53. @param targetExecutable the executable that should be launched
  54. @param iconResourceNumber the icon that gets displayed for the file type will be
  55. found by looking up this resource number in the
  56. executable. Pass 0 here to not use an icon
  57. */
  58. static void registerFileAssociation (const String& fileExtension,
  59. const String& symbolicDescription,
  60. const String& fullDescription,
  61. const File& targetExecutable,
  62. int iconResourceNumber);
  63. private:
  64. WindowsRegistry();
  65. JUCE_DECLARE_NON_COPYABLE (WindowsRegistry);
  66. };
  67. #endif
  68. #endif // __JUCE_WINDOWSREGISTRY_JUCEHEADER__