clipboard.h

Go to the documentation of this file.
00001 
00005 /*
00006     This file is part of Advanced Strategic Command; http://www.asc-hq.de
00007     Copyright (C) 1994-2010  Martin Bickel  and  Marc Schellenberger
00008 
00009     This program is free software; you can redistribute it and/or modify
00010     it under the terms of the GNU General Public License as published by
00011     the Free Software Foundation; either version 2 of the License, or
00012     (at your option) any later version.
00013 
00014     This program is distributed in the hope that it will be useful,
00015     but WITHOUT ANY WARRANTY; without even the implied warranty of
00016     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00017     GNU General Public License for more details.
00018 
00019     You should have received a copy of the GNU General Public License
00020     along with this program; see the file COPYING. If not, write to the
00021     Free Software Foundation, Inc., 59 Temple Place, Suite 330,
00022     Boston, MA  02111-1307  USA
00023 */
00024 
00025 #ifndef clipboardH
00026  #define clipboardH
00027 
00028  #include <map>
00029 
00030  #include "loki/Singleton.h"
00031  #include "basestrm.h"
00032  #include "vehicletype.h"
00033  #include "buildingtype.h"
00034  #include "typen.h"
00035  #include "textfile_evaluation.h"
00036 
00037 class ClipBoardBase {
00038       map<ASCString,ASCString> properties;
00039    
00040       MemoryStreamStorage buf;
00041       enum Type { ClipVehicle, ClipBuilding };
00042       int objectNum;
00043 
00044       friend struct Loki::CreateUsingNew<ClipBoardBase>;
00045       ClipBoardBase();
00046       ~ClipBoardBase() {};
00047       
00048       void setProperties( const ContainerBase* unit );
00049       
00050    public:
00051       void clear();
00052       void addUnit ( const Vehicle* unit );
00053       void addBuilding ( const Building* bld );
00054       Vehicle* pasteUnit();
00055       Vehicle* pasteUnit( tnstream& stream);
00056       void place ( const MapCoordinate& pos );
00057 
00058       void writeProperties( PropertyContainer& pc ) const;
00059       void readProperties( PropertyContainer& pc );
00060       
00061       void write( tnstream& stream );
00062       void read( tnstream& stream );
00063 };
00064 
00065 typedef Loki::SingletonHolder< ClipBoardBase > ClipBoard;
00066 
00067 extern const char* clipboardFileExtension;
00068 extern const char* oldClipboardFileExtension;
00069 
00070 
00071 #endif
00072 

Generated on Mon May 21 01:26:30 2012 for Advanced Strategic Command by  doxygen 1.5.1