1
// -*- mode: C++; c-basic-offset: 4; indent-tabs-mode: nil; c-file-offsets: ((innamespace . 0)); -*-
3
* This file is part of Maliit Plugins
5
* Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). All rights reserved.
7
* Contact: Mohammad Anwari <Mohammad.Anwari@nokia.com>
9
* Redistribution and use in source and binary forms, with or without modification,
10
* are permitted provided that the following conditions are met:
12
* Redistributions of source code must retain the above copyright notice, this list
13
* of conditions and the following disclaimer.
14
* Redistributions in binary form must reproduce the above copyright notice, this list
15
* of conditions and the following disclaimer in the documentation and/or other materials
16
* provided with the distribution.
17
* Neither the name of Nokia Corporation nor the names of its contributors may be
18
* used to endorse or promote products derived from this software without specific
19
* prior written permission.
21
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
22
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
23
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
24
* THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
25
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
26
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
27
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
28
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
29
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33
#ifndef MALIIT_KEYBOARD_DEADKEYMACHINE_H
34
#define MALIIT_KEYBOARD_DEADKEYMACHINE_H
36
#include "abstractstatemachine.h"
37
#include "models/key.h"
41
namespace MaliitKeyboard {
44
class DeadkeyMachinePrivate;
47
: public QStateMachine
48
, public AbstractStateMachine
51
Q_DISABLE_COPY(DeadkeyMachine)
52
Q_DECLARE_PRIVATE(DeadkeyMachine)
55
explicit DeadkeyMachine(QObject *parent = 0);
56
virtual ~DeadkeyMachine();
58
virtual void setup(LayoutUpdater *updater);
60
virtual void setAccentKey(const Key &accent_key);
61
Key accentKey() const;
63
//! This state means that deadkey wasn't pressed. No accented
64
//! characters may be entered now. This is initial state.
65
static const char *const no_deadkey_state;
66
//! This state means that deadkey was pressed but not yet released.
67
//! In this state either single accented character can be entered
68
//! or deadkey can be released to latch it.
69
static const char *const deadkey_state;
70
//! This state means that deadkey was pressed and released and thus
71
//! several accented characters can be entered. Pressing deadkey
72
//! again switches to initial state.
73
static const char *const latched_deadkey_state;
76
const QScopedPointer<DeadkeyMachinePrivate> d_ptr;
79
}} // namespace Logic, MaliitKeyboard
81
#endif // MALIIT_KEYBOARD_DEADKEYMACHINE_H