1
0
mirror of https://github.com/KDE/latte-dock.git synced 2024-12-25 19:21:41 +03:00
latte-dock/app/visibilitymanager_p.h
2016-12-30 02:17:38 -05:00

70 lines
1.6 KiB
C++

#ifndef VISIBILITYMANAGERPRIVATE_H
#define VISIBILITYMANAGERPRIVATE_H
#include "../liblattedock/dock.h"
#include "windowinfowrap.h"
#include "abstractwindowinterface.h"
#include <unordered_map>
#include <memory>
#include <QObject>
#include <QTimer>
#include <QEvent>
#include <plasmaquick/containmentview.h>
namespace Latte {
class VisibilityManager;
/*!
* \brief The Latte::VisibilityManagerPrivate is a class d-pointer
*/
class VisibilityManagerPrivate : public QObject {
Q_GADGET
public:
VisibilityManagerPrivate(PlasmaQuick::ContainmentView *view, VisibilityManager *q);
~VisibilityManagerPrivate();
void setMode(Dock::Visibility mode);
void setIsHidden(bool isHidden);
void setTimerShow(int msec);
void setTimerHide(int msec);
void raiseDock(bool raise);
void setDockRect(const QRect &rect);
void windowAdded(WId id);
void dodgeActive(WId id);
void dodgeMaximized(WId id);
void dodgeWindows(WId id);
void checkAllWindows();
bool intersects(const WindowInfoWrap &winfo);
void saveConfig();
void restoreConfig();
bool event(QEvent *ev) override;
VisibilityManager *q;
PlasmaQuick::ContainmentView *view;
std::unique_ptr<AbstractWindowInterface> wm;
Dock::Visibility mode{Dock::DodgeActive};
std::array<QMetaObject::Connection, 4> connections;
std::unordered_map<WId, WindowInfoWrap> windows;
QTimer timerShow;
QTimer timerHide;
QTimer timerCheckWindows;
QRect dockRect;
bool isHidden{false};
bool containsMouse{false};
};
}
#endif // VISIBILITYMANAGERPRIVATE_H