cmake/Source/CPack/WiX/cmWIXShortcut.h

61 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. */
2015-08-17 11:37:30 +02:00
#ifndef cmWIXShortcut_h
#define cmWIXShortcut_h
2015-04-27 22:25:09 +02:00
2017-07-20 19:35:53 +02:00
#include "cmInstalledFile.h"
2016-07-09 11:21:54 +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>
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
};
typedef std::vector<cmWIXShortcut> shortcut_list_t;
typedef std::map<std::string, shortcut_list_t> shortcut_id_map_t;
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:
typedef std::map<Type, shortcut_id_map_t> shortcut_type_map_t;
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
};
2010-06-23 01:18:35 +03:00
#endif