mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-11-22 07:14:21 +00:00
See ChangeLog
Monotone-Parent: 15a323395e06e9dba494ab7c7ad2871d2e95bdd4 Monotone-Revision: 048651c03289ee8aea9a9d3d3088a91e534dbe5b Monotone-Author: ludovic@Sophos.ca Monotone-Date: 2009-12-22T22:45:37 Monotone-Branch: ca.inverse.sogo
This commit is contained in:
1 parent
8ee88b6a42
commit
84b7582e03
37 files changed
+101
-673
No files matched your search
@@ -26,11 +26,6 @@ MailPartViewers_OBJC_FILES += \
|
||||
UIxMailPartICalViewer.m \
|
||||
\
|
||||
UIxMailPartICalActions.m \
|
||||
\
|
||||
UIxKolabPartViewer.m \
|
||||
UIxKolabPartContactViewer.m \
|
||||
UIxKolabPartEventViewer.m \
|
||||
UIxKolabPartTaskViewer.m \
|
||||
|
||||
MailPartViewers_RESOURCE_FILES += \
|
||||
Version \
|
||||
|
||||
@@ -1,60 +0,0 @@
|
||||
/*
|
||||
Copyright (C) 2005 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.
|
||||
*/
|
||||
|
||||
@class NSString;
|
||||
#import <Foundation/NSObject.h>
|
||||
|
||||
#import <DOM/DOMProtocols.h>
|
||||
|
||||
#import "UIxKolabPartViewer.h"
|
||||
|
||||
/*
|
||||
UIxKolabPartContactViewer
|
||||
|
||||
Show application/x-vnd.kolab.contact types. (Kolab XML content)
|
||||
*/
|
||||
|
||||
@interface UIxKolabPartContactViewer : UIxKolabPartViewer
|
||||
@end
|
||||
|
||||
@implementation UIxKolabPartContactViewer
|
||||
|
||||
- (id<NSObject,DOMNodeList>)addressElements {
|
||||
return [[[self domDocument] documentElement]
|
||||
getElementsByTagName:@"address"];
|
||||
}
|
||||
|
||||
- (id<NSObject,DOMNodeList>)phoneElements {
|
||||
return [[[self domDocument] documentElement]
|
||||
getElementsByTagName:@"phone"];
|
||||
}
|
||||
|
||||
- (id<NSObject,DOMNodeList>)emailElements {
|
||||
return [[[self domDocument] documentElement]
|
||||
getElementsByTagName:@"email"];
|
||||
}
|
||||
|
||||
- (id<NSObject,DOMNodeList>)customElements {
|
||||
return [[[self domDocument] documentElement]
|
||||
getElementsByTagName:@"x-custom"];
|
||||
}
|
||||
|
||||
@end /* UIxKolabPartContactViewer */
|
||||
@@ -1,34 +0,0 @@
|
||||
/*
|
||||
Copyright (C) 2005 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.
|
||||
*/
|
||||
|
||||
#import "UIxKolabPartViewer.h"
|
||||
|
||||
/*
|
||||
UIxKolabPartEventViewer
|
||||
|
||||
Show application/x-vnd.kolab.event types. (Kolab XML content)
|
||||
*/
|
||||
|
||||
@interface UIxKolabPartEventViewer : UIxKolabPartViewer
|
||||
@end
|
||||
|
||||
@implementation UIxKolabPartEventViewer
|
||||
@end /* UIxKolabPartEventViewer */
|
||||
@@ -1,34 +0,0 @@
|
||||
/*
|
||||
Copyright (C) 2005 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.
|
||||
*/
|
||||
|
||||
#import "UIxKolabPartViewer.h"
|
||||
|
||||
/*
|
||||
UIxKolabPartTaskViewer
|
||||
|
||||
Show application/x-vnd.kolab.task types. (Kolab XML content)
|
||||
*/
|
||||
|
||||
@interface UIxKolabPartTaskViewer : UIxKolabPartViewer
|
||||
@end
|
||||
|
||||
@implementation UIxKolabPartTaskViewer
|
||||
@end /* UIxKolabPartTaskViewer */
|
||||
@@ -1,48 +0,0 @@
|
||||
/*
|
||||
Copyright (C) 2005 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.
|
||||
*/
|
||||
|
||||
#ifndef __Mailer_UIxKolabPartViewer_H__
|
||||
#define __Mailer_UIxKolabPartViewer_H__
|
||||
|
||||
#import "UIxMailPartViewer.h"
|
||||
|
||||
/*
|
||||
UIxKolabPartContactViewer
|
||||
|
||||
Superclass for viewers which show the application/x-vnd.* XML documents.
|
||||
*/
|
||||
|
||||
@protocol NSObject;
|
||||
@protocol DOMDocument;
|
||||
|
||||
@interface UIxKolabPartViewer : UIxMailPartViewer
|
||||
{
|
||||
id <NSObject,DOMDocument> domDocument;
|
||||
id item;
|
||||
}
|
||||
|
||||
/* getting a DOM representation */
|
||||
|
||||
- (id <DOMDocument>) domDocument;
|
||||
|
||||
@end
|
||||
|
||||
#endif /* __Mailer_UIxKolabPartViewer_H__ */
|
||||
@@ -1,81 +0,0 @@
|
||||
/*
|
||||
Copyright (C) 2005 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.
|
||||
*/
|
||||
|
||||
#import <NGExtensions/NSNull+misc.h>
|
||||
#import <DOM/DOMBuilderFactory.h>
|
||||
#import <DOM/DOMProtocols.h>
|
||||
|
||||
#import "UIxKolabPartViewer.h"
|
||||
|
||||
@implementation UIxKolabPartViewer
|
||||
|
||||
static id<DOMBuilder> domBuilder = nil;
|
||||
|
||||
+ (void)initialize {
|
||||
DOMBuilderFactory *factory
|
||||
= [DOMBuilderFactory standardDOMBuilderFactory];
|
||||
|
||||
domBuilder = [[factory createDOMBuilderForMimeType:@"text/xml"] retain];
|
||||
NSLog(@"Note(%@): using DOM builder: %@",
|
||||
NSStringFromClass(self), domBuilder);
|
||||
}
|
||||
|
||||
- (void)dealloc {
|
||||
[(id)self->domDocument release];
|
||||
[self->item release];
|
||||
[super dealloc];
|
||||
}
|
||||
|
||||
/* maintain caches */
|
||||
|
||||
- (void)resetPathCaches {
|
||||
[super resetPathCaches];
|
||||
[(id)self->domDocument release]; self->domDocument = nil;
|
||||
[self->item release]; self->item = nil;
|
||||
}
|
||||
|
||||
/* getting a DOM representation */
|
||||
|
||||
- (id<DOMDocument>)domDocument {
|
||||
/*
|
||||
Note: this ignores the charset MIME header and will rely on proper
|
||||
encoding header in the XML.
|
||||
*/
|
||||
|
||||
if (self->domDocument != nil)
|
||||
return [(id)self->domDocument isNotNull] ? self->domDocument : nil;
|
||||
|
||||
self->domDocument =
|
||||
[[domBuilder buildFromSource:[self decodedFlatContent]
|
||||
systemId:@"Kolab Mail Object"] retain];
|
||||
return self->domDocument;
|
||||
}
|
||||
|
||||
/* accessors */
|
||||
|
||||
- (void)setItem:(id)_item {
|
||||
ASSIGN(self->item, _item);
|
||||
}
|
||||
- (id)item {
|
||||
return self->item;
|
||||
}
|
||||
|
||||
@end /* UIxKolabPartViewer */
|
||||
@@ -170,38 +170,6 @@ static BOOL showNamedTextAttachmentsInline = NO;
|
||||
return [viewer pageWithName: @"UIxMailPartICalViewer"];
|
||||
}
|
||||
|
||||
/* Kolab viewers */
|
||||
|
||||
- (WOComponent *) kolabContactViewer
|
||||
{
|
||||
return [viewer pageWithName: @"UIxKolabPartContactViewer"];
|
||||
}
|
||||
|
||||
- (WOComponent *) kolabEventViewer
|
||||
{
|
||||
return [viewer pageWithName: @"UIxKolabPartEventViewer"];
|
||||
}
|
||||
|
||||
- (WOComponent *) kolabTodoViewer
|
||||
{
|
||||
return [viewer pageWithName: @"UIxKolabPartTodoViewer"];
|
||||
}
|
||||
|
||||
- (WOComponent *) kolabNoteViewer
|
||||
{
|
||||
return [self textViewer]; // TODO
|
||||
}
|
||||
|
||||
- (WOComponent *) kolabJournalViewer
|
||||
{
|
||||
return [self textViewer]; // TODO
|
||||
}
|
||||
|
||||
- (WOComponent *) kolabDistributionListViewer
|
||||
{
|
||||
return [self textViewer]; // TODO
|
||||
}
|
||||
|
||||
/* main viewer selection */
|
||||
|
||||
- (WOComponent *) viewerForBodyInfo: (id) _info
|
||||
@@ -275,26 +243,7 @@ static BOOL showNamedTextAttachmentsInline = NO;
|
||||
if ([mt isEqualToString:@"application"])
|
||||
{
|
||||
// octet-stream (generate download link?, autodetect type?)
|
||||
|
||||
if ([st hasPrefix:@"x-vnd.kolab."])
|
||||
{
|
||||
if ([st isEqualToString:@"x-vnd.kolab.contact"])
|
||||
return [self kolabContactViewer];
|
||||
if ([st isEqualToString:@"x-vnd.kolab.event"])
|
||||
return [self kolabEventViewer];
|
||||
if ([st isEqualToString:@"x-vnd.kolab.task"])
|
||||
return [self kolabTodoViewer];
|
||||
if ([st isEqualToString:@"x-vnd.kolab.note"])
|
||||
return [self kolabNoteViewer];
|
||||
if ([st isEqualToString:@"x-vnd.kolab.journal"])
|
||||
return [self kolabJournalViewer];
|
||||
if ([st isEqualToString:@"x-vnd.kolab.contact.distlist"])
|
||||
return [self kolabDistributionListViewer];
|
||||
|
||||
[self errorWithFormat:@"found no viewer for Kolab type: %@/%@", mt, st];
|
||||
return [self linkViewer];
|
||||
}
|
||||
else if ([st isEqualToString:@"ics"]) /* Cooqle K4lendahr - Google Calendar */
|
||||
if ([st isEqualToString:@"ics"]) /* Cooqle K4lendahr - Google Calendar */
|
||||
return [self iCalViewer];
|
||||
|
||||
#if 0 /* the link viewer looks better than plain text ;-) */
|
||||
|
||||
Reference in new issue
Block a user