cmWIXShortcut.h 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. /*============================================================================
  2. CMake - Cross Platform Makefile Generator
  3. Copyright 2014-2015 Kitware, Inc.
  4. Distributed under the OSI-approved BSD License (the "License");
  5. see accompanying file Copyright.txt for details.
  6. This software is distributed WITHOUT ANY WARRANTY; without even the
  7. implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  8. See the License for more information.
  9. ============================================================================*/
  10. #ifndef cmWIXShortcut_h
  11. #define cmWIXShortcut_h
  12. #include <cmInstalledFile.h>
  13. #include <map>
  14. #include <set>
  15. #include <string>
  16. #include <vector>
  17. class cmWIXFilesSourceWriter;
  18. struct cmWIXShortcut
  19. {
  20. std::string label;
  21. std::string workingDirectoryId;
  22. };
  23. class cmWIXShortcuts
  24. {
  25. public:
  26. enum Type
  27. {
  28. START_MENU,
  29. DESKTOP,
  30. STARTUP
  31. };
  32. typedef std::vector<cmWIXShortcut> shortcut_list_t;
  33. typedef std::map<std::string, shortcut_list_t> shortcut_id_map_t;
  34. void insert(Type type, std::string const& id, cmWIXShortcut const& shortcut);
  35. bool empty(Type type) const;
  36. bool EmitShortcuts(
  37. Type type,
  38. std::string const& registryKey,
  39. std::string const& cpackComponentName,
  40. cmWIXFilesSourceWriter& fileDefinitions) const;
  41. void AddShortcutTypes(std::set<Type>& types);
  42. void CreateFromProperties(std::string const& id,
  43. std::string const& directoryId, cmInstalledFile const& installedFile);
  44. private:
  45. typedef std::map<Type, shortcut_id_map_t> shortcut_type_map_t;
  46. void CreateFromProperty(
  47. std::string const& propertyName,
  48. Type type,
  49. std::string const& id,
  50. std::string const& directoryId,
  51. cmInstalledFile const& installedFile);
  52. shortcut_type_map_t Shortcuts;
  53. shortcut_id_map_t EmptyIdMap;
  54. };
  55. #endif