KoRuler Class Reference
KoRuler is the horizontal or vertical ruler, to be used around the drawing area of most KOffice programs. More...
#include <koRuler.h>
Inheritance diagram for KoRuler:

Signals | |
void | newPageLayout (KoPageLayout) |
void | newLeftIndent (double) |
void | newFirstIndent (double) |
void | newRightIndent (double) |
void | openPageLayoutDia () |
void | doubleClicked () |
void | doubleClicked (double ptPos) |
void | tabListChanged (const KoTabulatorList &) |
void | unitChanged (QString) |
void | addHelpline (const QPoint &, bool) |
void | moveHelpLines (const QPoint &, bool) |
Public Member Functions | |
KoRuler (QWidget *_parent, QWidget *_canvas, Orientation _orientation, const KoPageLayout &_layout, int _flags, KoUnit::Unit _unit, KoTabChooser *_tabChooser=0L) | |
void | setUnit (const QString &unit) |
void | setUnit (KoUnit::Unit unit) |
void | setZoom (const double &zoom=1.0) |
const double & | zoom () const |
void | setPageLayout (KoPageLayout _layout) |
void | showMousePos (bool _showMPos) |
void | setMousePos (int mx, int my) |
void | setOffset (int _diffx, int _diffy) |
void | setLeftIndent (double _left) |
void | setFirstIndent (double _first) |
void | setRightIndent (double _right) |
void | setDirection (bool rtl) |
void | setTabList (const KoTabulatorList &tabList) |
void | setFrameStartEnd (int _frameStart, int _frameEnd) |
void | setReadWrite (bool _readWrite) |
void | changeFlags (int _flags) |
void | setGridSize (double newGridSize) |
int | flags () const |
bool | doubleClickedIndent () const |
void | setPageLayoutMenuItemEnabled (bool b) |
Static Public Attributes | |
const int | F_TABS = 1 |
const int | F_INDENTS = 2 |
const int | F_HELPLINES = 4 |
const int | F_NORESIZE = 8 |
Protected Types | |
enum | Action { A_NONE, A_BR_LEFT, A_BR_RIGHT, A_BR_TOP, A_BR_BOTTOM, A_LEFT_INDENT, A_FIRST_INDENT, A_TAB, A_RIGHT_INDENT, A_HELPLINES } |
Protected Slots | |
void | slotMenuActivated (int i) |
void | pageLayoutDia () |
void | rbRemoveTab () |
Protected Member Functions | |
void | drawContents (QPainter *_painter) |
void | drawHorizontal (QPainter *_painter) |
void | drawVertical (QPainter *_painter) |
void | drawTabs (QPainter &_painter) |
void | mousePressEvent (QMouseEvent *e) |
void | mouseReleaseEvent (QMouseEvent *e) |
void | mouseMoveEvent (QMouseEvent *e) |
void | mouseDoubleClickEvent (QMouseEvent *) |
void | resizeEvent (QResizeEvent *e) |
void | handleDoubleClick () |
double | makeIntern (double _v) |
double | zoomIt (const double &value) const |
int | zoomIt (const int &value) const |
unsigned int | zoomIt (const unsigned int &value) const |
double | unZoomIt (const double &value) const |
int | unZoomIt (const int &value) const |
unsigned int | unZoomIt (const unsigned int &value) const |
void | setupMenu () |
void | uncheckMenu () |
void | searchTab (int mx) |
void | drawLine (int oldX, int newX) |
Detailed Description
KoRuler is the horizontal or vertical ruler, to be used around the drawing area of most KOffice programs.It shows the graduated ruler with numbering, in any of the base units (like mm/pt/inch), and supports zooming, tabulators, paragraph indents, showing the mouse position, etc.
It also offers a popupmenu upon right-clicking, for changing the unit, the page layout, or removing a tab.
Definition at line 97 of file koRuler.h.
Constructor & Destructor Documentation
|
Create a ruler TODO document params.
Definition at line 79 of file koRuler.cc. References doubleClicked(), KoRuler(), openPageLayoutDia(), KoPageLayout::ptBottom, KoPageLayout::ptHeight, KoPageLayout::ptLeft, KoPageLayout::ptRight, KoPageLayout::ptTop, and KoPageLayout::ptWidth. Referenced by KoRuler(). |
Member Function Documentation
|
Set the unit to be used. The unit is specified using text as defined in KoUnit, for example "mm", "pt" or "inch". You should use the KoUnit::Unit variant instead. Definition at line 983 of file koRuler.cc. References setUnit(). Referenced by setUnit(). |
|
Set the unit to be used.
Definition at line 988 of file koRuler.cc. References setUnit(). |
|
Set the zoom of the ruler (default value of 1.0 is 100%).
Definition at line 996 of file koRuler.cc. References setZoom(). Referenced by setZoom(). |
|
|
|
Set the page layout, see KoPageLayout. This defines the size of the page and the margins, from which the size of the ruler is deducted. Definition at line 141 of file koRuler.h. References setPageLayout(). Referenced by setPageLayout(). |
|
Call showMousePos(true) if the ruler should indicate the position of the mouse. This is usually only the case for drawing applications, so it is not enabled by default. Definition at line 1049 of file koRuler.cc. References showMousePos(). Referenced by showMousePos(). |
|
Set the position of the mouse, to update the indication in the ruler. This is only effective if showMousePos(true) was called previously. The position to give is not zoomed, it's in real pixel coordinates! Definition at line 152 of file koRuler.cc. References setMousePos(). Referenced by setMousePos(). |
|
Set a global offset to the X and Y coordinates. Usually the main drawing area is a QScrollView, and this is called with contentsX() and contentsY(), each time those values change. Definition at line 1058 of file koRuler.cc. References setOffset(). Referenced by setOffset(). |
|
Set the [paragraph] left indent to the specified position (in the current unit).
Definition at line 167 of file koRuler.h. References setLeftIndent(). Referenced by setLeftIndent(). |
|
Set the [paragraph] first-line left indent to the specified position (in the current unit) This indent is cumulated with the left or right margin, depending on the [paragraph] direction.
Definition at line 174 of file koRuler.h. References setFirstIndent(). Referenced by setFirstIndent(). |
|
Set the [paragraph] right indent to the specified position (in the current unit).
Definition at line 1079 of file koRuler.cc. References setRightIndent(). Referenced by setRightIndent(). |
|
Set the [paragraph] direction. By default (rtl=false), the left indent is on the left, and the right indent is on the right ;) If rtl=true, it's the opposite. Definition at line 1085 of file koRuler.cc. References setDirection(). Referenced by setDirection(). |
|
Set the list of tabulators to show in the ruler.
Definition at line 941 of file koRuler.cc. References setTabList(). Referenced by setTabList(). |
|
Set the start and the end of the current 'frame', i.e.
the part of the page in which we are currently working. See KWord frames for an example where this is used. The tab positions and paragraph indents then become relative to the beginning of the frame, and the ruler goes from frameStart to frameEnd instead of using the page margins. Definition at line 1066 of file koRuler.cc. References setFrameStartEnd(). Referenced by setFrameStartEnd(). |
|
KoRuler is in "read write" mode by default. Use setReadWrite(false) to use it in read-only mode. Definition at line 1018 of file koRuler.cc. References setReadWrite(). Referenced by setReadWrite(). |
|
Change the flag (i.e. activate or deactivate certain features of KoRuler) Definition at line 1091 of file koRuler.cc. References changeFlags(). Referenced by changeFlags(). |
|
Set the size of the grid used for tabs positioning, size in pt. default value is 0. 0 means no grid. Definition at line 219 of file koRuler.h. References setGridSize(). Referenced by setGridSize(). |
|
Definition at line 1096 of file koRuler.cc. |
|
Definition at line 1101 of file koRuler.cc. |
|
Enable or disable the "Page Layout" menu item.
Definition at line 146 of file koRuler.cc. References setPageLayoutMenuItemEnabled(). Referenced by setPageLayoutMenuItemEnabled(). |
|
Old signal, kept for compatibility. Use doubleClicked instead. Referenced by KoRuler(). |
|
This signal is emitted when double-clicking the ruler (or an indent).
Referenced by KoRuler(). |
|
This signal is emitted when double-clicking a tab.
|
The documentation for this class was generated from the following files: