1 /***************************************************************************
2 klineal.h - description
4 begin : Fri Oct 13 2000
5 Copyright : (C) 2000 - 2008 by Till Krech <till@snafu.de>
6 (C) 2009 by Mathias Soeken <msoeken@tzi.de>
7 ***************************************************************************/
9 /***************************************************************************
11 * This program is free software; you can redistribute it and/or modify *
12 * it under the terms of the GNU General Public License as published by *
13 * the Free Software Foundation; either version 2 of the License, or *
14 * (at your option) any later version. *
16 ***************************************************************************/
27 class KActionCollection
;
31 class KLineal
: public QWidget
{
35 enum { North
= 0, West
, South
, East
};
37 KLineal( QWidget
*parent
= 0 );
40 void move( int x
, int y
);
41 void move( const QPoint
&p
);
47 void keyPressEvent( QKeyEvent
*e
);
48 void mousePressEvent( QMouseEvent
*e
);
49 void mouseReleaseEvent( QMouseEvent
*e
);
50 void mouseMoveEvent( QMouseEvent
*e
);
51 void wheelEvent( QWheelEvent
*e
);
52 void paintEvent( QPaintEvent
*e
);
53 void enterEvent( QEvent
*e
);
54 void leaveEvent( QEvent
*e
);
57 KAction
* addAction( KMenu
*menu
, KIcon icon
, const QString
& text
,
58 const QObject
* receiver
, const char* member
,
59 const QKeySequence
&shortcut
, const QString
& name
);
60 void drawScale( QPainter
&painter
);
61 void drawBackground( QPainter
&painter
);
62 void reLength( int percentOfScreen
);
63 void reLengthAbsolute( int length
);
64 void updateScaleDirectionMenuItem();
69 QAutoSizeLabel
*mLabel
;
70 QAutoSizeLabel
*mColorLabel
;
76 QAction
*mFullScreenAction
;
77 QAction
*mScaleDirectionAction
;
78 QAction
*mCenterOriginAction
;
79 QAction
*mOffsetAction
;
81 QCursor mCurrentCursor
;
92 KActionCollection
*mActionCollection
;
94 QToolButton
*mBtnRotateLeft
, *mBtnRotateRight
;
95 QToolButton
*mCloseButton
;
98 void setOrientation( int );
109 void adjustButtons();
110 void setShortLength();
111 void setMediumLength();
112 void setTallLength();
113 void setFullLength();
114 void switchDirection();
118 void slotOpacity( int value
);
119 void slotKeyBindings();
120 void slotPreferences();
121 void switchRelativeScale( bool checked
);