2009-11-05 11:08:32 -07:00
|
|
|
/* Copyright (C) 2004 Bart
|
2010-04-19 19:22:31 -06:00
|
|
|
* Copyright (C) 2008, 2009, 2010 Curtis Gedak
|
2004-09-19 14:24:53 -06:00
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU 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
|
2014-01-23 03:59:48 -07:00
|
|
|
* GNU General Public License for more details.
|
2004-09-19 14:24:53 -06:00
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
2014-01-23 03:59:48 -07:00
|
|
|
* along with this program; if not, see <http://www.gnu.org/licenses/>.
|
2004-09-19 14:24:53 -06:00
|
|
|
*/
|
|
|
|
|
2013-05-27 05:20:16 -06:00
|
|
|
#ifndef GPARTED_OPERATION_H
|
|
|
|
#define GPARTED_OPERATION_H
|
2004-09-19 14:24:53 -06:00
|
|
|
|
|
|
|
#include "../include/Device.h"
|
2006-07-29 02:27:28 -06:00
|
|
|
#include "../include/OperationDetail.h"
|
2015-05-23 13:22:37 -06:00
|
|
|
#include "../include/Partition.h"
|
|
|
|
#include "../include/PartitionVector.h"
|
2006-03-24 12:08:41 -07:00
|
|
|
|
2004-09-19 14:24:53 -06:00
|
|
|
namespace GParted
|
|
|
|
{
|
2006-07-29 02:27:28 -06:00
|
|
|
//FIXME: stop using GParted:: in front of our own enums.. it's not necessary and clutters the code
|
2004-09-19 14:24:53 -06:00
|
|
|
enum OperationType {
|
2014-12-16 14:06:20 -07:00
|
|
|
OPERATION_DELETE = 0,
|
|
|
|
OPERATION_CHECK = 1,
|
|
|
|
OPERATION_CREATE = 2,
|
|
|
|
OPERATION_RESIZE_MOVE = 3,
|
|
|
|
OPERATION_FORMAT = 4,
|
|
|
|
OPERATION_COPY = 5,
|
|
|
|
OPERATION_LABEL_FILESYSTEM = 6,
|
2014-12-12 00:00:02 -07:00
|
|
|
OPERATION_CHANGE_UUID = 7,
|
|
|
|
OPERATION_NAME_PARTITION = 8
|
2004-09-19 14:24:53 -06:00
|
|
|
};
|
|
|
|
|
|
|
|
class Operation
|
|
|
|
{
|
|
|
|
|
|
|
|
public:
|
2006-01-19 12:15:15 -07:00
|
|
|
Operation() ;
|
2006-03-24 12:08:41 -07:00
|
|
|
virtual ~Operation() {}
|
2015-05-23 13:22:37 -06:00
|
|
|
|
2015-09-20 03:50:57 -06:00
|
|
|
Partition & get_partition_original();
|
|
|
|
const Partition & get_partition_original() const;
|
|
|
|
virtual Partition & get_partition_new();
|
|
|
|
const virtual Partition & get_partition_new() const;
|
2015-09-19 08:57:39 -06:00
|
|
|
|
2015-05-23 13:22:37 -06:00
|
|
|
virtual void apply_to_visual( PartitionVector & partitions ) = 0;
|
2006-07-11 12:13:27 -06:00
|
|
|
virtual void create_description() = 0 ;
|
2015-09-12 07:59:40 -06:00
|
|
|
virtual bool merge_operations( const Operation & candidate ) = 0;
|
2006-03-24 12:08:41 -07:00
|
|
|
|
2004-09-19 14:24:53 -06:00
|
|
|
//public variables
|
2004-12-27 05:08:01 -07:00
|
|
|
Device device ;
|
2006-03-24 12:08:41 -07:00
|
|
|
OperationType type ;
|
|
|
|
|
|
|
|
Glib::RefPtr<Gdk::Pixbuf> icon ;
|
|
|
|
Glib::ustring description ;
|
fixed issues with copying (see also #335004) cleanups + added FIXME added
* include/GParted_Core.h,
src/GParted_Core.cc,
src/Win_GParted.cc,
src/ext2.cc,
src/ext3.cc,
src/fat16.cc,
src/fat32.cc,
src/jfs.cc,
src/ntfs.cc,
src/reiserfs.cc: fixed issues with copying (see also #335004)
* include/Operation.h,
src/Operation.cc: cleanups + added FIXME
* include/Partition.h,
src/Partition.cc: added clear_mountpoints()
* src/DrawingAreaVisualDisk.cc: added FIXME
2006-03-19 08:30:20 -07:00
|
|
|
|
2006-07-29 02:27:28 -06:00
|
|
|
OperationDetail operation_detail ;
|
2004-09-19 14:24:53 -06:00
|
|
|
|
2006-03-24 12:08:41 -07:00
|
|
|
protected:
|
2015-05-23 13:22:37 -06:00
|
|
|
int find_index_original( const PartitionVector & partitions );
|
|
|
|
int find_index_new( const PartitionVector & partitions );
|
|
|
|
int find_index_extended( const PartitionVector & partitions );
|
|
|
|
void insert_unallocated( PartitionVector & partitions,
|
|
|
|
Sector start, Sector end, Byte_Value sector_size, bool inside_extended );
|
|
|
|
void substitute_new( PartitionVector & partitions );
|
|
|
|
void insert_new( PartitionVector & partitions );
|
2015-09-19 08:57:39 -06:00
|
|
|
|
2015-09-20 03:50:57 -06:00
|
|
|
Partition * partition_original;
|
|
|
|
Partition * partition_new;
|
|
|
|
|
|
|
|
private:
|
|
|
|
// Disable compiler generated copy constructor and copy assignment operator by
|
|
|
|
// providing private declarations and no definition. Code which tries to copy
|
|
|
|
// construct or copy assign this class will fail to compile.
|
|
|
|
// References:
|
|
|
|
// * Disable copy constructor
|
|
|
|
// http://stackoverflow.com/questions/6077143/disable-copy-constructor
|
|
|
|
// * Disable compiler-generated copy-assignment operator [duplicate]
|
|
|
|
// http://stackoverflow.com/questions/7823845/disable-compiler-generated-copy-assignment-operator
|
|
|
|
Operation( const Operation & src ); // Not implemented copy constructor
|
|
|
|
Operation & operator=( const Operation & rhs ); // Not implemented copy assignment operator
|
2004-09-19 14:24:53 -06:00
|
|
|
};
|
|
|
|
|
|
|
|
} //GParted
|
|
|
|
|
2013-05-27 05:20:16 -06:00
|
|
|
#endif /* GPARTED_OPERATION_H */
|