cmWIXShortcut.h 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. /* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
  2. file Copyright.txt or https://cmake.org/licensing for details. */
  3. #pragma once
  4. #include <map>
  5. #include <set>
  6. #include <string>
  7. #include <vector>
  8. #include "cmInstalledFile.h"
  9. class cmWIXFilesSourceWriter;
  10. struct cmWIXShortcut
  11. {
  12. std::string label;
  13. std::string workingDirectoryId;
  14. };
  15. class cmWIXShortcuts
  16. {
  17. public:
  18. enum Type
  19. {
  20. START_MENU,
  21. DESKTOP,
  22. STARTUP
  23. };
  24. using shortcut_list_t = std::vector<cmWIXShortcut>;
  25. using shortcut_id_map_t = std::map<std::string, shortcut_list_t>;
  26. void insert(Type type, std::string const& id, cmWIXShortcut const& shortcut);
  27. bool empty(Type type) const;
  28. bool EmitShortcuts(Type type, std::string const& registryKey,
  29. std::string const& cpackComponentName,
  30. cmWIXFilesSourceWriter& fileDefinitions) const;
  31. void AddShortcutTypes(std::set<Type>& types);
  32. void CreateFromProperties(std::string const& id,
  33. std::string const& directoryId,
  34. cmInstalledFile const& installedFile);
  35. private:
  36. using shortcut_type_map_t = std::map<Type, shortcut_id_map_t>;
  37. void CreateFromProperty(std::string const& propertyName, Type type,
  38. std::string const& id,
  39. std::string const& directoryId,
  40. cmInstalledFile const& installedFile);
  41. shortcut_type_map_t Shortcuts;
  42. shortcut_id_map_t EmptyIdMap;
  43. };