1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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 INCLUDED_VCL_CURSOR_HXX
21 #define INCLUDED_VCL_CURSOR_HXX
23 #include <tools/gen.hxx>
24 #include <tools/link.hxx>
25 #include <vcl/dllapi.h>
26 #include <vcl/vclptr.hxx>
29 struct ImplCursorData
;
30 namespace vcl
{ class Window
; }
33 #define CURSOR_SHADOW ((sal_uInt16)0x0001)
35 enum class CursorDirection
43 class VCL_DLLPUBLIC Cursor
46 ImplCursorData
* mpData
;
47 VclPtr
<vcl::Window
> mpWindow
; // only for shadow cursor
54 CursorDirection mnDirection
;
57 SAL_DLLPRIVATE
void ImplDraw();
58 DECL_DLLPRIVATE_LINK( ImplTimerHdl
, Timer
*, void );
59 SAL_DLLPRIVATE
void ImplShow();
60 SAL_DLLPRIVATE
void ImplHide();
61 SAL_DLLPRIVATE
void ImplResume( bool bRestore
= false );
62 SAL_DLLPRIVATE
bool ImplSuspend();
63 SAL_DLLPRIVATE
void ImplNew();
67 Cursor( const Cursor
& rCursor
);
70 void SetStyle( sal_uInt16 nStyle
);
71 sal_uInt16
GetStyle() const { return mnStyle
; }
75 bool IsVisible() const { return mbVisible
; }
77 void SetWindow( vcl::Window
* pWindow
);
79 void SetPos( const Point
& rNewPos
);
80 const Point
& GetPos() const { return maPos
; }
82 void SetSize( const Size
& rNewSize
);
83 const Size
& GetSize() const { return maSize
; }
84 void SetWidth( long nNewWidth
);
85 long GetWidth() const { return maSize
.Width(); }
86 long GetHeight() const { return maSize
.Height(); }
88 void SetOrientation( short nOrientation
= 0 );
90 void SetDirection( CursorDirection nDirection
= CursorDirection::NONE
);
92 Cursor
& operator=( const Cursor
& rCursor
);
93 bool operator==( const Cursor
& rCursor
) const;
94 bool operator!=( const Cursor
& rCursor
) const
95 { return !(Cursor::operator==( rCursor
)); }
99 void ImplDoShow( bool bDrawDirect
, bool bRestore
);
100 bool ImplDoHide( bool bStop
);
105 #endif // INCLUDED_VCL_CURSOR_HXX
107 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */