]> err.no Git - sope/blob - sope-mime/NGImap4/NGSieveClient.h
minor code cleanups
[sope] / sope-mime / NGImap4 / NGSieveClient.h
1 /*
2   Copyright (C) 2000-2004 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 __Networking_NGImap4_NGSieveClient_H__
23 #define __Networking_NGImap4_NGSieveClient_H__
24
25 #import <Foundation/NSObject.h>
26 #include <NGStreams/NGStreams.h>
27 #include <NGStreams/NGSocketProtocols.h>
28 #include <NGImap4/NGImap4Support.h>
29 #include <NGImap4/NGImap4ResponseParser.h>
30
31 @class NSMutableArray, NSString, NSNumber, NSDictionary, NSArray;
32 @class NGSieveResponseParser, EOQualifier, NGHashMap;
33
34 typedef enum {
35   UnConnected_NGSieveState = 1,
36   NonAuthenticated_NGSieveState,
37   Authenticated_NGSieveState,
38 } NGSieveState;
39
40 @interface NGSieveClient : NSObject
41 {
42 @protected
43   id<NGActiveSocket>       socket;
44   id<NGExtendedTextStream> text;
45   id<NGSocketAddress>      address;
46   NGImap4ResponseParser    *parser;
47
48   BOOL     isLogin;
49
50   NSString *login;
51   NSString *password;
52
53   BOOL debug;
54 }
55
56 + (id)clientWithAddress:(id<NGSocketAddress>)_address;
57 + (id)clientWithHost:(id)_host;
58
59 - (id)initWithHost:(id)_host;
60 - (id)initWithAddress:(id<NGSocketAddress>)_address;
61
62 /* accessors */
63
64 - (id<NGActiveSocket>)socket;
65 - (id<NGSocketAddress>)address;
66
67 /* connection */
68
69 - (NSDictionary *)openConnection;
70 - (void)closeConnection;
71 - (NSNumber *)isConnected;
72 - (void)reconnect;
73
74 /* commands */
75
76 - (NSDictionary *)login:(NSString *)_login password:(NSString *)_passwd;
77 - (NSDictionary *)logout;
78
79 - (NSDictionary *)getScript:(NSString *)_scriptName;
80 - (NSDictionary *)putScript:(NSString *)_name script:(NSString *)_script;
81 - (NSDictionary *)setActiveScript:(NSString *)_name;
82 - (NSDictionary *)deleteScript:(NSString *)_script;
83 - (NSDictionary *)listScript:(NSString *)_script;
84
85 /* equality */
86
87 - (BOOL)isEqualToSieveClient:(NGSieveClient *)_obj;
88
89 @end
90
91 #endif /* __Networking_NGSieve_NGSieveClient_H__ */