Back to index

kdeartwork  4.3.2
Manager.h
Go to the documentation of this file.
00001 /*
00002   RISC OS KWin client
00003 
00004   Copyright 2000
00005     Rik Hemsley <rik@kde.org>
00006 
00007   This program is free software; you can redistribute it and/or
00008   modify it under the terms of the GNU General Public
00009   License as published by the Free Software Foundation; either
00010   version 2 of the License, or (at your option) any later version.
00011 
00012   This program is distributed in the hope that it will be useful,
00013   but WITHOUT ANY WARRANTY; without even the implied warranty of
00014   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00015   General Public License for more details.
00016 
00017   You should have received a copy of the GNU General Public License
00018   along with this program; see the file COPYING.  If not, write to
00019   the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
00020   Boston, MA 02110-1301, USA.
00021 */
00022 
00023 #ifndef RISC_OS_MANAGER_H
00024 #define RISC_OS_MANAGER_H
00025 
00026 #include <q3dict.h>
00027 //Added by qt3to4:
00028 #include <QMouseEvent>
00029 #include <QPixmap>
00030 #include <QVBoxLayout>
00031 #include <QResizeEvent>
00032 #include <QEvent>
00033 #include <QPaintEvent>
00034 #include <QBoxLayout>
00035 #include <Q3PtrList>
00036 #include <kdecoration.h>
00037 #include <kdecorationfactory.h>
00038 
00039 class QSpacerItem;
00040 class QVBoxLayout;
00041 class QBoxLayout;
00042 
00043 namespace RiscOS
00044 {
00045 
00046 class LowerButton;
00047 class CloseButton;
00048 class IconifyButton;
00049 class MaximiseButton;
00050 class StickyButton;
00051 class HelpButton;
00052 class Button;
00053 
00054 class Manager : public KDecoration
00055 {
00056    Q_OBJECT
00057 
00058    public:
00059 
00060       Manager(KDecorationBridge*, KDecorationFactory*);
00061       ~Manager();
00062       void init();
00063       bool eventFilter(QObject*, QEvent*);
00064       void reset(unsigned long changed);
00065       void borders(int&, int&, int&, int&) const;
00066       void resize(const QSize&);
00067       QSize minimumSize() const;
00068       void activeChange();
00069       void captionChange();
00070       void iconChange();
00071       void maximizeChange();
00072       void desktopChange();
00073       void shadeChange();
00074 
00075    signals:
00076 
00077       void maximizeChanged(bool);
00078       void stickyChanged(bool);
00079       void activeChanged(bool);
00080 
00081    public slots:
00082 
00083       void slotAbove();
00084       void slotLower();
00085       void slotMaximizeClicked(Qt::MouseButton);
00086       void slotToggleSticky();
00087 
00088    protected:
00089 
00090       KDecoration::Position mousePosition(const QPoint &) const;
00091       void paletteChange(const QPalette &);
00092       void activeChange(bool);
00093       void stickyChange(bool);
00094       void paintEvent(QPaintEvent *);
00095       void resizeEvent(QResizeEvent *);
00096       void mouseDoubleClickEvent(QMouseEvent *);
00097       bool animateMinimize(bool);
00098       void updateButtonVisibility();
00099       void updateTitleBuffer();
00100 
00101       void createTitle();
00102       void resetLayout();
00103 
00104    private:
00105 
00106       QVBoxLayout       *topLayout_;
00107       QBoxLayout        *titleLayout_;
00108       QSpacerItem       *titleSpacer_;
00109 
00110       QPixmap           titleBuf_;
00111       Q3PtrList<Button>  leftButtonList_;
00112       Q3PtrList<Button>  rightButtonList_;
00113 };
00114 
00115 class Factory : public QObject, public KDecorationFactory
00116 {
00117    Q_OBJECT
00118 
00119    public:
00120       Factory();
00121       ~Factory();
00122       virtual bool reset(unsigned long changed);
00123       virtual KDecoration* createDecoration(KDecorationBridge*);
00124       virtual bool supports( Ability ability );
00125 };
00126 
00127 } // End namespace
00128 
00129 #endif
00130 
00131 // vim:ts=2:sw=2:tw=78