1
/* * This file is part of Maliit framework *
3
* Copyright (C) 2010, 2011 Nokia Corporation and/or its subsidiary(-ies).
6
* Contact: maliit-discuss@lists.maliit.org
8
* This library is free software; you can redistribute it and/or
9
* modify it under the terms of the GNU Lesser General Public
10
* License version 2.1 as published by the Free Software Foundation
11
* and appearing in the file LICENSE.LGPL included in the packaging
15
// Based on minputmethodstate.h from libmeegotouch
17
#ifndef MALIIT_ATTRIBUTEEXTENSIONREGISTRY_H
18
#define MALIIT_ATTRIBUTEEXTENSIONREGISTRY_H
22
#include <QScopedPointer>
23
#include <QWeakPointer>
24
#include "attributeextension.h"
28
class AttributeExtensionRegistryPrivate;
30
typedef QList<QWeakPointer<AttributeExtension> > ExtensionList;
32
//! \ingroup libmaliit
34
class AttributeExtensionRegistry : public QObject
37
Q_DISABLE_COPY(AttributeExtensionRegistry)
38
Q_DECLARE_PRIVATE(AttributeExtensionRegistry)
41
//! \brief Get singleton instance
42
//! \return singleton instance
43
static AttributeExtensionRegistry *instance();
45
void addExtension(AttributeExtension *extension);
46
void addExtension(const QSharedPointer<AttributeExtension> &extension);
48
void removeExtension(AttributeExtension *extension);
50
void extensionChanged(AttributeExtension *extension, const QString &key, const QVariant &value);
52
ExtensionList extensions() const;
55
//! Emitted when an input method attribute extension which is defined in \a fileName with an unique identifier \a id is registered.
56
void extensionRegistered(int id, const QString &fileName);
58
//! Emitted when an input method attribute extension with an unique \a id is unregistered.
59
void extensionUnregistered(int id);
61
//! Emitted when input method extended attribute is changed.
62
void extensionChanged(int id, const QString &key, const QVariant &value);
66
* \brief Update cached \a value of extended attribute corresponding to given parameters.
68
void updateAttribute(int id,
69
const QString &target,
70
const QString &targetItem,
71
const QString &attribute,
72
const QVariant &value);
75
AttributeExtensionRegistry();
76
~AttributeExtensionRegistry();
78
const QScopedPointer<AttributeExtensionRegistryPrivate> d_ptr;
80
Q_SLOT void registerExistingAttributeExtensions();
85
#endif // MALIIT_ATTRIBUTEEXTENSIONREGISTRY_H