Commit 7014b4bc authored by Dirk Wilden's avatar Dirk Wilden
Browse files

changed interfaces for backup and selection

git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@11274 383ad7c9-94d9-4d36-a494-682f7c89f535
parent 3d9b3ef3
......@@ -43,9 +43,8 @@
#ifndef BACKUPPLUGININTERFACE_HH
#define BACKUPPLUGININTERFACE_HH
#include <QtGui>
#include <QMenuBar>
#include <OpenFlipper/common/Types.hh>
#include <QtGui>
#include <OpenFlipper/common/Types.hh>
/** \brief Create or restore backups
*
......@@ -63,61 +62,56 @@ class BackupInterface {
signals:
/** \brief Tell Backup Plugin to create a backup group
*
* A backup group can be used to combine multiple object backups into
* one backup group and undo all of them at once
*
* @param _name Name of the Backup group, to show the user what can be recovered
* @param _groupId A unique identifier for the created backup group
*/
virtual void createBackupGroup(QString /*_name*/, int& /*_groupId*/) {};
/** \brief Tell Backup Plugin to create a backup
*
* Plugins which supports backups can call this function if they want to create backups.\n
* A Backup control Plugin will do the rest.
* @param _objectid Identifier of the object to create the backup
* @param _name Name of the Backup, to show the user what can be recovered
* @param _internalId A unique identifier for the created backup
*/
virtual void createBackup( int /*_objectid*/, QString /*_name*/, int& /*_internalId*/, int /*_groupId*/ = -1) {};
virtual void createBackup( int /*_objectid*/, QString /*_name*/, UpdateType /*_type*/ = UPDATE_ALL){};
/** \brief Tell Backup Plugin to create a backup but don't get the id of the object ( if you don't care )
/** \brief Tell Backup Plugin to create a backup
*
* Plugins which supports backups can call this function if they want to create backups.\n
* A Backup control Plugin will do the rest.
* @param _objectid Identifier of the object to create the backup
* @param _objectids Identifier of the object to create the backup
* @param _name Name of the Backup, to show the user what can be recovered
*/
virtual void createBackup( int /*_objectid*/, QString /*_name*/) {};
virtual void createBackup( IdList /*_objectids*/, QString /*_name*/, std::vector<UpdateType> /*_types*/){};
/** \brief Make a backup persistent.
/** \brief Tell Backup Plugin to undo the last action of an object
*
* A persistent backup will not be removed automatically by the backup plugin.
* You have to remove it by yourself by calling removeBackup!
* Plugins which supports backups can call this function if they want to restore backups.\n
* A Backup control Plugin will do the rest.
* @param _objectid Identifier of the object to restore
*/
virtual void makeBackupPersistent(int /*_objectid*/, int /*_internalId*/){};
virtual void undo(int /*_objectid*/) {};
/** \brief Tell Backup Plugin to restore a backup
/** \brief Tell Backup Plugin to redo the last action on an object
*
* Plugins which supports backups can call this function if they want to restore backups.\n
* A Backup control Plugin will do the rest.
* @param _objectid Identifier of the object to restore
* @param _internalId The unique identifier of the restore set (-1 for last backup)
*/
virtual void restoreObject( int /*_objectid*/, int /*_internalId*/ =-1) {};
virtual void redo(int /*_objectid*/) {};
/** \brief Tell Backup Plugin to restore a backup group
/** \brief Tell Backup Plugin to undo the last action
*
* Plugins which supports backups can call this function if they want to restore backups.\n
* A Backup control Plugin will do the rest.
* @param _groupId Identifier of the group to restore
*/
virtual void restoreGroup( int /*_groupId*/ ) {};
virtual void undo(){};
/** \brief Tell Backup Plugin to redo the last action
*
* Plugins which supports backups can call this function if they want to restore backups.\n
* A Backup control Plugin will do the rest.
*/
virtual void redo(){};
private slots:
/** \brief Backup for an object requested
*
* This function will be called if a plugin requests a backup. You can
......@@ -126,17 +120,17 @@ class BackupInterface {
* @param _name Name of the Backup, to show the user what can be recovered
* @param _internalId Unique identifier of the backup. This number is generated by the core and returned by the original signal.
*/
virtual void slotBackup( int /*_objectid*/ , QString /*_name*/ , int /*_internalId*/, int /*_groupId*/ = -1) {};
virtual void slotCreateBackup( int /*_objectid*/ , QString /*_name*/ , UpdateType /*_type*/ = UPDATE_ALL) {};
/** \brief Backup group requested
/** \brief Backup for an object requested
*
* This function will be called if a plugin requests a backup group. You can
* This function will be called if a plugin requests a backup. You can
* also react on this event if you reimplement this function in your plugin.
*
* @param _name Name of the Backup group, to show the user what can be recovered
* @param _groupId Unique identifier of the backup group. This number is generated by the core and returned by the original signal.
* @param _id Identifier of the object to create the backup
* @param _name Name of the Backup, to show the user what can be recovered
* @param _internalId Unique identifier of the backup. This number is generated by the core and returned by the original signal.
*/
virtual void slotBackupGroup( QString /*_name*/ , int /*_groupId*/) {};
virtual void slotCreateBackup( IdList /*_objectids*/ , QString /*_name*/ , std::vector<UpdateType> /*_types*/) {};
/** \brief A given object will be restored.
*
......@@ -146,9 +140,8 @@ class BackupInterface {
* If you have any pointers or references to the given object you have to
* clean them up here.
* @param _id Identifier of the object which is about to be restored
* @param _internalId Unique Number of the Restore set
*/
virtual void slotAboutToRestore( int /*_objectid*/ , int /*_internalId*/) {};
virtual void slotAboutToRestore( int /*_objectid*/, UpdateType /*_type*/ ) {};
/** \brief Restore Object
*
......@@ -159,9 +152,8 @@ class BackupInterface {
* in your local plugin.\n
*
* @param _objectid Identifier of the object which is about to be restored
* @param _internalId Unique Number of the Restore set
*/
virtual void slotRestore( int /*_objectid*/ , int /*_internalId*/) {};
virtual void slotRestore( int /*_objectid*/, UpdateType /*_type*/ ) {};
/** \brief Object fully restored
*
......@@ -169,11 +161,10 @@ class BackupInterface {
* is restored from a backup.
* perObjectDatas and the object have been reset to the backup state.
* @param _objectid Identifier of the object which is about to be restored
* @param _internalId Unique Number of the Restore set
*/
virtual void slotRestored( int /*_objectid*/, int /*_internalId*/) {};
virtual void slotRestored( int /*_objectid*/, UpdateType /*_type*/ ) {};
public :
public:
/// Destructor
virtual ~BackupInterface() {};
......@@ -191,44 +182,67 @@ class BackupInterface {
/** \brief Backup Plugin tells other Plugins that a restore will happen
*
*/
virtual void aboutToRestore(int /*_objectid*/ , int /*_internalId*/) {};
virtual void aboutToRestore(int /*_objectid*/ , UpdateType /*_type*/ ) {};
/** \brief Backup Plugin tells other Plugins that they should restore their own data
*
*/
virtual void restore(int /*_objectid*/ , int /*_internalId*/) {};
virtual void restore(int /*_objectid*/ , UpdateType /*_type*/ ) {};
/** \brief Backup Plugin tells other Plugins that a restore has happened
*
*/
virtual void restored( int /*_objectid*/ , int /*_internalId*/) {};
virtual void restored( int /*_objectid*/ , UpdateType /*_type*/ ) {};
private slots:
/** \brief Restore the core object
/** \brief Undo the last action of an object
*
* This function has to be implemented in the backup management plugin. Normally
* this function is provided by the default backup plugin and should not be used!
* To restore data in your plugin use the slotRestore above.
*
* @param _objectId Object to restore
*
* @param _objectid Identifier of the object to restore
*/
virtual void slotRestoreObject(int /*_objectid*/, int /*_internalId*/) {};
virtual void slotUndo(int /*_objectid*/) {};
/** \brief Restore the a group
/** \brief Redo the last action on an object
*
* This function has to be implemented in the backup management plugin. Normally
* this function is provided by the default backup plugin and should not be used!
* To restore data in your plugin use the slotRestore above.
*
* @param _groupId group to restore
* @param _objectid Identifier of the object to restore
*/
virtual void slotRedo(int /*_objectid*/) {};
/** \brief Undo the last action
*
* This function has to be implemented in the backup management plugin. Normally
* this function is provided by the default backup plugin and should not be used!
* To restore data in your plugin use the slotRestore above.
*
*/
virtual void slotRestoreGroup(int /*_groupid*/) {};
virtual void slotUndo(){};
virtual void slotMakeBackupPersistent(int /*_objectid*/, int /*_internalId*/) {};
/** \brief Redo the last action
*
* This function has to be implemented in the backup management plugin. Normally
* this function is provided by the default backup plugin and should not be used!
* To restore data in your plugin use the slotRestore above.
*
*/
virtual void slotRedo(){};
signals:
/** \brief This signal is emitted by a BackupPlugin and tells a TypePlugin to generate a backup
*
* @param _id Id of the added object
* @param _type the type of backup that needs to be done
*/
virtual void generateBackup( int _id, QString _name, UpdateType _type ) {};
};
......
......@@ -787,11 +787,11 @@ class SelectionInterface {
* This connects to slotToggleSelection(QPoint,QString) which has to be implemented
* by each type selection plugin if this interactive selection mode should be provided.
*
* @param _position The 2-D position of the mouse cursor in local screen coordinates
* @param _event The mouse event that currently is performed
* @param _currentType The currently active primitive type
* @param _deselect True if entities should be deselected
*/
virtual void toggleSelection(QPoint _position, PrimitiveType _currentType, bool _deselect) {};
virtual void toggleSelection(QMouseEvent* _event, PrimitiveType _currentType, bool _deselect) {};
/** \brief Emitted by selection base plugin whenever the user performs a lasso selection
*
......@@ -831,35 +831,35 @@ class SelectionInterface {
* This connects to slotSphereSelection(QPoint,QString) which has to be implemented
* by each type selection plugin if this interactive selection mode should be provided.
*
* @param _position The 2-D position of the mouse cursor
* @param _event The mouse event that currently is performed
* @param _radius The current radius of the selection sphere
* @param _currentType The currently active primitive type
* @param _deselect True if entities should be deselected
*/
virtual void sphereSelection(QPoint _position, double _radius, PrimitiveType _currentType, bool _deselect) {};
virtual void sphereSelection(QMouseEvent* _event, double _radius, PrimitiveType _currentType, bool _deselect) {};
/** \brief Emitted by selection base plugin whenever the user performs a closest boundary selection
*
* This connects to slotClosestBoundarySelection(QPoint,QString) which has to be implemented
* by each type selection plugin if this interactive selection mode should be provided.
*
* @param _position The 2-D position of the mouse cursor in local screen coordinates
* @param _event The mouse event that currently is performed
* @param _currentType The currently active primitive type
* @param _deselect True if entities should be deselected
*/
virtual void closestBoundarySelection(QPoint _position, PrimitiveType _currentType, bool _deselect) {};
virtual void closestBoundarySelection(QMouseEvent* _event, PrimitiveType _currentType, bool _deselect) {};
/** \brief Emitted by selection base plugin whenever the user performs a flood fill selection
*
* This connects to slotFloodFillSelection(QPoint,QString) which has to be implemented
* by each type selection plugin if this interactive selection mode should be provided.
*
* @param _position The 2-D position of the mouse cursor in local screen coordinates
* @param _event The mouse event that currently is performed
* @param _maxAngle The maximum angle used for flood filling
* @param _currentType The currently active primitive type
* @param _deselect True if entities should be deselected
*/
virtual void floodFillSelection(QPoint _position, double _maxAngle, PrimitiveType _currentType, bool _deselect) {};
virtual void floodFillSelection(QMouseEvent* _event, double _maxAngle, PrimitiveType _currentType, bool _deselect) {};
/** \brief Emitted by selection base plugin whenever the user performs a custom selection
*
......
......@@ -95,6 +95,15 @@ class TypeInterface {
* a given dataType. If so, your addEmpty function will be invoked to create it.
*/
virtual DataType supportedType() = 0;
/** \brief This slot should be implemented in a TypePlugin to generate type specific backups
*
* @param _id Id of the added object
* @param _name name of the backup
* @param _type the type of backup that needs to be done
*/
virtual void generateBackup( int _id, QString _name, UpdateType _type ){};
};
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment