2004-09-19 14:24:53 -06:00
|
|
|
/* Copyright (C) 2004 Bart
|
|
|
|
*
|
|
|
|
* 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
|
|
|
|
* GNU Library General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef OPERATION
|
|
|
|
#define OPERATION
|
|
|
|
|
|
|
|
#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 {
|
2006-07-29 09:20:32 -06:00
|
|
|
OPERATION_DELETE = 0,
|
2006-11-26 07:27:16 -07:00
|
|
|
OPERATION_CHECK = 1,
|
|
|
|
OPERATION_CREATE = 2,
|
|
|
|
OPERATION_RESIZE_MOVE = 3,
|
|
|
|
OPERATION_FORMAT = 4,
|
|
|
|
OPERATION_COPY = 5
|
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 ) ;
|
|
|
|
void insert_unallocated( std::vector<Partition> & partitions, Sector start, Sector end, bool inside_extended );
|
2004-11-06 04:55:03 -07:00
|
|
|
|
2006-03-24 12:08:41 -07:00
|
|
|
int index ;
|
|
|
|
int index_extended ;
|
2004-09-19 14:24:53 -06:00
|
|
|
};
|
|
|
|
|
|
|
|
} //GParted
|
|
|
|
|
|
|
|
#endif //OPERATION
|