diff --git a/src/datatypes/action.cpp b/src/datatypes/action.cpp index 4f6381a..00cceb3 100644 --- a/src/datatypes/action.cpp +++ b/src/datatypes/action.cpp @@ -1,88 +1,90 @@ /* Copyright (C) 2018 Volker Krause This program is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ #include "action.h" #include "datatypes_p.h" #include using namespace KItinerary; namespace KItinerary { class ActionPrivate : public QSharedData { KITINERARY_PRIVATE_BASE_GADGET(Action) public: QUrl target; + QVariant result; }; KITINERARY_MAKE_BASE_CLASS(Action) KITINERARY_MAKE_PROPERTY(Action, QUrl, target, setTarget) +KITINERARY_MAKE_PROPERTY(Action, QVariant, result, setResult) KITINERARY_MAKE_OPERATOR(Action) class CancelActionPrivate : public ActionPrivate { KITINERARY_PRIVATE_GADGET(CancelAction) }; KITINERARY_MAKE_SUB_CLASS(CancelAction, Action) KITINERARY_MAKE_OPERATOR(CancelAction) class CheckInActionPrivate : public ActionPrivate { KITINERARY_PRIVATE_GADGET(CheckInAction) }; KITINERARY_MAKE_SUB_CLASS(CheckInAction, Action) KITINERARY_MAKE_OPERATOR(CheckInAction) class DownloadActionPrivate : public ActionPrivate { KITINERARY_PRIVATE_GADGET(DownloadAction) }; KITINERARY_MAKE_SUB_CLASS(DownloadAction, Action) KITINERARY_MAKE_OPERATOR(DownloadAction) class ReserveActionPrivate : public ActionPrivate { KITINERARY_PRIVATE_GADGET(ReserveAction) }; KITINERARY_MAKE_SUB_CLASS(ReserveAction, Action) KITINERARY_MAKE_OPERATOR(ReserveAction) class UpdateActionPrivate : public ActionPrivate { KITINERARY_PRIVATE_GADGET(UpdateAction) }; KITINERARY_MAKE_SUB_CLASS(UpdateAction, Action) KITINERARY_MAKE_OPERATOR(UpdateAction) class ViewActionPrivate : public ActionPrivate { KITINERARY_PRIVATE_GADGET(ViewAction) }; KITINERARY_MAKE_SUB_CLASS(ViewAction, Action) KITINERARY_MAKE_OPERATOR(ViewAction) } template <> KItinerary::ActionPrivate *QExplicitlySharedDataPointer::clone() { return d->clone(); } #include "moc_action.cpp" diff --git a/src/datatypes/action.h b/src/datatypes/action.h index 6c920da..a1b686f 100644 --- a/src/datatypes/action.h +++ b/src/datatypes/action.h @@ -1,93 +1,94 @@ /* Copyright (C) 2018 Volker Krause This program is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ #ifndef KITINERARY_ACTION_H #define KITINERARY_ACTION_H #include "kitinerary_export.h" #include "datatypes.h" class QUrl; namespace KItinerary { class ActionPrivate; /** Base class for actions. * @see https://schema.org/Action */ class KITINERARY_EXPORT Action { KITINERARY_BASE_GADGET(Action) KITINERARY_PROPERTY(QUrl, target, setTarget) + KITINERARY_PROPERTY(QVariant, result, setResult) protected: ///@cond internal QExplicitlySharedDataPointer d; ///@endcond }; /** Cancel action. * @see https://schema.org/CancelAction */ class KITINERARY_EXPORT CancelAction : public Action { KITINERARY_GADGET(CancelAction) }; /** Check-in action. * @see https://schema.org/CheckInAction */ class KITINERARY_EXPORT CheckInAction : public Action { KITINERARY_GADGET(CheckInAction) }; /** Download action. * @see https://schema.org/DownloadAction */ class KITINERARY_EXPORT DownloadAction : public Action { KITINERARY_GADGET(DownloadAction) }; /** Reserve action. * @see https://schema.org/ReserveAction */ class KITINERARY_EXPORT ReserveAction : public Action { KITINERARY_GADGET(ReserveAction) }; /** Edit/update action. * @see https://schema.org/UpdateAction */ class KITINERARY_EXPORT UpdateAction : public Action { KITINERARY_GADGET(UpdateAction) }; /** View action. * @see https://schema.org/ViewAction */ class KITINERARY_EXPORT ViewAction : public Action { KITINERARY_GADGET(ViewAction) }; } #endif // KITINERARY_ACTION_H