messenger-cli

Command-line user interface for GNUnet Messenger
Log | Files | Refs | README | LICENSE

lobby_create_dialog.h (1984B)


      1 /*
      2    This file is part of GNUnet.
      3    Copyright (C) 2022--2023, 2026 GNUnet e.V.
      4 
      5    GNUnet is free software: you can redistribute it and/or modify it
      6    under the terms of the GNU Affero General Public License as published
      7    by the Free Software Foundation, either version 3 of the License,
      8    or (at your option) any later version.
      9 
     10    GNUnet is distributed in the hope that it will be useful, but
     11    WITHOUT ANY WARRANTY; without even the implied warranty of
     12    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
     13    Affero General Public License for more details.
     14 
     15    You should have received a copy of the GNU Affero General Public License
     16    along with this program.  If not, see <http://www.gnu.org/licenses/>.
     17 
     18    SPDX-License-Identifier: AGPL3.0-or-later
     19  */
     20 /*
     21  * @author Tobias Frisch
     22  * @file ui/lobby_create_dialog.h
     23  */
     24 
     25 #ifndef UI_LOBBY_CREATE_DIALOG_H_
     26 #define UI_LOBBY_CREATE_DIALOG_H_
     27 
     28 #include <curses.h>
     29 
     30 #include <gnunet/gnunet_chat_lib.h>
     31 #include <gnunet/gnunet_util_lib.h>
     32 
     33 struct MESSENGER_Application;
     34 
     35 /**
     36  * @struct UI_LOBBY_CREATE_DIALOG_Handle
     37  */
     38 typedef struct UI_LOBBY_CREATE_DIALOG_Handle
     39 {
     40   WINDOW *window;
     41   WINDOW **win;
     42 
     43   int line_prev;
     44   int line_next;
     45 
     46   int line_index;
     47   int line_offset;
     48   int line_selected;
     49 
     50   uint64_t selected;
     51 
     52   struct GNUNET_CHAT_Lobby *lobby;
     53   char *uri;
     54 } UI_LOBBY_CREATE_DIALOG_Handle;
     55 
     56 /**
     57  * Processes the current key event by the dialog
     58  * to create a lobby.
     59  *
     60  * @param[in,out] create_dialog Lobby creation dialog
     61  * @param[in,out] app Application handle
     62  * @param[in] key Key
     63  */
     64 void
     65 lobby_create_dialog_event(UI_LOBBY_CREATE_DIALOG_Handle *create_dialog,
     66 		          struct MESSENGER_Application *app,
     67 		          int key);
     68 
     69 /**
     70  * Prints the content of the dialog to create a
     71  * lobby to its selected window view.
     72  *
     73  * @param[in] create_dialog Lobby creation dialog
     74  */
     75 void
     76 lobby_create_dialog_print(UI_LOBBY_CREATE_DIALOG_Handle *create_dialog);
     77 
     78 #endif /* UI_LOBBY_CREATE_DIALOG_H_ */