StateMimeData.cpp
Go to the documentation of this file.
1/*
2* This file is part of ArmarX.
3*
4* ArmarX is free software; you can redistribute it and/or modify
5* it under the terms of the GNU General Public License version 2 as
6* published by the Free Software Foundation.
7*
8* ArmarX is distributed in the hope that it will be useful, but
9* WITHOUT ANY WARRANTY; without even the implied warranty of
10* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11* GNU General Public License for more details.
12*
13* You should have received a copy of the GNU General Public License
14* along with this program. If not, see <http://www.gnu.org/licenses/>.
15*
16* @package ArmarX::
17* @author Mirko Waechter ( mirko.waechter at kit dot edu)
18* @date 2014
19* @copyright http://www.gnu.org/licenses/gpl-2.0.txt
20* GNU General Public License
21*/
22
23#include "StateMimeData.h"
24
25namespace armarx
26{
27
28
32
33 bool
34 AbstractStateMimeData::hasFormat(const QString& mimetype) const
35 {
36 if (mimetype == formats().first())
37 {
38 return true;
39 }
40 else
41 {
42 return false;
43 }
44 }
45
46 QStringList
48 {
49 return QStringList() << "application/x-State";
50 }
51
52 QVariant
53 AbstractStateMimeData::retrieveData(const QString& mimetype, QVariant::Type preferredType) const
54 {
55 ARMARX_INFO_S << "retrieveData: " << mimetype.toStdString();
56
57 if (mimetype == "application/x-State")
58 {
59 ARMARX_INFO_S << "Generating state variant";
60 QVariant v;
61 v.setValue(state);
63 return v;
64 }
65 else
66 {
67 return QMimeData::retrieveData(mimetype, preferredType);
68 }
69 }
70
71 const QString&
73 {
74 return proxyName;
75 }
76
77 void
79 {
80 proxyName = value;
81 }
82
85 {
86 return state;
87 }
88
89 void
94
95
96} // namespace armarx
bool hasFormat(const QString &mimetype) const override
QStringList formats() const override
statechartmodel::StatePtr getState() const
void setProxyName(const QString &value)
AbstractStateMimeData(statechartmodel::StatePtr state)
const QString & getProxyName() const
QVariant retrieveData(const QString &mimetype, QVariant::Type preferredType) const override
void setState(const statechartmodel::StatePtr &value)
statechartmodel::StatePtr state
#define ARMARX_INFO_S
Definition Logging.h:202
std::shared_ptr< State > StatePtr
Definition State.h:48
This file offers overloads of toIce() and fromIce() functions for STL container types.