1
/****************************************************************************
3
** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies).
4
** Contact: http://www.qt-project.org/legal
6
** This file is part of the QtOrganizer module of the Qt Toolkit.
8
** $QT_BEGIN_LICENSE:LGPL$
9
** Commercial License Usage
10
** Licensees holding valid commercial Qt licenses may use this file in
11
** accordance with the commercial license agreement provided with the
12
** Software or, alternatively, in accordance with the terms contained in
13
** a written agreement between you and Digia. For licensing terms and
14
** conditions see http://qt.digia.com/licensing. For further information
15
** use the contact form at http://qt.digia.com/contact-us.
17
** GNU Lesser General Public License Usage
18
** Alternatively, this file may be used under the terms of the GNU Lesser
19
** General Public License version 2.1 as published by the Free Software
20
** Foundation and appearing in the file LICENSE.LGPL included in the
21
** packaging of this file. Please review the following information to
22
** ensure the GNU Lesser General Public License version 2.1 requirements
23
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
25
** In addition, as a special exception, Digia gives you certain additional
26
** rights. These rights are described in the Digia Qt LGPL Exception
27
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
29
** GNU General Public License Usage
30
** Alternatively, this file may be used under the terms of the GNU
31
** General Public License version 3.0 as published by the Free Software
32
** Foundation and appearing in the file LICENSE.GPL included in the
33
** packaging of this file. Please review the following information to
34
** ensure the GNU General Public License version 3.0 requirements will be
35
** met: http://www.gnu.org/copyleft/gpl.html.
40
****************************************************************************/
42
#include "qdeclarativeorganizeritemsortorder_p.h"
44
QT_BEGIN_NAMESPACE_ORGANIZER
48
\instantiates QDeclarativeOrganizerItemSortOrder
49
\brief The SortOrder element defines how a list of organizer item should be ordered according to some criteria.
50
\inqmlmodule QtOrganizer 5.0
51
\ingroup qml-organizer-filters
53
QDeclarativeOrganizerItemSortOrder::QDeclarativeOrganizerItemSortOrder(QObject *parent)
55
, m_detail(QDeclarativeOrganizerItemDetail::Undefined), m_field(-1), m_componentCompleted(false)
60
\qmlsignal SortOrder::onSortOrderChanged()
62
This signal is emitted, when any of the SortOrder's properties have been changed.
68
void QDeclarativeOrganizerItemSortOrder::classBegin()
75
void QDeclarativeOrganizerItemSortOrder::componentComplete()
77
setDetailDefinitionName();
78
m_componentCompleted = true;
82
\qmlproperty string SortOrder::detail
84
This property holds the detail type of which the sorting will be performed to. The value should
85
be the enumeration value of Detail::type.
87
void QDeclarativeOrganizerItemSortOrder::setDetail(QDeclarativeOrganizerItemDetail::DetailType detail)
89
if (m_detail != detail) {
91
if (m_componentCompleted)
92
setDetailDefinitionName();
96
QDeclarativeOrganizerItemDetail::DetailType QDeclarativeOrganizerItemSortOrder::detail() const
102
\qmlproperty string SortOrder::field
104
This property holds the detail field type of which the sorting will be performed to. The value
105
should be the filld enumeration value defined in each detail element.
107
\sa EventTime, JournalTime, TodoTime, TodoProgress, Reminder, AudibleReminder, VisualReminder,
108
EmailReminder, Comment, Description, DisplayLabel, Guid, Location, Parent, Priority, Recurrence,
109
Timestamp, ItemType, Tag
111
void QDeclarativeOrganizerItemSortOrder::setField(int field)
113
if (field != m_field) {
115
if (m_componentCompleted)
116
setDetailDefinitionName();
120
int QDeclarativeOrganizerItemSortOrder::field() const
126
\qmlproperty enumeration SortOrder::blankPolicy
128
This property enumerates the ways in which the sort order interprets blanks when sorting organizer.
130
\li SortOrder.BlanksFirst Considers blank values to evaluate to less than all other values in comparisons.
131
\li SortOrder.BlanksLast Considers blank values to evaluate to greater than all other values in comparisons.
134
void QDeclarativeOrganizerItemSortOrder::setBlankPolicy(BlankPolicy policy)
136
if (policy != blankPolicy()) {
137
d.setBlankPolicy(static_cast<QOrganizerItemSortOrder::BlankPolicy>(policy));
138
emit sortOrderChanged();
142
QDeclarativeOrganizerItemSortOrder::BlankPolicy QDeclarativeOrganizerItemSortOrder::blankPolicy() const
144
return static_cast<QDeclarativeOrganizerItemSortOrder::BlankPolicy>(d.blankPolicy());
148
\qmlproperty enumeration SortOrder::direction
150
This property holds the direction of the sort order, the value can be one of:
152
\li Qt.AscendingOrder The items will be sorted by the ascending order (default).
153
\li Qt.DescendingOrder The items will be sorted by the descending order.
156
void QDeclarativeOrganizerItemSortOrder::setDirection(Qt::SortOrder newDirection)
158
if (newDirection != direction()) {
159
d.setDirection(newDirection);
160
emit sortOrderChanged();
164
Qt::SortOrder QDeclarativeOrganizerItemSortOrder::direction() const
166
return d.direction();
170
\qmlproperty enumeration SortOrder::caseSensitivity
172
This property holds the case sensitivity of the sort order, the value can be one of:
174
\li Qt.CaseInsensitive Sets the case sensitivity of the sort order to insensitivity.
175
\li Qt.CaseSensitive Sets the case sensitivity of the sort order to sensitivity (default).
178
void QDeclarativeOrganizerItemSortOrder::setCaseSensitivity(Qt::CaseSensitivity newSensitivity)
180
if (newSensitivity != caseSensitivity()) {
181
d.setCaseSensitivity(newSensitivity);
182
emit sortOrderChanged();
186
Qt::CaseSensitivity QDeclarativeOrganizerItemSortOrder::caseSensitivity() const
188
return d.caseSensitivity();
194
QOrganizerItemSortOrder QDeclarativeOrganizerItemSortOrder::sortOrder()
202
void QDeclarativeOrganizerItemSortOrder::setDetailDefinitionName()
204
d.setDetail(static_cast<QOrganizerItemDetail::DetailType>(m_detail), m_field);
205
emit sortOrderChanged();
209
#include "moc_qdeclarativeorganizeritemsortorder_p.cpp"
211
QT_END_NAMESPACE_ORGANIZER