LibreOffice Module vcl (master) 1
cursor.hxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 *
9 * This file incorporates work covered by the following license notice:
10 *
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18 */
19
20#ifndef INCLUDED_VCL_CURSOR_HXX
21#define INCLUDED_VCL_CURSOR_HXX
22
23#include <tools/gen.hxx>
24#include <tools/link.hxx>
25#include <vcl/dllapi.h>
26#include <vcl/vclptr.hxx>
27#include <rtl/ustring.hxx>
28#include <memory>
29
30class Timer;
31struct ImplCursorData;
32class OutputDevice;
33namespace vcl { class Window; }
34
35// Cursor styles
36#define CURSOR_SHADOW (sal_uInt16(0x0001))
37
39{
40 NONE, LTR, RTL
41};
42
43namespace vcl
44{
45
47{
48private:
49 std::unique_ptr<ImplCursorData> mpData;
50 VclPtr<vcl::Window> mpWindow; // only for shadow cursor
54 sal_uInt16 mnStyle;
57
58public:
59 SAL_DLLPRIVATE void ImplDraw();
60 DECL_DLLPRIVATE_LINK( ImplTimerHdl, Timer*, void );
61 SAL_DLLPRIVATE void ImplShow();
62 SAL_DLLPRIVATE void ImplHide();
63 SAL_DLLPRIVATE void ImplResume( bool bRestore = false );
64 SAL_DLLPRIVATE bool ImplSuspend();
65 SAL_DLLPRIVATE void ImplNew();
66
67public:
68 Cursor();
69 Cursor( const Cursor& rCursor );
70 ~Cursor();
71
72 void SetStyle( sal_uInt16 nStyle );
73 sal_uInt16 GetStyle() const { return mnStyle; }
74
75 void Show();
76 void Hide();
77 bool IsVisible() const { return mbVisible; }
78
79 void SetWindow( vcl::Window* pWindow );
80
81 void SetPos( const Point& rNewPos );
82 const Point& GetPos() const { return maPos; }
83
84 void SetSize( const Size& rNewSize );
85 const Size& GetSize() const { return maSize; }
86 void SetWidth( tools::Long nNewWidth );
87 tools::Long GetWidth() const { return maSize.Width(); }
88 tools::Long GetHeight() const { return maSize.Height(); }
89
90 void SetOrientation( Degree10 nOrientation = 0_deg10 );
91
92 void SetDirection( CursorDirection nDirection = CursorDirection::NONE );
93
94 Cursor& operator=( const Cursor& rCursor );
95 bool operator==( const Cursor& rCursor ) const;
96 bool operator!=( const Cursor& rCursor ) const
97 { return !(Cursor::operator==( rCursor )); }
98
99 void DrawToDevice(OutputDevice& rRenderContext);
100
101private:
102 void LOKNotify( vcl::Window* pWindow, const OUString& rAction );
103 bool ImplPrepForDraw(const OutputDevice* pDevice, ImplCursorData& rData);
104 void ImplRestore();
105 void ImplDoShow( bool bDrawDirect, bool bRestore );
106 bool ImplDoHide( bool bStop );
107};
108
109} // namespace vcl
110
111#endif // INCLUDED_VCL_CURSOR_HXX
112
113/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
geometry::RealSize2D maSize
Some things multiple-inherit from VclAbstractDialog and OutputDevice, so we need to use virtual inher...
Definition: outdev.hxx:170
Definition: timer.hxx:27
DECL_DLLPRIVATE_LINK(ImplTimerHdl, Timer *, void)
Degree10 mnOrientation
Definition: cursor.hxx:53
bool operator!=(const Cursor &rCursor) const
Definition: cursor.hxx:96
const Point & GetPos() const
Definition: cursor.hxx:82
tools::Long GetHeight() const
Definition: cursor.hxx:88
sal_uInt16 GetStyle() const
Definition: cursor.hxx:73
bool IsVisible() const
Definition: cursor.hxx:77
tools::Long GetWidth() const
Definition: cursor.hxx:87
sal_uInt16 mnStyle
Definition: cursor.hxx:54
Size maSize
Definition: cursor.hxx:51
VclPtr< vcl::Window > mpWindow
Definition: cursor.hxx:50
std::unique_ptr< ImplCursorData > mpData
Definition: cursor.hxx:49
bool mbVisible
Definition: cursor.hxx:55
CursorDirection mnDirection
Definition: cursor.hxx:56
bool operator==(const Cursor &rCursor) const
Definition: cursor.cxx:474
Point maPos
Definition: cursor.hxx:52
const Size & GetSize() const
Definition: cursor.hxx:85
CursorDirection
Definition: cursor.hxx:39
#define VCL_DLLPUBLIC
Definition: dllapi.h:29
NONE
long Long
bool mbVisible
bool operator==(const ItalicMatrix &a, const ItalicMatrix &b)
Definition: vclenum.hxx:175