File: ULDatabaseBrowser.h

package info (click to toggle)
adun.app 0.81-15
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 18,384 kB
  • sloc: objc: 70,952; ansic: 6,668; yacc: 394; python: 75; cpp: 36; makefile: 33; xml: 15; awk: 3
file content (126 lines) | stat: -rw-r--r-- 3,552 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
/* 
   Project: UL

   Copyright (C) 2006 Michael Johnston & Jordi Villa-Freixa

   Author: Michael Johnston

   This application is free software; you can redistribute it and/or
   modify it under the terms of the GNU General Public
   License as published by the Free Software Foundation; either
   version 2 of the License, or (at your option) any later version.
 
   This application is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   Library General Public License for more details.
 
   You should have received a copy of the GNU General Public
   License along with this library; if not, write to the Free
   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111 USA.
*/

#include <AppKit/AppKit.h>
#include "ULFramework/ULDatabaseInterface.h"
#include "ULProgressPanel.h"
#include "ULPasteboard.h"
#include "ULExportController.h"
#include "ULInterfaceFunctions.h"
#include "ULOutlineViewAdditions.h"

/**
Displays , and allows manipulation of, Adun data stored in multiple
databases.

\todo Implement multiple object removal.
\bug When moving, i.e. cutting & pasting, an object if the removal of the original object
fails the object is still copied. (The "cut" isnt performed until "paste" is selected")

\ingroup interface
*/

@interface ULDatabaseBrowser : NSObject <ULPasteboardDataSource>
{
	BOOL endPanel;	//!< If yes the progress panel should be stopped on next notification
	BOOL cut;	//!< Indicates wheather the editedObject should be cut 
	BOOL isActive;
	id editedObject; //!< The item selected for cut or copy
	NSOutlineView* browserView;
	id viewList;
	id databaseInterface;
	NSMutableArray* selectedDataSets;
	NSMutableArray* selectedOptions;
	NSMutableArray* selectedSystems;
	NSMutableArray* selectedSimulations;
	NSArray* allowedActions;
	id path;
	ULProgressPanel* progressPanel;
	//Datadisplay ivars
	NSMutableArray* currentObjects;	//!< The objects currently displayed
	NSMutableArray* oldObjects;	//!< Stores the objects displayed before reloadData is called.
}
/**
Documentation forthcoming
*/
- (void) setActive: (BOOL) value;
/**
Documentation forthcoming
*/
- (BOOL) isActive;
@end

/**
Category containing NSOutlineView delegate and data source methods
\ingroup interface
*/
@interface ULDatabaseBrowser (ULDatabaseBrowserDataDisplay)
/**
Must be called before reloadData is sent to the browser display.
This method ensures the objects displayed before the reload aren't
prematurely released
*/
- (void) willReloadData;
/**
Must be called after reloadData is sent to the browser display.
Frees all objects displayed before the reload was called.
*/
- (void) didReloadData;
@end

@interface ULDatabaseBrowserPath: NSObject
{
	NSMutableArray* path;
}
/**
Sets the item at level \e level to be \e object and truncates
the path if \e level is less than the current level
*/
- (void) setItem: (id)  object forLevel: (int) level;
/**
Returns the item for level \e level of the path
*/
- (id) itemForLevel: (int) level;
/**
Returns the current elements of the path
*/
- (NSArray*) currentPath;
/**
Returns the current depth of the path
*/
- (int) currentLevel;
/**
Truncates the path to level \e value. If value
is greater than the current number of levels an exception
is raised.
*/
- (BOOL) truncateToLevel: (int) value;
/**
Clears the path
*/
- (void) clearPath;
/**
Adds an item to the path, increasing the level count by one
*/
- (void) addItem: (id) object;
@end