xref: /aosp_15_r20/external/lzma/CPP/7zip/UI/FileManager/ViewSettings.h (revision f6dc9357d832569d4d1f5d24eacdb3935a1ae8e6)
1 // ViewSettings.h
2 
3 #ifndef ZIP7_INC_VIEW_SETTINGS_H
4 #define ZIP7_INC_VIEW_SETTINGS_H
5 
6 #include "../../../Common/MyTypes.h"
7 #include "../../../Common/MyString.h"
8 
9 struct CColumnInfo
10 {
11   PROPID PropID;
12   bool IsVisible;
13   UInt32 Width;
14 
IsEqualCColumnInfo15   bool IsEqual(const CColumnInfo &a) const
16   {
17     return PropID == a.PropID && IsVisible == a.IsVisible && Width == a.Width;
18   }
19 };
20 
21 struct CListViewInfo
22 {
23   CRecordVector<CColumnInfo> Columns;
24   PROPID SortID;
25   bool Ascending;
26   bool IsLoaded;
27 
ClearCListViewInfo28   void Clear()
29   {
30     SortID = 0;
31     Ascending = true;
32     IsLoaded = false;
33     Columns.Clear();
34   }
35 
CListViewInfoCListViewInfo36   CListViewInfo():
37     SortID(0),
38     Ascending(true),
39     IsLoaded(false)
40     {}
41 
42   /*
43   int FindColumnWithID(PROPID propID) const
44   {
45     FOR_VECTOR (i, Columns)
46       if (Columns[i].PropID == propID)
47         return i;
48     return -1;
49   }
50   */
51 
IsEqualCListViewInfo52   bool IsEqual(const CListViewInfo &info) const
53   {
54     if (Columns.Size() != info.Columns.Size() ||
55         SortID != info.SortID ||
56         Ascending != info.Ascending)
57       return false;
58     FOR_VECTOR (i, Columns)
59       if (!Columns[i].IsEqual(info.Columns[i]))
60         return false;
61     return true;
62   }
63 
64   void Save(const UString &id) const;
65   void Read(const UString &id);
66 };
67 
68 
69 struct CWindowInfo
70 {
71   RECT rect;
72   bool maximized;
73 
74   UInt32 numPanels;
75   UInt32 currentPanel;
76   UInt32 splitterPos;
77 
78   void Save() const;
79   void Read(bool &windowPosDefined, bool &panelInfoDefined);
80 };
81 
82 void SaveToolbarsMask(UInt32 toolbarMask);
83 UInt32 ReadToolbarsMask();
84 
85 const UInt32 kListMode_Report = 3;
86 
87 struct CListMode
88 {
89   UInt32 Panels[2];
90 
InitCListMode91   void Init() { Panels[0] = Panels[1] = kListMode_Report; }
CListModeCListMode92   CListMode() { Init(); }
93 
94   void Save() const ;
95   void Read();
96 };
97 
98 
99 
100 void SavePanelPath(UInt32 panel, const UString &path);
101 bool ReadPanelPath(UInt32 panel, UString &path);
102 
103 
104 void SaveFolderHistory(const UStringVector &folders);
105 void ReadFolderHistory(UStringVector &folders);
106 
107 void SaveFastFolders(const UStringVector &folders);
108 void ReadFastFolders(UStringVector &folders);
109 
110 void SaveCopyHistory(const UStringVector &folders);
111 void ReadCopyHistory(UStringVector &folders);
112 
113 void AddUniqueStringToHeadOfList(UStringVector &list, const UString &s);
114 
115 #endif
116