messenger-gtk

Gtk+3 graphical user interfaces for GNUnet Messenger
Log | Files | Refs | Submodules | README | LICENSE

discourse_panel.h (2122B)


      1 /*
      2    This file is part of GNUnet.
      3    Copyright (C) 2024 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/discourse_panel.h
     23  */
     24 
     25 #ifndef UI_DISCOURSE_PANEL_H_
     26 #define UI_DISCOURSE_PANEL_H_
     27 
     28 #include "messenger.h"
     29 
     30 #include <gnunet/gnunet_chat_lib.h>
     31 
     32 typedef struct UI_DISCOURSE_PANEL_Handle
     33 {
     34   const struct GNUNET_CHAT_Contact *contact;
     35 
     36   GtkBuilder *builder;
     37 
     38   GtkWidget *panel_box;
     39 
     40   GtkStack *panel_stack;
     41   GtkWidget *avatar_box;
     42 
     43   HdyAvatar *panel_avatar;
     44   GtkLabel *panel_label;
     45 
     46   GtkWidget *video_box;
     47 } UI_DISCOURSE_PANEL_Handle;
     48 
     49 /**
     50  * Allocates and creates a new discourse panel
     51  * handle to visualize a contact in a discourse
     52  * a given messenger application.
     53  *
     54  * @param app Messenger application
     55  * @return New discourse panel handle
     56  */
     57 UI_DISCOURSE_PANEL_Handle*
     58 ui_discourse_panel_new(MESSENGER_Application *app);
     59 
     60 /**
     61  * Sets the content of the given discourse panel
     62  * handle respectively to visually represent a
     63  * selected chat contact.
     64  *
     65  * @param handle Discourse panel handle
     66  * @param contact Chat contact
     67  */
     68 void
     69 ui_discourse_panel_set_contact(UI_DISCOURSE_PANEL_Handle* handle,
     70                                const struct GNUNET_CHAT_Contact *contact);
     71 
     72 /**
     73  * Frees its resources and destroys a given
     74  * discourse panel handle.
     75  *
     76  * @param handle Discourse panel handle
     77  */
     78 void
     79 ui_discourse_panel_delete(UI_DISCOURSE_PANEL_Handle *handle);
     80 
     81 #endif /* UI_DISCOURSE_PANEL_H_ */