]> err.no Git - scalable-opengroupware.org/commitdiff
Plain stupid first version of SOGoLogic
authorznek <znek@d1b88da0-ebda-0310-925b-ed51d893ca5b>
Sun, 27 Jun 2004 22:12:38 +0000 (22:12 +0000)
committerznek <znek@d1b88da0-ebda-0310-925b-ed51d893ca5b>
Sun, 27 Jun 2004 22:12:38 +0000 (22:12 +0000)
git-svn-id: http://svn.opengroupware.org/SOGo/trunk@64 d1b88da0-ebda-0310-925b-ed51d893ca5b

SOGoLogic/ChangeLog [new file with mode: 0644]
SOGoLogic/GNUmakefile [new file with mode: 0644]
SOGoLogic/SOGoAppointment.h [new file with mode: 0644]
SOGoLogic/SOGoAppointment.m [new file with mode: 0644]
SOGoLogic/Version [new file with mode: 0644]

diff --git a/SOGoLogic/ChangeLog b/SOGoLogic/ChangeLog
new file mode 100644 (file)
index 0000000..f66d082
--- /dev/null
@@ -0,0 +1,3 @@
+2004-06-25  Marcus Mueller  <znek@mulle-kybernetik.com>
+
+       * created.
\ No newline at end of file
diff --git a/SOGoLogic/GNUmakefile b/SOGoLogic/GNUmakefile
new file mode 100644 (file)
index 0000000..76e9dfd
--- /dev/null
@@ -0,0 +1,23 @@
+# $Id$
+
+include $(GNUSTEP_MAKEFILES)/common.make
+
+include Version
+
+LIBRARY_NAME = libSOGoLogic
+
+libSOGoLogic_HEADER_FILES_DIR         = .
+libSOGoLogic_HEADER_FILES_INSTALL_DIR = /SOGoLogic
+libSOGoLogic_SOVERSION=$(MAJOR_VERSION).$(MINOR_VERSION)
+
+libSOGoLogic_HEADER_FILES += \
+       SOGoAppointment.h \
+
+libSOGoLogic_OBJC_FILES += \
+       SOGoAppointment.m       \
+
+libSOGoLogic_LIBRARY_DEPENDS_UPON += -lNGiCal
+
+-include GNUmakefile.preamble
+include $(GNUSTEP_MAKEFILES)/library.make
+-include GNUmakefile.postamble
diff --git a/SOGoLogic/SOGoAppointment.h b/SOGoLogic/SOGoAppointment.h
new file mode 100644 (file)
index 0000000..a85331b
--- /dev/null
@@ -0,0 +1,42 @@
+/*
+  Copyright (C) 2000-2004 SKYRIX Software AG
+
+  This file is part of OpenGroupware.org.
+
+  OGo is free software; you can redistribute it and/or modify it under
+  the terms of the GNU Lesser General Public License as published by the
+  Free Software Foundation; either version 2, or (at your option) any
+  later version.
+
+  OGo 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 Lesser General Public
+  License for more details.
+
+  You should have received a copy of the GNU Lesser General Public
+  License along with OGo; see the file COPYING.  If not, write to the
+  Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
+  02111-1307, USA.
+*/
+// $Id$
+
+
+#ifndef        __SOGoAppointment_H_
+#define        __SOGoAppointment_H_
+
+
+#import <Foundation/Foundation.h>
+
+
+@interface SOGoAppointment : NSObject
+{
+    id event;
+}
+
+- (id)initWithiCalString:(NSString *)_iCal;
+
+- (id)event;
+
+@end
+
+#endif /* __SOGoAppointment_H_ */
diff --git a/SOGoLogic/SOGoAppointment.m b/SOGoLogic/SOGoAppointment.m
new file mode 100644 (file)
index 0000000..ede2088
--- /dev/null
@@ -0,0 +1,72 @@
+/*
+  Copyright (C) 2000-2004 SKYRIX Software AG
+
+  This file is part of OpenGroupware.org.
+
+  OGo is free software; you can redistribute it and/or modify it under
+  the terms of the GNU Lesser General Public License as published by the
+  Free Software Foundation; either version 2, or (at your option) any
+  later version.
+
+  OGo 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 Lesser General Public
+  License for more details.
+
+  You should have received a copy of the GNU Lesser General Public
+  License along with OGo; see the file COPYING.  If not, write to the
+  Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
+  02111-1307, USA.
+*/
+// $Id$
+
+
+#include "SOGoAppointment.h"
+#include <SaxObjC/SaxObjC.h>
+
+
+@implementation SOGoAppointment
+
+- (id)initWithiCalString:(NSString *)_iCal {
+    if ((self = [self init])) {
+        id<NSObject,SaxXMLReader> parser;
+        SaxObjectDecoder *sax;
+
+        parser =
+            [[[SaxXMLReaderFactory standardXMLReaderFactory] 
+              createXMLReaderForMimeType:@"text/calendar"]
+              retain];
+        if (parser == nil) {
+            NSLog(@"did not find a parser for text/calendar !");
+            [self release];
+            return nil;
+        }
+        
+        sax = [[SaxObjectDecoder alloc] initWithMappingNamed:@"NGiCal"];
+        if (sax == nil) {
+            NSLog(@"could not create the iCal SAX handler !");
+            [self release];
+            return nil;
+        }
+        
+        [parser setContentHandler:sax];
+        [parser setErrorHandler:sax];
+        
+        [parser parseFromSource:_iCal];
+        self->event = [[sax rootObject] retain];
+        [parser release];
+        [sax release];
+    }
+    return self;
+}
+
+- (void)dealloc {
+    [self->event release];
+    [super dealloc];
+}
+
+- (id)event {
+    return self->event;
+}
+
+@end
diff --git a/SOGoLogic/Version b/SOGoLogic/Version
new file mode 100644 (file)
index 0000000..237a590
--- /dev/null
@@ -0,0 +1,3 @@
+# $Id$
+
+SUBMINOR_VERSION:=1