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.

110 lines
3.6KB

  1. /*
  2. ==============================================================================
  3. This file is part of the JUCE library.
  4. Copyright (c) 2015 - ROLI Ltd.
  5. Permission is granted to use this software under the terms of either:
  6. a) the GPL v2 (or any later version)
  7. b) the Affero GPL v3
  8. Details of these licenses can be found at: www.gnu.org/licenses
  9. JUCE is distributed in the hope that it will be useful, but WITHOUT ANY
  10. WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
  11. A PARTICULAR PURPOSE. See the GNU General Public License for more details.
  12. ------------------------------------------------------------------------------
  13. To release a closed-source product which uses JUCE, commercial licenses are
  14. available: visit www.juce.com for more information.
  15. ==============================================================================
  16. */
  17. #pragma once
  18. //==============================================================================
  19. #include "../Project/jucer_DependencyPathPropertyComponent.h"
  20. class GlobalPreferencesTab
  21. {
  22. public:
  23. virtual ~GlobalPreferencesTab() {}
  24. virtual Component* getContent() = 0;
  25. virtual String getName() const noexcept = 0;
  26. };
  27. //==============================================================================
  28. /** This component implements the "Paths" tab in the global preferences window,
  29. which defines the default paths for dependencies like third-party SDKs
  30. for this machine.
  31. */
  32. class PathSettingsTab : public GlobalPreferencesTab,
  33. public Component,
  34. private TextPropertyComponent::Listener
  35. {
  36. public:
  37. PathSettingsTab (DependencyPathOS);
  38. ~PathSettingsTab();
  39. Component* getContent() override;
  40. String getName() const noexcept override;
  41. void resized() override;
  42. private:
  43. void textPropertyComponentChanged (TextPropertyComponent*) override;
  44. Identifier getKeyForPropertyComponent (TextPropertyComponent*) const;
  45. OwnedArray<TextPropertyComponent> pathComponents;
  46. TextPropertyComponent* vst3PathComponent;
  47. TextPropertyComponent* rtasPathComponent;
  48. TextPropertyComponent* aaxPathComponent;
  49. TextPropertyComponent* androidSdkPathComponent;
  50. TextPropertyComponent* androidNdkPathComponent;
  51. JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (PathSettingsTab)
  52. };
  53. //==============================================================================
  54. /** This component implements the "Code Editor" tabl in the global preferences window,
  55. which sets font sizes and colours for the Projucer's code editor.
  56. The content is either an EditorPanel (the actual settings tab) or a FontScanPanel
  57. (shown if the tab is scanning for available fonts before showing the EditorPanel).
  58. */
  59. class AppearanceSettingsTab : public GlobalPreferencesTab,
  60. public Component
  61. {
  62. public:
  63. AppearanceSettingsTab();
  64. Component* getContent() override;
  65. void changeContent (Component* newContent);
  66. String getName() const noexcept override;
  67. void resized() override;
  68. private:
  69. ScopedPointer<Component> content;
  70. JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (AppearanceSettingsTab)
  71. };
  72. //==============================================================================
  73. class GlobalPreferencesComponent : public TabbedComponent
  74. {
  75. public:
  76. GlobalPreferencesComponent();
  77. private:
  78. OwnedArray<GlobalPreferencesTab> preferenceTabs;
  79. JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (GlobalPreferencesComponent)
  80. };