1 /* 2 Copyright (c) 2007-2013 uim Project https://github.com/uim/uim 3 4 All rights reserved. 5 6 Redistribution and use in source and binary forms, with or without 7 modification, are permitted provided that the following conditions 8 are met: 9 10 1. Redistributions of source code must retain the above copyright 11 notice, this list of conditions and the following disclaimer. 12 2. Redistributions in binary form must reproduce the above copyright 13 notice, this list of conditions and the following disclaimer in the 14 documentation and/or other materials provided with the distribution. 15 3. Neither the name of authors nor the names of its contributors 16 may be used to endorse or promote products derived from this software 17 without specific prior written permission. 18 19 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS'' AND 20 ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 21 IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 22 ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE 23 FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 24 DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 25 OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 26 HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 27 LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 28 OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 29 SUCH DAMAGE. 30 31 */ 32 33 /* !WARNING! 34 35 This API is experimental and unstable. 36 37 */ 38 39 /* 40 * It is notification plugin's responsibility to convert messages into 41 * encoding suitable for the notification agents. Messages are assumed to 42 * be tranlated by gettext into the encoding of working locale of the process. 43 */ 44 45 #ifndef UIM_NOTIFY_H 46 #define UIM_NOTIFY_H 47 48 #ifdef __cplusplus 49 extern "C" { 50 #endif 51 52 typedef struct uim_notify_desc_ { 53 const char *name; 54 const char *desc; 55 } uim_notify_desc; 56 57 /* API for notification facility users */ 58 uim_bool uim_notify_init(void); 59 void uim_notify_quit(void); 60 uim_bool uim_notify_load(const char *name); 61 62 const uim_notify_desc *uim_notify_get_desc(void); 63 uim_bool uim_notify_info(const char *msg_fmt, ...); 64 uim_bool uim_notify_fatal(const char *msg_fmt, ...); 65 66 /* API for pluggable notification agent implementors */ 67 uim_bool uim_notify_plugin_init(void); 68 void uim_notify_plugin_quit(void); 69 const uim_notify_desc *uim_notify_plugin_get_desc(void); 70 uim_bool uim_notify_plugin_info(const char *msg); 71 uim_bool uim_notify_plugin_fatal(const char *msg); 72 73 #ifdef __cplusplus 74 } 75 #endif 76 77 #endif /* UIM_NOTIFY_H */ 78