summaryrefslogtreecommitdiffstats
path: root/karbon/core/vcursor.h
blob: ccb4a36f65a326ed639ff3af286e13100987cfce (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
/* This file is part of the KDE project
   Copyright (C) 2006 The Karbon Developers

   This library is free software; you can redistribute it and/or
   modify it under the terms of the GNU Library General Public
   License as published by the Free Software Foundation; either
   version 2 of the License, or (at your option) any later version.

   This library is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   Library General Public License for more details.

   You should have received a copy of the GNU Library General Public License
   along with this library; see the file COPYING.LIB.  If not, write to
   the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
 * Boston, MA 02110-1301, USA.
*/

#ifndef __VCURSOR_H__
#define __VCURSOR_H__

#include <tqcursor.h>
#include <koffice_export.h>

/**
* A helper class for easily creating cursors from XPMs.
*
* One can create a predefined unthemed cursor or create a cursor from two given XMPs, 
* the cursor bitmap and the cursor mask.
*/
class KARBONBASE_EXPORT VCursor
{
public:
	/** Predefined cursor types */
	enum CursorType
	{
		CrossHair = 0, /**< unthemed crosshair cursor */
		ZoomPlus  = 1, /**< zoom in cursor */
		ZoomMinus = 2, /**< zoom out cursor */
		NeedleArrow = 3  /**< needle arrow */
	};

	/**
	 * Creates a predefined cursor of the specified type.
	 *
	 * @param type the requested cursor id
	 * @return the predefined cursor
	 */
	static TQCursor createCursor( CursorType type );
	
	/**
	 * Creates a cursor from two specified XPM images.
	 * This is only a wrapper function for a TQCursor ctor.
	 */
	static TQCursor createCursor( const char * bitmap[], const char * mask[], int hotX = -1, int hotY = -1 );

	/** crosshair cursor */
	static TQCursor crossHair();
	
	/** needle arraow cursor */
	static TQCursor needleArrow();

	/** needle arrow with four way arrow */
	static TQCursor needleMoveArrow();

	static TQCursor horzMove();

private:
	// prevent instantiation
	VCursor() {};
};

#endif