File: ViewSettings.h

package info (click to toggle)
7zip 24.09%2Bdfsg-8
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 13,436 kB
  • sloc: cpp: 206,595; ansic: 39,085; asm: 4,357; makefile: 2,188; sh: 162
file content (115 lines) | stat: -rwxr-xr-x 2,309 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
// ViewSettings.h

#ifndef ZIP7_INC_VIEW_SETTINGS_H
#define ZIP7_INC_VIEW_SETTINGS_H

#include "../../../Common/MyTypes.h"
#include "../../../Common/MyString.h"

struct CColumnInfo
{
  PROPID PropID;
  bool IsVisible;
  UInt32 Width;

  bool IsEqual(const CColumnInfo &a) const
  {
    return PropID == a.PropID && IsVisible == a.IsVisible && Width == a.Width;
  }
};

struct CListViewInfo
{
  CRecordVector<CColumnInfo> Columns;
  PROPID SortID;
  bool Ascending;
  bool IsLoaded;

  void Clear()
  {
    SortID = 0;
    Ascending = true;
    IsLoaded = false;
    Columns.Clear();
  }

  CListViewInfo():
    SortID(0),
    Ascending(true),
    IsLoaded(false)
    {}

  /*
  int FindColumnWithID(PROPID propID) const
  {
    FOR_VECTOR (i, Columns)
      if (Columns[i].PropID == propID)
        return i;
    return -1;
  }
  */

  bool IsEqual(const CListViewInfo &info) const
  {
    if (Columns.Size() != info.Columns.Size() ||
        SortID != info.SortID ||
        Ascending != info.Ascending)
      return false;
    FOR_VECTOR (i, Columns)
      if (!Columns[i].IsEqual(info.Columns[i]))
        return false;
    return true;
  }

  void Save(const UString &id) const;
  void Read(const UString &id);
};


struct CWindowInfo
{
  RECT rect;
  bool maximized;

  UInt32 numPanels;
  UInt32 currentPanel;
  UInt32 splitterPos;

  void Save() const;
  void Read(bool &windowPosDefined, bool &panelInfoDefined);
};

void SaveToolbarsMask(UInt32 toolbarMask);
UInt32 ReadToolbarsMask();

const UInt32 kListMode_Report = 3;

struct CListMode
{
  UInt32 Panels[2];
  
  void Init() { Panels[0] = Panels[1] = kListMode_Report; }
  CListMode() { Init(); }
  
  void Save() const ;
  void Read();
};



void SavePanelPath(UInt32 panel, const UString &path);
bool ReadPanelPath(UInt32 panel, UString &path);


void SaveFolderHistory(const UStringVector &folders);
void ReadFolderHistory(UStringVector &folders);

void SaveFastFolders(const UStringVector &folders);
void ReadFastFolders(UStringVector &folders);

void SaveCopyHistory(const UStringVector &folders);
void ReadCopyHistory(UStringVector &folders);

void AddUniqueStringToHeadOfList(UStringVector &list, const UString &s);

#endif