Changeset View
Changeset View
Standalone View
Standalone View
src/plasmaquick/private/appletquickitem_p.h
Show First 20 Lines • Show All 49 Lines • ▼ Show 20 Line(s) | |||||
50 | namespace PlasmaQuick | 50 | namespace PlasmaQuick | ||
51 | { | 51 | { | ||
52 | 52 | | |||
53 | class AppletQuickItem; | 53 | class AppletQuickItem; | ||
54 | 54 | | |||
55 | class AppletQuickItemPrivate | 55 | class AppletQuickItemPrivate | ||
56 | { | 56 | { | ||
57 | public: | 57 | public: | ||
58 | //weight values for the logic for when or if to preload | ||||
59 | enum PreloadWeights { | ||||
60 | DefaultPreloadWeight = 50, | ||||
61 | DefaultLauncherPreloadWeight = 100, | ||||
62 | DelayedPreloadWeight = 25, | ||||
63 | PreloadWeightIncrement = 5, | ||||
64 | PreloadWeightDecrement = 8 | ||||
65 | }; | ||||
66 | | ||||
67 | enum PreloadPolicy { | ||||
68 | Uninitialized, | ||||
69 | None, | ||||
70 | Adaptive, | ||||
71 | Aggressive | ||||
72 | }; | ||||
73 | | ||||
58 | AppletQuickItemPrivate(Plasma::Applet *a, AppletQuickItem *item); | 74 | AppletQuickItemPrivate(Plasma::Applet *a, AppletQuickItem *item); | ||
59 | 75 | | |||
60 | void init(); | 76 | void init(); | ||
61 | 77 | | |||
78 | int preloadWeight() const; | ||||
79 | | ||||
62 | QQuickItem *createCompactRepresentationItem(); | 80 | QQuickItem *createCompactRepresentationItem(); | ||
63 | QQuickItem *createFullRepresentationItem(); | 81 | QQuickItem *createFullRepresentationItem(); | ||
64 | QQuickItem *createCompactRepresentationExpanderItem(); | 82 | QQuickItem *createCompactRepresentationExpanderItem(); | ||
65 | 83 | | |||
66 | //look into item, and return the Layout attached property, if found | 84 | //look into item, and return the Layout attached property, if found | ||
67 | void connectLayoutAttached(QObject *item); | 85 | void connectLayoutAttached(QObject *item); | ||
68 | void propagateSizeHint(const QByteArray &layoutProperty); | 86 | void propagateSizeHint(const QByteArray &layoutProperty); | ||
69 | 87 | | |||
70 | //handlers of Layout signals, private slots | 88 | //handlers of Layout signals, private slots | ||
71 | void compactRepresentationCheck(); | 89 | void compactRepresentationCheck(); | ||
72 | void minimumWidthChanged(); | 90 | void minimumWidthChanged(); | ||
73 | void minimumHeightChanged(); | 91 | void minimumHeightChanged(); | ||
74 | void preferredWidthChanged(); | 92 | void preferredWidthChanged(); | ||
75 | void preferredHeightChanged(); | 93 | void preferredHeightChanged(); | ||
76 | void maximumWidthChanged(); | 94 | void maximumWidthChanged(); | ||
77 | void maximumHeightChanged(); | 95 | void maximumHeightChanged(); | ||
78 | void fillWidthChanged(); | 96 | void fillWidthChanged(); | ||
79 | void fillHeightChanged(); | 97 | void fillHeightChanged(); | ||
80 | 98 | | |||
81 | AppletQuickItem *q; | 99 | AppletQuickItem *q; | ||
82 | 100 | | |||
101 | static PreloadPolicy s_preloadPolicy; | ||||
83 | int switchWidth; | 102 | int switchWidth; | ||
84 | int switchHeight; | 103 | int switchHeight; | ||
85 | 104 | | |||
86 | QPointer<QQmlComponent> compactRepresentation; | 105 | QPointer<QQmlComponent> compactRepresentation; | ||
87 | QPointer<QQmlComponent> fullRepresentation; | 106 | QPointer<QQmlComponent> fullRepresentation; | ||
88 | QPointer<QQmlComponent> preferredRepresentation; | 107 | QPointer<QQmlComponent> preferredRepresentation; | ||
89 | QPointer<QQmlComponent> compactRepresentationExpander; | 108 | QPointer<QQmlComponent> compactRepresentationExpander; | ||
90 | 109 | | |||
Show All 26 Lines |