summaryrefslogtreecommitdiffstats
path: root/kshowmail/kwalletaccess.h
blob: 8e9c537e930209fad8ccf7ef0afe913bda0a81e5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
//
// C++ Interface: kwalletaccess
//
// Author: Ulrich Weigelt <ulrich.weigelt@gmx.de>, (C) 2007
//
// Copyright: See COPYING file that comes with this distribution
//
//
#ifndef KWALLETACCESS_H
#define KWALLETACCESS_H

//Qt headers
#include <qstring.h>

//KDE headers
#include <kwallet.h>
#include <kmessagebox.h>
#include <kdebug.h>
#include <klocale.h>

/**
 * @brief Provides routines to save and read passwords using KWallet.
 * @author Ulrich Weigelt <ulrich.weigelt@gmx.de>
 */
namespace KWalletAccess
{

  /**
   * Saves the given password into KWallet.
   * @param account account name
   * @param password the password
   * @return TRUE - password successfully saved
   * @return FALSE - password could not be saved
   */
  bool savePassword( const QString& account, const QString& password );

  /**
   * Returns the password of the given account.
   * @param account account name
   * @return the password or QString::null, if the sought password is not stored in KWallet.
   */
  QString getPassword( const QString& account );
}

#endif