1/*
2 * Copyright 2002-2007 Haiku Inc. All rights reserved.
3 * Distributed under the terms of the MIT license.
4 */
5#ifndef SUPPORT_H
6#define SUPPORT_H
7
8
9#include <DiskDeviceDefs.h>
10#include <HashMap.h>
11#include <HashString.h>
12#include <Slider.h>
13#include <String.h>
14#include "StringForSize.h"
15
16
17class BPartition;
18
19
20void dump_partition_info(const BPartition* partition);
21
22bool is_valid_partitionable_space(size_t size);
23
24
25static const uint32 kMegaByte = 0x100000;
26
27class SpaceIDMap : public HashMap<HashString, partition_id> {
28public:
29								SpaceIDMap();
30	virtual						~SpaceIDMap();
31
32			partition_id		SpaceIDFor(partition_id parentID,
33									off_t spaceOffset);
34
35private:
36			partition_id		fNextSpaceID;
37};
38
39class SizeSlider : public BSlider {
40public:
41								SizeSlider(const char* name, const char* label,
42        							BMessage* message, int32 minValue,
43        							int32 maxValue);
44	virtual						~SizeSlider();
45
46	virtual const char*			UpdateText() const;
47			int32				Size();
48			int32				Offset();
49			int32				MaxPartitionSize();
50
51private:
52			off_t				fStartOffset;
53			off_t				fEndOffset;
54			off_t				fMaxPartitionSize;
55	mutable	char				fStatusLabel[64];
56};
57
58#endif // SUPPORT_H
59