Stepan Salenikovich | 75a3917 | 2015-07-10 13:21:08 -0400 | [diff] [blame] | 1 | /* |
Guillaume Roguez | 2a6150d | 2017-07-19 18:24:47 -0400 | [diff] [blame^] | 2 | * Copyright (C) 2015-2017 Savoir-faire Linux Inc. |
Stepan Salenikovich | 75a3917 | 2015-07-10 13:21:08 -0400 | [diff] [blame] | 3 | * Author: Stepan Salenikovich <stepan.salenikovich@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, write to the Free Software |
| 17 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. |
Stepan Salenikovich | 75a3917 | 2015-07-10 13:21:08 -0400 | [diff] [blame] | 18 | */ |
| 19 | |
| 20 | #ifndef _ACCOUNTS_H |
| 21 | #define _ACCOUNTS_H |
| 22 | |
| 23 | #include <gtk/gtk.h> |
| 24 | |
Stepan Salenikovich | 30e134e | 2015-09-24 21:20:25 -0400 | [diff] [blame] | 25 | class Account; |
| 26 | |
Stepan Salenikovich | 75a3917 | 2015-07-10 13:21:08 -0400 | [diff] [blame] | 27 | /** |
| 28 | * returns TRUE if a RING account exists; FALSE otherwise |
| 29 | */ |
| 30 | gboolean |
| 31 | has_ring_account(); |
| 32 | |
| 33 | /** |
Stepan Salenikovich | 30e134e | 2015-09-24 21:20:25 -0400 | [diff] [blame] | 34 | * iterates through all existing accounts and make sure all RING accounts have |
Stepan Salenikovich | 75a3917 | 2015-07-10 13:21:08 -0400 | [diff] [blame] | 35 | * a display name set; if a display name is empty, it is set to the alias of the |
| 36 | * account |
| 37 | */ |
| 38 | void |
| 39 | force_ring_display_name(); |
| 40 | |
Stepan Salenikovich | 30e134e | 2015-09-24 21:20:25 -0400 | [diff] [blame] | 41 | /** |
| 42 | * Finds and returns the first RING account, in order of priority: |
| 43 | * 1. registered |
| 44 | * 2. enabled |
| 45 | * 3. existing |
| 46 | * |
| 47 | * Returns a nullptr if no RING acconts exist |
| 48 | */ |
| 49 | Account* |
| 50 | get_active_ring_account(); |
| 51 | |
Stepan Salenikovich | 75a3917 | 2015-07-10 13:21:08 -0400 | [diff] [blame] | 52 | #endif /* _ACCOUNTS_H */ |