src/app/qgsclipboard.h

Go to the documentation of this file.
00001 /***************************************************************************
00002       qgsclipboard.h  -  QGIS internal clipboard for storage of features
00003       ------------------------------------------------------------------
00004     begin                : 20 May, 2005
00005     copyright            : (C) 2005 by Brendan Morley
00006     email                : morb at ozemail dot com dot au
00007  ***************************************************************************/
00008 
00009 /***************************************************************************
00010  *                                                                         *
00011  *   This program is free software; you can redistribute it and/or modify  *
00012  *   it under the terms of the GNU General Public License as published by  *
00013  *   the Free Software Foundation; either version 2 of the License, or     *
00014  *   (at your option) any later version.                                   *
00015  *                                                                         *
00016  ***************************************************************************/
00017 
00018 /* $Id: qgsclipboard.h 9551 2008-10-27 17:35:28Z homann $ */
00019 
00020 #ifndef QGSCLIPBOARD_H
00021 #define QGSCLIPBOARD_H
00022 
00023 #include <QList>
00024 #include <QMap>
00025 
00026 #include "qgsfield.h"
00027 #include "qgsfeature.h"
00028 
00029 
00048 class QgsClipboard
00049 {
00050 
00051 
00052   public:
00053 
00054 
00058     QgsClipboard();
00059 
00061     virtual ~QgsClipboard();
00062 
00063     /*
00064      *  Place a copy of features on the internal clipboard,
00065      *  destroying the previous contents.
00066      */
00067     void replaceWithCopyOf( const QgsFieldMap& fields, QgsFeatureList& features );
00068 
00069     /*
00070      *  Returns a copy of features on the internal clipboard,
00071      *  the caller assumes responsibility fot destroying the contents
00072      *  when it's done with it.
00073      */
00074     QgsFeatureList copyOf();
00075 
00076     /*
00077      *  Clears the internal clipboard.
00078      */
00079     void clear();
00080 
00081     /*
00082      *  Inserts a copy of the feature on the internal clipboard.
00083      */
00084     void insert( QgsFeature& feature );
00085 
00086 
00087     /*
00088      *  Returns true if the internal clipboard is empty, else false.
00089      */
00090     bool empty();
00091 
00092   private:
00093 
00098     QgsFeatureList mFeatureClipboard;
00099 
00100 };
00101 
00102 #endif

Generated on Tue Oct 28 16:51:26 2008 for Quantum GIS API Documentation by  doxygen 1.5.1