fdo#74697 Add Bluez 5 support for impress remote.
[LibreOffice.git] / include / vcl / cursor.hxx
blobd0433858c3b39141a4258db67e6c5568cb1d7b64
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
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/.
9 * This file incorporates work covered by the following license notice:
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 .
20 #ifndef _SV_CURSOR_HXX
21 #define _SV_CURSOR_HXX
23 #include <tools/gen.hxx>
24 #include <tools/link.hxx>
25 #include <tools/solar.h>
26 #include <vcl/dllapi.h>
28 class AutoTimer;
29 struct ImplCursorData;
30 class Window;
32 // -----------------
33 // - Cursor-Styles -
34 // -----------------
36 #define CURSOR_SHADOW ((sal_uInt16)0x0001)
37 #define CURSOR_DIRECTION_NONE ((unsigned char)0x00)
38 #define CURSOR_DIRECTION_LTR ((unsigned char)0x01)
39 #define CURSOR_DIRECTION_RTL ((unsigned char)0x02)
41 // ----------
42 // - Cursor -
43 // ----------
45 class VCL_DLLPUBLIC Cursor
47 private:
48 ImplCursorData* mpData; // Interne Daten
49 Window* mpWindow; // Window (only for shadow cursor)
50 long mnSlant; // Schraegstellung
51 long mnOffsetY; // Offset fuer Rotation
52 Size maSize; // Groesse
53 Point maPos; // Position
54 short mnOrientation; // Rotation
55 sal_uInt16 mnStyle; // Style
56 bool mbVisible; // Ist Cursor sichtbar
57 unsigned char mnDirection; // indicates direction
59 public:
60 SAL_DLLPRIVATE void ImplDraw();
61 SAL_DLLPRIVATE void ImplRestore();
62 DECL_DLLPRIVATE_LINK( ImplTimerHdl, void* );
63 SAL_DLLPRIVATE void ImplShow( bool bDrawDirect = true );
64 SAL_DLLPRIVATE void ImplHide( bool bStopTimer );
65 SAL_DLLPRIVATE void ImplResume( bool bRestore = false );
66 SAL_DLLPRIVATE bool ImplSuspend();
67 SAL_DLLPRIVATE void ImplNew();
69 public:
70 Cursor();
71 Cursor( const Cursor& rCursor );
72 ~Cursor();
74 void SetStyle( sal_uInt16 nStyle );
75 sal_uInt16 GetStyle() const { return mnStyle; }
77 void Show();
78 void Hide();
79 bool IsVisible() const { return mbVisible; }
81 void SetWindow( Window* pWindow );
82 Window* GetWindow() const { return mpWindow; }
84 void SetPos( const Point& rNewPos );
85 const Point& GetPos() const { return maPos; }
86 long GetOffsetY() const { return mnOffsetY; }
88 void SetSize( const Size& rNewSize );
89 const Size& GetSize() const { return maSize; }
90 void SetWidth( long nNewWidth );
91 long GetWidth() const { return maSize.Width(); }
92 long GetHeight() const { return maSize.Height(); }
94 long GetSlant() const { return mnSlant; }
96 void SetOrientation( short nOrientation = 0 );
97 short GetOrientation() const { return mnOrientation; }
99 void SetDirection( unsigned char nDirection = 0 );
100 unsigned char GetDirection() const { return mnDirection; }
102 Cursor& operator=( const Cursor& rCursor );
103 bool operator==( const Cursor& rCursor ) const;
104 bool operator!=( const Cursor& rCursor ) const
105 { return !(Cursor::operator==( rCursor )); }
107 private:
108 void ImplDoShow( bool bDrawDirect, bool bRestore );
109 bool ImplDoHide( bool bStop );
112 #endif // _SV_CURSOR_HXX
114 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */