cmake/Source/CPack/WiX/cmWIXShortcut.h

58 lines
1.5 KiB
C
Raw Normal View History

2016-10-30 18:24:19 +01:00
/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
file Copyright.txt or https://cmake.org/licensing for details. */
2021-09-14 00:13:48 +02:00
#pragma once
2015-04-27 22:25:09 +02:00
2015-08-17 11:37:30 +02:00
#include <map>
#include <set>
2016-07-09 11:21:54 +02:00
#include <string>
2015-08-17 11:37:30 +02:00
#include <vector>
2020-02-01 23:06:01 +01:00
#include "cmInstalledFile.h"
2015-08-17 11:37:30 +02:00
class cmWIXFilesSourceWriter;
2015-04-27 22:25:09 +02:00
struct cmWIXShortcut
{
2015-08-17 11:37:30 +02:00
std::string label;
2015-04-27 22:25:09 +02:00
std::string workingDirectoryId;
2015-08-17 11:37:30 +02:00
};
class cmWIXShortcuts
{
public:
enum Type
{
START_MENU,
DESKTOP,
STARTUP
};
2020-02-01 23:06:01 +01:00
using shortcut_list_t = std::vector<cmWIXShortcut>;
using shortcut_id_map_t = std::map<std::string, shortcut_list_t>;
2015-08-17 11:37:30 +02:00
void insert(Type type, std::string const& id, cmWIXShortcut const& shortcut);
bool empty(Type type) const;
2016-07-09 11:21:54 +02:00
bool EmitShortcuts(Type type, std::string const& registryKey,
std::string const& cpackComponentName,
cmWIXFilesSourceWriter& fileDefinitions) const;
2015-08-17 11:37:30 +02:00
void AddShortcutTypes(std::set<Type>& types);
void CreateFromProperties(std::string const& id,
2016-07-09 11:21:54 +02:00
std::string const& directoryId,
cmInstalledFile const& installedFile);
2015-08-17 11:37:30 +02:00
private:
2020-02-01 23:06:01 +01:00
using shortcut_type_map_t = std::map<Type, shortcut_id_map_t>;
2015-08-17 11:37:30 +02:00
2016-07-09 11:21:54 +02:00
void CreateFromProperty(std::string const& propertyName, Type type,
std::string const& id,
std::string const& directoryId,
cmInstalledFile const& installedFile);
2015-08-17 11:37:30 +02:00
shortcut_type_map_t Shortcuts;
shortcut_id_map_t EmptyIdMap;
2015-04-27 22:25:09 +02:00
};