see ChangeLog

Monotone-Revision: 9054022ef1ca8aeba6e34842d27d9b94ce002b89

Monotone-Author: dev-unix.inverse.qc.ca
Monotone-Date: 2006-06-15T19:34:10
Monotone-Branch: ca.inverse.sogo
This commit is contained in:
dev-unix.inverse.qc.ca
2006-06-15 19:34:10 +00:00
commit f18c764ffa
965 changed files with 99196 additions and 0 deletions
+482
View File
@@ -0,0 +1,482 @@
GNU LIBRARY GENERAL PUBLIC LICENSE
Version 2, June 1991
Copyright (C) 1991 Free Software Foundation, Inc.
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
[This is the first released version of the library GPL. It is
numbered 2 because it goes with version 2 of the ordinary GPL.]
Preamble
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
Licenses are intended to guarantee your freedom to share and change
free software--to make sure the software is free for all its users.
This license, the Library General Public License, applies to some
specially designated Free Software Foundation software, and to any
other libraries whose authors decide to use it. You can use it for
your libraries, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
this service if you wish), that you receive source code or can get it
if you want it, that you can change the software or use pieces of it
in new free programs; and that you know you can do these things.
To protect your rights, we need to make restrictions that forbid
anyone to deny you these rights or to ask you to surrender the rights.
These restrictions translate to certain responsibilities for you if
you distribute copies of the library, or if you modify it.
For example, if you distribute copies of the library, whether gratis
or for a fee, you must give the recipients all the rights that we gave
you. You must make sure that they, too, receive or can get the source
code. If you link a program with the library, you must provide
complete object files to the recipients so that they can relink them
with the library, after making changes to the library and recompiling
it. And you must show them these terms so they know their rights.
Our method of protecting your rights has two steps: (1) copyright
the library, and (2) offer you this license which gives you legal
permission to copy, distribute and/or modify the library.
Also, for each distributor's protection, we want to make certain
that everyone understands that there is no warranty for this free
library. If the library is modified by someone else and passed on, we
want its recipients to know that what they have is not the original
version, so that any problems introduced by others will not reflect on
the original authors' reputations.
Finally, any free program is threatened constantly by software
patents. We wish to avoid the danger that companies distributing free
software will individually obtain patent licenses, thus in effect
transforming the program into proprietary software. To prevent this,
we have made it clear that any patent must be licensed for everyone's
free use or not licensed at all.
Most GNU software, including some libraries, is covered by the ordinary
GNU General Public License, which was designed for utility programs. This
license, the GNU Library General Public License, applies to certain
designated libraries. This license is quite different from the ordinary
one; be sure to read it in full, and don't assume that anything in it is
the same as in the ordinary license.
The reason we have a separate public license for some libraries is that
they blur the distinction we usually make between modifying or adding to a
program and simply using it. Linking a program with a library, without
changing the library, is in some sense simply using the library, and is
analogous to running a utility program or application program. However, in
a textual and legal sense, the linked executable is a combined work, a
derivative of the original library, and the ordinary General Public License
treats it as such.
Because of this blurred distinction, using the ordinary General
Public License for libraries did not effectively promote software
sharing, because most developers did not use the libraries. We
concluded that weaker conditions might promote sharing better.
However, unrestricted linking of non-free programs would deprive the
users of those programs of all benefit from the free status of the
libraries themselves. This Library General Public License is intended to
permit developers of non-free programs to use free libraries, while
preserving your freedom as a user of such programs to change the free
libraries that are incorporated in them. (We have not seen how to achieve
this as regards changes in header files, but we have achieved it as regards
changes in the actual functions of the Library.) The hope is that this
will lead to faster development of free libraries.
The precise terms and conditions for copying, distribution and
modification follow. Pay close attention to the difference between a
"work based on the library" and a "work that uses the library". The
former contains code derived from the library, while the latter only
works together with the library.
Note that it is possible for a library to be covered by the ordinary
General Public License rather than by this special one.
GNU LIBRARY GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License Agreement applies to any software library which
contains a notice placed by the copyright holder or other authorized
party saying it may be distributed under the terms of this Library
General Public License (also called "this License"). Each licensee is
addressed as "you".
A "library" means a collection of software functions and/or data
prepared so as to be conveniently linked with application programs
(which use some of those functions and data) to form executables.
The "Library", below, refers to any such software library or work
which has been distributed under these terms. A "work based on the
Library" means either the Library or any derivative work under
copyright law: that is to say, a work containing the Library or a
portion of it, either verbatim or with modifications and/or translated
straightforwardly into another language. (Hereinafter, translation is
included without limitation in the term "modification".)
"Source code" for a work means the preferred form of the work for
making modifications to it. For a library, complete source code means
all the source code for all modules it contains, plus any associated
interface definition files, plus the scripts used to control compilation
and installation of the library.
Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope. The act of
running a program using the Library is not restricted, and output from
such a program is covered only if its contents constitute a work based
on the Library (independent of the use of the Library in a tool for
writing it). Whether that is true depends on what the Library does
and what the program that uses the Library does.
1. You may copy and distribute verbatim copies of the Library's
complete source code as you receive it, in any medium, provided that
you conspicuously and appropriately publish on each copy an
appropriate copyright notice and disclaimer of warranty; keep intact
all the notices that refer to this License and to the absence of any
warranty; and distribute a copy of this License along with the
Library.
You may charge a fee for the physical act of transferring a copy,
and you may at your option offer warranty protection in exchange for a
fee.
2. You may modify your copy or copies of the Library or any portion
of it, thus forming a work based on the Library, and copy and
distribute such modifications or work under the terms of Section 1
above, provided that you also meet all of these conditions:
a) The modified work must itself be a software library.
b) You must cause the files modified to carry prominent notices
stating that you changed the files and the date of any change.
c) You must cause the whole of the work to be licensed at no
charge to all third parties under the terms of this License.
d) If a facility in the modified Library refers to a function or a
table of data to be supplied by an application program that uses
the facility, other than as an argument passed when the facility
is invoked, then you must make a good faith effort to ensure that,
in the event an application does not supply such function or
table, the facility still operates, and performs whatever part of
its purpose remains meaningful.
(For example, a function in a library to compute square roots has
a purpose that is entirely well-defined independent of the
application. Therefore, Subsection 2d requires that any
application-supplied function or table used by this function must
be optional: if the application does not supply it, the square
root function must still compute square roots.)
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Library,
and can be reasonably considered independent and separate works in
themselves, then this License, and its terms, do not apply to those
sections when you distribute them as separate works. But when you
distribute the same sections as part of a whole which is a work based
on the Library, the distribution of the whole must be on the terms of
this License, whose permissions for other licensees extend to the
entire whole, and thus to each and every part regardless of who wrote
it.
Thus, it is not the intent of this section to claim rights or contest
your rights to work written entirely by you; rather, the intent is to
exercise the right to control the distribution of derivative or
collective works based on the Library.
In addition, mere aggregation of another work not based on the Library
with the Library (or with a work based on the Library) on a volume of
a storage or distribution medium does not bring the other work under
the scope of this License.
3. You may opt to apply the terms of the ordinary GNU General Public
License instead of this License to a given copy of the Library. To do
this, you must alter all the notices that refer to this License, so
that they refer to the ordinary GNU General Public License, version 2,
instead of to this License. (If a newer version than version 2 of the
ordinary GNU General Public License has appeared, then you can specify
that version instead if you wish.) Do not make any other change in
these notices.
Once this change is made in a given copy, it is irreversible for
that copy, so the ordinary GNU General Public License applies to all
subsequent copies and derivative works made from that copy.
This option is useful when you wish to copy part of the code of
the Library into a program that is not a library.
4. You may copy and distribute the Library (or a portion or
derivative of it, under Section 2) in object code or executable form
under the terms of Sections 1 and 2 above provided that you accompany
it with the complete corresponding machine-readable source code, which
must be distributed under the terms of Sections 1 and 2 above on a
medium customarily used for software interchange.
If distribution of object code is made by offering access to copy
from a designated place, then offering equivalent access to copy the
source code from the same place satisfies the requirement to
distribute the source code, even though third parties are not
compelled to copy the source along with the object code.
5. A program that contains no derivative of any portion of the
Library, but is designed to work with the Library by being compiled or
linked with it, is called a "work that uses the Library". Such a
work, in isolation, is not a derivative work of the Library, and
therefore falls outside the scope of this License.
However, linking a "work that uses the Library" with the Library
creates an executable that is a derivative of the Library (because it
contains portions of the Library), rather than a "work that uses the
library". The executable is therefore covered by this License.
Section 6 states terms for distribution of such executables.
When a "work that uses the Library" uses material from a header file
that is part of the Library, the object code for the work may be a
derivative work of the Library even though the source code is not.
Whether this is true is especially significant if the work can be
linked without the Library, or if the work is itself a library. The
threshold for this to be true is not precisely defined by law.
If such an object file uses only numerical parameters, data
structure layouts and accessors, and small macros and small inline
functions (ten lines or less in length), then the use of the object
file is unrestricted, regardless of whether it is legally a derivative
work. (Executables containing this object code plus portions of the
Library will still fall under Section 6.)
Otherwise, if the work is a derivative of the Library, you may
distribute the object code for the work under the terms of Section 6.
Any executables containing that work also fall under Section 6,
whether or not they are linked directly with the Library itself.
6. As an exception to the Sections above, you may also compile or
link a "work that uses the Library" with the Library to produce a
work containing portions of the Library, and distribute that work
under terms of your choice, provided that the terms permit
modification of the work for the customer's own use and reverse
engineering for debugging such modifications.
You must give prominent notice with each copy of the work that the
Library is used in it and that the Library and its use are covered by
this License. You must supply a copy of this License. If the work
during execution displays copyright notices, you must include the
copyright notice for the Library among them, as well as a reference
directing the user to the copy of this License. Also, you must do one
of these things:
a) Accompany the work with the complete corresponding
machine-readable source code for the Library including whatever
changes were used in the work (which must be distributed under
Sections 1 and 2 above); and, if the work is an executable linked
with the Library, with the complete machine-readable "work that
uses the Library", as object code and/or source code, so that the
user can modify the Library and then relink to produce a modified
executable containing the modified Library. (It is understood
that the user who changes the contents of definitions files in the
Library will not necessarily be able to recompile the application
to use the modified definitions.)
b) Accompany the work with a written offer, valid for at
least three years, to give the same user the materials
specified in Subsection 6a, above, for a charge no more
than the cost of performing this distribution.
c) If distribution of the work is made by offering access to copy
from a designated place, offer equivalent access to copy the above
specified materials from the same place.
d) Verify that the user has already received a copy of these
materials or that you have already sent this user a copy.
For an executable, the required form of the "work that uses the
Library" must include any data and utility programs needed for
reproducing the executable from it. However, as a special exception,
the source code distributed need not include anything that is normally
distributed (in either source or binary form) with the major
components (compiler, kernel, and so on) of the operating system on
which the executable runs, unless that component itself accompanies
the executable.
It may happen that this requirement contradicts the license
restrictions of other proprietary libraries that do not normally
accompany the operating system. Such a contradiction means you cannot
use both them and the Library together in an executable that you
distribute.
7. You may place library facilities that are a work based on the
Library side-by-side in a single library together with other library
facilities not covered by this License, and distribute such a combined
library, provided that the separate distribution of the work based on
the Library and of the other library facilities is otherwise
permitted, and provided that you do these two things:
a) Accompany the combined library with a copy of the same work
based on the Library, uncombined with any other library
facilities. This must be distributed under the terms of the
Sections above.
b) Give prominent notice with the combined library of the fact
that part of it is a work based on the Library, and explaining
where to find the accompanying uncombined form of the same work.
8. You may not copy, modify, sublicense, link with, or distribute
the Library except as expressly provided under this License. Any
attempt otherwise to copy, modify, sublicense, link with, or
distribute the Library is void, and will automatically terminate your
rights under this License. However, parties who have received copies,
or rights, from you under this License will not have their licenses
terminated so long as such parties remain in full compliance.
9. You are not required to accept this License, since you have not
signed it. However, nothing else grants you permission to modify or
distribute the Library or its derivative works. These actions are
prohibited by law if you do not accept this License. Therefore, by
modifying or distributing the Library (or any work based on the
Library), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying
the Library or works based on it.
10. Each time you redistribute the Library (or any work based on the
Library), the recipient automatically receives a license from the
original licensor to copy, distribute, link with or modify the Library
subject to these terms and conditions. You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties to
this License.
11. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot
distribute so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you
may not distribute the Library at all. For example, if a patent
license would not permit royalty-free redistribution of the Library by
all those who receive copies directly or indirectly through you, then
the only way you could satisfy both it and this License would be to
refrain entirely from distribution of the Library.
If any portion of this section is held invalid or unenforceable under any
particular circumstance, the balance of the section is intended to apply,
and the section as a whole is intended to apply in other circumstances.
It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of any
such claims; this section has the sole purpose of protecting the
integrity of the free software distribution system which is
implemented by public license practices. Many people have made
generous contributions to the wide range of software distributed
through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing
to distribute software through any other system and a licensee cannot
impose that choice.
This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.
12. If the distribution and/or use of the Library is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Library under this License may add
an explicit geographical distribution limitation excluding those countries,
so that distribution is permitted only in or among countries not thus
excluded. In such case, this License incorporates the limitation as if
written in the body of this License.
13. The Free Software Foundation may publish revised and/or new
versions of the Library General Public License from time to time.
Such new versions will be similar in spirit to the present version,
but may differ in detail to address new problems or concerns.
Each version is given a distinguishing version number. If the Library
specifies a version number of this License which applies to it and
"any later version", you have the option of following the terms and
conditions either of that version or of any later version published by
the Free Software Foundation. If the Library does not specify a
license version number, you may choose any version ever published by
the Free Software Foundation.
14. If you wish to incorporate parts of the Library into other free
programs whose distribution conditions are incompatible with these,
write to the author to ask for permission. For software which is
copyrighted by the Free Software Foundation, write to the Free
Software Foundation; we sometimes make exceptions for this. Our
decision will be guided by the two goals of preserving the free status
of all derivatives of our free software and of promoting the sharing
and reuse of software generally.
NO WARRANTY
15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
DAMAGES.
END OF TERMS AND CONDITIONS
Appendix: How to Apply These Terms to Your New Libraries
If you develop a new library, and you want it to be of the greatest
possible use to the public, we recommend making it free software that
everyone can redistribute and change. You can do so by permitting
redistribution under these terms (or, alternatively, under the terms of the
ordinary General Public License).
To apply these terms, attach the following notices to the library. It is
safest to attach them to the start of each source file to most effectively
convey the exclusion of warranty; and each file should have at least the
"copyright" line and a pointer to where the full notice is found.
<one line to give the library's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library 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 Library General Public
License along with this library; if not, write to the Free
Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
MA 02111-1307, USA
Also add information on how to contact you by electronic and paper mail.
You should also get your employer (if you work as a programmer) or your
school, if any, to sign a "copyright disclaimer" for the library, if
necessary. Here is a sample; alter the names:
Yoyodyne, Inc., hereby disclaims all copyright interest in the
library `Frob' (a library for tweaking knobs) written by James Random Hacker.
<signature of Ty Coon>, 1 April 1990
Ty Coon, President of Vice
That's all there is to it!
+4
View File
@@ -0,0 +1,4 @@
Copyright (C) 2004 SKYRIX Software AG
Contact: info@skyrix.com
+119
View File
@@ -0,0 +1,119 @@
2005-07-30 Helge Hess <helge.hess@opengroupware.org>
* v0.9.22
* UIxKolabPartContactViewer.m: added accessors for multi-value fields
* UIxKolabPartViewer.m: added item
* UIxKolabPartViewer.m: cache parsed DOM document (v0.9.21)
* v0.9.20
* UIxMailPartViewer.m: added ability to use a fallback string encoding
in case the default one or the one specified in the content-type did
fail (this can happen with Outlook iCal mails ...).
* UIxMailPartICalViewer.m: hardened against missing content data, use
Latin-1 as a fallback encoding in case the part encoding didn't work
out.
* prepared MIME part viewers for Kolab XML types
* UIxMailRenderingContext.m: prepared some support for Kolab types in
IMAP4 (v0.9.19)
2005-07-27 Helge Hess <helge.hess@opengroupware.org>
* English.lproj/Localizable.strings: added a missing semicolon
(v0.9.18)
2005-07-23 Helge Hess <helge.hess@opengroupware.org>
* UIxMailPartICalViewer.m: fixed include path for new hierarchy
(v0.9.17)
2005-07-18 Helge Hess <helge.hess@opengroupware.org>
* UIxMailRenderingContext.m: show text/plain and text/html attachments
which have "filename" set in the content-disposition using the link
viewer (#1468) (v0.9.16)
2005-07-18 Helge Hess <helge.hess@opengroupware.org>
* UIxMailRenderingContext.m: map multipart/report mimetype to use the
multipart/mixed viewer, map message/delivery-status mimetype to use
the link viewer (v0.9.15)
* v0.9.14
* UIxMailPartICalViewer.m: replaced some methods with label bindings
* English.lproj/Localizable.strings: added more strings
* UIxMailPartICalViewer.m: added -attendeeStatusLabel to produce a
readable and localized part-stat (v0.9.13)
2005-07-18 Helge Hess <helge.hess@opengroupware.org>
* UIxMailPartICalViewer.m: added code to support iMIP REPLY messages
(v0.9.12)
2005-07-15 Helge Hess <helge.hess@opengroupware.org>
* v0.9.11
* added UIxMailPartICalAction for calendar part related link actions
(no actions implemented yet)
* UIxMailPartViewer.m: added preferred extensions for iCalendar and
vCard mime types, moved in -pathToAttachment from
UIxMailPartLinkViewer (returns a nice download-link), added
-pathToAttachmentObject method (returns a plain link to the part
SoObject)
* UIxMailPartLinkViewer.m: moved -pathToAttachment method to baseclass
* UIxMailPartICalViewer.m: added method to retrieve the authorative
event (DB before mail), added a method to return an organizer display
name (with appropriate fallbacks) (v0.9.10)
* UIxMailPartICalViewer.m: rewrote not to use SOGoAppointment and to
use iCalCalendar instead (v0.9.9)
* UIxMailSizeFormatter.m, UIxMailPartMixedViewer.m,
UIxMailPartICalViewer.m, UIxMailPartAlternativeViewer.m,
UIxMailPartViewer.m: fixed gcc 4.0 warnings (v0.9.8)
2005-07-14 Helge Hess <helge.hess@opengroupware.org>
* UIxMailPartICalViewer.m: properly reset part caches when the
part-path changes, added methods to check whether the event is
already stored in the calendar of the login-user, added methods to
check whether the login-user is the organizer (v0.9.7)
2005-07-08 Helge Hess <helge.hess@opengroupware.org>
* UIxMailPartViewer.m: added '8bit' as a known MIME encoding (v0.9.6)
2005-07-06 Helge Hess <helge.hess@opengroupware.org>
* UIxMailRenderingContext.m: fixed a bug when rendering nested
multiparts (cannot be cached) (v0.9.5)
2005-06-24 Helge Hess <helge.hess@opengroupware.org>
* UIxMailPartLinkViewer.m: fixed an exception on Cocoa when a mail is
composed from just the HTML body (v0.9.4)
2005-02-21 Helge Hess <helge.hess@opengroupware.org>
* prepared HTML and iCal mail part viewers (0.9.3)
2005-02-20 Helge Hess <helge.hess@opengroupware.org>
* moved in UIxMailSizeFormatter (v0.9.2)
2005-02-18 Helge Hess <helge.hess@opengroupware.org>
* created ChangeLog
@@ -0,0 +1,23 @@
ACCEPTED = "accepted";
COMPLETED = "completed";
DECLINED = "declined";
DELEGATED = "delegated";
IN-PROCESS = "in process";
NEEDS-ACTION = "needs action";
TENTATIVE = "tentative";
organized_by_you = "organized by you";
you_are_an_attendee = "you are an attendee";
add_info_text = "iMIP 'ADD' requests are not yet supported by SOGo.";
publish_info_text = "The sender informs you of the attached event.";
cancel_info_text = "Your invitation or the whole event was canceled.";
request_info_no_attendee = "is proposing a meeting to the attendees. You receive this mail as a notification, you are not scheduled as a participant.";
Organizer = "Organizer";
request_info = "invites you to participate in a meeting.";
do_add_to_cal = "add to calendar";
do_del_from_cal = "delete from calendar";
do_accept = "accept";
do_decline = "decline";
do_tentative = "tentative";
do_update_status = "update status in calendar";
reply_info_no_attendee = "You received a reply to a scheduling event but the sender of the reply is not a participant.";
reply_info = "This is a reply to an event invitation done by you.";
@@ -0,0 +1,7 @@
ACCEPTED = "Accépté"
COMPLETED = "Terminé"
DECLINED = "Refusé"
DELEGATED = "Délégué"
IN-PROCESS = "En cours de traitement"
NEEDS-ACTION = "Prise de décision nécessaire"
TENTATIVE = "Proposition"
+48
View File
@@ -0,0 +1,48 @@
# GNUstep makefile
include ../common.make
BUNDLE_NAME = MailPartViewers
MailPartViewers_PRINCIPAL_CLASS = MailPartViewersProduct
MailPartViewers_LANGUAGES = English French
MailPartViewers_LANGUAGES = English French
MailPartViewers_OBJC_FILES += \
MailPartViewersProduct.m \
\
UIxMailRenderingContext.m \
UIxMailSizeFormatter.m \
\
UIxMailPartViewer.m \
UIxMailPartTextViewer.m \
UIxMailPartImageViewer.m \
UIxMailPartLinkViewer.m \
UIxMailPartMixedViewer.m \
UIxMailPartAlternativeViewer.m \
UIxMailPartMessageViewer.m \
UIxMailPartICalViewer.m \
UIxMailPartHTMLViewer.m \
\
UIxMailPartICalAction.m \
\
UIxKolabPartViewer.m \
UIxKolabPartContactViewer.m \
UIxKolabPartEventViewer.m \
UIxKolabPartTaskViewer.m \
MailPartViewers_RESOURCE_FILES += \
Version \
product.plist \
MailPartViewers_LOCALIZED_RESOURCE_FILES += \
Localizable.strings
# make
-include GNUmakefile.preamble
include $(GNUSTEP_MAKEFILES)/bundle.make
-include GNUmakefile.postamble
include ../../fhsbundle.make
@@ -0,0 +1,33 @@
/*
Copyright (C) 2004-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 <Foundation/NSObject.h>
@interface MailPartViewersProduct : NSObject
{
}
@end
#include "common.h"
@implementation MailPartViewersProduct
@end /* MailPartViewersProduct */
+17
View File
@@ -0,0 +1,17 @@
SOGo MailPartViewers
====================
TODO
This product bundle contains components for displaying certain parts of an
email, like the text content, attachments or embedded images.
All the contained classes inherit from UIxMailPartViewer which provides the
majority of the functionality. Subclasses usually only add methods for the
presentation of the content (which in turn is usually done in the templates).
The "master object" which selects appropriate classes and coordinates the
rendering is the UIxMailRenderingContext. The context also maintains a cache
of components for rendering which can then be reused for similiar parts in the
mail. Note that this only works for leaf-content (eg not for recursive ones
like multipart/* viewers).
@@ -0,0 +1,57 @@
/*
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.
*/
#include "UIxKolabPartViewer.h"
/*
UIxKolabPartContactViewer
Show application/x-vnd.kolab.contact types. (Kolab XML content)
*/
@interface UIxKolabPartContactViewer : UIxKolabPartViewer
@end
#include "common.h"
@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 */
@@ -0,0 +1,36 @@
/*
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.
*/
#include "UIxKolabPartViewer.h"
/*
UIxKolabPartEventViewer
Show application/x-vnd.kolab.event types. (Kolab XML content)
*/
@interface UIxKolabPartEventViewer : UIxKolabPartViewer
@end
#include "common.h"
@implementation UIxKolabPartEventViewer
@end /* UIxKolabPartEventViewer */
@@ -0,0 +1,36 @@
/*
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.
*/
#include "UIxKolabPartViewer.h"
/*
UIxKolabPartTaskViewer
Show application/x-vnd.kolab.task types. (Kolab XML content)
*/
@interface UIxKolabPartTaskViewer : UIxKolabPartViewer
@end
#include "common.h"
@implementation UIxKolabPartTaskViewer
@end /* UIxKolabPartTaskViewer */
+47
View File
@@ -0,0 +1,47 @@
/*
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__
#include "UIxMailPartViewer.h"
/*
UIxKolabPartContactViewer
Superclass for viewers which show the application/x-vnd.* XML documents.
*/
#include <DOM/DOMProtocols.h>
@interface UIxKolabPartViewer : UIxMailPartViewer
{
id<NSObject,DOMDocument> domDocument;
id item;
}
/* getting a DOM representation */
- (id<DOMDocument>)domDocument;
@end
#endif /* __Mailer_UIxKolabPartViewer_H__ */
+79
View File
@@ -0,0 +1,79 @@
/*
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.
*/
#include "UIxKolabPartViewer.h"
#include "common.h"
#include <DOM/DOMBuilderFactory.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 */
@@ -0,0 +1,164 @@
/*
Copyright (C) 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.
*/
#include "UIxMailPartViewer.h"
/*
UIxMailPartAlternativeViewer
Display multipart/alternative parts. Most common application is for messages
which contain text/html and text/plain, but it is also used in other
contexts, eg in OGo appointment mails.
TODO: We might want to give the user the possibility to access all parts
of the alternative set.
*/
@interface UIxMailPartAlternativeViewer : UIxMailPartViewer
{
id childInfo;
unsigned int childIndex;
}
@end
#include "UIxMailRenderingContext.h"
#include <UI/MailerUI/WOContext+UIxMailer.h>
#include "common.h"
@implementation UIxMailPartAlternativeViewer
- (void)dealloc {
[self->childInfo release];
[super dealloc];
}
/* caches */
- (void)resetBodyInfoCaches {
[self->childInfo release]; self->childInfo = nil;
self->childIndex = 0;
[super resetBodyInfoCaches];
}
/* part selection */
- (NSArray *)childPartTypes {
NSMutableArray *types;
unsigned i, count;
NSArray *childParts;
childParts = [[self bodyInfo] valueForKey:@"parts"];
count = [childParts count];
types = [NSMutableArray arrayWithCapacity:count];
for (i = 0; i < count; i++) {
NSString *mt, *st;
mt = [[[childParts objectAtIndex:i] valueForKey:@"type"] lowercaseString];
st = [[[childParts objectAtIndex:i] valueForKey:@"subtype"]
lowercaseString];
mt = [[mt stringByAppendingString:@"/"] stringByAppendingString:st];
[types addObject:mt ? mt : (id)[NSNull null]];
}
return types;
}
- (int)selectPartIndexFromTypes:(NSArray *)_types {
/* returns the index of the selected part or NSNotFound */
unsigned i, count;
if ((count = [_types count]) == 0)
return NSNotFound;
/* we always choose text/plain if available */
if ((i = [_types indexOfObject:@"text/plain"]) != NSNotFound)
return i;
/* then we scan for other text types and choose the first one found */
for (i = 0; i < count; i++) {
if ([(NSString *)[_types objectAtIndex:i] hasPrefix:@"text/"])
return i;
}
/* as a fallback, we select the first available part */
return 0;
}
- (void)selectChildInfo {
unsigned idx;
[self->childInfo release]; self->childInfo = nil;
self->childIndex = 0;
idx = [self selectPartIndexFromTypes:[self childPartTypes]];
if (idx == NSNotFound) {
[self errorWithFormat:@"could not select a part of types: %@",
[self childPartTypes]];
return;
}
self->childIndex = idx + 1;
self->childInfo =
[[[[self bodyInfo] valueForKey:@"parts"] objectAtIndex:idx] retain];
}
/* accessors */
- (id)childInfo {
if (self->childInfo == nil)
[self selectChildInfo];
return self->childInfo;
}
- (unsigned int)childIndex {
if (self->childIndex == 0)
[self selectChildInfo];
return self->childIndex - 1;
}
- (NSString *)childPartName {
char buf[8];
sprintf(buf, "%d", [self childIndex] + 1);
return [NSString stringWithCString:buf];
}
- (id)childPartPath {
NSArray *pp;
pp = [self partPath];
return [pp count] > 0
? [pp arrayByAddingObject:[self childPartName]]
: [NSArray arrayWithObject:[self childPartName]];
}
/* nested viewers */
- (id)contentViewerComponent {
id info;
info = [self childInfo];
return [[[self context] mailRenderingContext] viewerForBodyInfo:info];
}
@end /* UIxMailPartAlternativeViewer */
@@ -0,0 +1,30 @@
/*
Copyright (C) 2004-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.
*/
#include "UIxMailPartLinkViewer.h"
@interface UIxMailPartHTMLViewer : UIxMailPartLinkViewer
@end
#include "common.h"
@implementation UIxMailPartHTMLViewer
@end /* UIxMailPartHTMLViewer */
@@ -0,0 +1,73 @@
/*
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.
*/
#include <NGObjWeb/WODirectAction.h>
@interface UIxMailPartICalAction : WODirectAction
@end
#include "common.h"
@implementation UIxMailPartICalAction
- (id)redirectToViewerWithError:(NSString *)_error {
WOResponse *r;
NSString *viewURL;
id mail;
mail = [[self clientObject] valueForKey:@"mailObject"];
[self logWithFormat:@"MAIL: %@", mail];
viewURL = [mail baseURLInContext:[self context]];
[self logWithFormat:@" url: %@", viewURL];
viewURL = [viewURL stringByAppendingString:
[viewURL hasSuffix:@"/"] ? @"view" : @"/view"];
if ([_error isNotNull] && [_error length] > 0) {
viewURL = [viewURL stringByAppendingString:@"?error="];
viewURL = [viewURL stringByAppendingString:
[_error stringByEscapingURL]];
}
r = [[self context] response];
[r setStatus:302 /* moved */];
[r setHeader:viewURL forKey:@"location"];
return r;
}
- (id)changePartStatusAction:(NSString *)_newStatus {
[self logWithFormat:@"TODO: should %@: %@", _newStatus, [self clientObject]];
return [self redirectToViewerWithError:
[_newStatus stringByAppendingString:@" not implemented!"]];
}
- (id)markAcceptedAction {
return [self changePartStatusAction:@"ACCEPTED"];
}
- (id)markDeclinedAction {
return [self changePartStatusAction:@"DECLINED"];
}
- (id)markTentativeAction {
return [self changePartStatusAction:@"TENTATIVE"];
}
@end /* UIxMailPartICalAction */
+370
View File
@@ -0,0 +1,370 @@
/*
Copyright (C) 2004-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.
*/
#include "UIxMailPartViewer.h"
/*
UIxMailPartICalViewer
Show plain/calendar mail parts.
*/
@class SOGoDateFormatter;
@class iCalEvent, iCalCalendar;
@interface UIxMailPartICalViewer : UIxMailPartViewer
{
iCalCalendar *inCalendar;
iCalEvent *inEvent;
id attendee;
SOGoDateFormatter *dateFormatter;
id item;
id storedEventObject;
iCalEvent *storedEvent;
}
- (iCalEvent *)authorativeEvent;
@end
#include <SOGoUI/SOGoDateFormatter.h>
#include <SOGo/SOGoAppointment.h>
#include <SOGo/SOGoUser.h>
#include <SoObjects/Appointments/SOGoAppointmentFolder.h>
#include <SoObjects/Appointments/SOGoAppointmentObject.h>
#include <SoObjects/Mailer/SOGoMailObject.h>
#include <NGiCal/NGiCal.h>
#include <NGImap4/NGImap4EnvelopeAddress.h>
#include "common.h"
@implementation UIxMailPartICalViewer
- (void)dealloc {
[self->storedEventObject release];
[self->storedEvent release];
[self->attendee release];
[self->item release];
[self->inCalendar release];
[self->inEvent release];
[self->dateFormatter release];
[super dealloc];
}
/* maintain caches */
- (void)resetPathCaches {
[super resetPathCaches];
[self->inEvent release]; self->inEvent = nil;
[self->inCalendar release]; self->inCalendar = nil;
[self->storedEventObject release]; self->storedEventObject = nil;
[self->storedEvent release]; self->storedEvent = nil;
/* not strictly path-related, but useless without it anyway: */
[self->attendee release]; self->attendee = nil;
[self->item release]; self->item = nil;
}
/* raw content handling */
- (NSStringEncoding)fallbackStringEncoding {
/*
iCalendar invitations sent by Outlook 2002 have the annoying bug that the
mail states an UTF-8 content encoding but the actual iCalendar content is
encoding in Latin-1 (or Windows Western?).
As a result the content decoding will fail (TODO: always?). In this case we
try to decode with Latin-1.
Note: we could check for the Outlook x-mailer, but it was considered better
to try Latin-1 as a fallback in any case (be tolerant).
*/
return NSISOLatin1StringEncoding;
}
/* accessors */
- (iCalCalendar *)inCalendar {
NSString *iCalString;
if (self->inCalendar != nil)
return [self->inCalendar isNotNull] ? self->inCalendar : nil;
if ((iCalString = [self flatContentAsString]) == nil) {
[self errorWithFormat:@"Could not retrieve content string for part!"];
self->inCalendar = [[NSNull null] retain];
return nil;
}
self->inCalendar =
[[iCalCalendar parseCalendarFromSource:iCalString] retain];
if (self->inCalendar == nil) {
[self warnWithFormat:@"Could not parse a vcalendar string."];
self->inCalendar = [[NSNull null] retain];
return nil;
}
else
return self->inCalendar;
}
- (BOOL)couldParseCalendar {
return [[self inCalendar] isNotNull];
}
- (iCalEvent *)inEvent {
NSArray *events;
if (self->inEvent != nil)
return [self->inEvent isNotNull] ? self->inEvent : nil;
events = [[self inCalendar] events];
if ([events count] > 0) {
self->inEvent = [[events objectAtIndex:0] retain];
return self->inEvent;
}
else {
self->inEvent = [[NSNull null] retain];
return nil;
}
}
/* formatters */
- (SOGoDateFormatter *)dateFormatter {
if (self->dateFormatter == nil) {
self->dateFormatter =
[[SOGoDateFormatter alloc] initWithLocale:[self locale]];
[self->dateFormatter setFullWeekdayNameAndDetails];
}
return self->dateFormatter;
}
/* below is copied from UIxAppointmentView, can we avoid that? */
- (void)setAttendee:(id)_attendee {
ASSIGN(self->attendee, _attendee);
}
- (id)attendee {
return self->attendee;
}
- (void)setItem:(id)_item {
ASSIGN(self->item, _item);
}
- (id)item {
return self->item;
}
- (NSCalendarDate *)startTime {
NSCalendarDate *date;
date = [[self authorativeEvent] startDate];
[date setTimeZone:[self viewTimeZone]];
return date;
}
- (NSCalendarDate *)endTime {
NSCalendarDate *date;
date = [[self authorativeEvent] endDate];
[date setTimeZone:[self viewTimeZone]];
return date;
}
- (BOOL)isEndDateOnSameDay {
return [[self startTime] isDateOnSameDay:[self endTime]];
}
- (NSTimeInterval)duration {
return [[self endTime] timeIntervalSinceDate:[self startTime]];
}
/* calendar folder support */
- (id)calendarFolder {
/* return scheduling calendar of currently logged-in user */
return [[[self context] activeUser] schedulingCalendarInContext:
[self context]];
}
- (id)storedEventObject {
/* lookup object in the users Calendar */
id calendar;
if (self->storedEventObject != nil)
return [self->storedEventObject isNotNull] ? self->storedEventObject : nil;
calendar = [self calendarFolder];
if ([calendar isKindOfClass:[NSException class]]) {
[self errorWithFormat:@"Did not find Calendar folder: %@", calendar];
}
else {
NSString *filename;
filename = [calendar resourceNameForEventUID:[[self inEvent] uid]];
if (filename != nil) {
// TODO: When we get an exception, this might be an auth issue meaning
// that the UID indeed exists but that the user has no access to
// the object.
// Of course this is quite unusual for the private calendar though.
id tmp;
tmp = [calendar lookupName:filename inContext:[self context] acquire:NO];
if ([tmp isNotNull] && ![tmp isKindOfClass:[NSException class]])
self->storedEventObject = [tmp retain];
}
}
if (self->storedEventObject == nil)
self->storedEventObject = [[NSNull null] retain];
return self->storedEventObject;
}
- (BOOL)isEventStoredInCalendar {
return [[self storedEventObject] isNotNull];
}
- (iCalEvent *)storedEvent {
return [(SOGoAppointmentObject *)[self storedEventObject] event];
}
/* organizer tracking */
- (NSString *)loggedInUserEMail {
return [[[self context] activeUser] email];
}
- (iCalEvent *)authorativeEvent {
/* DB is considered master, when in DB, ignore mail organizer */
return [self isEventStoredInCalendar]
? [self storedEvent]
: [self inEvent];
}
- (BOOL)isLoggedInUserTheOrganizer {
NSString *loginEMail;
if ((loginEMail = [self loggedInUserEMail]) == nil) {
[self warnWithFormat:@"Could not determine email of logged in user?"];
return NO;
}
return [[self authorativeEvent] isOrganizer:loginEMail];
}
- (BOOL)isLoggedInUserAnAttendee {
NSString *loginEMail;
if ((loginEMail = [self loggedInUserEMail]) == nil) {
[self warnWithFormat:@"Could not determine email of logged in user?"];
return NO;
}
return [[self authorativeEvent] isParticipant:loginEMail];
}
/* derived fields */
- (NSString *)organizerDisplayName {
iCalPerson *organizer;
NSString *cn;
if ((organizer = [[self authorativeEvent] organizer]) != nil) {
cn = [organizer valueForKey:@"cnForDisplay"];
if ([cn isNotNull] && [cn length] > 0)
return cn;
cn = [organizer valueForKey:@"rfc822Email"];
if ([cn isNotNull] && [cn length] > 0)
return cn;
return @"[error: unable to derive organizer name]";
}
return @"[todo: no organizer set, use 'from']";
}
/* replies */
- (NGImap4EnvelopeAddress *)replySenderAddress {
/*
The iMIP reply is the sender of the mail, the 'attendees' are NOT set to
the actual attendees. BUT the attendee field contains the reply-status!
*/
id tmp;
tmp = [[self clientObject] fromEnvelopeAddresses];
if ([tmp count] == 0) return nil;
return [tmp objectAtIndex:0];
}
- (NSString *)replySenderEMail {
return [[self replySenderAddress] email];
}
- (NSString *)replySenderBaseEMail {
return [[self replySenderAddress] baseEMail];
}
- (iCalPerson *)inReplyAttendee {
NSArray *attendees;
attendees = [[self inEvent] attendees];
if ([attendees count] == 0)
return nil;
if ([attendees count] > 1)
[self warnWithFormat:@"More than one attendee in REPLY: %@", attendees];
return [attendees objectAtIndex:0];
}
- (iCalPerson *)storedReplyAttendee {
/*
TODO: since an attendee can have multiple email addresses, maybe we
should translate the email to an internal uid and then retrieve
all emails addresses for matching the participant.
Note: -findParticipantWithEmail: does not parse the email!
*/
iCalEvent *e;
iCalPerson *p;
if ((e = [self storedEvent]) == nil)
return nil;
if ((p = [e findParticipantWithEmail:[self replySenderBaseEMail]]))
return p;
if ((p = [e findParticipantWithEmail:[self replySenderEMail]]))
return p;
return nil;
}
- (BOOL)isReplySenderAnAttendee {
return [[self storedReplyAttendee] isNotNull];
}
/* action URLs */
- (id)acceptLink {
return [[self pathToAttachmentObject] stringByAppendingString:@"/accept"];
}
- (id)declineLink {
return [[self pathToAttachmentObject] stringByAppendingString:@"/decline"];
}
- (id)tentativeLink {
return [[self pathToAttachmentObject] stringByAppendingString:@"/tentative"];
}
@end /* UIxMailPartICalViewer */
@@ -0,0 +1,54 @@
/*
Copyright (C) 2004-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.
*/
#include "UIxMailPartViewer.h"
@interface UIxMailPartImageViewer : UIxMailPartViewer
{
}
@end
#include "common.h"
@implementation UIxMailPartImageViewer
/* URLs */
- (NSString *)pathToImage {
NSString *url;
NSString *s;
url = [[self clientObject] baseURLInContext:[self context]];
if (![url hasSuffix:@"/"]) url = [url stringByAppendingString:@"/"];
s = [[self partPath] componentsJoinedByString:@"/"];
url = [url stringByAppendingString:s];
if ((s = [self preferredPathExtension]) != nil) {
url = [url stringByAppendingString:@"."];
url = [url stringByAppendingString:s];
}
return url;
}
@end /* UIxMailPartImageViewer */
@@ -0,0 +1,53 @@
/*
Copyright (C) 2004-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_UIxMailPartLinkViewer_H__
#define __Mailer_UIxMailPartLinkViewer_H__
#include "UIxMailPartViewer.h"
/*
UIxMailPartLinkViewer
The generic viewer for all kinds of attachments. Renders a link to download
the attachment.
TODO: show info based on the 'bodyInfo' dictionary:
{
bodyId = "";
description = "";
encoding = BASE64;
parameterList = {
"x-unix-mode" = 0666;
name = "IncoWEBOpenGroupwarepresentation.pdf";
};
size = 1314916;
subtype = PDF; type = application;
}
*/
@interface UIxMailPartLinkViewer : UIxMailPartViewer
{
}
@end
#endif /* __Mailer_UIxMailPartLinkViewer_H__ */
@@ -0,0 +1,28 @@
/*
Copyright (C) 2004-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.
*/
#include "UIxMailPartLinkViewer.h"
#include "common.h"
@implementation UIxMailPartLinkViewer
@end /* UIxMailPartLinkViewer */
@@ -0,0 +1,153 @@
/*
Copyright (C) 2004-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.
*/
#include "UIxMailPartViewer.h"
/*
UIxMailPartMessageViewer
Show message/rfc822 mail parts. Note that the IMAP4 server already returns a
proper body structure of the message.
Relevant body-info keys:
to/sender/from/cc/bcc/in-reply-to/reply-to - array of addr-dicts
type/subtype - message/RFC822
size
subject
parameterList - dict (eg 'name')
messageId
date
encoding - 7BIT
bodyLines - 83
bodyId - (empty string?)
description - (empty string?, content-description?)
body - a body structure?
Addr-Dict:
hostName / mailboxName / personalName / sourceRoute
*/
@class NGImap4Envelope;
@interface UIxMailPartMessageViewer : UIxMailPartViewer
{
NGImap4Envelope *envelope;
id currentAddress;
}
@end
#include <UI/MailerUI/WOContext+UIxMailer.h>
#include "UIxMailRenderingContext.h"
#include <NGImap4/NGImap4Envelope.h>
#include <NGImap4/NGImap4EnvelopeAddress.h>
#include "common.h"
@implementation UIxMailPartMessageViewer
- (void)dealloc {
[self->currentAddress release];
[self->envelope release];
[super dealloc];
}
/* cache maintenance */
- (void)resetBodyInfoCaches {
[super resetBodyInfoCaches];
[self->envelope release]; self->envelope = nil;
[self->currentAddress release]; self->currentAddress = nil;
}
/* notifications */
- (void)sleep {
[self->currentAddress release]; self->currentAddress = nil;
[super sleep];
}
/* accessors */
- (void)setCurrentAddress:(id)_addr {
ASSIGN(self->currentAddress, _addr);
}
- (id)currentAddress {
return self->currentAddress;
}
/* nested body structure */
- (id)contentInfo {
return [[self bodyInfo] valueForKey:@"body"];
}
- (id)contentPartPath {
/*
Path processing is a bit weird in the context of message/rfc822. If we have
a multipart, the multipart itself has no own identifier! Instead the
children of the multipart are directly mapped into the message namespace.
If the message has just a plain content, ids seems to be as expected (that
is, its just a "1").
*/
NSArray *pp;
NSString *mt;
mt = [[[self contentInfo] valueForKey:@"type"] lowercaseString];
if ([mt isEqualToString:@"multipart"])
return [self partPath];
pp = [self partPath];
return [pp count] > 0
? [pp arrayByAddingObject:@"1"]
: [NSArray arrayWithObject:@"1"];
}
- (id)contentViewerComponent {
id info;
info = [self contentInfo];
return [[[self context] mailRenderingContext] viewerForBodyInfo:info];
}
/* generating envelope */
- (NGImap4Envelope *)envelope {
if (self->envelope == nil) {
self->envelope = [[NGImap4Envelope alloc] initWithBodyStructureInfo:
[self bodyInfo]];
}
return self->envelope;
}
/* links to recipients */
- (NSString *)linkToEnvelopeAddress:(NGImap4EnvelopeAddress *)_address {
// TODO: make some web-link, eg open a new compose panel?
return [@"mailto:" stringByAppendingString:[_address baseEMail]];
}
- (NSString *)currentAddressLink {
return [self linkToEnvelopeAddress:[self currentAddress]];
}
@end /* UIxMailPartMessageViewer */
@@ -0,0 +1,90 @@
/*
Copyright (C) 2004-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.
*/
#include "UIxMailPartViewer.h"
@interface UIxMailPartMixedViewer : UIxMailPartViewer
{
id childInfo;
unsigned int childIndex;
}
@end
#include "UIxMailRenderingContext.h"
#include <UI/MailerUI/WOContext+UIxMailer.h>
#include "common.h"
@implementation UIxMailPartMixedViewer
- (void)dealloc {
[self->childInfo release];
[super dealloc];
}
/* caches */
- (void)resetBodyInfoCaches {
[self->childInfo release]; self->childInfo = nil;
[super resetBodyInfoCaches];
}
/* accessors */
- (void)setChildInfo:(id)_info {
ASSIGN(self->childInfo, _info);
}
- (id)childInfo {
return self->childInfo;
}
- (void)setChildIndex:(unsigned int)_index {
self->childIndex = _index;
}
- (unsigned int)childIndex {
return self->childIndex;
}
- (NSString *)childPartName {
char buf[8];
sprintf(buf, "%d", [self childIndex] + 1);
return [NSString stringWithCString:buf];
}
- (id)childPartPath {
NSArray *pp;
pp = [self partPath];
return [pp count] > 0
? [pp arrayByAddingObject:[self childPartName]]
: [NSArray arrayWithObject:[self childPartName]];
}
/* nested viewers */
- (id)contentViewerComponent {
id info;
info = [self childInfo];
return [[[self context] mailRenderingContext] viewerForBodyInfo:info];
}
@end /* UIxMailPartMixedViewer */
@@ -0,0 +1,43 @@
/*
Copyright (C) 2004-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.
*/
#include "UIxMailPartViewer.h"
/*
UIxMailPartTextViewer
Show plain/text mail parts in a <pre> section.
TODO: add server side wrapping.
TODO: add contained link detection.
*/
@interface UIxMailPartTextViewer : UIxMailPartViewer
{
}
@end
#include "common.h"
@implementation UIxMailPartTextViewer
@end /* UIxMailPartTextViewer */
+82
View File
@@ -0,0 +1,82 @@
/*
Copyright (C) 2004-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_UIxMailPartViewer_H__
#define __Mailer_UIxMailPartViewer_H__
#include <SOGoUI/UIxComponent.h>
/*
UIxMailPartViewer
This class is the superclass for MIME content viewers.
Since part-viewers can be reused for multiple parts, you need to be careful
in subclass to properly reset your specific state by overriding
- resetPathCaches
The part viewers have access to the rendering state using the
[[self context] mailRenderingContext]
object. This class provides several convenience methods to access mailpart
content.
*/
@class NSData, NSArray, NSFormatter;
@interface UIxMailPartViewer : UIxComponent
{
NSArray *partPath;
id bodyInfo;
NSData *flatContent;
}
/* accessors */
- (void)setPartPath:(NSArray *)_path;
- (NSArray *)partPath;
- (void)setBodyInfo:(id)_info;
- (id)bodyInfo;
- (NSData *)flatContent;
- (NSData *)decodedFlatContent;
- (NSString *)flatContentAsString;
- (NSString *)preferredPathExtension;
- (NSString *)filename;
- (NSString *)filenameForDisplay;
- (NSFormatter *)sizeFormatter;
/* caches */
- (void)resetPathCaches;
- (void)resetBodyInfoCaches;
/* part URLs */
- (NSString *)pathToAttachmentObject; /* link to SoObject */
- (NSString *)pathToAttachment; /* download link */
@end
#endif /* __Mailer_UIxMailPartViewer_H__ */
+294
View File
@@ -0,0 +1,294 @@
/*
Copyright (C) 2004-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.
*/
#include "UIxMailPartViewer.h"
#include "UIxMailRenderingContext.h"
#include "UIxMailSizeFormatter.h"
#include "../MailerUI/WOContext+UIxMailer.h"
#include <NGExtensions/NSString+Encoding.h>
#include "common.h"
@implementation UIxMailPartViewer
- (void)dealloc {
[self->flatContent release];
[self->bodyInfo release];
[self->partPath release];
[super dealloc];
}
/* caches */
- (void)resetPathCaches {
/* this is called when -setPartPath: is called */
[self->flatContent release]; self->flatContent = nil;
}
- (void)resetBodyInfoCaches {
}
/* notifications */
- (void)sleep {
[self resetPathCaches];
[self resetBodyInfoCaches];
[self->partPath release]; self->partPath = nil;
[self->bodyInfo release]; self->bodyInfo = nil;
[super sleep];
}
/* accessors */
- (void)setPartPath:(NSArray *)_path {
if ([_path isEqual:self->partPath])
return;
ASSIGN(self->partPath, _path);
[self resetPathCaches];
}
- (NSArray *)partPath {
return self->partPath;
}
- (void)setBodyInfo:(id)_info {
ASSIGN(self->bodyInfo, _info);
}
- (id)bodyInfo {
return self->bodyInfo;
}
- (NSData *)flatContent {
if (self->flatContent != nil)
return [self->flatContent isNotNull] ? self->flatContent : nil;
self->flatContent =
[[[[self context] mailRenderingContext] flatContentForPartPath:
[self partPath]] retain];
return self->flatContent;
}
- (NSData *)decodedFlatContent {
NSString *enc;
enc = [[(NSDictionary *)[self bodyInfo]
objectForKey:@"encoding"] lowercaseString];
if ([enc isEqualToString:@"7bit"])
return [self flatContent];
if ([enc isEqualToString:@"8bit"]) // TODO: correct?
return [self flatContent];
if ([enc isEqualToString:@"base64"])
return [[self flatContent] dataByDecodingBase64];
if ([enc isEqualToString:@"quoted-printable"])
return [[self flatContent] dataByDecodingQuotedPrintable];
[self errorWithFormat:@"unsupported MIME encoding: %@", enc];
return [self flatContent];
}
- (NSStringEncoding)fallbackStringEncoding {
return 0;
}
- (NSString *)flatContentAsString {
/* Note: we even have the line count in the body-info! */
NSString *charset;
NSString *s;
NSData *content;
if ((content = [self decodedFlatContent]) == nil) {
[self errorWithFormat:@"got no text content: %@",
[[self partPath] componentsJoinedByString:@"."]];
return nil;
}
charset = [(NSDictionary *)
[(NSDictionary *)[self bodyInfo] objectForKey:@"parameterList"]
objectForKey:@"charset"];
charset = [charset lowercaseString];
// TODO: properly decode charset, might need to handle encoding?
if ([charset length] > 0) {
s = [NSString stringWithData:content usingEncodingNamed:charset];
}
else {
s = [[NSString alloc] initWithData:content encoding:NSUTF8StringEncoding];
s = [s autorelease];
}
if (s == nil) {
/*
Note: this can happend with iCalendar invitations sent by Outlook 2002.
It will mark the content as UTF-8 but actually deliver it as
Latin-1 (or Windows encoding?).
*/
[self errorWithFormat:@"could not convert content to text, charset: '%@'",
charset];
if ([self fallbackStringEncoding] > 0) {
s = [[NSString alloc] initWithData:content
encoding:[self fallbackStringEncoding]];
s = [s autorelease];
if (s == nil) {
[self errorWithFormat:
@" an attempt to use fallback encoding failed to."];
}
}
}
return s;
}
/* path extension */
- (NSString *)pathExtensionForType:(NSString *)_mt subtype:(NSString *)_st {
// TODO: support /etc/mime.types
if (![_mt isNotNull] || ![_st isNotNull])
return nil;
if ([_mt length] == 0) return nil;
if ([_st length] == 0) return nil;
_mt = [_mt lowercaseString];
_st = [_st lowercaseString];
if ([_mt isEqualToString:@"image"]) {
if ([_st isEqualToString:@"gif"]) return @"gif";
if ([_st isEqualToString:@"jpeg"]) return @"jpg";
if ([_st isEqualToString:@"png"]) return @"png";
}
else if ([_mt isEqualToString:@"text"]) {
if ([_st isEqualToString:@"plain"]) return @"txt";
if ([_st isEqualToString:@"xml"]) return @"xml";
if ([_st isEqualToString:@"calendar"]) return @"ics";
if ([_st isEqualToString:@"x-vcard"]) return @"vcf";
}
else if ([_mt isEqualToString:@"message"]) {
if ([_st isEqualToString:@"rfc822"]) return @"mail";
}
else if ([_mt isEqualToString:@"application"]) {
if ([_st isEqualToString:@"pdf"]) return @"pdf";
}
return nil;
}
- (NSString *)preferredPathExtension {
return [self pathExtensionForType:[[self bodyInfo] valueForKey:@"type"]
subtype:[[self bodyInfo] valueForKey:@"subtype"]];
}
- (NSString *)filename {
id tmp;
tmp = [[self bodyInfo] valueForKey:@"parameterList"];
if (![tmp isNotNull])
return nil;
tmp = [tmp valueForKey:@"name"];
if (![tmp isNotNull])
return nil;
if ([tmp length] == 0)
return nil;
return tmp;
}
- (NSString *)filenameForDisplay {
NSString *s;
if ((s = [self filename]) != nil)
return s;
s = [[self partPath] componentsJoinedByString:@"-"];
return ([s length] > 0)
? [@"untitled-" stringByAppendingString:s]
: @"untitled";
}
- (NSFormatter *)sizeFormatter {
return [UIxMailSizeFormatter sharedMailSizeFormatter];
}
/* URL generation */
- (NSString *)pathToAttachmentObject {
/* this points to the SoObject representing the part, no modifications */
NSString *url, *n, *pext;
/* path to mail controller object */
url = [[self clientObject] baseURLInContext:[self context]];
if (![url hasSuffix:@"/"]) url = [url stringByAppendingString:@"/"];
/* mail relative path to body-part */
if ([(n = [[self partPath] componentsJoinedByString:@"/"]) isNotNull]) {
/* eg this was nil for a draft containing an HTML message */
url = [url stringByAppendingString:n];
}
/* we currently NEED the extension for SoObject lookup (should be fixed) */
pext = [self preferredPathExtension];
if ([pext isNotNull] && [pext length] > 0) {
/* attach extension */
if ([url hasSuffix:@"/"]) {
/* this happens if the part is the root-content of the mail */
url = [url substringToIndex:([url length] - 1)];
}
url = [url stringByAppendingString:@"."];
url = [url stringByAppendingString:pext];
}
return url;
}
- (NSString *)pathToAttachment {
/* this generates a more beautiful 'download' URL for a part */
NSString *url, *fn;
fn = [self filename];
if (![fn isNotNull] || ([fn length] == 0))
fn = nil;
/* get basic URL */
url = [self pathToAttachmentObject];
/*
If we have an attachment name, we attach it, this is properly handled by
SOGoMailBodyPart.
*/
if (fn != nil) {
if (![url hasSuffix:@"/"]) url = [url stringByAppendingString:@"/"];
if (isdigit([fn characterAtIndex:0]))
url = [url stringByAppendingString:@"fn-"];
url = [url stringByAppendingString:[fn stringByEscapingURL]];
// TODO: should we check for a proper extension?
}
return url;
}
@end /* UIxMailPartViewer */
@@ -0,0 +1,78 @@
/*
Copyright (C) 2004-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_UIxMailRenderingContext_H__
#define __Mailer_UIxMailRenderingContext_H__
#import <Foundation/NSObject.h>
/*
UIxMailRenderingContext
The rendering context is used to track nesting of mail part viewers.
*/
@class NSData, NSArray, NSDictionary;
@class WOContext, WOComponent;
@interface UIxMailRenderingContext : NSObject
{
WOComponent *viewer; /* non-retained! */
WOContext *context; /* non-retained! */
NSDictionary *flatContents; /* IMAP4 name to NSData */
WOComponent *textViewer;
WOComponent *imageViewer;
WOComponent *linkViewer;
WOComponent *messageViewer;
WOComponent *iCalViewer;
WOComponent *htmlViewer;
}
- (id)initWithViewer:(WOComponent *)_viewer context:(WOContext *)_ctx;
/* state */
- (void)reset;
/* fetching */
- (NSDictionary *)flatContents;
- (NSData *)flatContentForPartPath:(NSArray *)_partPath;
/* viewer components */
- (WOComponent *)viewerForBodyInfo:(id)_info;
@end
#include <NGObjWeb/WOContext.h>
@interface WOContext(UIxMailPart)
- (void)pushMailRenderingContext:(UIxMailRenderingContext *)_mctx;
- (UIxMailRenderingContext *)popMailRenderingContext;
- (UIxMailRenderingContext *)mailRenderingContext;
@end
#endif /* __Mailer_UIxMailRenderingContext_H__ */
@@ -0,0 +1,303 @@
/*
Copyright (C) 2004-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.
*/
#include "UIxMailRenderingContext.h"
#include <SoObjects/Mailer/SOGoMailObject.h>
#include "common.h"
@implementation UIxMailRenderingContext
static BOOL showNamedTextAttachmentsInline = NO;
- (id)initWithViewer:(WOComponent *)_viewer context:(WOContext *)_ctx {
if ((self = [super init])) {
self->viewer = _viewer;
self->context = _ctx;
}
return self;
}
- (id)init {
return [self initWithViewer:nil context:nil];
}
- (void)dealloc {
[self->iCalViewer release];
[self->htmlViewer release];
[self->textViewer release];
[self->imageViewer release];
[self->linkViewer release];
[self->messageViewer release];
[super dealloc];
}
/* resetting state */
- (void)reset {
[self->flatContents release]; self->flatContents = nil;
[self->textViewer release]; self->textViewer = nil;
[self->htmlViewer release]; self->htmlViewer = nil;
[self->imageViewer release]; self->imageViewer = nil;
[self->linkViewer release]; self->linkViewer = nil;
[self->messageViewer release]; self->messageViewer = nil;
[self->iCalViewer release]; self->iCalViewer = nil;
}
/* fetching */
- (NSDictionary *)flatContents {
if (self->flatContents != nil)
return [self->flatContents isNotNull] ? self->flatContents : nil;
self->flatContents =
[[[self->viewer clientObject] fetchPlainTextParts] retain];
[self debugWithFormat:@"CON: %@", self->flatContents];
return self->flatContents;
}
- (NSData *)flatContentForPartPath:(NSArray *)_partPath {
NSString *pid;
pid = _partPath ? [_partPath componentsJoinedByString:@"."] : @"";
return [[self flatContents] objectForKey:pid];
}
/* viewer components */
- (WOComponent *)mixedViewer {
/* Note: we cannot cache the multipart viewers, because it can be nested */
return [self->viewer pageWithName:@"UIxMailPartMixedViewer"];
}
- (WOComponent *)signedViewer {
/* Note: we cannot cache the multipart viewers, because it can be nested */
// TODO: temporary workaround (treat it like a plain mixed part)
return [self mixedViewer];
}
- (WOComponent *)alternativeViewer {
/* Note: we cannot cache the multipart viewers, because it can be nested */
return [self->viewer pageWithName:@"UIxMailPartAlternativeViewer"];
}
- (WOComponent *)textViewer {
if (self->textViewer == nil) {
self->textViewer =
[[self->viewer pageWithName:@"UIxMailPartTextViewer"] retain];
}
return self->textViewer;
}
- (WOComponent *)imageViewer {
if (self->imageViewer == nil) {
self->imageViewer =
[[self->viewer pageWithName:@"UIxMailPartImageViewer"] retain];
}
return self->imageViewer;
}
- (WOComponent *)linkViewer {
if (self->linkViewer == nil) {
self->linkViewer =
[[self->viewer pageWithName:@"UIxMailPartLinkViewer"] retain];
}
return self->linkViewer;
}
- (WOComponent *)htmlViewer {
if (self->htmlViewer == nil) {
self->htmlViewer =
[[self->viewer pageWithName:@"UIxMailPartHTMLViewer"] retain];
}
return self->htmlViewer;
}
- (WOComponent *)messageViewer {
if (self->messageViewer == nil) {
self->messageViewer =
[[self->viewer pageWithName:@"UIxMailPartMessageViewer"] retain];
}
return self->messageViewer;
}
- (WOComponent *)iCalViewer {
if (self->iCalViewer == nil) {
self->iCalViewer =
[[self->viewer pageWithName:@"UIxMailPartICalViewer"] retain];
}
return self->iCalViewer;
}
/* Kolab viewers */
- (WOComponent *)kolabContactViewer {
return [self->viewer pageWithName:@"UIxKolabPartContactViewer"];
}
- (WOComponent *)kolabEventViewer {
return [self->viewer pageWithName:@"UIxKolabPartEventViewer"];
}
- (WOComponent *)kolabTodoViewer {
return [self->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 {
NSString *mt, *st;
mt = [[_info valueForKey:@"type"] lowercaseString];
st = [[_info valueForKey:@"subtype"] lowercaseString];
if ([mt isEqualToString:@"multipart"]) {
if ([st isEqualToString:@"mixed"])
return [self mixedViewer];
if ([st isEqualToString:@"signed"])
return [self signedViewer];
if ([st isEqualToString:@"alternative"])
return [self alternativeViewer];
if ([st isEqualToString:@"report"])
/* this is used by mail-delivery reports */
return [self mixedViewer];
}
else if ([mt isEqualToString:@"text"]) {
/*
Note: in the _info dictionary we do not get the content-disposition
information (inline vs attachment). Our hack is to check for the
'name' parameter.
*/
if ([st isEqualToString:@"plain"] || [st isEqualToString:@"html"]) {
if (!showNamedTextAttachmentsInline) {
NSString *n;
n = [[_info objectForKey:@"parameterList"] objectForKey:@"name"];
if ([n isNotNull] && [n length] > 0)
return [self linkViewer];
}
return [st isEqualToString:@"html"]
? [self htmlViewer] : [self textViewer];
}
if ([st isEqualToString:@"calendar"])
return [self iCalViewer];
}
if ([mt isEqualToString:@"image"])
return [self imageViewer];
if ([mt isEqualToString:@"message"] && [st isEqualToString:@"rfc822"])
return [self messageViewer];
if ([mt isEqualToString:@"message"] &&
[st isEqualToString:@"delivery-status"]) {
/*
Content-Description: Delivery error report
Content-Type: message/delivery-status
Reporting-MTA: dns; mail.opengroupware.org
Arrival-Date: Mon, 18 Jul 2005 12:08:43 +0200 (CEST)
Final-Recipient: rfc822; ioioi@plop.com
Action: failed
Status: 5.0.0
Diagnostic-Code: X-Postfix; host plop.com[64.39.31.55] said: 550 5.7.1
<ioioi@plop.com>... Relaying denied
*/
// Note: we cannot use the text viewer because the body is not pre-fetched
return [self linkViewer];
}
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];
}
#if 0 /* the link viewer looks better than plain text ;-) */
if ([st isEqualToString:@"pgp-signature"]) // TODO: real PGP viewer
return [self textViewer];
#endif
}
// TODO: always fallback to octet viewer?!
#if 1
[self errorWithFormat:@"found no viewer for MIME type: %@/%@", mt, st];
#endif
return [self linkViewer];
}
/* debugging */
- (BOOL)isDebuggingEnabled {
return NO;
}
@end /* UIxMailRenderingContext */
@implementation WOContext(UIxMailPart)
static NSString *MRK = @"UIxMailRenderingContext";
- (void)pushMailRenderingContext:(UIxMailRenderingContext *)_mctx {
[self setObject:_mctx forKey:MRK];
}
- (UIxMailRenderingContext *)popMailRenderingContext {
UIxMailRenderingContext *mctx;
if ((mctx = [self objectForKey:MRK]) == nil)
return nil;
mctx = [[mctx retain] autorelease];
[self removeObjectForKey:MRK];
return mctx;
}
- (UIxMailRenderingContext *)mailRenderingContext {
return [self objectForKey:MRK];
}
@end /* WOContext(UIxMailPart) */
+41
View File
@@ -0,0 +1,41 @@
/*
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_UIxMailSizeFormatter_H__
#define __Mailer_UIxMailSizeFormatter_H__
#include <Foundation/NSFormatter.h>
/*
UIxMailSizeFormatter
This class formats the size values for display.
*/
@interface UIxMailSizeFormatter : NSFormatter
{
}
+ (id)sharedMailSizeFormatter;
@end
#endif /* __Mailer_UIxMailSizeFormatter_H__ */
+52
View File
@@ -0,0 +1,52 @@
/*
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.
*/
#include "UIxMailSizeFormatter.h"
#include "common.h"
@implementation UIxMailSizeFormatter
+ (id)sharedMailSizeFormatter {
static UIxMailSizeFormatter *fmt = nil; // THREAD
if (fmt == nil) fmt = [[self alloc] init];
return fmt;
}
/* formatting */
- (NSString *)stringForSize:(unsigned int)size {
char buf[128];
if (size < 1024)
sprintf(buf, "%d", size);
else if (size < 1024 * 1024)
sprintf(buf, "%.1fK", ((double)size / 1024));
else
sprintf(buf, "%.1fM", ((double)size / 1024 / 1024));
return [NSString stringWithCString:buf];
}
- (NSString *)stringForObjectValue:(id)_object {
return [self stringForSize:[_object unsignedIntValue]];
}
@end /* UIxMailSizeFormatter */
+6
View File
@@ -0,0 +1,6 @@
# version file
SUBMINOR_VERSION:=22
# v0.9.0 requires libNGiCal v4.5.53
# v0.9.1 requires libNGMime v4.5.213
+33
View File
@@ -0,0 +1,33 @@
/*
Copyright (C) 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.
*/
#import <Foundation/Foundation.h>
#if LIB_FOUNDATION_LIBRARY
# include <Foundation/exceptions/GeneralExceptions.h>
#elif NeXT_Foundation_LIBRARY || COCOA_Foundation_LIBRARY
# include <NGExtensions/NGObjectMacros.h>
# include <NGExtensions/NSString+Ext.h>
#endif
#include <NGExtensions/NGExtensions.h>
#include <NGObjWeb/NGObjWeb.h>
#include <NGObjWeb/SoObjects.h>
+31
View File
@@ -0,0 +1,31 @@
{
requires = ( MAIN, MailerUI );
publicResources = (
);
factories = {
};
categories = {
SOGoCalendarMailBodyPart = {
methods = {
accept = {
protectedBy = "View";
actionClass = "UIxMailPartICalAction";
actionName = "markAccepted";
};
decline = {
protectedBy = "View";
actionClass = "UIxMailPartICalAction";
actionName = "markDeclined";
};
tentative = {
protectedBy = "View";
actionClass = "UIxMailPartICalAction";
actionName = "markTentative";
};
};
};
};
}