1
/***************************************************************************
2
* Copyright (C) 2013-2014 by Savoir-Faire Linux *
3
* Author : Emmanuel Lepage Vallee <emmanuel.lepage@savoirfairelinux.com>*
5
* This program is free software; you can redistribute it and/or modify *
6
* it under the terms of the GNU General Public License as published by *
7
* the Free Software Foundation; either version 3 of the License, or *
8
* (at your option) any later version. *
10
* This program is distributed in the hope that it will be useful, *
11
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
12
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
13
* GNU General Public License for more details. *
15
* You should have received a copy of the GNU General Public License *
16
* along with this program. If not, see <http://www.gnu.org/licenses/>. *
17
**************************************************************************/
18
#ifndef EVENTMANAGER_H
19
#define EVENTMANAGER_H
21
#include "klib/macromodel.h"
25
class QDragEnterEvent;
27
class QDragMoveEvent ;
28
class QDragMoveEvent ;
33
class CanvasObjectManager;
34
class MainWindowEvent;
37
class EventManager : public QObject, public MacroListener {
41
friend class MainWindowEvent;
42
explicit EventManager(SFLPhoneView* parent = nullptr);
43
virtual ~EventManager();
45
* Handles the behaviour when the user types something with
46
* the dialpad widget or his keyboard (normally it's a one char
47
* string but we use a string just in case).
48
* Adds str to the selected item if in the main window
49
* and creates a new item if no item is selected.
50
* Send DTMF if appropriate according to current item's state.
51
* Adds str to the search bar if in history or address book.
52
* @param str the string sent by the user
54
void typeString(const QString& str);
56
* Handles the behaviour when the user types a backspace
57
* according to the current state (window, item selected...)
62
* Handles the behaviour when the user types escape
63
* according to the current state (window, item selected...)
67
//Implement macro key listener
68
virtual void addDTMF(const QString& sequence);
72
virtual bool eventFilter(QObject *obj, QEvent *event);
76
CanvasObjectManager* m_pCanvasManager;
77
SFLPhoneView* m_pParent ;
78
MainWindowEvent* m_pMainWindowEv ;
81
bool viewKeyEvent ( QKeyEvent* e);
82
bool viewDragEnterEvent( const QDragEnterEvent* e);
83
bool viewDropEvent ( QDropEvent* e);
84
bool viewDragMoveEvent ( const QDragMoveEvent* e);
85
bool viewDragLeaveEvent( const QDragMoveEvent* e);
90
* Handles the behaviour when the user types enter
91
* according to the current state (window, item selected...)
94
void slotAutoCompletionVisibility(bool);
97
void slotCallStateChanged(Call* call, Call::State previousState);
98
void slotIncomingCall(Call* call);
99
void slotAccountRegistrationChanged(Account* a,bool reg);
100
void slotNetworkDown();
103
#endif //EVENTMANAGER_H