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
;
30 class KRulerSystemTray
;
32 class KLineal
: public QWidget
{
36 enum { North
= 0, West
, South
, East
};
38 KLineal( QWidget
*parent
= 0 );
41 void move( int x
, int y
);
42 void move( const QPoint
&p
);
48 void keyPressEvent( QKeyEvent
*e
);
49 void mousePressEvent( QMouseEvent
*e
);
50 void mouseReleaseEvent( QMouseEvent
*e
);
51 void mouseMoveEvent( QMouseEvent
*e
);
52 void wheelEvent( QWheelEvent
*e
);
53 void paintEvent( QPaintEvent
*e
);
54 void enterEvent( QEvent
*e
);
55 void leaveEvent( QEvent
*e
);
57 void createSystemTray();
60 KAction
* addAction( KMenu
*menu
, KIcon icon
, const QString
& text
,
61 const QObject
* receiver
, const char* member
,
62 const QKeySequence
&shortcut
, const QString
& name
);
63 void drawScale( QPainter
&painter
);
64 void drawBackground( QPainter
&painter
);
65 void reLength( int percentOfScreen
);
66 void reLengthAbsolute( int length
);
67 void updateScaleDirectionMenuItem();
72 QAutoSizeLabel
*mLabel
;
73 QAutoSizeLabel
*mColorLabel
;
79 QAction
*mFullScreenAction
;
80 QAction
*mScaleDirectionAction
;
81 QAction
*mCenterOriginAction
;
82 QAction
*mOffsetAction
;
84 QCursor mCurrentCursor
;
95 KActionCollection
*mActionCollection
;
97 QToolButton
*mBtnRotateLeft
, *mBtnRotateRight
;
98 QToolButton
*mCloseButton
;
99 KRulerSystemTray
*mTrayIcon
;
102 void setOrientation( int );
113 void adjustButtons();
114 void setShortLength();
115 void setMediumLength();
116 void setTallLength();
117 void setFullLength();
118 void switchDirection();
122 void slotOpacity( int value
);
123 void slotKeyBindings();
124 void slotPreferences();
125 void switchRelativeScale( bool checked
);