cmWIXShortcut.h 1.5 KB

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