lib Library API Documentation

kotooldockmovemanager.h

00001 /*
00002  * This file is part of the KDE project
00003  * Copyright (C) 2000-2001 theKompany.com & Dave Marotti
00004  *
00005  * This program is free software; you can redistribute it and/or
00006  * modify it under the terms of the GNU General Public License
00007  * as published by the Free Software Foundation; either version 2
00008  * of the License, or (at your option) any later version.
00009  *
00010  * This program is distributed in the hope that it will be useful,
00011  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00012  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00013  * GNU General Public License for more details.
00014  *
00015  * You should have received a copy of the GNU General Public License
00016  * along with this program; if not, write to the Free Software
00017  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
00018  */
00019 #ifndef KO_TOOLDOCK_MOVEMANAGER_H
00020 #define KO_TOOLDOCK_MOVEMANAGER_H
00021 
00022 #include <qobject.h>
00023 
00024 #if defined Q_WS_X11 && !defined K_WS_QTONLY
00025 #include <X11/X.h>
00026 #include <X11/Xlib.h>
00027 #include <X11/Xutil.h>
00028 #endif
00029 #include <koffice_export.h>
00030 class QTimer;
00031 class QWidget;
00032 
00033 
00038 class KOFFICEUI_EXPORT KoToolDockMoveManager: public QObject
00039 {
00040     Q_OBJECT
00041 
00042 public:
00043 
00044     KoToolDockMoveManager();
00045     ~KoToolDockMoveManager();
00046 
00047     bool isWorking() const { return working; }
00048 
00049     void doXResize( QWidget*, bool mirror );
00050     void doYResize( QWidget*, bool mirror );
00051     void doXYResize( QWidget*, bool _mirrorX, bool _mirrorY );
00052 
00053     void doMove( QWidget* );
00054     void movePause( bool horizontal = true, bool vertical = true );
00055     void moveContinue();
00056 
00057     void setGeometry( const QRect& r );
00058     void setGeometry(int x, int y, int w, int h);
00059 
00060     QRect geometry();
00061 
00062     void resize( const QSize& s ) { setGeometry(xp, yp, s.width(), s.height()); }
00063     void resize(int rw, int rh) { setGeometry(xp, yp, rw, rh); }
00064     void move( int rx, int ry) { setGeometry(rx, ry, w, h); }
00065     void move( const QPoint& p ) {setGeometry(p.x(), p.y(), w, h); }
00066 
00067     int x()const { return xp; }
00068     int y() const { return yp; }
00069     int width()const { return w; }
00070     int height()const { return h; }
00071 
00072     bool isXMirror() const { return mirrorX; }
00073     bool isYMirror() const{ return mirrorY; }
00074 
00075     void stop ();
00076     QWidget* getWidget()const{ return widget; }
00077 
00078 signals:
00079 
00080     void positionChanged();
00081     void sizeChanged();
00082     void fixPosition(int& x, int& y, int& w, int& h);
00083     void fixSize(int& x, int& y, int& w, int& h);
00084 
00085 protected:
00086 
00087     void doResize( QWidget* );
00088     void setWidget( QWidget* );
00089     void drawRectangle (int x, int y, int w, int h);
00090     void paintProcess( bool onlyDeelete = true, int _x = 0, int _y = 0, int _w = 0, int _h = 0 );
00091     bool check(int& x, int& y, int& w, int& h, bool change = false);
00092 
00093 private slots:
00094 
00095     void doMoveInternal();
00096     void doResizeInternal();
00097 
00098 private:
00099 
00100     bool pauseMoveX;
00101     bool pauseMoveY;
00102     int xp, yp, w, h;
00103     int ox, oy, ow, oh;
00104     int orig_x, orig_y, orig_w, orig_h;
00105     bool noLast;
00106     bool working;
00107 
00108     QSize maxSize;
00109     QSize minSize;
00110     QWidget* widget;
00111     QTimer* timer;
00112 
00113     int rx, ry, sx, sy;
00114     int offX, offY;
00115 
00116     /* X-stuff */
00117 #if defined Q_WS_X11 && !defined K_WS_QTONLY
00118     Window root;
00119     GC rootgc;
00120     int scr;
00121     XEvent ev;
00122 #endif
00123 
00124     bool mirrorX;
00125     bool mirrorY;
00126     bool xOnly;
00127     bool yOnly;
00128 
00129     bool isDoMove;
00130     QRect rr;
00131     QPoint p;
00132 };
00133 
00134 #endif // KO_TOOLDOCK_MOVEMANAGER_H
00135 
KDE Logo
This file is part of the documentation for lib Library Version 1.4.2.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Mon Feb 13 09:40:13 2006 by doxygen 1.4.2 written by Dimitri van Heesch, © 1997-2003