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

libkdepim

  • sources
  • kde-4.12
  • 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 namespace KPIM {
41 
42 SSLLabel::SSLLabel( QWidget* parent )
43  : QLabel( parent )
44 {
45  setState( Done );
46 }
47 
48 void SSLLabel::setEncrypted( bool enc )
49 {
50  if ( enc ) {
51  m_lastEncryptionState = Encrypted;
52  } else {
53  m_lastEncryptionState = Unencrypted;
54  }
55 }
56 
57 SSLLabel::State SSLLabel::lastState() const
58 {
59  return m_lastEncryptionState;
60 }
61 
62 void SSLLabel::setState( State state )
63 {
64  switch( state ) {
65  case Encrypted:
66  this->setToolTip( i18n("Connection is encrypted") );
67  setPixmap( SmallIcon( QLatin1String("security-high") ) );
68  show();
69  break;
70  case Unencrypted:
71  this->setToolTip( i18n("Connection is unencrypted") );
72  setPixmap( SmallIcon( QLatin1String("security-low") ) );
73  show();
74  break;
75  case Done:
76  this->setToolTip(QString());
77  hide();
78  break;
79  case Clean:
80  default:
81  this->setToolTip(QString());
82  hide();
83  //we return because we do not save the state as the only
84  //action we want to perform is to hide ourself
85  return;
86  }
87  m_lastEncryptionState = state;
88 }
89 
90 
91 } //end namespace KPIM
92 
KPIM::SSLLabel::setState
void setState(State state)
Definition: ssllabel.cpp:62
KPIM::SSLLabel::Done
Definition: ssllabel.h:46
QWidget
ssllabel.h
KPIM::SSLLabel::Clean
Definition: ssllabel.h:45
KPIM::SSLLabel::Encrypted
Definition: ssllabel.h:43
KPIM::SSLLabel::lastState
State lastState() const
Definition: ssllabel.cpp:57
KPIM::SSLLabel::State
State
Definition: ssllabel.h:42
QLabel
KPIM::SSLLabel::setEncrypted
void setEncrypted(bool enc=true)
Definition: ssllabel.cpp:48
KPIM::SSLLabel::SSLLabel
SSLLabel(QWidget *parent)
Definition: ssllabel.cpp:42
KPIM::SSLLabel::Unencrypted
Definition: ssllabel.h:44
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:58:03 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

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