Warning, file /office/calligra/libs/flake/KoEventAction.h was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).
0001 /* This file is part of the KDE project 0002 Copyright (C) 2008 Thorsten Zachmann <zachmann@kde.org> 0003 0004 This library is free software; you can redistribute it and/or 0005 modify it under the terms of the GNU Library General Public 0006 License as published by the Free Software Foundation; either 0007 version 2 of the License, or (at your option) any later version. 0008 0009 This library is distributed in the hope that it will be useful, 0010 but WITHOUT ANY WARRANTY; without even the implied warranty of 0011 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 0012 Library General Public License for more details. 0013 0014 You should have received a copy of the GNU Library General Public License 0015 along with this library; see the file COPYING.LIB. If not, write to 0016 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 0017 * Boston, MA 02110-1301, USA. 0018 */ 0019 0020 #ifndef KOEVENTACTION_H 0021 #define KOEVENTACTION_H 0022 0023 #include "flake_export.h" 0024 #include "KoXmlReaderForward.h" 0025 0026 class QString; 0027 class KoShapeLoadingContext; 0028 class KoShapeSavingContext; 0029 0030 /** 0031 * This is the base class for actions that are executed on events. 0032 * 0033 * See ODF: 0034 * 9.9 Presentation Events 0035 * Many objects inside a presentation document support special presentation events. For example, a 0036 * user can advance the presentation one frame when clicking on an object with a corresponding 0037 * event. Presentation events are contained with a graphic object's event listener table. See section 0038 * 9.2.21 for details. 0039 * 0040 * 12.4 Event Listener Tables 0041 * Many objects such as controls, images, text boxes, or an entire document support events. An 0042 * event binds the occurrence of a particular condition to an action that is executed if the condition 0043 * arises. For example, if a user places the cursor over a graphic, this condition triggers an action 0044 * that is supported by the office application. This event, called "on-mouse-over", can be associated 0045 * with a macro that is executed whenever the condition occurs, that is, whenever a user places the 0046 * cursor over a graphic. 0047 */ 0048 class FLAKE_EXPORT KoEventAction 0049 { 0050 public: 0051 /** 0052 * Constructor 0053 */ 0054 KoEventAction(); 0055 virtual ~KoEventAction(); 0056 0057 /** 0058 * Set The id of the action 0059 * 0060 * @param id this is the value that is used for storing the event action in odf. 0061 */ 0062 void setId(const QString &id); 0063 0064 /** 0065 * The id of the action 0066 * 0067 * The id is the value that is used for storing the event action in odf. 0068 */ 0069 QString id() const; 0070 0071 /** 0072 * Load action from ODF. 0073 * 0074 * @param context the KoShapeLoadingContext used for loading 0075 * @param element element which represents the shape in odf 0076 * 0077 * @return false if loading failed 0078 */ 0079 virtual bool loadOdf(const KoXmlElement &element, KoShapeLoadingContext &context) = 0; 0080 0081 /** 0082 * Store the action as ODF. 0083 * 0084 * @param context The KoShapeSavingContext used for saving 0085 */ 0086 virtual void saveOdf(KoShapeSavingContext &context) const = 0; 0087 0088 /** 0089 * Start the action. 0090 */ 0091 virtual void start() = 0; 0092 /** 0093 * Finish the action 0094 * 0095 * If the action takes some time to finish it can bs stoped with 0096 * this method before its end. 0097 */ 0098 virtual void finish() {} 0099 0100 private: 0101 class Private; 0102 Private * const d; 0103 }; 0104 0105 #endif /* KOEVENTACTION_H */