1 /* GormShelfPref.h
2  *
3  * Copyright (C) 2003 Free Software Foundation, Inc.
4  *
5  * Author: Gregory Casamento <greg_casamento@yahoo.com>
6  * Date: February 2004
7  *
8  * Author: Enrico Sersale <enrico@imago.ro>
9  * Date: August 2001
10  *
11  * This class is heavily based on work done by Enrico Sersale
12  * on ShelfPref.h for GWorkspace.
13  *
14  * This program is free software; you can redistribute it and/or modify
15  * it under the terms of the GNU General Public License as published by
16  * the Free Software Foundation; either version 3 of the License, or
17  * (at your option) any later version.
18  *
19  * This program is distributed in the hope that it will be useful,
20  * but WITHOUT ANY WARRANTY; without even the implied warranty of
21  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
22  * GNU General Public License for more details.
23  *
24  * You should have received a copy of the GNU General Public License
25  * along with this program; if not, write to the Free Software
26  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
27  */
28 
29 #ifndef GORMSHELFPREF_H
30 #define GORMSHELFPREF_H
31 
32 #include <AppKit/NSView.h>
33 #include <Foundation/NSObject.h>
34 
35 typedef enum {
36 	leftarrow,
37 	rightarrow
38 } ArrowPosition;
39 
40 @class NSEvent;
41 @class NSNotification;
42 
43 @interface ArrResizer : NSView
44 {
45   NSImage *arrow;
46   ArrowPosition position;
47   id controller;
48 }
49 
50 - (id)initForController:(id)acontroller
51            withPosition:(ArrowPosition)pos;
52 
53 - (ArrowPosition)position;
54 
55 @end
56 
57 @interface GormShelfPref : NSObject
58 {
59   IBOutlet id win;
60   IBOutlet id prefbox;
61   IBOutlet id iconbox;
62   IBOutlet id imView;
63   IBOutlet id leftResBox;
64   IBOutlet id rightResBox;
65   IBOutlet id nameField;
66   IBOutlet id setButt;
67 
68   ArrResizer *leftResizer;
69   ArrResizer *rightResizer;
70   NSString *fname;
71   int cellsWidth;
72 }
73 
74 /**
75  * Sets the frame for the resize arrows.
76  */
77 - (void)tile;
78 
79 /**
80  * Called when the selection is changed.
81  */
82 - (void)selectionChanged:(NSNotification *)n;
83 
84 /**
85  * Invoked when the resizer widgets are moved.
86  */
87 - (void)startMouseEvent:(NSEvent *)event
88               onResizer:(ArrResizer *)resizer;
89 
90 /**
91  * Programmatically set a width.
92  */
93 - (void)setNewWidth:(int)w;
94 
95 /**
96  * Set the resizer back to the default width.
97  */
98 - (IBAction)setDefaultWidth:(id)sender;
99 
100 /**
101  * The view to display in the prefs panel.
102  */
103 - (NSView *)view;
104 
105 /**
106  * Return the current width.
107  */
108 - (int) shelfCellsWidth;
109 @end
110 
111 #endif
112