Debian Codegraph @

src/af/xap/cocoa/xap_CocoaToolbar_Icons.h

raw
1 /* -*- mode: C++; tab-width: 4; c-basic-offset: 4; -*- */
2
3 /* AbiSource Application Framework
4 * Copyright (C) 1998 AbiSource, Inc.
5 * Copyright (C) 2001 Hubert Figuiere
6 *
7 * This program is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License
9 * as published by the Free Software Foundation; either version 2
10 * of the License, or (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
20 * 02110-1301 USA.
21 */
22
23 #ifndef XAP_COCOATOOLBARICONS_H
24 #define XAP_COCOATOOLBARICONS_H
25
26 #import <Cocoa/Cocoa.h>
27
28 #include "ut_types.h"
29
30 #include "xap_Toolbar_Icons.h"
31
32 /*****************************************************************/
33
34 @class XAP_CocoaToolbarButton;
35
36 @protocol XAP_CocoaButtonController
37 - (void)menuWillActivate:(NSMenu *)menu forButton:(XAP_CocoaToolbarButton *)button;
38 @end
39
40 @interface XAP_CocoaToolbarButton : NSButton
41 {
42 NSMenu * m_menu;
43 id <XAP_CocoaButtonController> m_controller;
44 }
45 - (id)initWithFrame:(NSRect)frameRect;
46 - (void)setMenu:(NSMenu *)menu withController:(id <XAP_CocoaButtonController>)controller;
47 - (void)mouseDown:(NSEvent *)theEvent;
48 - (void)drawRect:(NSRect)aRect;
49 @end
50
51 class XAP_CocoaToolbar_Icons : public XAP_Toolbar_Icons
52 {
53 public:
54 XAP_CocoaToolbar_Icons(void);
55 ~XAP_CocoaToolbar_Icons(void);
56
57 NSImage * getPixmapForIcon(const char * szIconID); // the ID is an internal AbiWord identifier
58
59 static NSString * getPNGNameForIcon(const char * szIconID);
60 static NSString * getFilenameForIcon(NSString * szIconName); // e.g., the PNGName from the above method
61
62 protected:
63 };
64
65 #endif /* XAP_COCOATOOLBARICONS_H */