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

knode

  • sources
  • kde-4.12
  • kdepim
  • knode
knaccountmanager.h
Go to the documentation of this file.
1 /*
2  KNode, the KDE newsreader
3  Copyright (c) 1999-2005 the KNode authors.
4  See file AUTHORS for details
5 
6  This program is free software; you can redistribute it and/or modify
7  it under the terms of the GNU General Public License as published by
8  the Free Software Foundation; either version 2 of the License, or
9  (at your option) any later version.
10  You should have received a copy of the GNU General Public License
11  along with this program; if not, write to the Free Software Foundation,
12  Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, US
13 */
14 
15 #ifndef KNACCOUNTMANAGER_H
16 #define KNACCOUNTMANAGER_H
17 
18 #include "knnntpaccount.h"
19 
20 #include <QObject>
21 #include <qglobal.h>
22 #include <QList>
23 
24 namespace KWallet {
25  class Wallet;
26 }
27 
28 class KNGroupManager;
29 
30 
33 class KNAccountManager : public QObject
34 {
35  Q_OBJECT
36 
37  public:
42  explicit KNAccountManager( KNGroupManager *gm, QObject *parent = 0 );
45  ~KNAccountManager();
46 
48  void prepareShutdown();
49 
53  void setCurrentAccount( KNNntpAccount::Ptr a );
54 
58  bool newAccount( KNNntpAccount::Ptr a );
63  bool removeAccount( KNNntpAccount::Ptr a = KNNntpAccount::Ptr() );
67  void editProperties( KNNntpAccount::Ptr a = KNNntpAccount::Ptr() );
68  void accountRenamed( KNNntpAccount::Ptr a = KNNntpAccount::Ptr() );
69 
71  bool hasCurrentAccount() const { return c_urrentAccount != 0; }
73  KNNntpAccount::Ptr currentAccount() const { return c_urrentAccount; }
75  KNNntpAccount::Ptr account( int id );
77  KNNntpAccount::List accounts() const { return mAccounts; }
79  KNNntpAccount::Ptr first() const;
80 
82  void loadPasswords();
84  void loadPasswordsAsync();
85 
87  static KWallet::Wallet* wallet();
88 
89  protected:
90  void loadAccounts();
91  KNGroupManager *gManager;
92  KNNntpAccount::Ptr c_urrentAccount;
93 
94  signals:
95  void accountAdded( KNNntpAccount::Ptr a );
96  void accountRemoved( KNNntpAccount::Ptr a ); // don't do anything with a, it will be deleted soon
97  void accountModified( KNNntpAccount::Ptr a );
99  void passwordsChanged();
100 
101  private slots:
102  void slotWalletOpened( bool success );
103 
104  private:
106  static void prepareWallet();
107 
108  private:
109  KNNntpAccount::List mAccounts;
110  static KWallet::Wallet *mWallet;
111  static bool mWalletOpenFailed;
112  bool mAsyncOpening;
113 
114 };
115 
116 #endif
KNAccountManager::removeAccount
bool removeAccount(KNNntpAccount::Ptr a=KNNntpAccount::Ptr())
Remove an existing account.
Definition: knaccountmanager.cpp:132
KNAccountManager::wallet
static KWallet::Wallet * wallet()
Returns a pointer to an open wallet if available, 0 otherwise.
Definition: knaccountmanager.cpp:239
KNAccountManager::loadAccounts
void loadAccounts()
Definition: knaccountmanager.cpp:59
QObject
KNNntpAccount::Ptr
boost::shared_ptr< KNNntpAccount > Ptr
Shared pointer to a KNNntpAccount.
Definition: knnntpaccount.h:62
KNAccountManager::currentAccount
KNNntpAccount::Ptr currentAccount() const
Returns the current account.
Definition: knaccountmanager.h:73
KNAccountManager::gManager
KNGroupManager * gManager
Definition: knaccountmanager.h:91
knnntpaccount.h
KNAccountManager::accountAdded
void accountAdded(KNNntpAccount::Ptr a)
KNAccountManager::accountRemoved
void accountRemoved(KNNntpAccount::Ptr a)
KNAccountManager::newAccount
bool newAccount(KNNntpAccount::Ptr a)
Add a new account.
Definition: knaccountmanager.cpp:102
KNAccountManager::KNAccountManager
KNAccountManager(KNGroupManager *gm, QObject *parent=0)
Create a new account manager.
Definition: knaccountmanager.cpp:36
KNAccountManager::first
KNNntpAccount::Ptr first() const
Returns the first account (used as fallback sometimes).
Definition: knaccountmanager.cpp:199
KNAccountManager::loadPasswords
void loadPasswords()
Loads the passwords of all accounts, allows on-demand wallet opening.
Definition: knaccountmanager.cpp:231
KNAccountManager::editProperties
void editProperties(KNNntpAccount::Ptr a=KNNntpAccount::Ptr())
Show the properties dialog for the given account.
Definition: knaccountmanager.cpp:180
KNAccountManager::setCurrentAccount
void setCurrentAccount(KNNntpAccount::Ptr a)
Sets the current account.
Definition: knaccountmanager.cpp:95
KNAccountManager::passwordsChanged
void passwordsChanged()
Emitted if passwords have been loaded from the wallet.
KNAccountManager::prepareShutdown
void prepareShutdown()
Save all accounts.
Definition: knaccountmanager.cpp:52
KNAccountManager::accounts
KNNntpAccount::List accounts() const
Returns the list of all accounts.
Definition: knaccountmanager.h:77
KNAccountManager::accountRenamed
void accountRenamed(KNNntpAccount::Ptr a=KNNntpAccount::Ptr())
Definition: knaccountmanager.cpp:190
KNAccountManager::hasCurrentAccount
bool hasCurrentAccount() const
Returns true if there is a current account.
Definition: knaccountmanager.h:71
KNAccountManager
Account manager.
Definition: knaccountmanager.h:33
KNAccountManager::c_urrentAccount
KNNntpAccount::Ptr c_urrentAccount
Definition: knaccountmanager.h:92
KNAccountManager::loadPasswordsAsync
void loadPasswordsAsync()
Loads passwords of all accounts asynchronous.
Definition: knaccountmanager.cpp:207
KNAccountManager::accountModified
void accountModified(KNNntpAccount::Ptr a)
KNGroupManager
Group manager.
Definition: kngroupmanager.h:83
KNAccountManager::account
KNNntpAccount::Ptr account(int id)
Returns the account with the given id.
Definition: knaccountmanager.cpp:84
QList< KNNntpAccount::Ptr >
KNAccountManager::~KNAccountManager
~KNAccountManager()
Delete this account manager and all managed accounts.
Definition: knaccountmanager.cpp:44
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:58:36 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

knode

Skip menu "knode"
  • Main Page
  • Namespace List
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Related Pages

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