~ubuntu-branches/ubuntu/wily/sflphone/wily

« back to all changes in this revision

Viewing changes to kde/src/eventmanager.h

  • Committer: Package Import Robot
  • Author(s): Mark Purcell
  • Date: 2014-01-28 18:23:36 UTC
  • mfrom: (1.1.11)
  • mto: This revision was merged to the branch mainline in revision 24.
  • Revision ID: package-import@ubuntu.com-20140128182336-3xenud1kbnwmf3mz
* New upstream release 
  - Fixes "New Upstream Release" (Closes: #735846)
  - Fixes "Ringtone does not stop" (Closes: #727164)
  - Fixes "[sflphone-kde] crash on startup" (Closes: #718178)
  - Fixes "sflphone GUI crashes when call is hung up" (Closes: #736583)
* Build-Depends: ensure GnuTLS 2.6
  - libucommon-dev (>= 6.0.7-1.1), libccrtp-dev (>= 2.0.6-3)
  - Fixes "FTBFS Build-Depends libgnutls{26,28}-dev" (Closes: #722040)
* Fix "boost 1.49 is going away" unversioned Build-Depends: (Closes: #736746)
* Add Build-Depends: libsndfile-dev, nepomuk-core-dev

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/***************************************************************************
 
2
 *   Copyright (C) 2013-2014 by Savoir-Faire Linux                         *
 
3
 *   Author : Emmanuel Lepage Vallee <emmanuel.lepage@savoirfairelinux.com>*
 
4
 *                                                                         *
 
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.                                   *
 
9
 *                                                                         *
 
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.                          *
 
14
 *                                                                         *
 
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
 
20
 
 
21
#include "klib/macromodel.h"
 
22
 
 
23
//Qt
 
24
class QKeyEvent      ;
 
25
class QDragEnterEvent;
 
26
class QDropEvent     ;
 
27
class QDragMoveEvent ;
 
28
class QDragMoveEvent ;
 
29
 
 
30
//SFLPhone
 
31
#include <lib/call.h>
 
32
class SFLPhoneView;
 
33
class CanvasObjectManager;
 
34
class MainWindowEvent;
 
35
class Account;
 
36
 
 
37
class EventManager : public QObject, public MacroListener {
 
38
   Q_OBJECT
 
39
 
 
40
public:
 
41
   friend class MainWindowEvent;
 
42
   explicit EventManager(SFLPhoneView* parent = nullptr);
 
43
   virtual ~EventManager();
 
44
      /**
 
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
 
53
    */
 
54
   void typeString(const QString& str);
 
55
   /**
 
56
    *   Handles the behaviour when the user types a backspace
 
57
    *   according to the current state (window, item selected...)
 
58
    */
 
59
   void backspace();
 
60
 
 
61
   /**
 
62
    *   Handles the behaviour when the user types escape
 
63
    *   according to the current state (window, item selected...)
 
64
    */
 
65
   void escape();
 
66
 
 
67
   //Implement macro key listener
 
68
   virtual void addDTMF(const QString& sequence);
 
69
 
 
70
 
 
71
protected:
 
72
   virtual bool eventFilter(QObject *obj, QEvent *event);
 
73
 
 
74
private:
 
75
   //Attributes
 
76
   CanvasObjectManager* m_pCanvasManager;
 
77
   SFLPhoneView*        m_pParent       ;
 
78
   MainWindowEvent*     m_pMainWindowEv ;
 
79
 
 
80
   //Methods
 
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);
 
86
 
 
87
 
 
88
public Q_SLOTS:
 
89
   /**
 
90
    *   Handles the behaviour when the user types enter
 
91
    *   according to the current state (window, item selected...)
 
92
    */
 
93
   void enter();
 
94
   void slotAutoCompletionVisibility(bool);
 
95
 
 
96
private Q_SLOTS:
 
97
   void slotCallStateChanged(Call* call, Call::State previousState);
 
98
   void slotIncomingCall(Call* call);
 
99
   void slotAccountRegistrationChanged(Account* a,bool reg);
 
100
   void slotNetworkDown();
 
101
};
 
102
 
 
103
#endif //EVENTMANAGER_H