WSF
DragAndDrop.hpp
Go to the documentation of this file.
1// ****************************************************************************
2// CUI
3//
4// The Advanced Framework for Simulation, Integration, and Modeling (AFSIM)
5//
6// Copyright 2003-2015 The Boeing Company. All rights reserved.
7//
8// The use, dissemination or disclosure of data in this file is subject to
9// limitation or restriction. See accompanying README and LICENSE for details.
10// ****************************************************************************
11
12#ifndef DRAGANDDROP_HPP
13#define DRAGANDDROP_HPP
14#include <vector>
15
16#include <QMap>
17#include <QString>
18#include <QVariant>
19
20#include "ViExport.hpp"
21
22class QMimeData;
23class ViFileItem;
24class WsfPProxyNode;
25
26namespace wizard
27{
30{
31public:
32 // A QMimeData objects can not be aggregated, which is problematic because
33 // copy/paste/drag/drop operations typically allow multiselect. This leads to implementing
34 // these operations at the top-level, instead of the item level.
35 // To avoid this issue, any non-text mime data should use PropertyList to store mime data.
36 //
37 // currently used property keys:
38 // "proxy-node" - A string with a space delimited 'stable' proxy path pointing to a proxy node
39 // "command-chain" - A command chain name associated with the item
40 //
41
42 typedef QMap<QString, QVariant> PropertyMap;
43 typedef QList<PropertyMap> PropertyList;
44 static const char* cFILE_PATH_MIME_TYPE;
45 static const char* cPROPERTY_SET_MIME_TYPE;
46 static const char* cPROXY_NODE_LIST_MIME_TYPE;
47
48 static QMimeData* CreatePropertySetMime(const PropertyList& aProperties);
49 static PropertyList ReadPropertySetMime(const QMimeData* aMimePtr);
50 static QMimeData* CreateProxyNodeListMime(const std::vector<WsfPProxyNode>& aProxyNodes);
51 static QString ToString(const WsfPProxyNode& aNode);
52 static std::vector<WsfPProxyNode> ReadProxyNodeListMime(const QMimeData* aMimePtr);
53 static WsfPProxyNode ToProxyNode(const QString& aStr);
54
55 // ViWorkspaceItem* GetWorkspaceItem();
56 // void SetWorkspaceItem(ViWorkspaceItem* aItemPtr);
57 // int AddWorkspaceItem(ViWorkspaceItem* aItemPtr);
58};
59} // namespace wizard
60#endif
#define VI_EXPORT
Definition ViExport.hpp:38
Definition WsfPProxyNode.hpp:60
Routines for handling conversion to/from QMimeData for the Wizard.
Definition DragAndDrop.hpp:30
static const char * cPROPERTY_SET_MIME_TYPE
Definition DragAndDrop.hpp:45
static const char * cFILE_PATH_MIME_TYPE
Definition DragAndDrop.hpp:44
static QMimeData * CreatePropertySetMime(const PropertyList &aProperties)
Definition DragAndDrop.cpp:38
static const char * cPROXY_NODE_LIST_MIME_TYPE
Definition DragAndDrop.hpp:46
QList< PropertyMap > PropertyList
Definition DragAndDrop.hpp:43
static std::vector< WsfPProxyNode > ReadProxyNodeListMime(const QMimeData *aMimePtr)
Definition DragAndDrop.cpp:69
static WsfPProxyNode ToProxyNode(const QString &aStr)
Definition DragAndDrop.cpp:135
static QMimeData * CreateProxyNodeListMime(const std::vector< WsfPProxyNode > &aProxyNodes)
Definition DragAndDrop.cpp:48
static PropertyList ReadPropertySetMime(const QMimeData *aMimePtr)
Definition DragAndDrop.cpp:29
static QString ToString(const WsfPProxyNode &aNode)
Definition DragAndDrop.cpp:100
QMap< QString, QVariant > PropertyMap
Definition DragAndDrop.hpp:42
Definition Runner.hpp:22
Copyrights Multiple, All Rights Reserved