Changeset View
Changeset View
Standalone View
Standalone View
src/radialMap/map.h
Show All 21 Lines | |||||
22 | #ifndef MAP_H | 22 | #ifndef MAP_H | ||
23 | #define MAP_H | 23 | #define MAP_H | ||
24 | 24 | | |||
25 | #include "fileTree.h" | 25 | #include "fileTree.h" | ||
26 | 26 | | |||
27 | #include <KColorScheme> | 27 | #include <KColorScheme> | ||
28 | 28 | | |||
29 | #include <QPixmap> | 29 | #include <QPixmap> | ||
30 | #include <QRect> | 30 | #include <QRectF> | ||
31 | #include <QString> | 31 | #include <QString> | ||
32 | 32 | | |||
33 | namespace RadialMap { | 33 | namespace RadialMap { | ||
34 | class Segment; | 34 | class Segment; | ||
35 | 35 | | |||
36 | class Map | 36 | class Map | ||
37 | { | 37 | { | ||
38 | public: | 38 | public: | ||
39 | explicit Map(bool summary); | 39 | explicit Map(bool summary); | ||
40 | ~Map(); | 40 | ~Map(); | ||
41 | 41 | | |||
42 | void make(const Folder *, bool = false); | 42 | void make(const Folder *, bool = false); | ||
43 | bool resize(const QRect&); | 43 | bool resize(const QRectF&); | ||
44 | 44 | | |||
45 | bool isNull() const { | 45 | bool isNull() const { | ||
46 | return (m_signature == nullptr); | 46 | return (m_signature == nullptr); | ||
47 | } | 47 | } | ||
48 | void invalidate(); | 48 | void invalidate(); | ||
49 | 49 | | |||
50 | int height() const { | 50 | qreal height() const { | ||
51 | return m_rect.height(); | 51 | return m_rect.height(); | ||
52 | } | 52 | } | ||
53 | int width() const { | 53 | qreal width() const { | ||
54 | return m_rect.width(); | 54 | return m_rect.width(); | ||
55 | } | 55 | } | ||
56 | QPixmap pixmap() const { | 56 | QPixmap pixmap() const { | ||
57 | return m_pixmap; | 57 | return m_pixmap; | ||
58 | } | 58 | } | ||
59 | 59 | | |||
60 | 60 | | |||
61 | friend class Widget; | 61 | friend class Widget; | ||
62 | 62 | | |||
63 | private: | 63 | private: | ||
64 | void paint(bool antialias = true); | 64 | void paint(bool antialias = true); | ||
65 | void colorise(); | 65 | void colorise(); | ||
66 | void setRingBreadth(); | 66 | void setRingBreadth(); | ||
67 | void findVisibleDepth(const Folder *dir, uint currentDepth = 0); | 67 | void findVisibleDepth(const Folder *dir, uint currentDepth = 0); | ||
68 | bool build(const Folder* const dir, const uint depth =0, uint a_start =0, const uint a_end =5760); | 68 | bool build(const Folder* const dir, const uint depth =0, uint a_start =0, const uint a_end =5760); | ||
69 | 69 | | |||
70 | QList<Segment*> *m_signature; | 70 | QList<Segment*> *m_signature; | ||
71 | 71 | | |||
72 | const Folder *m_root; | 72 | const Folder *m_root; | ||
73 | uint m_minSize; | 73 | uint m_minSize; | ||
74 | QVector<FileSize> m_limits; | 74 | QVector<FileSize> m_limits; | ||
75 | QRect m_rect; | 75 | QRectF m_rect; | ||
76 | uint m_visibleDepth; ///visible level depth of system | 76 | uint m_visibleDepth; ///visible level depth of system | ||
77 | QPixmap m_pixmap; | 77 | QPixmap m_pixmap; | ||
78 | int m_ringBreadth; | 78 | int m_ringBreadth; | ||
79 | uint m_innerRadius; ///radius of inner circle | 79 | uint m_innerRadius; ///radius of inner circle | ||
80 | QString m_centerText; | 80 | QString m_centerText; | ||
81 | bool m_summary; | 81 | bool m_summary; | ||
82 | qreal m_dpr; | ||||
82 | 83 | | |||
83 | uint MAP_2MARGIN; | 84 | uint MAP_2MARGIN; | ||
84 | }; | 85 | }; | ||
85 | } | 86 | } | ||
86 | 87 | | |||
87 | #endif | 88 | #endif |