~timo-jyrinki/ubuntu/trusty/maliit-framework/fix_qt52

« back to all changes in this revision

Viewing changes to maliit/attributeextensionregistry.h

  • Committer: Package Import Robot
  • Author(s): Ricardo Salveti de Araujo, Sergio Schvezov, Ricardo Salveti de Araujo
  • Date: 2013-07-23 19:47:04 UTC
  • mfrom: (1.1.2) (1.2.1 experimental)
  • Revision ID: package-import@ubuntu.com-20130723194704-1lsy1kmlda069cea
Tags: 0.99.0+git20130615+97e8335-0ubuntu1
[ Sergio Schvezov ]
* New build from HEAD 97e8335.
* Packaging import from lp:phablet-extras/maliit-framework.

[ Ricardo Salveti de Araujo ]
* debian/control: adding vcs and fixing dependencies
* General package cleanup

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* * This file is part of Maliit framework *
2
 
 *
3
 
 * Copyright (C) 2010, 2011 Nokia Corporation and/or its subsidiary(-ies).
4
 
 * All rights reserved.
5
 
 *
6
 
 * Contact: maliit-discuss@lists.maliit.org
7
 
 *
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
12
 
 * of this file.
13
 
 */
14
 
 
15
 
// Based on minputmethodstate.h from libmeegotouch
16
 
 
17
 
#ifndef MALIIT_ATTRIBUTEEXTENSIONREGISTRY_H
18
 
#define MALIIT_ATTRIBUTEEXTENSIONREGISTRY_H
19
 
 
20
 
#include <QList>
21
 
#include <QObject>
22
 
#include <QScopedPointer>
23
 
#include <QWeakPointer>
24
 
#include "attributeextension.h"
25
 
 
26
 
namespace Maliit {
27
 
 
28
 
class AttributeExtensionRegistryPrivate;
29
 
 
30
 
typedef QList<QWeakPointer<AttributeExtension> > ExtensionList;
31
 
 
32
 
//! \ingroup libmaliit
33
 
//! \internal
34
 
class AttributeExtensionRegistry : public QObject
35
 
{
36
 
    Q_OBJECT
37
 
    Q_DISABLE_COPY(AttributeExtensionRegistry)
38
 
    Q_DECLARE_PRIVATE(AttributeExtensionRegistry)
39
 
 
40
 
public:
41
 
    //! \brief Get singleton instance
42
 
    //! \return singleton instance
43
 
    static AttributeExtensionRegistry *instance();
44
 
 
45
 
    void addExtension(AttributeExtension *extension);
46
 
    void addExtension(const QSharedPointer<AttributeExtension> &extension);
47
 
 
48
 
    void removeExtension(AttributeExtension *extension);
49
 
 
50
 
    void extensionChanged(AttributeExtension *extension, const QString &key, const QVariant &value);
51
 
 
52
 
    ExtensionList extensions() const;
53
 
 
54
 
Q_SIGNALS:
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);
57
 
 
58
 
    //! Emitted when an input method attribute extension with an unique \a id is unregistered.
59
 
    void extensionUnregistered(int id);
60
 
 
61
 
    //! Emitted when input method extended attribute is changed.
62
 
    void extensionChanged(int id, const QString &key, const QVariant &value);
63
 
 
64
 
public Q_SLOTS:
65
 
    /*!
66
 
     * \brief Update cached \a value of extended attribute corresponding to given parameters.
67
 
     */
68
 
    void updateAttribute(int id,
69
 
                         const QString &target,
70
 
                         const QString &targetItem,
71
 
                         const QString &attribute,
72
 
                         const QVariant &value);
73
 
 
74
 
private:
75
 
    AttributeExtensionRegistry();
76
 
    ~AttributeExtensionRegistry();
77
 
 
78
 
    const QScopedPointer<AttributeExtensionRegistryPrivate> d_ptr;
79
 
 
80
 
    Q_SLOT void registerExistingAttributeExtensions();
81
 
};
82
 
 
83
 
} // namespace Maliit
84
 
 
85
 
#endif // MALIIT_ATTRIBUTEEXTENSIONREGISTRY_H