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 QtContacts 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 "qcontactactionfactory.h"
43
#include "qcontactactiondescriptor_p.h"
45
QT_BEGIN_NAMESPACE_CONTACTS
48
\class QContactActionFactory
49
\brief The QContactActionFactory class provides an interface for clients
50
to retrieve instances of action implementations
52
\ingroup contacts-actions
56
\fn QContactActionFactory::QContactActionFactory(QObject* parent)
57
Default constructor for this interface. Passes \a parent to the QObject constructor.
61
\fn QContactActionFactory::~QContactActionFactory()
63
Clears any memory in use by this factory
66
QContactActionFactory::~QContactActionFactory()
72
\fn QContactActionFactory::actionDescriptors() const
74
Return a list of action descriptors for the actions that this factory supports.
78
\fn QContactActionFactory::contactFilter(const QContactActionDescriptor& which) const
80
Returns a filter to select contacts that are supported by the action specified by \a which.
84
\fn QContactActionFactory::supportedTargets(const QContact& contact, const QContactActionDescriptor& which) const
86
Returns the targets which are supported by the action described by \a which that may be instantiated by this factory
87
for the given \a contact. If there are no supported targets for the \a contact, then that
88
contact is not supported by the action.
94
\fn QContactActionFactory::supportsContact(const QContact& contact, const QContactActionDescriptor& which) const
96
Returns true if there are any targets for the given \a contact supported by the action described by \a which.
100
\fn QContactActionFactory::create(const QContactActionDescriptor& which) const
102
Returns a new \l QContactAction instance for the supplied action descriptor \a which.
104
The caller will own this object.
108
\fn QContactActionFactory::metaData(const QString& key, const QList<QContactActionTarget>& targets, const QVariantMap& parameters = QVariantMap(), const QContactActionDescriptor& which) const
110
Returns the meta-data associated with the action described by \a which for the given \a key (such as icon, label or sound cues).
111
The meta-data may vary depending on the \a targets of the action and any \a parameters to invocation which the client may specify.
115
\fn QContactActionFactory::InterfaceName()
116
The name of the interface that action plugins should implement.
119
bool QContactActionFactory::supportsContact(const QContact& contact, const QContactActionDescriptor& which) const
121
// default implementation is naive.
122
return !supportedTargets(contact, which).isEmpty();
126
Creates an action descriptor based on the supplied action name \a actionName, service name \a serviceName, action identifier \a actionIdentifier, and version \a implementationVersion.
128
QContactActionDescriptor QContactActionFactory::createDescriptor(const QString& actionName, const QString& serviceName, const QString& actionIdentifier, int implementationVersion) const
130
QContactActionDescriptor retn;
131
retn.d->m_actionName = actionName;
132
retn.d->m_serviceName = serviceName;
133
retn.d->m_identifier = actionIdentifier;
134
retn.d->m_implementationVersion = implementationVersion;
135
retn.d->m_factory = this;
139
#include "moc_qcontactactionfactory.cpp"
141
QT_END_NAMESPACE_CONTACTS