~noskcaj/ubuntu/saucy/sflphone/merge-1.2.3-2

« back to all changes in this revision

Viewing changes to kde/src/widgets/HistoryDock.h

  • Committer: Package Import Robot
  • Author(s): Francois Marier
  • Date: 2012-02-18 21:47:09 UTC
  • mfrom: (1.1.6)
  • Revision ID: package-import@ubuntu.com-20120218214709-6362d71gqdsdkrj5
Tags: 1.0.2-1
* New upstream release
  - remove logging patch (applied upstream)
  - update s390 patch since it was partially applied upstream
* Include the Evolution plugin as a separate binary package

* Fix compilation issues on SH4 (closes: #658987)
* Merge Ubuntu's binutils-gold linking fix

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/***************************************************************************
 
2
 *   Copyright (C) 2009-2012 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, write to the                         *
 
17
 *   Free Software Foundation, Inc.,                                       *
 
18
 *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
 
19
 **************************************************************************/
 
20
#ifndef HISTORY_DOCK_H
 
21
#define HISTORY_DOCK_H
 
22
 
 
23
#include <QtGui/QDockWidget>
 
24
#include <QtGui/QTreeWidget>
 
25
#include <QtCore/QDate>
 
26
 
 
27
//Qt
 
28
class QTreeWidgetItem;
 
29
class QString;
 
30
class QTreeWidget;
 
31
class QComboBox;
 
32
class QLabel;
 
33
class QCheckBox;
 
34
class QPushButton;
 
35
class QDate;
 
36
 
 
37
//KDE
 
38
class KLineEdit;
 
39
class KDateWidget;
 
40
 
 
41
//SFLPhone
 
42
class HistoryTreeItem;
 
43
class HistoryTree;
 
44
 
 
45
//Typedef
 
46
typedef QList<HistoryTreeItem*> HistoryList;
 
47
 
 
48
///@class HistoryDock Dock to see the previous SFLPhone calls
 
49
class HistoryDock : public QDockWidget {
 
50
   Q_OBJECT
 
51
 
 
52
public:
 
53
   //Friends
 
54
   friend class KeyPressEater;
 
55
 
 
56
   //Constructors
 
57
   HistoryDock(QWidget* parent);
 
58
   virtual ~HistoryDock();
 
59
 
 
60
private:
 
61
   //Enum
 
62
   enum SortBy {
 
63
      Date       = 0,
 
64
      Name       = 1,
 
65
      Popularity = 2,
 
66
      Duration   = 3
 
67
   };
 
68
 
 
69
   //Getters
 
70
   QString getIdentity(HistoryTreeItem* item);
 
71
 
 
72
   //Attributes
 
73
   HistoryTree*  m_pItemView        ;
 
74
   KLineEdit*    m_pFilterLE        ;
 
75
   QComboBox*    m_pSortByCBB       ;
 
76
   QLabel*       m_pSortByL         ;
 
77
   QLabel*       m_pFromL           ;
 
78
   QLabel*       m_pToL             ;
 
79
   KDateWidget*  m_pFromDW          ;
 
80
   KDateWidget*  m_pToDW            ;
 
81
   QCheckBox*    m_pAllTimeCB       ;
 
82
   QPushButton*  m_pLinkPB          ;
 
83
   HistoryList   m_History          ;
 
84
   QDate         m_CurrentFromDate  ;
 
85
   QDate         m_CurrentToDate    ;
 
86
 
 
87
   //Mutator
 
88
   void updateLinkedDate(KDateWidget* item, QDate& prevDate, QDate& newDate);
 
89
 
 
90
public slots:
 
91
   void enableDateRange(bool enable);
 
92
   virtual void keyPressEvent(QKeyEvent* event);
 
93
 
 
94
private slots:
 
95
   void filter               (QString text );
 
96
   void updateLinkedFromDate (QDate   date );
 
97
   void updateLinkedToDate   (QDate   date );
 
98
   void reload               (             );
 
99
   void updateContactInfo    (             );
 
100
};
 
101
 
 
102
 
 
103
///@class HistoryTree Simple tree view with additional keybpard filter
 
104
class HistoryTree : public QTreeWidget {
 
105
   Q_OBJECT
 
106
public:
 
107
   HistoryTree(QWidget* parent) : QTreeWidget(parent) {}
 
108
   virtual QMimeData* mimeData( const QList<QTreeWidgetItem *> items) const;
 
109
   bool dropMimeData(QTreeWidgetItem *parent, int index, const QMimeData *data, Qt::DropAction action);
 
110
};
 
111
 
 
112
class KeyPressEater : public QObject
 
113
{
 
114
   Q_OBJECT
 
115
public:
 
116
   KeyPressEater(HistoryDock* parent) : QObject(parent) {
 
117
      m_pDock =  parent;
 
118
   }
 
119
protected:
 
120
   bool eventFilter(QObject *obj, QEvent *event);
 
121
private:
 
122
   HistoryDock* m_pDock;
 
123
};
 
124
 
 
125
#endif
 
 
b'\\ No newline at end of file'