blob: afe4651f8fa4c9d72753c6a946dce4c4b5d0e186 [file] [log] [blame]
srs5694fad06422010-02-19 17:19:17 -05001/*
srs5694a17fe692011-09-10 20:30:20 -04002 Implementation of GPTData class derivative with basic text-mode interaction
Rod Smith44cda472018-07-05 09:07:58 -04003 Copyright (C) 2010-2018 Roderick W. Smith
srs5694fad06422010-02-19 17:19:17 -05004
5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 2 of the License, or
8 (at your option) any later version.
9
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
14
15 You should have received a copy of the GNU General Public License along
16 with this program; if not, write to the Free Software Foundation, Inc.,
17 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
18
19*/
20
21#ifndef __GPTDATATEXT_H
22#define __GPTDATATEXT_H
23
24#include "gpt.h"
25
26using namespace std;
27
28class GPTDataTextUI : public GPTData {
29 protected:
30 public:
31 GPTDataTextUI(void);
32 GPTDataTextUI(string filename);
33 ~GPTDataTextUI(void);
34
srs56945a081752010-09-24 20:39:41 -040035 // This one needs to be explicitly defined, even though it does nothing new....
srs5694a17fe692011-09-10 20:30:20 -040036// const GPTPart & operator[](uint32_t partNum) {return GPTData::operator[](partNum);}
srs56945a081752010-09-24 20:39:41 -040037
srs5694fad06422010-02-19 17:19:17 -050038 // Extended (interactive) versions of some base-class functions
39 WhichToUse UseWhichPartitions(void);
40 int XFormDisklabel(void);
41
42 // Request information from the user (& possibly do something with it)
43 uint32_t GetPartNum(void);
44 void ResizePartitionTable(void);
Rod Smith503e9ad2017-07-21 21:48:13 -040045 void MoveMainTable(void);
srs5694fad06422010-02-19 17:19:17 -050046 void CreatePartition(void);
47 void DeletePartition(void);
48 void ChangePartType(void);
srs5694815fb652011-03-18 12:35:56 -040049 void ChangeUniqueGuid(void);
srs5694fad06422010-02-19 17:19:17 -050050 void SetAttributes(uint32_t partNum);
srs5694699941e2011-03-21 21:33:57 -040051 int SetName(uint32_t partNum);
srs5694fad06422010-02-19 17:19:17 -050052 int SwapPartitions(void);
53 int DestroyGPTwPrompt(void); // Returns 1 if user proceeds
54 void ShowDetails(void);
55 void MakeHybrid(void);
srs5694fad06422010-02-19 17:19:17 -050056 int XFormToMBR(void); // convert GPT to MBR, wiping GPT afterwards. Returns 1 if successful
srs5694a17fe692011-09-10 20:30:20 -040057
Roderick W. Smitha345a922014-02-22 12:12:32 -050058 // An informational function....
59 void WarnAboutIffyMBRPart(int partNum);
60
srs5694a17fe692011-09-10 20:30:20 -040061 // Main menu functions
62 void MainMenu(string filename);
63 void ShowCommands(void);
64 void ExpertsMenu(string filename);
65 void ShowExpertCommands(void);
66 void RecoveryMenu(string filename);
67 void ShowRecoveryCommands(void);
srs5694fad06422010-02-19 17:19:17 -050068}; // class GPTDataTextUI
69
70int GetMBRTypeCode(int defType);
srs5694699941e2011-03-21 21:33:57 -040071UnicodeString ReadUString(void);
srs5694fad06422010-02-19 17:19:17 -050072
73#endif // __GPTDATATEXT_H