1 /*
2     Implementation of GPTData class derivative with basic text-mode interaction
3     Copyright (C) 2010-2018 Roderick W. Smith
4 
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 
26 using namespace std;
27 
28 class GPTDataTextUI : public GPTData {
29    protected:
30    public:
31       GPTDataTextUI(void);
32       GPTDataTextUI(string filename);
33       ~GPTDataTextUI(void);
34 
35       // This one needs to be explicitly defined, even though it does nothing new....
36 //      const GPTPart & operator[](uint32_t partNum) {return GPTData::operator[](partNum);}
37 
38       // 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);
45       void MoveMainTable(void);
46       void CreatePartition(void);
47       void DeletePartition(void);
48       void ChangePartType(void);
49       void ChangeUniqueGuid(void);
50       void SetAttributes(uint32_t partNum);
51       int SetName(uint32_t partNum);
52       void ReverseName(uint32_t partNum);
53       int SwapPartitions(void);
54       int DestroyGPTwPrompt(void); // Returns 1 if user proceeds
55       void ShowDetails(void);
56       void MakeHybrid(void);
57       int XFormToMBR(void); // convert GPT to MBR, wiping GPT afterwards. Returns 1 if successful
58 
59       // An informational function....
60       void WarnAboutIffyMBRPart(int partNum);
61 
62       // Main menu functions
63       void MainMenu(string filename);
64       void ShowCommands(void);
65       void ExpertsMenu(string filename);
66       void ShowExpertCommands(void);
67       void RecoveryMenu(string filename);
68       void ShowRecoveryCommands(void);
69 }; // class GPTDataTextUI
70 
71 int GetMBRTypeCode(int defType);
72 UnicodeString ReadUString(void);
73 
74 #endif // __GPTDATATEXT_H
75