~oif-team/ubuntu/natty/qt4-x11/xi2.1

« back to all changes in this revision

Viewing changes to tools/designer/src/lib/sdk/abstractformwindowcursor.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Adam Conrad
  • Date: 2005-08-24 04:09:09 UTC
  • Revision ID: james.westby@ubuntu.com-20050824040909-xmxe9jfr4a0w5671
Tags: upstream-4.0.0
ImportĀ upstreamĀ versionĀ 4.0.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/****************************************************************************
 
2
**
 
3
** Copyright (C) 1992-2005 Trolltech AS. All rights reserved.
 
4
**
 
5
** This file is part of the designer application of the Qt Toolkit.
 
6
**
 
7
** This file may be distributed under the terms of the Q Public License
 
8
** as defined by Trolltech AS of Norway and appearing in the file
 
9
** LICENSE.QPL included in the packaging of this file.
 
10
**
 
11
** This file may be distributed and/or modified under the terms of the
 
12
** GNU General Public License version 2 as published by the Free Software
 
13
** Foundation and appearing in the file LICENSE.GPL included in the
 
14
** packaging of this file.
 
15
**
 
16
** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
 
17
**   information about Qt Commercial License Agreements.
 
18
** See http://www.trolltech.com/qpl/ for QPL licensing information.
 
19
** See http://www.trolltech.com/gpl/ for GPL licensing information.
 
20
**
 
21
** Contact info@trolltech.com if any conditions of this licensing are
 
22
** not clear to you.
 
23
**
 
24
** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
 
25
** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
 
26
**
 
27
****************************************************************************/
 
28
 
 
29
#include "abstractformwindowcursor.h"
 
30
 
 
31
/*!
 
32
    \class QDesignerFormWindowCursorInterface
 
33
    \brief The QDesignerFormWindowCursorInterface class provides an interface to the form window's
 
34
    text cursor.
 
35
    \inmodule QtDesigner
 
36
*/
 
37
 
 
38
/*!
 
39
    \enum QDesignerFormWindowCursorInterface::MoveOperation
 
40
 
 
41
    This enum describes the types of text cursor operation that can occur in a form window.
 
42
 
 
43
    \value NoMove The cursor does not move.
 
44
    \value Start  Moves the cursor to the start of the focus chain.
 
45
    \value End    Moves the cursor to the end of the focus chain.
 
46
    \value Next   Moves the cursor to the next widget in the focus chain.
 
47
    \value Prev   Moves the cursor to the previous widget in the focus chain.
 
48
    \value Left   The cursor moves to the left.
 
49
    \value Right  The cursor moves to the right.
 
50
    \value Up     The cursor moves upwards.
 
51
    \value Down   The cursor moves downwards.
 
52
*/
 
53
 
 
54
/*!
 
55
    \enum QDesignerFormWindowCursorInterface::MoveMode
 
56
 
 
57
    This enum describes the different modes that are used when the text cursor moves.
 
58
 
 
59
    \value MoveAnchor The anchor moves with the cursor to its new location.
 
60
    \value KeepAnchor The anchor remains at the cursor's old location.
 
61
*/
 
62
 
 
63
/*!
 
64
    Returns true if the specified \a widget is selected; otherwise returns false.*/
 
65
bool QDesignerFormWindowCursorInterface::isWidgetSelected(QWidget *widget) const
 
66
{
 
67
    for (int index=0; index<selectedWidgetCount(); ++index) {
 
68
        if (selectedWidget(index) == widget)
 
69
            return true;
 
70
    }
 
71
 
 
72
    return false;
 
73
}
 
74
 
 
75
/*!
 
76
    \fn virtual QDesignerFormWindowCursorInterface::~QDesignerFormWindowCursorInterface()
 
77
 
 
78
    Destroys the cursor interface.
 
79
*/
 
80
 
 
81
/*!
 
82
    \fn virtual QDesignerFormWindowInterface *QDesignerFormWindowCursorInterface::formWindow() const = 0
 
83
 
 
84
    Returns the interface to the form window associated with this interface.
 
85
*/
 
86
 
 
87
/*!
 
88
    \fn virtual bool QDesignerFormWindowCursorInterface::movePosition(MoveOperation operation, MoveMode mode) = 0
 
89
 
 
90
    Performs the given \a operation on the cursor using the specified \a mode, and returns true
 
91
    if it completed successfully; otherwise returns false.
 
92
*/
 
93
 
 
94
/*!
 
95
    \fn virtual int QDesignerFormWindowCursorInterface::position() const = 0
 
96
 
 
97
    Returns the cursor position.
 
98
 
 
99
    \sa setPosition()
 
100
*/
 
101
 
 
102
/*!
 
103
    \fn virtual void QDesignerFormWindowCursorInterface::setPosition(int position, MoveMode mode = MoveAnchor) = 0
 
104
 
 
105
    Sets the position of the cursor to the given \a position using the \a mode to specify
 
106
    how it is moved there.
 
107
 
 
108
    \sa position()
 
109
*/
 
110
 
 
111
/*!
 
112
    \fn virtual QWidget *QDesignerFormWindowCursorInterface::current() const = 0
 
113
 
 
114
    Returns the current widget in the form.
 
115
 
 
116
    \sa selectedWidget()
 
117
*/
 
118
 
 
119
/*!
 
120
    \fn virtual int QDesignerFormWindowCursorInterface::widgetCount() const = 0
 
121
 
 
122
    Returns the number of widgets in the form window.
 
123
*/
 
124
 
 
125
/*!
 
126
    \fn virtual QWidget *QDesignerFormWindowCursorInterface::widget(int index) const = 0
 
127
 
 
128
    Returns the widget with the given \a index in the list of widgets on the form.
 
129
 
 
130
    \sa selectedWidget()
 
131
*/
 
132
 
 
133
/*!
 
134
    \fn virtual bool QDesignerFormWindowCursorInterface::hasSelection() const = 0
 
135
 
 
136
    Returns true if the form window contains a selection; otherwise returns false.
 
137
*/
 
138
 
 
139
/*!
 
140
    \fn virtual int QDesignerFormWindowCursorInterface::selectedWidgetCount() const = 0
 
141
 
 
142
    Returns the number of selected widgets in the form window.
 
143
*/
 
144
 
 
145
/*!
 
146
    \fn virtual QWidget *QDesignerFormWindowCursorInterface::selectedWidget(int index) const = 0
 
147
 
 
148
    Returns the widget with the given \a index in the list of selected widgets.
 
149
 
 
150
    \sa widget()
 
151
*/
 
152
 
 
153
/*!
 
154
    \fn virtual void QDesignerFormWindowCursorInterface::setProperty(const QString &name, const QVariant &value) = 0
 
155
 
 
156
    Sets the property with the given \a name in the current widget to the specified \a value.
 
157
 
 
158
    \sa setWidgetProperty(), resetWidgetProperty()
 
159
*/
 
160
 
 
161
/*!
 
162
    \fn virtual void QDesignerFormWindowCursorInterface::setWidgetProperty(QWidget *widget, const QString &name, const QVariant &value) = 0
 
163
 
 
164
    Sets the property with the given \a name in the \a widget to the specified \a value.
 
165
 
 
166
    \sa resetWidgetProperty(), setProperty()
 
167
*/
 
168
 
 
169
/*!
 
170
    \fn virtual void QDesignerFormWindowCursorInterface::resetWidgetProperty(QWidget *widget, const QString &name) = 0
 
171
 
 
172
    Resets the property with the given \a name in the specified \a widget to its default value.
 
173
 
 
174
    \sa setProperty()
 
175
*/