2014-02-25 08:28:24 +01:00
|
|
|
/* prompt.h
|
|
|
|
*
|
|
|
|
*
|
|
|
|
* Copyright (C) 2014 Toxic All Rights Reserved.
|
|
|
|
*
|
|
|
|
* This file is part of Toxic.
|
|
|
|
*
|
|
|
|
* Toxic is free software: you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation, either version 3 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* Toxic is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with Toxic. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*
|
2013-09-19 23:03:22 +02:00
|
|
|
*/
|
|
|
|
|
2014-09-23 03:24:45 +02:00
|
|
|
#ifndef PROMPT_H
|
|
|
|
#define PROMPT_H
|
2013-08-13 00:50:43 +02:00
|
|
|
|
2014-06-12 00:06:55 +02:00
|
|
|
#include "toxic.h"
|
|
|
|
#include "windows.h"
|
2013-12-05 00:09:51 +01:00
|
|
|
|
2014-08-07 19:05:42 +02:00
|
|
|
#define MAX_FRIEND_REQUESTS 32
|
|
|
|
|
2014-09-23 03:24:45 +02:00
|
|
|
struct friend_request {
|
2014-08-20 02:49:29 +02:00
|
|
|
bool active;
|
|
|
|
char msg[MAX_STR_SIZE];
|
2015-02-01 21:09:48 +01:00
|
|
|
uint8_t key[TOX_PUBLIC_KEY_SIZE];
|
2014-08-20 02:49:29 +02:00
|
|
|
};
|
|
|
|
|
2014-08-07 19:05:42 +02:00
|
|
|
typedef struct {
|
2014-08-20 02:49:29 +02:00
|
|
|
int max_idx;
|
|
|
|
int num_requests;
|
2014-09-23 03:24:45 +02:00
|
|
|
struct friend_request request[MAX_FRIEND_REQUESTS];
|
2014-09-28 23:49:48 +02:00
|
|
|
} FriendRequests;
|
2014-08-07 19:05:42 +02:00
|
|
|
|
2013-09-19 23:03:22 +02:00
|
|
|
ToxWindow new_prompt(void);
|
2015-08-27 09:38:08 +02:00
|
|
|
|
2013-12-06 11:07:35 +01:00
|
|
|
void prep_prompt_win(void);
|
2013-09-07 01:59:45 +02:00
|
|
|
void prompt_init_statusbar(ToxWindow *self, Tox *m);
|
2014-07-29 20:54:34 +02:00
|
|
|
void prompt_update_nick(ToxWindow *prompt, const char *nick);
|
2014-08-12 09:01:18 +02:00
|
|
|
void prompt_update_statusmessage(ToxWindow *prompt, Tox *m, const char *statusmsg);
|
2015-03-26 03:56:45 +01:00
|
|
|
void prompt_update_status(ToxWindow *prompt, TOX_USER_STATUS status);
|
2013-09-18 23:30:35 +02:00
|
|
|
void prompt_update_connectionstatus(ToxWindow *prompt, bool is_connected);
|
2014-07-09 01:24:44 +02:00
|
|
|
void kill_prompt_window(ToxWindow *self);
|
2013-08-13 00:50:43 +02:00
|
|
|
|
2015-03-28 07:56:54 +01:00
|
|
|
/* callback: Updates own connection status in prompt statusbar */
|
|
|
|
void prompt_onSelfConnectionChange(Tox *m, TOX_CONNECTION connection_status, void *userdata);
|
|
|
|
|
2018-02-25 06:00:06 +01:00
|
|
|
/* Returns our own connection status */
|
|
|
|
TOX_CONNECTION prompt_selfConnectionStatus(void);
|
|
|
|
|
2014-09-23 03:24:45 +02:00
|
|
|
#endif /* end of include guard: PROMPT_H */
|