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

« back to all changes in this revision

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

  • Committer: Package Import Robot
  • Author(s): Jonathan Riddell
  • Date: 2015-01-07 14:51:16 UTC
  • mfrom: (4.3.5 sid)
  • Revision ID: package-import@ubuntu.com-20150107145116-yxnafinf4lrdvrmx
Tags: 1.4.1-0.1ubuntu1
* Merge with Debian, remaining changes:
 - Drop soprano, nepomuk build-dep
* Drop ubuntu patches, now upstream

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/***************************************************************************
 
2
 *   Copyright (C) 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 SECURITYPROGRESS_H
 
19
#define SECURITYPROGRESS_H
 
20
 
 
21
#include <QtGui/QProgressBar>
 
22
 
 
23
//Qt
 
24
class QListView;
 
25
class QLabel;
 
26
class QHBoxLayout;
 
27
class QLineEdit;
 
28
 
 
29
//SFLPhone
 
30
#include <lib/securityvalidationmodel.h>
 
31
class SecurityProgress;
 
32
 
 
33
class IssuesIcon : public QWidget {
 
34
   Q_OBJECT
 
35
public:
 
36
   explicit IssuesIcon(QWidget* parent = nullptr);
 
37
   ~IssuesIcon();
 
38
 
 
39
   //Setter
 
40
   void setBuddy(QWidget* buddy);
 
41
   void setModel(SecurityValidationModel* model);
 
42
 
 
43
   //Getter
 
44
   QWidget* buddy() const;
 
45
 
 
46
   //Mutator
 
47
   void addFlaw(const Flaw* flaw);
 
48
   void setupForLineEdit(QLineEdit* le);
 
49
   void reset();
 
50
protected:
 
51
   virtual bool eventFilter(QObject *obj, QEvent *event);
 
52
 
 
53
private:
 
54
   QHBoxLayout* m_pLayout;
 
55
   QWidget*     m_pBuddy;
 
56
   SecurityValidationModel* m_pModel;
 
57
private Q_SLOTS:
 
58
   void slotSolved();
 
59
   void slotFlawClicked();
 
60
Q_SIGNALS:
 
61
   void selectFlaw(const QModelIndex idx);
 
62
};
 
63
 
 
64
class SecurityLevelWidget : public QWidget
 
65
{
 
66
   Q_OBJECT
 
67
public:
 
68
   explicit SecurityLevelWidget(QWidget* parent = nullptr);
 
69
   virtual ~SecurityLevelWidget();
 
70
 
 
71
   //Getter
 
72
   QListView* view() const;
 
73
 
 
74
   //Setter
 
75
   void setModel(SecurityValidationModel* model);
 
76
protected:
 
77
   //Virtual events
 
78
   virtual void mouseReleaseEvent ( QMouseEvent * event );
 
79
private:
 
80
   //Attributes
 
81
   SecurityProgress* m_pLevel;
 
82
   QListView* m_pView;
 
83
   SecurityValidationModel* m_pModel;
 
84
 
 
85
   //Widgets
 
86
   QLabel* m_pInfoL   ;
 
87
   QLabel* m_pWarningL;
 
88
   QLabel* m_pIssueL  ;
 
89
   QLabel* m_pErrorL  ;
 
90
 
 
91
private Q_SLOTS:
 
92
   void reloadCount();
 
93
   void dblClicked(const QModelIndex& idx);
 
94
};
 
95
 
 
96
#endif