• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdepim API Reference
  • KDE Home
  • Contact Us
 

libkdepim

  • sources
  • kde-4.14
  • kdepim
  • libkdepim
  • progresswidget
ssllabel.cpp
Go to the documentation of this file.
1 /* -*- mode: C++; c-file-style: "gnu" -*-
2  *
3  * This file is part of KMail, the KDE mail client.
4  *
5  * Copyright (c) 2003 Zack Rusin <zack@kde.org>
6  *
7  * KMail is free software; you can redistribute it and/or modify it
8  * under the terms of the GNU General Public License, version 2, as
9  * published by the Free Software Foundation.
10  *
11  * KMail is distributed in the hope that it will be useful, but
12  * WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14  * General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program; if not, write to the Free Software
18  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19  *
20  * In addition, as a special exception, the copyright holders give
21  * permission to link the code of this program with any edition of
22  * the Qt library by Trolltech AS, Norway (or with modified versions
23  * of Qt that use the same license as Qt), and distribute linked
24  * combinations including the two. You must obey the GNU General
25  * Public License in all respects for all of the code used other than
26  * Qt. If you modify this file, you may extend this exception to
27  * your version of the file, but you are not obligated to do so. If
28  * you do not wish to do so, delete this exception statement from
29  * your version.
30  */
31 
32 #include "ssllabel.h"
33 
34 #include <KLocale>
35 #include <KIconLoader>
36 
37 #include <QLabel>
38 #include <QPixmap>
39 
40 using namespace KPIM;
41 
42 SSLLabel::SSLLabel( QWidget* parent )
43  : QLabel( parent )
44 {
45  setState( Done );
46 }
47 
48 void SSLLabel::setEncrypted( SSLLabel::State state )
49 {
50  m_lastEncryptionState = state;
51 }
52 
53 SSLLabel::State SSLLabel::lastState() const
54 {
55  return m_lastEncryptionState;
56 }
57 
58 void SSLLabel::setState( State state )
59 {
60  switch( state ) {
61  case Encrypted:
62  this->setToolTip( i18n("Connection is encrypted") );
63  setPixmap( SmallIcon( QLatin1String("security-high") ) );
64  show();
65  break;
66  case Unencrypted:
67  this->setToolTip( i18n("Connection is unencrypted") );
68  setPixmap( SmallIcon( QLatin1String("security-low") ) );
69  show();
70  break;
71  case Unknown:
72  case Done:
73  this->setToolTip(QString());
74  hide();
75  break;
76  case Clean:
77  default:
78  this->setToolTip(QString());
79  hide();
80  //we return because we do not save the state as the only
81  //action we want to perform is to hide ourself
82  return;
83  }
84  m_lastEncryptionState = state;
85 }
86 
KPIM::SSLLabel::setState
void setState(State state)
Definition: ssllabel.cpp:58
QWidget
KPIM::SSLLabel::Done
Definition: ssllabel.h:46
QLabel::setPixmap
void setPixmap(const QPixmap &)
ssllabel.h
KPIM::SSLLabel::setEncrypted
void setEncrypted(State enc=Encrypted)
Definition: ssllabel.cpp:48
KPIM::SSLLabel::Clean
Definition: ssllabel.h:45
KPIM::SSLLabel::Encrypted
Definition: ssllabel.h:43
QString
QWidget::hide
void hide()
KPIM::SSLLabel::State
State
Definition: ssllabel.h:42
KPIM::SSLLabel::lastState
State lastState() const
Definition: ssllabel.cpp:53
QLatin1String
KPIM::SSLLabel::SSLLabel
SSLLabel(QWidget *parent)
Definition: ssllabel.cpp:42
QWidget::show
void show()
QWidget::setToolTip
void setToolTip(const QString &)
QLabel
KPIM::SSLLabel::Unencrypted
Definition: ssllabel.h:44
KPIM::SSLLabel::Unknown
Definition: ssllabel.h:47
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:33:50 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

libkdepim

Skip menu "libkdepim"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Modules

kdepim API Reference

Skip menu "kdepim API Reference"
  • akonadi_next
  • akregator
  • blogilo
  • calendarsupport
  • console
  •   kabcclient
  •   konsolekalendar
  • kaddressbook
  • kalarm
  •   lib
  • kdgantt2
  • kjots
  • kleopatra
  • kmail
  • knode
  • knotes
  • kontact
  • korgac
  • korganizer
  • ktimetracker
  • libkdepim
  • libkleo
  • libkpgp
  • mailcommon
  • messagelist
  • messageviewer
  • pimprint

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal