Add GNU LGPL headers to all .c .C and .h files
[oweals/cde.git] / cde / lib / tt / lib / api / c / api_typecb.h
1 /*
2  * CDE - Common Desktop Environment
3  *
4  * Copyright (c) 1993-2012, The Open Group. All rights reserved.
5  *
6  * These libraries and programs are free software; you can
7  * redistribute them and/or modify them under the terms of the GNU
8  * Lesser General Public License as published by the Free Software
9  * Foundation; either version 2 of the License, or (at your option)
10  * any later version.
11  *
12  * These libraries and programs are distributed in the hope that
13  * they will be useful, but WITHOUT ANY WARRANTY; without even the
14  * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
15  * PURPOSE. See the GNU Lesser General Public License for more
16  * details.
17  *
18  * You should have received a copy of the GNU Lesser General Public
19  * License along with these librararies and programs; if not, write
20  * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
21  * Floor, Boston, MA 02110-1301 USA
22  */
23 /*%%  (c) Copyright 1993, 1994 Hewlett-Packard Company                   */
24 /*%%  (c) Copyright 1993, 1994 International Business Machines Corp.     */
25 /*%%  (c) Copyright 1993, 1994 Sun Microsystems, Inc.                    */
26 /*%%  (c) Copyright 1993, 1994 Novell, Inc.                              */
27 /*%%  $TOG: api_typecb.h /main/5 1999/10/14 18:40:11 mgreess $                                                   */
28 /* -*-C++-*-
29  *
30  * @(#)api_typecb.h     1.2 93/07/30 SMI
31  *
32  * Copyright (c) 1993 by Sun Microsystems, Inc.
33  * 
34  * _Tt_typecb is a class which holds a <typename, opnum, callback list>
35  * triple.  Tables of these are attached to _Tt_c_procid instances to hold
36  * the callbacks registerd by tt_ptype_opnum_callback_add and
37  * tt_otype_opnum_callback_add.
38  */
39
40 #ifndef _API_TYPECB_H
41 #define _API_TYPECB_H
42
43 #include "util/tt_object.h"
44 #include "api/c/tt_c.h"
45 #include "api/c/api_handle.h"
46
47 #if defined(linux)
48 // Avoid g++ compiler errors on linux.
49 #define typename typenm
50 #endif
51
52 class _Tt_typecb : public _Tt_object {
53       public:
54         _Tt_typecb();
55         _Tt_typecb(const _Tt_string &typenm, int opnum);
56         virtual ~_Tt_typecb();
57         _Tt_string &    get_typename();
58         int             opnum();
59         void            add_callback(Tt_message_callback f);
60         Tt_callback_action run_callbacks(Tt_message mh, Tt_pattern ph);
61         void           *clientdata;
62       private:
63         _Tt_string      _typename;
64         int             _opnum;
65         _Tt_api_callback_list_ptr cblp;
66 };
67         
68
69
70 #endif                          /* _MP_PATTERN_H */