cmake/Source/CPack/WiX/cmWIXShortcut.h

71 lines
1.9 KiB
C
Raw Normal View History

2010-06-23 01:18:35 +03:00
/*============================================================================
CMake - Cross Platform Makefile Generator
2015-08-17 11:37:30 +02:00
Copyright 2014-2015 Kitware, Inc.
2010-06-23 01:18:35 +03:00
Distributed under the OSI-approved BSD License (the "License");
see accompanying file Copyright.txt for details.
This software is distributed WITHOUT ANY WARRANTY; without even the
implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the License for more information.
============================================================================*/
2015-04-27 22:25:09 +02:00
2015-08-17 11:37:30 +02:00
#ifndef cmWIXShortcut_h
#define cmWIXShortcut_h
2015-04-27 22:25:09 +02:00
2016-07-09 11:21:54 +02:00
#include <cmInstalledFile.h>
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