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"
|
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() {}
|
2004-09-19 14:24:53 -06:00
|
|
|
|
2006-03-24 12:08:41 -07:00
|
|
|
virtual void apply_to_visual( std::vector<Partition> & partitions ) = 0 ;
|
2006-07-11 12:13:27 -06:00
|
|
|
virtual void create_description() = 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 ;
|
|
|
|
Partition partition_original ;
|
|
|
|
Partition partition_new ;
|
|
|
|
|
|
|
|
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:
|
|
|
|
int find_index_original( const std::vector<Partition> & partitions ) ;
|
|
|
|
int find_index_extended( const std::vector<Partition> & partitions ) ;
|
2010-04-19 19:22:31 -06:00
|
|
|
void insert_unallocated( std::vector<Partition> & partitions, Sector start, Sector end, Byte_Value sector_size, bool inside_extended );
|
|
|
|
|
2006-03-24 12:08:41 -07:00
|
|
|
int index ;
|
|
|
|
int index_extended ;
|
2004-09-19 14:24:53 -06:00
|
|
|
};
|
|
|
|
|
|
|
|
} //GParted
|
|
|
|
|
2013-05-27 05:20:16 -06:00
|
|
|
#endif /* GPARTED_OPERATION_H */
|