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.

60 lines
2.0KB

  1. /*
  2. ==============================================================================
  3. This file is part of the JUCE 6 technical preview.
  4. Copyright (c) 2020 - Raw Material Software Limited
  5. You may use this code under the terms of the GPL v3
  6. (see www.gnu.org/licenses).
  7. For this technical preview, this file is not subject to commercial licensing.
  8. JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER
  9. EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE
  10. DISCLAIMED.
  11. ==============================================================================
  12. */
  13. #pragma once
  14. #include "../Project/jucer_Project.h"
  15. //==============================================================================
  16. class NewFileWizard
  17. {
  18. public:
  19. //==============================================================================
  20. NewFileWizard();
  21. ~NewFileWizard();
  22. //==============================================================================
  23. class Type
  24. {
  25. public:
  26. Type() {}
  27. virtual ~Type() {}
  28. //==============================================================================
  29. virtual String getName() = 0;
  30. virtual void createNewFile (Project&, Project::Item projectGroupToAddTo) = 0;
  31. protected:
  32. //==============================================================================
  33. File askUserToChooseNewFile (const String& suggestedFilename, const String& wildcard,
  34. const Project::Item& projectGroupToAddTo);
  35. static void showFailedToWriteMessage (const File& file);
  36. };
  37. //==============================================================================
  38. void addWizardsToMenu (PopupMenu&) const;
  39. bool runWizardFromMenu (int chosenMenuItemID, Project&,
  40. const Project::Item& projectGroupToAddTo) const;
  41. void registerWizard (Type*);
  42. private:
  43. OwnedArray<Type> wizards;
  44. };