Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
Kitware
GitHub Repository: Kitware/CMake
Path: blob/master/Source/CPack/WiX/cmWIXShortcut.h
5017 views
1
/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
2
file LICENSE.rst or https://cmake.org/licensing for details. */
3
#pragma once
4
5
#include <map>
6
#include <set>
7
#include <string>
8
#include <vector>
9
10
#include "cmInstalledFile.h"
11
12
class cmWIXFilesSourceWriter;
13
14
struct cmWIXShortcut
15
{
16
std::string label;
17
std::string workingDirectoryId;
18
};
19
20
class cmWIXShortcuts
21
{
22
public:
23
enum Type
24
{
25
START_MENU,
26
DESKTOP,
27
STARTUP
28
};
29
30
using shortcut_list_t = std::vector<cmWIXShortcut>;
31
using shortcut_id_map_t = std::map<std::string, shortcut_list_t>;
32
33
void insert(Type type, std::string const& id, cmWIXShortcut const& shortcut);
34
35
bool empty(Type type) const;
36
37
bool EmitShortcuts(Type type, std::string const& registryKey,
38
std::string const& cpackComponentName,
39
cmWIXFilesSourceWriter& fileDefinitions) const;
40
41
void AddShortcutTypes(std::set<Type>& types);
42
43
void CreateFromProperties(std::string const& id,
44
std::string const& directoryId,
45
cmInstalledFile const& installedFile);
46
47
private:
48
using shortcut_type_map_t = std::map<Type, shortcut_id_map_t>;
49
50
void CreateFromProperty(std::string const& propertyName, Type type,
51
std::string const& id,
52
std::string const& directoryId,
53
cmInstalledFile const& installedFile);
54
55
shortcut_type_map_t Shortcuts;
56
shortcut_id_map_t EmptyIdMap;
57
};
58
59