blob: e903982129c90b8eee3d21068c71f87ec8f033cd [file] [log] [blame]
Alexandre Lision7fd5d3d2013-12-04 13:06:40 -05001/*
2 * Tivi client glue code for ZRTP.
3 * Copyright (c) 2012 Slient Circle LLC. All rights reserved.
4 *
5 *
6 * @author Werner Dittmann <Werner.Dittmann@t-online.de>
7 */
8
9/**
10 * Interfaces for Tivi callback classes.
11 *
12 * @author: Werner Dittmann <Werner.Dittmann@t-online.de>
13 */
14
15#ifndef _CTZRTPCALLBACK_H_
16#define _CTZRTPCALLBACK_H_
17
18#include <CtZrtpSession.h>
19
20/**
21 * @brief Tivi callback functions for state changes, warnings, and enrollment.
22 *
23 * The @c CtZrpSession and @c CtZrtpStream classes use these callbacks to inform
24 * the Tivi client about a new ZRTP state, if a @c Warning occured or if the
25 * client should display the @c Enrollment GUI.
26 */
27class __EXPORT CtZrtpCb {
28public:
29 /**
30 * @brief Destructor.
31 * Define a virtual destructor to enable cleanup in derived classes.
32 */
33 virtual ~CtZrtpCb() {};
34
35 virtual void onNewZrtpStatus(CtZrtpSession *session, char *p, CtZrtpSession::streamName streamNm) =0;
36 virtual void onNeedEnroll(CtZrtpSession *session, CtZrtpSession::streamName streamNm, int32_t info) =0;
37 virtual void onPeer(CtZrtpSession *session, char *name, int iIsVerified, CtZrtpSession::streamName streamNm) =0;
38 virtual void onZrtpWarning(CtZrtpSession *session, char *p, CtZrtpSession::streamName streamNm) =0;
39};
40
41
42/**
43 * @brief Tivi callback function to send a ZRTP packet via the RTP session.
44 *
45 * The @c CtZrtpStream class uses this callback to send a ZRTP packet via Tivi's
46 * RTP session.
47 */
48class __EXPORT CtZrtpSendCb {
49public:
50 /**
51 * @brief Destructor.
52 * Define a virtual destructor to enable cleanup in derived classes.
53 */
54 virtual ~CtZrtpSendCb() {};
55
56 virtual void sendRtp(CtZrtpSession const *session, uint8_t* packet, size_t length, CtZrtpSession::streamName streamNm) =0;
57};
58
59#endif