File: file_grid_attr.h

package info (click to toggle)
freefilesync 13.7-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 9,044 kB
  • sloc: cpp: 66,712; ansic: 447; makefile: 216
file content (105 lines) | stat: -rw-r--r-- 2,542 bytes parent folder | download | duplicates (2)
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
// *****************************************************************************
// * This file is part of the FreeFileSync project. It is distributed under    *
// * GNU General Public License: https://www.gnu.org/licenses/gpl-3.0          *
// * Copyright (C) Zenju (zenju AT freefilesync DOT org) - All Rights Reserved *
// *****************************************************************************

#ifndef COLUMN_ATTR_H_189467891346732143213
#define COLUMN_ATTR_H_189467891346732143213

#include <vector>
#include <cassert>
#include <wx+/dc.h>


namespace fff
{
enum class GridViewType
{
    difference,
    action,
};

enum class ColumnTypeRim
{
    path,
    size,
    date,
    extension,
};

struct ColAttributesRim
{
    ColumnTypeRim type    = ColumnTypeRim::path;
    int           offset  = 0;
    int           stretch = 0;
    bool          visible = false;
};

inline
std::vector<ColAttributesRim> getFileGridDefaultColAttribsLeft()
{
    using namespace zen;
    return //harmonize with main_dlg.cpp::onGridLabelContextRim() => expects stretched path and non-stretched other columns!
    {
        {ColumnTypeRim::path,     -dipToWxsize(100), 1, true },
        {ColumnTypeRim::extension, dipToWxsize( 60), 0, false},
        {ColumnTypeRim::date,      dipToWxsize(140), 0, false},
        {ColumnTypeRim::size,      dipToWxsize(100), 0, true },
    };
}

inline
std::vector<ColAttributesRim> getFileGridDefaultColAttribsRight()
{
    return getFileGridDefaultColAttribsLeft(); //*currently* same default
}


inline
bool getDefaultSortDirection(ColumnTypeRim type) //true: ascending; false: descending
{
    switch (type)
    {
        case ColumnTypeRim::size:
        case ColumnTypeRim::date:
            return false;

        case ColumnTypeRim::path:
        case ColumnTypeRim::extension:
            return true;
    }
    assert(false);
    return true;
}


enum class ItemPathFormat
{
    name,
    relative,
    full,
};

const ItemPathFormat defaultItemPathFormatLeftGrid  = ItemPathFormat::relative;
const ItemPathFormat defaultItemPathFormatRightGrid = ItemPathFormat::relative;

//------------------------------------------------------------------
enum class ColumnTypeCenter
{
    checkbox,
    difference,
    action,
};


inline
bool getDefaultSortDirection(ColumnTypeCenter type) //true: ascending; false: descending
{
    assert(type != ColumnTypeCenter::checkbox);
    return true;
}
//------------------------------------------------------------------
}

#endif //COLUMN_ATTR_H_189467891346732143213