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.

112 lines
3.6KB

  1. /*
  2. ==============================================================================
  3. This file is part of the JUCE library.
  4. Copyright (c) 2017 - ROLI Ltd.
  5. JUCE is an open source library subject to commercial or open-source
  6. licensing.
  7. By using JUCE, you agree to the terms of both the JUCE 5 End-User License
  8. Agreement and JUCE 5 Privacy Policy (both updated and effective as of the
  9. 27th April 2017).
  10. End User License Agreement: www.juce.com/juce-5-licence
  11. Privacy Policy: www.juce.com/juce-5-privacy-policy
  12. Or: You may also use this code under the terms of the GPL v3 (see
  13. www.gnu.org/licenses).
  14. JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER
  15. EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE
  16. DISCLAIMED.
  17. ==============================================================================
  18. */
  19. #pragma once
  20. //==============================================================================
  21. #include "../Project/jucer_DependencyPathPropertyComponent.h"
  22. class GlobalPreferencesTab
  23. {
  24. public:
  25. virtual ~GlobalPreferencesTab() {}
  26. virtual Component* getContent() = 0;
  27. virtual String getName() const noexcept = 0;
  28. };
  29. //==============================================================================
  30. /** This component implements the "Paths" tab in the global preferences window,
  31. which defines the default paths for dependencies like third-party SDKs
  32. for this machine.
  33. */
  34. class PathSettingsTab : public GlobalPreferencesTab,
  35. public Component,
  36. private TextPropertyComponent::Listener
  37. {
  38. public:
  39. PathSettingsTab (DependencyPathOS);
  40. ~PathSettingsTab();
  41. Component* getContent() override;
  42. String getName() const noexcept override;
  43. void resized() override;
  44. private:
  45. void textPropertyComponentChanged (TextPropertyComponent*) override;
  46. Identifier getKeyForPropertyComponent (TextPropertyComponent*) const;
  47. OwnedArray<TextPropertyComponent> pathComponents;
  48. TextPropertyComponent* vst3PathComponent;
  49. TextPropertyComponent* rtasPathComponent;
  50. TextPropertyComponent* aaxPathComponent;
  51. TextPropertyComponent* androidSdkPathComponent;
  52. TextPropertyComponent* androidNdkPathComponent;
  53. JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (PathSettingsTab)
  54. };
  55. //==============================================================================
  56. /** This component implements the "Code Editor" tabl in the global preferences window,
  57. which sets font sizes and colours for the Projucer's code editor.
  58. The content is either an EditorPanel (the actual settings tab) or a FontScanPanel
  59. (shown if the tab is scanning for available fonts before showing the EditorPanel).
  60. */
  61. class AppearanceSettingsTab : public GlobalPreferencesTab,
  62. public Component
  63. {
  64. public:
  65. AppearanceSettingsTab();
  66. Component* getContent() override;
  67. void changeContent (Component* newContent);
  68. String getName() const noexcept override;
  69. void resized() override;
  70. private:
  71. ScopedPointer<Component> content;
  72. JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (AppearanceSettingsTab)
  73. };
  74. //==============================================================================
  75. class GlobalPreferencesComponent : public TabbedComponent
  76. {
  77. public:
  78. GlobalPreferencesComponent();
  79. private:
  80. OwnedArray<GlobalPreferencesTab> preferenceTabs;
  81. JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (GlobalPreferencesComponent)
  82. };