summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2016-05-11 10:37:46 +0200
committerNoel Grandin <noelgrandin@gmail.com>2016-05-12 06:57:04 +0000
commit0f4ac20e0456b32995f7a3aff4e46b59e64704a6 (patch)
treeac4a2e26907013b29ea1f87cc6757290c2d6de34 /include
parente1efe3359c5105f1347ab7527aeff109e62b7e3f (diff)
Convert RulerType to scoped enum
Change-Id: I2233b70e5413bfa3156011e1b3306d539003795b Reviewed-on: https://gerrit.libreoffice.org/24879 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Diffstat (limited to 'include')
-rw-r--r--include/svtools/ruler.hxx64
1 files changed, 32 insertions, 32 deletions
diff --git a/include/svtools/ruler.hxx b/include/svtools/ruler.hxx
index d18ae426eeb5..60436bbad4a6 100644
--- a/include/svtools/ruler.hxx
+++ b/include/svtools/ruler.hxx
@@ -244,11 +244,11 @@ it has been dragged. There are the following query methods:
- GetDragType()
Returns what has been dragged.
- RULER_TYPE_MARGIN1
- RULER_TYPE_MARGIN2
- RULER_TYPE_BORDER
- RULER_TYPE_INDENT
- RULER_TYPE_TAB
+ RulerType::Margin1
+ RulerType::Margin2
+ RulerType::Border
+ RulerType::Indent
+ RulerType::Tab
- GetDragPos()
Returns the pixel position to which the user has moved the mouse
@@ -298,13 +298,13 @@ it has been dragged. There are the following query methods:
- GetClickType()
Returns what is applied by double click:
- RULER_TYPE_DONTKNOW (no element in the ruler area)
- RULER_TYPE_OUTSIDE (outside of the ruler area)
- RULER_TYPE_MARGIN1 (only Margin1 border)
- RULER_TYPE_MARGIN2 (only Margin2 border)
- RULER_TYPE_BORDER (Border: GetClickAryPos())
- RULER_TYPE_INDENT (indent: GetClickAryPos())
- RULER_TYPE_TAB (Tab: GetClickAryPos())
+ RulerType::DontKnow (no element in the ruler area)
+ RulerType::Outside (outside of the ruler area)
+ RulerType::Margin1 (only Margin1 border)
+ RulerType::Margin2 (only Margin2 border)
+ RulerType::Border (Border: GetClickAryPos())
+ RulerType::Indent (indent: GetClickAryPos())
+ RulerType::Tab (Tab: GetClickAryPos())
- GetClickAryPos()
Returns the index in the array if a Border, an Indent or a Tab
@@ -318,13 +318,13 @@ it has been dragged. There are the following query methods:
sal_uInt16 are passed, in order to determine the array position
of a Tab, an Indent, or a Border. The following values are
returned as type:
- RULER_TYPE_DONTKNOW (no element in the ruler area)
- RULER_TYPE_OUTSIDE (outside of the ruler area)
- RULER_TYPE_MARGIN1 (only Margin1 border)
- RULER_TYPE_MARGIN2 (only Margin2 border)
- RULER_TYPE_BORDER (Border: GetClickAryPos())
- RULER_TYPE_INDENT (indent: GetClickAryPos())
- RULER_TYPE_TAB (Tab: GetClickAryPos())
+ RulerType::DontKnow (no element in the ruler area)
+ RulerType::Outside (outside of the ruler area)
+ RulerType::Margin1 (only Margin1 border)
+ RulerType::Margin2 (only Margin2 border)
+ RulerType::Border (Border: GetClickAryPos())
+ RulerType::Indent (indent: GetClickAryPos())
+ RulerType::Tab (Tab: GetClickAryPos())
If the drag process should be canceled, this can be done using CancelDrag().
There are the following methods for controlling the Drag:
@@ -342,7 +342,7 @@ methods:
- StartDocDrag()
This method is passed the MouseEvent of the document window
- and what should be dragged. If RULER_TYPE_DONTKNOW is passed
+ and what should be dragged. If RulerType::DontKnow is passed
as DragType, the ruler decides what should be dragged. In case
of the other types, the Drag is only started if a respective
element was found at the given position.
@@ -435,22 +435,22 @@ Tips for the use of the ruler:
multiple of one value because the screen resolution is very imprecise.
- DoubleClicks should be handled in the following way (GetClickType()):
- - RULER_TYPE_DONTKNOW
- RULER_TYPE_MARGIN1
- RULER_TYPE_MARGIN2
+ - RulerType::DontKnow
+ RulerType::Margin1
+ RulerType::Margin2
If the conditions GetClickPos() <= GetMargin1() or
GetClickPos() >= GetMargin2() are met or the type is equal to
- RULER_TYPE_MARGIN1 or RULER_TYPE_MARGIN2, a side dialog should
+ RulerType::Margin1 or RulerType::Margin2, a side dialog should
be displayed in which the focus is at the respective border.
- - RULER_TYPE_BORDER
+ - RulerType::Border
A column or table dialog should be shown in which the focus
is at the respective column that can be queried using
GetClickAryPos().
- - RULER_TYPE_INDENT
+ - RulerType::Indent
The dialog, in which the indents can be configured, should be
shown. In this, the focus should be on the indent which can
be queried using GetClickAryPos().
- - RULER_TYPE_TAB
+ - RulerType::Tab
A TabDialog should be displayed in which the Tab, that can be
queried using GetClickAryPos(), should be selected.
@@ -462,9 +462,9 @@ Tips for the use of the ruler:
#define WB_STDRULER WB_HORZ
-enum RulerType { RULER_TYPE_DONTKNOW, RULER_TYPE_OUTSIDE,
- RULER_TYPE_MARGIN1, RULER_TYPE_MARGIN2,
- RULER_TYPE_BORDER, RULER_TYPE_INDENT, RULER_TYPE_TAB };
+enum class RulerType { DontKnow, Outside,
+ Margin1, Margin2,
+ Border, Indent, Tab };
enum class RulerExtra { DontKnow, NullOffset, Tab };
@@ -561,7 +561,7 @@ struct RulerSelection
RulerSelection()
: nPos(0)
- , eType(RULER_TYPE_DONTKNOW)
+ , eType(RulerType::DontKnow)
, nAryPos(0)
, mnDragSize(RulerDragSize::Move)
, bSize(false)
@@ -750,7 +750,7 @@ public:
void SetExtraType( RulerExtra eNewExtraType, sal_uInt16 nStyle = 0 );
bool StartDocDrag( const MouseEvent& rMEvt,
- RulerType eDragType = RULER_TYPE_DONTKNOW );
+ RulerType eDragType = RulerType::DontKnow );
RulerType GetDragType() const { return meDragType; }
long GetDragPos() const { return mnDragPos; }
sal_uInt16 GetDragAryPos() const { return mnDragAryPos; }