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

« back to all changes in this revision

Viewing changes to kde/src/callview.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) 2009-2013 by Savoir-Faire Linux                         *
3
 
 *   Author : Emmanuel Lepage Valle <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 CALL_VIEW
19
 
#define CALL_VIEW
20
 
 
21
 
//Qt
22
 
#include <QtGui/QTreeWidget>
23
 
 
24
 
//SFLPhone
25
 
#include "lib/callmodel.h"
26
 
 
27
 
//Qt
28
 
class QTreeWidgetItem;
29
 
 
30
 
//KDE
31
 
class KLineEdit;
32
 
 
33
 
//SFLPhone
34
 
class CallTreeItem;
35
 
class CallTreeItemDelegate;
36
 
class CallViewOverlayToolbar;
37
 
class CallViewOverlay;
38
 
 
39
 
//Typedef
40
 
typedef CallModel<CallTreeItem*,QTreeWidgetItem*> TreeWidgetCallModel;
41
 
 
42
 
///CallView: Central tree widget managing active calls
43
 
class CallView : public QTreeWidget {
44
 
   Q_OBJECT
45
 
   friend class CallTreeItemDelegate;
46
 
 
47
 
   public:
48
 
      explicit CallView           ( QWidget* parent = 0                                                               );
49
 
      ~CallView                   (                                                                                   );
50
 
 
51
 
      //Getters
52
 
      Call* getCurrentItem        (                                                                                   );
53
 
      QWidget* getWidget          (                                                                                   );
54
 
      bool haveOverlay            (                                                                                   );
55
 
      virtual QMimeData* mimeData ( const QList<QTreeWidgetItem *> items                                              ) const;
56
 
      CallViewOverlayToolbar*     overlayToolbar() { return m_pCanvasToolbar;                                         };
57
 
 
58
 
      //Setters
59
 
      void setTitle               ( const QString& title                                                              );
60
 
 
61
 
      //Mutator
62
 
      bool removeItem             ( Call* item                                                                        );
63
 
      bool dropMimeData           ( QTreeWidgetItem *parent, int index, const QMimeData *data, Qt::DropAction action  );
64
 
      bool callToCall             ( QTreeWidgetItem *parent, int index, const QMimeData *data, Qt::DropAction action  );
65
 
      bool phoneNumberToCall      ( QTreeWidgetItem *parent, int index, const QMimeData *data, Qt::DropAction action  );
66
 
      bool contactToCall          ( QTreeWidgetItem *parent, int index, const QMimeData *data, Qt::DropAction action  );
67
 
      void moveSelectedItem       ( Qt::Key direction                                                                 );
68
 
      void selectFirstItem        (                                                                                   );
69
 
 
70
 
   private:
71
 
      //Mutator
72
 
      QTreeWidgetItem* extractItem ( const QString& callId                             );
73
 
      QTreeWidgetItem* extractItem ( QTreeWidgetItem* item                             );
74
 
      CallTreeItem* insertItem     ( QTreeWidgetItem* item, QTreeWidgetItem* parent=0  );
75
 
      CallTreeItem* insertItem     ( QTreeWidgetItem* item, Call* parent               );
76
 
      void clearArtefact           (                                                   );
77
 
 
78
 
      //Attributes
79
 
      KLineEdit*              m_pTransferLE         ;
80
 
      CallViewOverlay*        m_pTransferOverlay    ;
81
 
      CallViewOverlay*        m_pActiveOverlay      ;
82
 
      Call*                   m_pCallPendingTransfer;
83
 
      CallViewOverlayToolbar* m_pCanvasToolbar      ;
84
 
 
85
 
   protected:
86
 
      //Reimlementation
87
 
      virtual void dragEnterEvent ( QDragEnterEvent *e );
88
 
      virtual void dragMoveEvent  ( QDragMoveEvent  *e );
89
 
      virtual void dragLeaveEvent ( QDragLeaveEvent *e );
90
 
      virtual void resizeEvent    ( QResizeEvent    *e );
91
 
      virtual void drawBranches(QPainter* painter, const QRect& rect, const QModelIndex& index) const;
92
 
 
93
 
   public Q_SLOTS:
94
 
      void destroyCall        ( Call* toDestroy);
95
 
      void itemDoubleClicked  ( QTreeWidgetItem* item, int column    );
96
 
      void itemClicked        ( QTreeWidgetItem* item, int column =0 );
97
 
      Call* addCall           ( Call* call, Call* parent =0          );
98
 
      Call* addConference     ( Call* conf                           );
99
 
      bool conferenceChanged  ( Call* conf                           );
100
 
      void conferenceRemoved  ( Call* conf                           );
101
 
 
102
 
      virtual void keyPressEvent(QKeyEvent* event);
103
 
 
104
 
   public Q_SLOTS:
105
 
      void clearHistory();
106
 
      void showTransferOverlay(Call* call);
107
 
      void transfer();
108
 
      void transferDropEvent(Call* call,QMimeData* data);
109
 
      void conversationDropEvent(Call* call,QMimeData* data);
110
 
      void hideOverlay();
111
 
      void moveCanvasTip();
112
 
 
113
 
   Q_SIGNALS:
114
 
      ///Emitted when one of the call item change
115
 
      void itemChanged(Call*);
116
 
 
117
 
};
118
 
#endif