2014-02-25 02:28:24 -05: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 17:03:22 -04:00
|
|
|
*/
|
|
|
|
|
2014-09-22 21:24:45 -04:00
|
|
|
#ifndef PROMPT_H
|
|
|
|
#define PROMPT_H
|
2013-08-13 10:50:43 +12:00
|
|
|
|
2014-06-11 18:06:55 -04:00
|
|
|
#include "toxic.h"
|
|
|
|
#include "windows.h"
|
2013-12-04 18:09:51 -05:00
|
|
|
|
2014-08-07 13:05:42 -04:00
|
|
|
#define MAX_FRIEND_REQUESTS 32
|
|
|
|
|
2014-09-22 21:24:45 -04:00
|
|
|
struct friend_request {
|
2014-08-19 20:49:29 -04: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-19 20:49:29 -04:00
|
|
|
};
|
|
|
|
|
2014-08-07 13:05:42 -04:00
|
|
|
typedef struct {
|
2014-08-19 20:49:29 -04:00
|
|
|
int max_idx;
|
|
|
|
int num_requests;
|
2014-09-22 21:24:45 -04:00
|
|
|
struct friend_request request[MAX_FRIEND_REQUESTS];
|
2014-09-28 17:49:48 -04:00
|
|
|
} FriendRequests;
|
2014-08-07 13:05:42 -04:00
|
|
|
|
2013-09-19 17:03:22 -04:00
|
|
|
ToxWindow new_prompt(void);
|
2015-08-27 03:38:08 -04:00
|
|
|
|
2013-12-06 05:07:35 -05:00
|
|
|
void prep_prompt_win(void);
|
2013-09-06 19:59:45 -04:00
|
|
|
void prompt_init_statusbar(ToxWindow *self, Tox *m);
|
2014-07-29 14:54:34 -04:00
|
|
|
void prompt_update_nick(ToxWindow *prompt, const char *nick);
|
2014-08-12 03:01:18 -04:00
|
|
|
void prompt_update_statusmessage(ToxWindow *prompt, Tox *m, const char *statusmsg);
|
2015-03-25 22:56:45 -04:00
|
|
|
void prompt_update_status(ToxWindow *prompt, TOX_USER_STATUS status);
|
2013-09-18 17:30:35 -04:00
|
|
|
void prompt_update_connectionstatus(ToxWindow *prompt, bool is_connected);
|
2014-07-08 19:24:44 -04:00
|
|
|
void kill_prompt_window(ToxWindow *self);
|
2013-08-13 10:50:43 +12:00
|
|
|
|
2015-03-28 02:56:54 -04:00
|
|
|
/* callback: Updates own connection status in prompt statusbar */
|
|
|
|
void prompt_onSelfConnectionChange(Tox *m, TOX_CONNECTION connection_status, void *userdata);
|
|
|
|
|
2018-02-25 00:00:06 -05:00
|
|
|
/* Returns our own connection status */
|
|
|
|
TOX_CONNECTION prompt_selfConnectionStatus(void);
|
|
|
|
|
2014-09-22 21:24:45 -04:00
|
|
|
#endif /* end of include guard: PROMPT_H */
|