Add GNU LGPL headers to all .c .C and .h files
[oweals/cde.git] / cde / programs / dtprintinfo / libUI / MotifUI / Menu.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 /* $XConsortium: Menu.h /main/3 1995/11/06 09:43:09 rswiston $ */
24 /*                                                                      *
25  * (c) Copyright 1993, 1994 Hewlett-Packard Company                     *
26  * (c) Copyright 1993, 1994 International Business Machines Corp.       *
27  * (c) Copyright 1993, 1994 Sun Microsystems, Inc.                      *
28  * (c) Copyright 1993, 1994 Novell, Inc.                                *
29  */
30
31 #ifndef MENU_H
32 #define MENU_H
33
34 #include "MotifUI.h"
35
36 class Menu : public MotifUI {
37
38    static void MapCB(Widget, XtPointer, XtPointer);
39    friend void MapCB(Widget, XtPointer, XtPointer);
40
41  protected:
42
43    Widget _cascadeButton;
44    Widget _title;
45    Widget _sep;
46    MenuType _menu_type;
47
48    void CreateMenu(Widget parent, char *name, char *category,
49                    char *mnemonic, MenuType menu_type);
50    void CreateTitle(Widget, char *title, char *category);
51    boolean SetName(char *name);
52
53  public:
54
55    Menu(char *category,
56         MotifUI *parent,
57         char *name,
58         char *mnemonic = NULL,
59         MenuType menu_type = PULLDOWN_MENU);
60    Menu(char *category,
61         MotifUI *parent,
62         boolean has_title,
63         char *title,
64         char *name,
65         char *mnemonic = NULL,
66         MenuType menu_type = PULLDOWN_MENU);
67    Menu(MotifUI *parent,
68         char *name,
69         char *mnemonic = NULL,
70         MenuType menu_type = PULLDOWN_MENU);
71    Menu(MotifUI *parent,
72         boolean has_title,
73         char *title,
74         char *name,
75         char *mnemonic = NULL,
76         MenuType menu_type = PULLDOWN_MENU);
77
78    void SetRadio(boolean flag);
79    Widget GetCascade() { return _cascadeButton; }
80    boolean SetActivity(boolean flag);
81
82    const UI_Class UIClass()         { return MENU; }
83    const int UISubClass()           { return _menu_type; }
84    const char *const UIClassName()  { return "Menu"; }
85
86 };
87
88 #endif /* MENU_H */