Changeset View
Changeset View
Standalone View
Standalone View
tabgroup.h
Show All 39 Lines | |||||
40 | * time. All decorated clients SHOULD be in a group, even if it's a group of | 40 | * time. All decorated clients SHOULD be in a group, even if it's a group of | ||
41 | * one client. | 41 | * one client. | ||
42 | * | 42 | * | ||
43 | * rohanp: Had to convert this object to a QObject to make it easier for adding | 43 | * rohanp: Had to convert this object to a QObject to make it easier for adding | ||
44 | * scripting interface to TabGroup. | 44 | * scripting interface to TabGroup. | ||
45 | * | 45 | * | ||
46 | * If a group contains multiple clients then only one will ever be mapped at | 46 | * If a group contains multiple clients then only one will ever be mapped at | ||
47 | * any given time. | 47 | * any given time. | ||
48 | */ | 48 | **/ | ||
49 | class TabGroup | 49 | class TabGroup | ||
50 | { | 50 | { | ||
51 | public: | 51 | public: | ||
52 | /** | 52 | /** | ||
53 | * Creates a new group containing \p c. | 53 | * Creates a new group containing \p c. | ||
54 | */ | 54 | **/ | ||
55 | explicit TabGroup(AbstractClient* c); | 55 | explicit TabGroup(AbstractClient* c); | ||
56 | ~TabGroup(); | 56 | ~TabGroup(); | ||
57 | 57 | | |||
58 | enum State { | 58 | enum State { | ||
59 | None = 0, Minimized = 1<<0, Maximized = 1<<1, Shaded = 1<<2, | 59 | None = 0, Minimized = 1<<0, Maximized = 1<<1, Shaded = 1<<2, | ||
60 | Geometry = 1<<3, Desktop = 1<<4, Activity = 1<<5, | 60 | Geometry = 1<<3, Desktop = 1<<4, Activity = 1<<5, | ||
61 | Layer = 1<<6, QuickTile = 1<<7, All = 0xffffffff | 61 | Layer = 1<<6, QuickTile = 1<<7, All = 0xffffffff | ||
62 | }; | 62 | }; | ||
63 | Q_DECLARE_FLAGS(States, State) | 63 | Q_DECLARE_FLAGS(States, State) | ||
64 | 64 | | |||
65 | /** | 65 | /** | ||
66 | * Activate next tab (flips) | 66 | * Activate next tab (flips) | ||
67 | */ | 67 | **/ | ||
68 | void activateNext(); | 68 | void activateNext(); | ||
69 | 69 | | |||
70 | /** | 70 | /** | ||
71 | * Activate previous tab (flips) | 71 | * Activate previous tab (flips) | ||
72 | */ | 72 | **/ | ||
73 | void activatePrev(); | 73 | void activatePrev(); | ||
74 | 74 | | |||
75 | /** | 75 | /** | ||
76 | * Allows to alter several attributes in random order and trigger a general update at the end | 76 | * Allows to alter several attributes in random order and trigger a general update at the end | ||
77 | * (must still be explicitly called) | 77 | * (must still be explicitly called) | ||
78 | * this is to prevent side effects, mostly for geometry adjustments during maximization and QuickTiling | 78 | * this is to prevent side effects, mostly for geometry adjustments during maximization and QuickTiling | ||
79 | */ | 79 | **/ | ||
80 | void blockStateUpdates(bool); | 80 | void blockStateUpdates(bool); | ||
81 | 81 | | |||
82 | /** | 82 | /** | ||
83 | * Close all clients in this group. | 83 | * Close all clients in this group. | ||
84 | */ | 84 | **/ | ||
85 | void closeAll(); | 85 | void closeAll(); | ||
86 | 86 | | |||
87 | /** | 87 | /** | ||
88 | * Whether client \p c is member of this group | 88 | * Whether client \p c is member of this group | ||
89 | */ | 89 | **/ | ||
90 | bool contains(AbstractClient* c) const; | 90 | bool contains(AbstractClient* c) const; | ||
91 | 91 | | |||
92 | /** | 92 | /** | ||
93 | * The amount of clients in this group | 93 | * The amount of clients in this group | ||
94 | */ | 94 | **/ | ||
95 | int count() const; | 95 | int count() const; | ||
96 | 96 | | |||
97 | /** | 97 | /** | ||
98 | * Returns whether or not this group contains the active client. | 98 | * Returns whether or not this group contains the active client. | ||
99 | */ | 99 | **/ | ||
100 | bool isActive() const; | 100 | bool isActive() const; | ||
101 | 101 | | |||
102 | /** | 102 | /** | ||
103 | * Returns whether this group is empty (used by workspace to remove it) | 103 | * Returns whether this group is empty (used by workspace to remove it) | ||
104 | */ | 104 | **/ | ||
105 | bool isEmpty() const; | 105 | bool isEmpty() const; | ||
106 | 106 | | |||
107 | /** | 107 | /** | ||
108 | * Returns the list of all the clients contained in this group in their current order. | 108 | * Returns the list of all the clients contained in this group in their current order. | ||
109 | */ | 109 | **/ | ||
110 | const QVector<AbstractClient*> &clients() const; | 110 | const QVector<AbstractClient*> &clients() const; | ||
111 | 111 | | |||
112 | /** | 112 | /** | ||
113 | * Returns the currently visible client. | 113 | * Returns the currently visible client. | ||
114 | */ | 114 | **/ | ||
115 | AbstractClient* current() const; | 115 | AbstractClient* current() const; | ||
116 | /** | 116 | /** | ||
117 | * Makes \p c the visible client in the group - force is only used when the window becomes ready for painting. | 117 | * Makes \p c the visible client in the group - force is only used when the window becomes ready for painting. | ||
118 | * Any other usage just causes pointless action | 118 | * Any other usage just causes pointless action | ||
119 | */ | 119 | **/ | ||
120 | void setCurrent(AbstractClient* c, bool force = false); | 120 | void setCurrent(AbstractClient* c, bool force = false); | ||
121 | 121 | | |||
122 | /** | 122 | /** | ||
123 | * Alignes the dynamic Qt @param property of all clients to the one of @param c | 123 | * Alignes the dynamic Qt @param property of all clients to the one of @param c | ||
124 | */ | 124 | **/ | ||
125 | void sync(const char *property, AbstractClient *c); | 125 | void sync(const char *property, AbstractClient *c); | ||
126 | 126 | | |||
127 | /** | 127 | /** | ||
128 | * Returns combined minimum size of all clients in the group. | 128 | * Returns combined minimum size of all clients in the group. | ||
129 | */ | 129 | **/ | ||
130 | QSize minSize() const; | 130 | QSize minSize() const; | ||
131 | /** | 131 | /** | ||
132 | * Returns combined maximum size of all clients in the group. | 132 | * Returns combined maximum size of all clients in the group. | ||
133 | */ | 133 | **/ | ||
134 | QSize maxSize() const; | 134 | QSize maxSize() const; | ||
135 | 135 | | |||
136 | /** | 136 | /** | ||
137 | * Ensures that all the clients in the group have identical geometries and states using | 137 | * Ensures that all the clients in the group have identical geometries and states using | ||
138 | * \p main as the primary client to copy the settings off. If \p only is set then only | 138 | * \p main as the primary client to copy the settings off. If \p only is set then only | ||
139 | * that client is updated to match \p main. | 139 | * that client is updated to match \p main. | ||
140 | */ | 140 | **/ | ||
141 | void updateStates(AbstractClient* main, States states, AbstractClient* only = NULL); | 141 | void updateStates(AbstractClient* main, States states, AbstractClient* only = NULL); | ||
142 | 142 | | |||
143 | /** | 143 | /** | ||
144 | * updates geometry restrictions of this group, basically called from Client::getWmNormalHints(), otherwise rather private | 144 | * updates geometry restrictions of this group, basically called from Client::getWmNormalHints(), otherwise rather private | ||
145 | */ | 145 | **/ | ||
146 | void updateMinMaxSize(); | 146 | void updateMinMaxSize(); | ||
147 | 147 | | |||
148 | Q_SIGNALS: | 148 | Q_SIGNALS: | ||
149 | void minSizeChanged(); | 149 | void minSizeChanged(); | ||
150 | void maxSizeChanged(); | 150 | void maxSizeChanged(); | ||
151 | 151 | | |||
152 | private: | 152 | private: | ||
153 | friend class AbstractClient; | 153 | friend class AbstractClient; | ||
▲ Show 20 Lines • Show All 56 Lines • Show Last 20 Lines |