]> err.no Git - sope/blob - sope-gdl1/GDLContentStore/GCSFolder.h
properly use system-lib-dir
[sope] / sope-gdl1 / GDLContentStore / GCSFolder.h
1 /*
2   Copyright (C) 2004-2005 SKYRIX Software AG
3
4   This file is part of OpenGroupware.org.
5
6   OGo is free software; you can redistribute it and/or modify it under
7   the terms of the GNU Lesser General Public License as published by the
8   Free Software Foundation; either version 2, or (at your option) any
9   later version.
10
11   OGo is distributed in the hope that it will be useful, but WITHOUT ANY
12   WARRANTY; without even the implied warranty of MERCHANTABILITY or
13   FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
14   License for more details.
15
16   You should have received a copy of the GNU Lesser General Public
17   License along with OGo; see the file COPYING.  If not, write to the
18   Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
19   02111-1307, USA.
20 */
21
22 #ifndef __GDLContentStore_GCSFolder_H__
23 #define __GDLContentStore_GCSFolder_H__
24
25 #import <Foundation/NSObject.h>
26
27 @class NSString, NSURL, NSNumber, NSArray, NSException, NSMutableString;
28 @class NSDictionary;
29 @class EOQualifier, EOFetchSpecification;
30 @class EOAdaptorChannel;
31 @class GCSFolderManager, GCSFolderType, GCSChannelManager;
32
33 @interface GCSFolder : NSObject
34 {
35   GCSFolderManager *folderManager;
36   GCSFolderType    *folderInfo;
37   
38   NSNumber *folderId;
39   NSString *folderName;
40   NSString *path;
41   NSURL    *location;
42   NSURL    *quickLocation;
43   NSString *folderTypeName;
44
45   struct {
46     int requiresFolderSelect:1;
47     int sameTableForQuick:1;
48     int reserved:30;
49   } ofFlags;
50 }
51
52 - (id)initWithPath:(NSString *)_path primaryKey:(id)_folderId
53   folderTypeName:(NSString *)_ftname folderType:(GCSFolderType *)_ftype
54   location:(NSURL *)_loc quickLocation:(NSURL *)_qloc
55   folderManager:(GCSFolderManager *)_fm;
56
57 /* accessors */
58
59 - (NSNumber *)folderId;
60 - (NSString *)folderName;
61 - (NSString *)path;
62 - (NSURL    *)location;
63 - (NSURL    *)quickLocation;
64 - (NSString *)folderTypeName;
65
66 - (GCSFolderManager *)folderManager;
67 - (GCSChannelManager *)channelManager;
68
69 - (NSString *)storeTableName;
70 - (NSString *)quickTableName;
71 - (BOOL)isQuickInfoStoredInContentTable;
72
73 /* connection */
74
75 - (EOAdaptorChannel *)acquireStoreChannel;
76 - (EOAdaptorChannel *)acquireQuickChannel;
77 - (void)releaseChannel:(EOAdaptorChannel *)_channel;
78
79 - (BOOL)canConnectStore;
80 - (BOOL)canConnectQuick;
81
82 /* operations */
83
84 - (NSArray *)subFolderNames;
85 - (NSArray *)allSubFolderNames;
86
87 - (NSString *)fetchContentWithName:(NSString *)_name;
88 - (NSException *)writeContent:(NSString *)_content toName:(NSString *)_name;
89 - (NSException *)deleteContentWithName:(NSString *)_name;
90
91 - (NSDictionary *)fetchContentsOfAllFiles;
92
93 - (NSArray *)fetchFields:(NSArray *)_flds 
94   fetchSpecification:(EOFetchSpecification *)_fs;
95 - (NSArray *)fetchFields:(NSArray *)_flds matchingQualifier:(EOQualifier *)_q;
96
97 @end
98
99 #endif /* __GDLContentStore_GCSFolder_H__ */