0f54da9dde
The idea for this base class is to provide access to all elements which make up a managed "Client" being it X11 or Wayland. They share a lot, like they have a caption, they can be minimized, etc. etc. Of course it would have also been possible to derive a new class from Client, but that looks like the more difficult task as Client is very X11 specific. So far only a very small interface is extracted with pure-virtual methods. This is going to change by moving the functionality up into the AbstractClient. The interface extracted so far is inspired by the usage of FocusChain and users of FocusChain.
68 lines
2.1 KiB
C++
68 lines
2.1 KiB
C++
/********************************************************************
|
|
KWin - the KDE window manager
|
|
This file is part of the KDE project.
|
|
|
|
Copyright (C) 2015 Martin Gräßlin <mgraesslin@kde.org>
|
|
|
|
This program is free software; you can redistribute it and/or modify
|
|
it under the terms of the GNU General Public License as published by
|
|
the Free Software Foundation; either version 2 of the License, or
|
|
(at your option) any later version.
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
GNU General Public License for more details.
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
*********************************************************************/
|
|
#ifndef KWIN_ABSTRACT_CLIENT_H
|
|
#define KWIN_ABSTRACT_CLIENT_H
|
|
|
|
#include "toplevel.h"
|
|
|
|
namespace KWin
|
|
{
|
|
|
|
namespace TabBox
|
|
{
|
|
class TabBoxClientImpl;
|
|
}
|
|
|
|
class AbstractClient : public Toplevel
|
|
{
|
|
Q_OBJECT
|
|
public:
|
|
virtual ~AbstractClient();
|
|
|
|
virtual QWeakPointer<TabBox::TabBoxClientImpl> tabBoxClient() const = 0;
|
|
virtual void updateMouseGrab();
|
|
virtual QString caption(bool full = true, bool stripped = false) const = 0;
|
|
virtual bool isMinimized() const = 0;
|
|
virtual bool isCloseable() const = 0;
|
|
virtual bool isFirstInTabBox() const = 0;
|
|
// TODO: remove boolean trap
|
|
virtual bool isShown(bool shaded_is_shown) const = 0;
|
|
virtual bool wantsTabFocus() const = 0;
|
|
virtual bool isFullScreen() const = 0;
|
|
virtual const QIcon &icon() const = 0;
|
|
|
|
// TODO: remove boolean trap
|
|
static bool belongToSameApplication(const AbstractClient* c1, const AbstractClient* c2, bool active_hack = false);
|
|
|
|
public Q_SLOTS:
|
|
virtual void closeWindow() = 0;
|
|
|
|
protected:
|
|
AbstractClient();
|
|
// TODO: remove boolean trap
|
|
virtual bool belongsToSameApplication(const AbstractClient *other, bool active_hack) const = 0;
|
|
};
|
|
|
|
}
|
|
|
|
Q_DECLARE_METATYPE(KWin::AbstractClient*)
|
|
Q_DECLARE_METATYPE(QList<KWin::AbstractClient*>)
|
|
|
|
#endif
|