• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2     Implementation of GPTData class derivative with basic text-mode interaction
3     Copyright (C) 2010-2022 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 class GPTDataTextUI : public GPTData {
27    protected:
28    public:
29       GPTDataTextUI(void);
30       GPTDataTextUI(std::string filename);
31       ~GPTDataTextUI(void);
32 
33       // This one needs to be explicitly defined, even though it does nothing new....
34 //      const GPTPart & operator[](uint32_t partNum) {return GPTData::operator[](partNum);}
35 
36       // Extended (interactive) versions of some base-class functions
37       WhichToUse UseWhichPartitions(void);
38       int XFormDisklabel(void);
39 
40       // Request information from the user (& possibly do something with it)
41       uint32_t GetPartNum(void);
42       void ResizePartitionTable(void);
43       void MoveMainTable(void);
44       void CreatePartition(void);
45       void DeletePartition(void);
46       void ChangePartType(void);
47       void ChangeUniqueGuid(void);
48       void SetAttributes(uint32_t partNum);
49       int SetName(uint32_t partNum);
50       void ReverseName(uint32_t partNum);
51       int SwapPartitions(void);
52       int DestroyGPTwPrompt(void); // Returns 1 if user proceeds
53       void ShowDetails(void);
54       void MakeHybrid(void);
55       int XFormToMBR(void); // convert GPT to MBR, wiping GPT afterwards. Returns 1 if successful
56       uint64_t GetSectorNum(uint64_t low, uint64_t high, uint64_t def, const std::string & prompt);
57 
58       // An informational function....
59       void WarnAboutIffyMBRPart(int partNum);
60 
61       // Main menu functions
62       void MainMenu(std::string filename);
63       void ShowCommands(void);
64       void ExpertsMenu(std::string filename);
65       void ShowExpertCommands(void);
66       void RecoveryMenu(std::string filename);
67       void ShowRecoveryCommands(void);
68 }; // class GPTDataTextUI
69 
70 int GetMBRTypeCode(int defType);
71 UnicodeString ReadUString(void);
72 
73 #endif // __GPTDATATEXT_H
74