1 /* CategoryView.h
2  *
3  * Copyright (C) 2006 Free Software Foundation, Inc.
4  *
5  * Author: Enrico Sersale <enrico@imago.ro>
6  * Date: December 2006
7  *
8  * This file is part of the GNUstep GWorkspace application
9  *
10  * This program is free software; you can redistribute it and/or modify
11  * it under the terms of the GNU General Public License as published by
12  * the Free Software Foundation; either version 2 of the License, or
13  * (at your option) any later version.
14  *
15  * This program is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18  * GNU General Public License for more details.
19  *
20  * You should have received a copy of the GNU General Public License
21  * along with this program; if not, write to the Free Software
22  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111 USA.
23  */
24 
25 #ifndef CATEGORIES_VIEW_H
26 #define CATEGORIES_VIEW_H
27 
28 #include <Foundation/Foundation.h>
29 #include <AppKit/NSView.h>
30 #include <AppKit/NSTextField.h>
31 
32 @class NSButton;
33 @class NSImage;
34 @class NSColor;
35 @class CViewTitleField;
36 @class CategoriesEditor;
37 
38 @interface CategoryView : NSView
39 {
40   NSMutableDictionary *catinfo;
41   CategoriesEditor *editor;
42 
43   NSButton *stateButton;
44   NSImage *icon;
45   CViewTitleField *titleField;
46   NSColor *backcolor;
47   NSImage *dragImage;
48   BOOL isDragTarget;
49   NSRect targetRects[2];
50   int insertpos;
51 }
52 
53 - (id)initWithCategoryInfo:(NSDictionary *)info
54                   inEditor:(CategoriesEditor *)aneditor;
55 
56 - (NSDictionary *)categoryInfo;
57 
58 - (int)index;
59 
60 - (void)setIndex:(int)index;
61 
62 - (void)createDragImage;
63 
64 - (void)stateButtonAction:(id)sender;
65 
66 - (unsigned int)draggingSourceOperationMaskForLocal:(BOOL)flag;
67 
68 - (NSDragOperation)draggingEntered:(id <NSDraggingInfo>)sender;
69 - (NSDragOperation)draggingUpdated:(id <NSDraggingInfo>)sender;
70 - (void)draggingExited:(id <NSDraggingInfo>)sender;
71 - (BOOL)prepareForDragOperation:(id <NSDraggingInfo>)sender;
72 - (BOOL)performDragOperation:(id <NSDraggingInfo>)sender;
73 - (void)concludeDragOperation:(id <NSDraggingInfo>)sender;
74 
75 @end
76 
77 
78 @interface CViewTitleField : NSTextField
79 {
80   CategoryView *cview;
81 }
82 
83 - (id)initWithFrame:(NSRect)rect
84      inCategoryView:(CategoryView *)view;
85 
86 @end
87 
88 #endif // CATEGORIES_VIEW_H
89 
90