BsVSCodeEditor.h 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. //********************************** Banshee Engine (www.banshee3d.com) **************************************************//
  2. //**************** Copyright (c) 2016 Marko Pintera ([email protected]). All rights reserved. **********************//
  3. #pragma once
  4. #include "BsEditorPrerequisites.h"
  5. #include "BsCodeEditor.h"
  6. namespace BansheeEngine
  7. {
  8. /**
  9. * @brief Recognized types of Microsoft Visual Studio versions
  10. * recognized by VSCodeEditor.
  11. */
  12. enum class VisualStudioVersion
  13. {
  14. VS2008,
  15. VS2010,
  16. VS2012,
  17. VS2013,
  18. VS2015
  19. };
  20. /**
  21. * @brief Code editor implementation that handles interacting with Microsoft Visual Studio.
  22. */
  23. class BS_ED_EXPORT VSCodeEditor : public CodeEditor
  24. {
  25. public:
  26. VSCodeEditor(VisualStudioVersion version, const Path& execPath, const WString& CLSID);
  27. /**
  28. * @copydoc CodeEditor::openFile
  29. */
  30. void openFile(const Path& solutionPath, const Path& filePath, UINT32 lineNumber) const override;
  31. /**
  32. * @copydoc CodeEditor::syncSolution
  33. */
  34. void syncSolution(const CodeSolutionData& data, const Path& outputPath) const override;
  35. private:
  36. VisualStudioVersion mVersion;
  37. Path mExecPath;
  38. WString mCLSID;
  39. };
  40. /**
  41. * @brief Code editor factory used for creating specific instances
  42. * of the Visual Studio code editor object.
  43. */
  44. class BS_ED_EXPORT VSCodeEditorFactory : public CodeEditorFactory
  45. {
  46. public:
  47. VSCodeEditorFactory();
  48. /**
  49. * @copydoc CodeEditorFactory::getAvailableEditors
  50. */
  51. const Vector<CodeEditorType>& getAvailableEditors() const override { return mAvailableEditors; }
  52. /**
  53. * @copydoc CodeEditorFactory::create
  54. */
  55. CodeEditor* create(CodeEditorType editor) const override;
  56. private:
  57. /**
  58. * @brief Contains detailed information about a specific Visual Studio version.
  59. */
  60. struct VSVersionInfo
  61. {
  62. WString name;
  63. Path execPath;
  64. WString CLSID;
  65. VisualStudioVersion version;
  66. };
  67. /**
  68. * @brief Returns a list of Visual Studio versions installed on this machine.
  69. */
  70. Map<CodeEditorType, VSVersionInfo> getAvailableVersions() const;
  71. Map<CodeEditorType, VSVersionInfo> mAvailableVersions;
  72. Vector<CodeEditorType> mAvailableEditors;
  73. };
  74. }