Compare commits

...

84 Commits

Author SHA1 Message Date
sspitzer%netscape.com
2e740252e7 some perf tweaks from neil
git-svn-id: svn://10.0.0.236/branches/ANYTHING_FOR_PUTTERMAN_BRANCH@128680 18797224-902f-48f8-a5cc-f745e15eee43
2002-09-02 21:44:49 +00:00
sspitzer%netscape.com
42f98c78ce minor tweak
git-svn-id: svn://10.0.0.236/branches/ANYTHING_FOR_PUTTERMAN_BRANCH@128678 18797224-902f-48f8-a5cc-f745e15eee43
2002-09-02 21:14:08 +00:00
sspitzer%netscape.com
5157b4e590 foobar
git-svn-id: svn://10.0.0.236/branches/ANYTHING_FOR_PUTTERMAN_BRANCH@128677 18797224-902f-48f8-a5cc-f745e15eee43
2002-09-02 21:02:28 +00:00
sspitzer%netscape.com
078e56ffb7 changes for perf...
git-svn-id: svn://10.0.0.236/branches/ANYTHING_FOR_PUTTERMAN_BRANCH@128676 18797224-902f-48f8-a5cc-f745e15eee43
2002-09-02 20:48:34 +00:00
sspitzer%netscape.com
7a6f671640 more foo.
git-svn-id: svn://10.0.0.236/branches/ANYTHING_FOR_PUTTERMAN_BRANCH@128672 18797224-902f-48f8-a5cc-f745e15eee43
2002-09-02 18:39:50 +00:00
sspitzer%netscape.com
3367afd97f more foo for bar.
git-svn-id: svn://10.0.0.236/branches/ANYTHING_FOR_PUTTERMAN_BRANCH@128671 18797224-902f-48f8-a5cc-f745e15eee43
2002-09-02 18:30:12 +00:00
sspitzer%netscape.com
12af4537f9 more hacking to improve startup time.
git-svn-id: svn://10.0.0.236/branches/ANYTHING_FOR_PUTTERMAN_BRANCH@128670 18797224-902f-48f8-a5cc-f745e15eee43
2002-09-02 18:21:33 +00:00
varga%netscape.com
43b19ae41e We don't need whole addressing widget JS. Uncommenting communicator overlay back.
git-svn-id: svn://10.0.0.236/branches/ANYTHING_FOR_PUTTERMAN_BRANCH@128497 18797224-902f-48f8-a5cc-f745e15eee43
2002-08-29 22:37:32 +00:00
varga%netscape.com
86453664a2 speeding up compose window by delaying startup precudure
git-svn-id: svn://10.0.0.236/branches/ANYTHING_FOR_PUTTERMAN_BRANCH@128486 18797224-902f-48f8-a5cc-f745e15eee43
2002-08-29 21:19:29 +00:00
sspitzer%netscape.com
41c9a9838e backing out a fix, causing problems.
git-svn-id: svn://10.0.0.236/branches/ANYTHING_FOR_PUTTERMAN_BRANCH@128483 18797224-902f-48f8-a5cc-f745e15eee43
2002-08-29 20:36:37 +00:00
sspitzer%netscape.com
1c99f6c813 do messenger's onload on a timeout.
according to hyatt and blake, the window won't show til your onload handler is done.  so don't delay window showing by doing a bunch of work that you don't have to in the onload.

don't hide account central or load the start page, since we don't have to.


git-svn-id: svn://10.0.0.236/branches/ANYTHING_FOR_PUTTERMAN_BRANCH@128446 18797224-902f-48f8-a5cc-f745e15eee43
2002-08-29 08:18:24 +00:00
sspitzer%netscape.com
1fd11c51f1 removing mailMessengerOverlay
git-svn-id: svn://10.0.0.236/branches/ANYTHING_FOR_PUTTERMAN_BRANCH@128442 18797224-902f-48f8-a5cc-f745e15eee43
2002-08-29 07:37:36 +00:00
sspitzer%netscape.com
a362bab9cf add scrollable, selectable headers
git-svn-id: svn://10.0.0.236/branches/ANYTHING_FOR_PUTTERMAN_BRANCH@128439 18797224-902f-48f8-a5cc-f745e15eee43
2002-08-29 06:38:52 +00:00
sspitzer%netscape.com
825ccb8726 hard code in smime support.
git-svn-id: svn://10.0.0.236/branches/ANYTHING_FOR_PUTTERMAN_BRANCH@128414 18797224-902f-48f8-a5cc-f745e15eee43
2002-08-29 02:28:36 +00:00
sspitzer%netscape.com
1422945b65 removing the platform overlay.
it's empty on windows, and stand alone mail is windows only right now.


git-svn-id: svn://10.0.0.236/branches/ANYTHING_FOR_PUTTERMAN_BRANCH@128398 18797224-902f-48f8-a5cc-f745e15eee43
2002-08-28 23:22:44 +00:00
sspitzer%netscape.com
61549a4864 collapse platformMailnewsOverlay.xul for perf.
git-svn-id: svn://10.0.0.236/branches/ANYTHING_FOR_PUTTERMAN_BRANCH@128397 18797224-902f-48f8-a5cc-f745e15eee43
2002-08-28 23:01:59 +00:00
sspitzer%netscape.com
6715c7a786 collapse threadPane.xul, folderPane.xul into messenger.xul
collapse folderpane.dtd, threadpane.dtd into messenger.dtd


git-svn-id: svn://10.0.0.236/branches/ANYTHING_FOR_PUTTERMAN_BRANCH@128396 18797224-902f-48f8-a5cc-f745e15eee43
2002-08-28 22:46:56 +00:00
sspitzer%netscape.com
d40ee50ca2 putting threadPane.css folderPane.css and threadPaneLabel.css into mailWindow.css
removing some navigator stuff from classic.jar


git-svn-id: svn://10.0.0.236/branches/ANYTHING_FOR_PUTTERMAN_BRANCH@128394 18797224-902f-48f8-a5cc-f745e15eee43
2002-08-28 22:46:13 +00:00
sspitzer%netscape.com
337a9cf936 remove toolbar grippy and the constructors that deal with it. thanks to blake for the tip.
git-svn-id: svn://10.0.0.236/branches/ANYTHING_FOR_PUTTERMAN_BRANCH@128389 18797224-902f-48f8-a5cc-f745e15eee43
2002-08-28 21:53:50 +00:00
sspitzer%netscape.com
b35d9898de remove unnecessary wav
git-svn-id: svn://10.0.0.236/branches/ANYTHING_FOR_PUTTERMAN_BRANCH@128387 18797224-902f-48f8-a5cc-f745e15eee43
2002-08-28 21:45:38 +00:00
sspitzer%netscape.com
b3af92b208 launch ns 7.0, instead of mozilla.
git-svn-id: svn://10.0.0.236/branches/ANYTHING_FOR_PUTTERMAN_BRANCH@128379 18797224-902f-48f8-a5cc-f745e15eee43
2002-08-28 20:48:48 +00:00
sspitzer%netscape.com
e244995975 more work for new compose ui
git-svn-id: svn://10.0.0.236/branches/ANYTHING_FOR_PUTTERMAN_BRANCH@128320 18797224-902f-48f8-a5cc-f745e15eee43
2002-08-28 01:39:21 +00:00
sspitzer%netscape.com
54e49bd355 part of the new compose window. this one supports offline, but doesn't have the new ab UI.
going for OE / eudora like UI first.


git-svn-id: svn://10.0.0.236/branches/ANYTHING_FOR_PUTTERMAN_BRANCH@128319 18797224-902f-48f8-a5cc-f745e15eee43
2002-08-28 01:14:23 +00:00
sspitzer%netscape.com
30e605ce52 once again, land blake's autocomplete changes for a new compose window.
git-svn-id: svn://10.0.0.236/branches/ANYTHING_FOR_PUTTERMAN_BRANCH@128317 18797224-902f-48f8-a5cc-f745e15eee43
2002-08-28 00:44:28 +00:00
cavin%netscape.com
4de40b6d93 Made aim screen name a standard column in the addrbook.
git-svn-id: svn://10.0.0.236/branches/ANYTHING_FOR_PUTTERMAN_BRANCH@128301 18797224-902f-48f8-a5cc-f745e15eee43
2002-08-27 22:54:47 +00:00
sspitzer%netscape.com
26f7ff5570 for minotaur, none of this is needed.
git-svn-id: svn://10.0.0.236/branches/ANYTHING_FOR_PUTTERMAN_BRANCH@128273 18797224-902f-48f8-a5cc-f745e15eee43
2002-08-27 19:29:20 +00:00
sspitzer%netscape.com
f740dc1c23 make the folder pane a little wider.
git-svn-id: svn://10.0.0.236/branches/ANYTHING_FOR_PUTTERMAN_BRANCH@128268 18797224-902f-48f8-a5cc-f745e15eee43
2002-08-27 18:48:56 +00:00
cavin%netscape.com
8ead2f036d Added msgbaseutil to REQUIRES list.
git-svn-id: svn://10.0.0.236/branches/ANYTHING_FOR_PUTTERMAN_BRANCH@127895 18797224-902f-48f8-a5cc-f745e15eee43
2002-08-22 22:36:47 +00:00
cavin%netscape.com
4e77ceb956 Added nsAbSyncList.cpp source list.
git-svn-id: svn://10.0.0.236/branches/ANYTHING_FOR_PUTTERMAN_BRANCH@127892 18797224-902f-48f8-a5cc-f745e15eee43
2002-08-22 22:34:00 +00:00
cavin%netscape.com
81b0a5907f Delete all 'email member' cards when a mailing list is deleted.
git-svn-id: svn://10.0.0.236/branches/ANYTHING_FOR_PUTTERMAN_BRANCH@127723 18797224-902f-48f8-a5cc-f745e15eee43
2002-08-20 22:16:57 +00:00
cavin%netscape.com
3852377ef3 Added code for mailing list support.
git-svn-id: svn://10.0.0.236/branches/ANYTHING_FOR_PUTTERMAN_BRANCH@127519 18797224-902f-48f8-a5cc-f745e15eee43
2002-08-17 00:47:50 +00:00
cavin%netscape.com
1f5fc0f66d Added a few card properties (in nsIAbCard.idl) and a few new functions for mailing list absync.
git-svn-id: svn://10.0.0.236/branches/ANYTHING_FOR_PUTTERMAN_BRANCH@127518 18797224-902f-48f8-a5cc-f745e15eee43
2002-08-17 00:43:10 +00:00
sspitzer%netscape.com
8411df4f52 comment
git-svn-id: svn://10.0.0.236/branches/ANYTHING_FOR_PUTTERMAN_BRANCH@127356 18797224-902f-48f8-a5cc-f745e15eee43
2002-08-15 06:51:14 +00:00
sspitzer%netscape.com
77a1c87c95 even though this is stand alone mail, add back in some of the the UI for launching editor and browser.
now, add a crude hack to nsIExternalProtocolService.idl so that we can launch the default editor and browser instead.  this of this as reverse altmail.


git-svn-id: svn://10.0.0.236/branches/ANYTHING_FOR_PUTTERMAN_BRANCH@127351 18797224-902f-48f8-a5cc-f745e15eee43
2002-08-15 05:52:07 +00:00
sspitzer%netscape.com
f21333d6d5 fix this: updating: skin/classic/messenger/messageKeywords.css (deflated 23%)
zip warning: name not matched: skin/classic/messenger/messageKeywords.css


git-svn-id: svn://10.0.0.236/branches/ANYTHING_FOR_PUTTERMAN_BRANCH@127204 18797224-902f-48f8-a5cc-f745e15eee43
2002-08-13 23:04:26 +00:00
bienvenu%netscape.com
9ca986ff28 clean up js exceptions when reading non-imap msg
git-svn-id: svn://10.0.0.236/branches/ANYTHING_FOR_PUTTERMAN_BRANCH@127105 18797224-902f-48f8-a5cc-f745e15eee43
2002-08-12 22:36:00 +00:00
bienvenu%netscape.com
42dc236667 clean up js exceptions when reading local msg
git-svn-id: svn://10.0.0.236/branches/ANYTHING_FOR_PUTTERMAN_BRANCH@127104 18797224-902f-48f8-a5cc-f745e15eee43
2002-08-12 22:34:25 +00:00
bienvenu%netscape.com
1013c8241a clean up js exceptions when reading news msg
git-svn-id: svn://10.0.0.236/branches/ANYTHING_FOR_PUTTERMAN_BRANCH@127103 18797224-902f-48f8-a5cc-f745e15eee43
2002-08-12 22:33:33 +00:00
sspitzer%netscape.com
82e60bafb7 landing initial work for stand alone mail application. still more to do, see (http://www.mozilla.org/mailnews/minotaur/index.html)
git-svn-id: svn://10.0.0.236/branches/ANYTHING_FOR_PUTTERMAN_BRANCH@127023 18797224-902f-48f8-a5cc-f745e15eee43
2002-08-11 08:08:46 +00:00
sspitzer%netscape.com
ba0fea49b6 supplimental fix for #124269. send focus to thread pane, after we forward the command to it.
git-svn-id: svn://10.0.0.236/branches/ANYTHING_FOR_PUTTERMAN_BRANCH@126613 18797224-902f-48f8-a5cc-f745e15eee43
2002-08-07 05:28:28 +00:00
sspitzer%netscape.com
0ebfa86055 fix js errors when opening the edit menu, when you have a server selected.
git-svn-id: svn://10.0.0.236/branches/ANYTHING_FOR_PUTTERMAN_BRANCH@126540 18797224-902f-48f8-a5cc-f745e15eee43
2002-08-06 22:09:22 +00:00
sspitzer%netscape.com
e42a190ef3 fix #124269 (select all in folder pane fwds to thread pane) and #161333 (js warning).
git-svn-id: svn://10.0.0.236/branches/ANYTHING_FOR_PUTTERMAN_BRANCH@126531 18797224-902f-48f8-a5cc-f745e15eee43
2002-08-06 18:50:16 +00:00
sspitzer%netscape.com
9e3d99d9b5 fix for http://bugscape.netscape.com/show_bug.cgi?id=18674.
when building up the folder URI for where to copy sent or read mail
convert from UCS to UTF8, for non ascii folder names.


git-svn-id: svn://10.0.0.236/branches/ANYTHING_FOR_PUTTERMAN_BRANCH@126406 18797224-902f-48f8-a5cc-f745e15eee43
2002-08-06 01:35:00 +00:00
sspitzer%netscape.com
eedcd1d863 bring over some of bryner's porting work
git-svn-id: svn://10.0.0.236/branches/ANYTHING_FOR_PUTTERMAN_BRANCH@126367 18797224-902f-48f8-a5cc-f745e15eee43
2002-08-05 20:51:45 +00:00
sspitzer%netscape.com
be9153f907 changes for mac
git-svn-id: svn://10.0.0.236/branches/ANYTHING_FOR_PUTTERMAN_BRANCH@126366 18797224-902f-48f8-a5cc-f745e15eee43
2002-08-05 20:42:43 +00:00
sspitzer%netscape.com
20dc31ce61 changes for linux.
git-svn-id: svn://10.0.0.236/branches/ANYTHING_FOR_PUTTERMAN_BRANCH@126365 18797224-902f-48f8-a5cc-f745e15eee43
2002-08-05 20:40:55 +00:00
sspitzer%netscape.com
f0a6d55e6c classic work for extensible mailnews UI.
git-svn-id: svn://10.0.0.236/branches/ANYTHING_FOR_PUTTERMAN_BRANCH@126318 18797224-902f-48f8-a5cc-f745e15eee43
2002-08-04 18:04:23 +00:00
sspitzer%netscape.com
d458f41d1a classic work for extensible mailnews UI.
git-svn-id: svn://10.0.0.236/branches/ANYTHING_FOR_PUTTERMAN_BRANCH@126317 18797224-902f-48f8-a5cc-f745e15eee43
2002-08-04 17:58:35 +00:00
sspitzer%netscape.com
8375af7917 add conditional UI for saving imap mail that you read into a local folder.
git-svn-id: svn://10.0.0.236/branches/ANYTHING_FOR_PUTTERMAN_BRANCH@126218 18797224-902f-48f8-a5cc-f745e15eee43
2002-08-02 04:33:15 +00:00
sspitzer%netscape.com
2ccd2f7e5d add flex, so the thread pane isn't squashed.
git-svn-id: svn://10.0.0.236/branches/ANYTHING_FOR_PUTTERMAN_BRANCH@126213 18797224-902f-48f8-a5cc-f745e15eee43
2002-08-02 03:35:46 +00:00
sspitzer%netscape.com
8ef8c0963a moving extra toolbar around...
git-svn-id: svn://10.0.0.236/branches/ANYTHING_FOR_PUTTERMAN_BRANCH@126212 18797224-902f-48f8-a5cc-f745e15eee43
2002-08-02 03:26:24 +00:00
sspitzer%netscape.com
2b966340c7 make the keyword stuff work for multiple keywords.
git-svn-id: svn://10.0.0.236/branches/ANYTHING_FOR_PUTTERMAN_BRANCH@126207 18797224-902f-48f8-a5cc-f745e15eee43
2002-08-02 01:37:40 +00:00
bienvenu%netscape.com
71964ec8c2 get aol mdn request working
git-svn-id: svn://10.0.0.236/branches/ANYTHING_FOR_PUTTERMAN_BRANCH@126197 18797224-902f-48f8-a5cc-f745e15eee43
2002-08-02 00:20:43 +00:00
bienvenu%netscape.com
e1e704b2ea fix handling of multiple keywords
git-svn-id: svn://10.0.0.236/branches/ANYTHING_FOR_PUTTERMAN_BRANCH@126164 18797224-902f-48f8-a5cc-f745e15eee43
2002-08-01 17:04:08 +00:00
sspitzer%netscape.com
de9a8edc78 update extra toolbar. I think there might be a bug in the command updating suppression code here.
git-svn-id: svn://10.0.0.236/branches/ANYTHING_FOR_PUTTERMAN_BRANCH@126130 18797224-902f-48f8-a5cc-f745e15eee43
2002-07-31 21:50:36 +00:00
sspitzer%netscape.com
16e06b4972 change some toolbar notifcations
git-svn-id: svn://10.0.0.236/branches/ANYTHING_FOR_PUTTERMAN_BRANCH@126127 18797224-902f-48f8-a5cc-f745e15eee43
2002-07-31 21:27:25 +00:00
sspitzer%netscape.com
01d3e803bc need to notify here, for the stand alone msg window
git-svn-id: svn://10.0.0.236/branches/ANYTHING_FOR_PUTTERMAN_BRANCH@126124 18797224-902f-48f8-a5cc-f745e15eee43
2002-07-31 20:20:04 +00:00
sspitzer%netscape.com
4030919b60 fix js / xpconnect error you can get if biff goes off and you are viewing account central
git-svn-id: svn://10.0.0.236/branches/ANYTHING_FOR_PUTTERMAN_BRANCH@126119 18797224-902f-48f8-a5cc-f745e15eee43
2002-07-31 18:20:37 +00:00
sspitzer%netscape.com
6ba8656e2e update toolbar when both servers and folders are selected.
git-svn-id: svn://10.0.0.236/branches/ANYTHING_FOR_PUTTERMAN_BRANCH@126117 18797224-902f-48f8-a5cc-f745e15eee43
2002-07-31 17:51:03 +00:00
bienvenu%netscape.com
e49432baab fix custom header stuff so imap protocol won't download all headers all the time
git-svn-id: svn://10.0.0.236/branches/ANYTHING_FOR_PUTTERMAN_BRANCH@126012 18797224-902f-48f8-a5cc-f745e15eee43
2002-07-29 21:00:35 +00:00
bienvenu%netscape.com
afd15242c8 add imaphdrdownloaded event listener so we'll set hasAttachment and hasImage flags correctly
git-svn-id: svn://10.0.0.236/branches/ANYTHING_FOR_PUTTERMAN_BRANCH@126011 18797224-902f-48f8-a5cc-f745e15eee43
2002-07-29 20:56:53 +00:00
bienvenu%netscape.com
b8b57cd309 fix initial setting of keywords for official aol chrome
git-svn-id: svn://10.0.0.236/branches/ANYTHING_FOR_PUTTERMAN_BRANCH@125995 18797224-902f-48f8-a5cc-f745e15eee43
2002-07-29 17:48:07 +00:00
bienvenu%netscape.com
718e5ac152 don't show aol folder contents until we've connected to the server
git-svn-id: svn://10.0.0.236/branches/ANYTHING_FOR_PUTTERMAN_BRANCH@125994 18797224-902f-48f8-a5cc-f745e15eee43
2002-07-29 17:47:11 +00:00
sspitzer%netscape.com
7910838bfb pass the window as the subject, so we can tell if we want to handle it. otherwise, all observers get events from all windows
git-svn-id: svn://10.0.0.236/branches/ANYTHING_FOR_PUTTERMAN_BRANCH@125874 18797224-902f-48f8-a5cc-f745e15eee43
2002-07-26 19:06:26 +00:00
sspitzer%netscape.com
3da8526fa0 instead of doing "if foo in top then foo()", use the observer service.
this is the right way to add hooks.


git-svn-id: svn://10.0.0.236/branches/ANYTHING_FOR_PUTTERMAN_BRANCH@125862 18797224-902f-48f8-a5cc-f745e15eee43
2002-07-26 17:26:48 +00:00
sspitzer%netscape.com
023f54556a move the hook around.
git-svn-id: svn://10.0.0.236/branches/ANYTHING_FOR_PUTTERMAN_BRANCH@125850 18797224-902f-48f8-a5cc-f745e15eee43
2002-07-26 06:25:54 +00:00
sspitzer%netscape.com
af203df990 some hooks for updates extra stand alone msg window chrome.
git-svn-id: svn://10.0.0.236/branches/ANYTHING_FOR_PUTTERMAN_BRANCH@125849 18797224-902f-48f8-a5cc-f745e15eee43
2002-07-26 05:58:36 +00:00
sspitzer%netscape.com
24256cfef2 allow the ISPs to add or override the icon when viewing mail in the collapsed view
git-svn-id: svn://10.0.0.236/branches/ANYTHING_FOR_PUTTERMAN_BRANCH@125848 18797224-902f-48f8-a5cc-f745e15eee43
2002-07-26 04:28:08 +00:00
sspitzer%netscape.com
b32565fa84 create an atom from the redirector type (if non-empty) early and pass it through
to the view, so we can use it to override thread pane icons.


git-svn-id: svn://10.0.0.236/branches/ANYTHING_FOR_PUTTERMAN_BRANCH@125846 18797224-902f-48f8-a5cc-f745e15eee43
2002-07-26 04:09:40 +00:00
sspitzer%netscape.com
c01c3d46c8 provide stub folderPaneExtras and threadPaneExtras.css for ISPs / distributors to easily override what's in the thread pane and folder pane.
git-svn-id: svn://10.0.0.236/branches/ANYTHING_FOR_PUTTERMAN_BRANCH@125844 18797224-902f-48f8-a5cc-f745e15eee43
2002-07-26 03:34:18 +00:00
sspitzer%netscape.com
f870406814 propogate the redirector type to the folder data source (and for now, into the folder pane), in case people want to use that to change icons based on that info.
git-svn-id: svn://10.0.0.236/branches/ANYTHING_FOR_PUTTERMAN_BRANCH@125841 18797224-902f-48f8-a5cc-f745e15eee43
2002-07-26 03:01:03 +00:00
sspitzer%netscape.com
1376a081b7 add hook for extra toolbar updating...
git-svn-id: svn://10.0.0.236/branches/ANYTHING_FOR_PUTTERMAN_BRANCH@125835 18797224-902f-48f8-a5cc-f745e15eee43
2002-07-26 00:47:04 +00:00
bienvenu%netscape.com
4f409ad144 get read pfc working in 3-pane and stand-alone msg window
git-svn-id: svn://10.0.0.236/branches/ANYTHING_FOR_PUTTERMAN_BRANCH@125827 18797224-902f-48f8-a5cc-f745e15eee43
2002-07-25 23:53:29 +00:00
sspitzer%netscape.com
1b45bdbca8 add mailWindowExtrasOverlay.xul, so people can add stuff to mail windows.
git-svn-id: svn://10.0.0.236/branches/ANYTHING_FOR_PUTTERMAN_BRANCH@125824 18797224-902f-48f8-a5cc-f745e15eee43
2002-07-25 22:21:32 +00:00
sspitzer%netscape.com
22dd7bba0f FE work for generic keyword support for header area in preview pane and stand alone msg window.
git-svn-id: svn://10.0.0.236/branches/ANYTHING_FOR_PUTTERMAN_BRANCH@125816 18797224-902f-48f8-a5cc-f745e15eee43
2002-07-25 21:32:44 +00:00
bienvenu%netscape.com
72bfe3f221 ignore expunges from aol server
git-svn-id: svn://10.0.0.236/branches/ANYTHING_FOR_PUTTERMAN_BRANCH@125809 18797224-902f-48f8-a5cc-f745e15eee43
2002-07-25 21:09:25 +00:00
bienvenu%netscape.com
7edd03287e first stab at backporting backend ishmail changes
git-svn-id: svn://10.0.0.236/branches/ANYTHING_FOR_PUTTERMAN_BRANCH@125799 18797224-902f-48f8-a5cc-f745e15eee43
2002-07-25 20:12:26 +00:00
sspitzer%netscape.com
a05995530d stub message keywords file for classic skin
git-svn-id: svn://10.0.0.236/branches/ANYTHING_FOR_PUTTERMAN_BRANCH@125788 18797224-902f-48f8-a5cc-f745e15eee43
2002-07-25 17:10:27 +00:00
sspitzer%netscape.com
876130f7ef add stub for messageKeywords.css to the mozilla tree.
git-svn-id: svn://10.0.0.236/branches/ANYTHING_FOR_PUTTERMAN_BRANCH@125786 18797224-902f-48f8-a5cc-f745e15eee43
2002-07-25 16:51:53 +00:00
sspitzer%netscape.com
0ee885bf00 comment out some dump statements that shouldn't be there.
git-svn-id: svn://10.0.0.236/branches/ANYTHING_FOR_PUTTERMAN_BRANCH@125770 18797224-902f-48f8-a5cc-f745e15eee43
2002-07-25 05:24:48 +00:00
sspitzer%netscape.com
4b697f1a20 fix security, again. bah
git-svn-id: svn://10.0.0.236/branches/ANYTHING_FOR_PUTTERMAN_BRANCH@125765 18797224-902f-48f8-a5cc-f745e15eee43
2002-07-25 02:48:51 +00:00
sspitzer%netscape.com
3a3f038ffa every time. I hate this.
git-svn-id: svn://10.0.0.236/branches/ANYTHING_FOR_PUTTERMAN_BRANCH@125757 18797224-902f-48f8-a5cc-f745e15eee43
2002-07-25 01:45:46 +00:00
sspitzer%netscape.com
8a5a622765 pull by branch.
git-svn-id: svn://10.0.0.236/branches/ANYTHING_FOR_PUTTERMAN_BRANCH@125751 18797224-902f-48f8-a5cc-f745e15eee43
2002-07-25 00:36:04 +00:00
(no author)
1811c2387a This commit was manufactured by cvs2svn to create branch
'ANYTHING_FOR_PUTTERMAN_BRANCH'.

git-svn-id: svn://10.0.0.236/branches/ANYTHING_FOR_PUTTERMAN_BRANCH@125693 18797224-902f-48f8-a5cc-f745e15eee43
2002-07-24 08:39:40 +00:00
1437 changed files with 8983 additions and 376448 deletions

View File

@@ -7,15 +7,15 @@
# mozilla/gc, , 10/25/2000 12:00:00
#
mozilla/nsprpub, MOZILLA_1_0_BRANCH
mozilla/security/nss, MOZILLA_1_0_BRANCH
mozilla/security/manager, MOZILLA_1_0_BRANCH
mozilla/accessible, MOZILLA_1_0_BRANCH
mozilla/directory/c-sdk, MOZILLA_1_0_0_BRANCH
mozilla/lib/mac/Instrumentation, MOZILLA_1_0_BRANCH
mozilla/gfx2, MOZILLA_1_0_BRANCH
mozilla/modules/libpr0n, MOZILLA_1_0_BRANCH
SeaMonkeyAll, MOZILLA_1_0_BRANCH
mozilla/nsprpub, ANYTHING_FOR_PUTTERMAN_BRANCH
mozilla/security/nss, ANYTHING_FOR_PUTTERMAN_BRANCH
mozilla/security/manager, ANYTHING_FOR_PUTTERMAN_BRANCH
mozilla/accessible, ANYTHING_FOR_PUTTERMAN_BRANCH
mozilla/directory/c-sdk, ANYTHING_FOR_PUTTERMAN_BRANCH
mozilla/lib/mac/Instrumentation, ANYTHING_FOR_PUTTERMAN_BRANCH
mozilla/gfx2, ANYTHING_FOR_PUTTERMAN_BRANCH
mozilla/modules/libpr0n, ANYTHING_FOR_PUTTERMAN_BRANCH
SeaMonkeyAll, ANYTHING_FOR_PUTTERMAN_BRANCH
## You need this if you want to be able to use SVG
## Note that this library is under the LGPL, not the MPL

View File

@@ -0,0 +1,11 @@
prefix=%prefix%
exec_prefix=%exec_prefix%
libdir=%libdir%
includedir=%includedir%
Name: NSS
Description: Mozilla Network Security Services
Version: %MOZILLA_VERSION%
Requires: mozilla-nspr = %MOZILLA_VERSION%
Libs: -L${libdir} -lnss3 -lsmime3 -lssl3 -lsoftokn3
Cflags: -I${includedir}/nss

View File

@@ -40,18 +40,20 @@ MOZ_OBJDIR = WIN32_O.OBJ
#// Figure out how to do the pull.
#//------------------------------------------------------------------------
# uncomment these, modify branch tag, and check in to branch for milestones
MOZ_BRANCH=MOZILLA_1_0_BRANCH
NSPR_CO_TAG=MOZILLA_1_0_BRANCH
MOZ_BRANCH=ANYTHING_FOR_PUTTERMAN_BRANCH
NSPR_CO_TAG=ANYTHING_FOR_PUTTERMAN_BRANCH
PSM_CO_TAG=MOZILLA_1_0_BRANCH
NSS_CO_TAG=MOZILLA_1_0_BRANCH
LDAPCSDK_CO_TAG=MOZILLA_1_0_BRANCH
ACCESSIBLE_CO_TAG=MOZILLA_1_0_BRANCH
IMGLIB2_CO_TAG=MOZILLA_1_0_BRANCH
GFX2_CO_TAG=MOZILLA_1_0_BRANCH
LDAPCSDK_CO_TAG=ANYTHING_FOR_PUTTERMAN_BRANCH
ACCESSIBLE_CO_TAG=ANYTHING_FOR_PUTTERMAN_BRANCH
IMGLIB2_CO_TAG=ANYTHING_FOR_PUTTERMAN_BRANCH
GFX2_CO_TAG=ANYTHING_FOR_PUTTERMAN_BRANCH
!ifdef MOZ_BRANCH
CVS_BRANCH=-r $(MOZ_BRANCH)
PSM_CVS_BRANCH=-r $(PSM_CO_TAG)
NSS_CVS_BRANCH=-r $(NSS_CO_TAG)
!endif
!ifdef MOZ_DATE
@@ -113,7 +115,7 @@ CVSCO_NSPR = cvs $(CVS_FLAGS) co $(NSPR_CO_FLAGS)
NSS_CO_FLAGS=$(MOZ_CO_FLAGS)
!endif
NSS_CO_FLAGS=$(NSS_CO_FLAGS) $(CVS_BRANCH)
NSS_CO_FLAGS=$(NSS_CO_FLAGS) $(NSS_CVS_BRANCH)
CVSCO_NSS = cvs $(CVS_FLAGS) co $(NSS_CO_FLAGS)
@@ -121,7 +123,7 @@ CVSCO_NSS = cvs $(CVS_FLAGS) co $(NSS_CO_FLAGS)
PSM_CO_FLAGS=$(MOZ_CO_FLAGS)
!endif
PSM_CO_FLAGS=$(PSM_CO_FLAGS) $(CVS_BRANCH)
PSM_CO_FLAGS=$(PSM_CO_FLAGS) $(PSM_CVS_BRANCH)
CVSCO_PSM = cvs $(CVS_FLAGS) co $(PSM_CO_FLAGS)

View File

@@ -52,14 +52,14 @@
#
# For branches, uncomment the MOZ_CO_TAG line with the proper tag,
# and commit this file on that tag.
MOZ_CO_TAG = MOZILLA_1_0_BRANCH
NSPR_CO_TAG = MOZILLA_1_0_BRANCH
PSM_CO_TAG = MOZILLA_1_0_BRANCH
NSS_CO_TAG = MOZILLA_1_0_BRANCH
LDAPCSDK_CO_TAG = MOZILLA_1_0_BRANCH
ACCESSIBLE_CO_TAG = MOZILLA_1_0_BRANCH
GFX2_CO_TAG = MOZILLA_1_0_BRANCH
IMGLIB2_CO_TAG = MOZILLA_1_0_BRANCH
MOZ_CO_TAG = ANYTHING_FOR_PUTTERMAN_BRANCH
NSPR_CO_TAG = ANYTHING_FOR_PUTTERMAN_BRANCH
PSM_CO_TAG = ANYTHING_FOR_PUTTERMAN_BRANCH
NSS_CO_TAG = ANYTHING_FOR_PUTTERMAN_BRANCH
LDAPCSDK_CO_TAG = ANYTHING_FOR_PUTTERMAN_BRANCH
ACCESSIBLE_CO_TAG = ANYTHING_FOR_PUTTERMAN_BRANCH
GFX2_CO_TAG = ANYTHING_FOR_PUTTERMAN_BRANCH
IMGLIB2_CO_TAG = ANYTHING_FOR_PUTTERMAN_BRANCH
BUILD_MODULES = all
#######################################################################

View File

@@ -117,6 +117,11 @@ typedef unsigned long HMTX;
#include "nsIFileStream.h"
#include "nsISHistoryInternal.h"
#ifndef ENABLE_BROWSER
#include "nsIExternalProtocolService.h"
#include "nsCExternalHandlerService.h"
#endif
#include "nsIHttpChannel.h" // add this to the ick include list...we need it to QI for post data interface
#include "nsILocaleService.h"
@@ -567,6 +572,58 @@ nsWebShell::OnLinkClickSync(nsIContent *aContent,
*aRequest = nsnull;
}
#ifndef ENABLE_BROWSER
// this hack is to make it so when we click on links in messages
// we launch the default application
// for example, http -> IE, Mozilla, NS 7.0
//
// stand alone mail still needs http support to handle
// img src links in html mail, the start page,
// and ab sync
//
// since this is a stand alone mail application, we handle
// mailto, news, nntp and imap urls
//
// hack, clean this up. allow for XRE applications to say
// which schemes they handle.
nsAutoString spec(aURLSpec);
nsAutoString scheme;
PRInt32 pos = spec.FindChar(':');
static const char kMailToURI[] = "mailto";
static const char kNewsURI[] = "news";
static const char kSnewsURI[] = "snews";
static const char kNntpURI[] = "nntp";
static const char kImapURI[] = "imap";
if ((pos == (PRInt32)(sizeof kMailToURI - 1)) && (spec.Left(scheme, pos) != -1) && scheme.EqualsIgnoreCase(kMailToURI)) {
// the scheme is mailto, we can handle it
}
else if ((pos == (PRInt32)(sizeof kNewsURI - 1)) && (spec.Left(scheme, pos) != -1) && scheme.EqualsIgnoreCase(kNewsURI)) {
// the scheme is news, we can handle it
}
else if ((pos == (PRInt32)(sizeof kSnewsURI - 1)) && (spec.Left(scheme, pos) != -1) && scheme.EqualsIgnoreCase(kSnewsURI)) {
// the scheme is snews, we can handle it
}
else if ((pos == (PRInt32)(sizeof kNntpURI - 1)) && (spec.Left(scheme, pos) != -1) && scheme.EqualsIgnoreCase(kNntpURI)) {
// the scheme is nntp, we can handle it
}
else if ((pos == (PRInt32)(sizeof kImapURI - 1)) && (spec.Left(scheme, pos) != -1) && scheme.EqualsIgnoreCase(kImapURI)) {
// the scheme is imap, we can handle it
}
else {
// we don't handle this type, the the registered handler take it
nsCOMPtr <nsIURI> uri;
rv = NS_NewURI(getter_AddRefs(uri), NS_ConvertUCS2toUTF8(aURLSpec).get());
NS_ENSURE_SUCCESS(rv,rv);
nsCOMPtr<nsIExternalProtocolService> extProtService = do_GetService(NS_EXTERNALPROTOCOLSERVICE_CONTRACTID, &rv);
NS_ENSURE_SUCCESS(rv,rv);
rv = extProtService->LoadUrl(uri);
NS_ENSURE_SUCCESS(rv,rv);
return rv;
}
#endif
switch(aVerb) {
case eLinkVerb_New:
target.Assign(NS_LITERAL_STRING("_blank"));

View File

@@ -18,17 +18,21 @@
<!-- overlay information -->
<RDF:Seq about="urn:mozilla:overlays">
<!--
<RDF:li resource="chrome://communicator/content/tasksOverlay.xul"/>
<RDF:li resource="chrome://messenger/content/mailWindowOverlay.xul"/>
-->
<RDF:li resource="chrome://communicator/content/pref/preftree.xul"/>
<RDF:li resource="chrome://communicator/content/pref/pref-appearance.xul"/>
<RDF:li resource="chrome://navigator/content/navigatorOverlay.xul"/>
<RDF:li resource="chrome://messenger/content/mailWindowOverlay.xul"/>
</RDF:Seq>
<!-- editor tasks overlay -->
<!--
<RDF:Seq about="chrome://communicator/content/tasksOverlay.xul">
<RDF:li>chrome://editor/content/editorTasksOverlay.xul</RDF:li>
</RDF:Seq>
-->
<!-- editor preferences branches -->
<RDF:Seq about="chrome://communicator/content/pref/preftree.xul">
@@ -46,10 +50,11 @@
</RDF:Seq>
<!-- editor items for Mail -->
<!--
<RDF:Seq about="chrome://messenger/content/mailWindowOverlay.xul">
<RDF:li>chrome://editor/content/editorMailOverlay.xul</RDF:li>
</RDF:Seq>
-->
</RDF:RDF>

View File

@@ -33,6 +33,7 @@
</groupbox>
<!-- category tree entries for editor -->
<!-- stand alone mail, no editor
<treechildren id="panelChildren">
<treeitem container="true" id="editor" position="3">
<treerow>
@@ -44,15 +45,14 @@
<treecell url="chrome://editor/content/pref-editing.xul" label="&editing.label;"/>
</treerow>
</treeitem>
<!--
<treeitem>
<treerow>
<treecell url="chrome://editor/content/pref-publish.xul" label="&publish.label;"/>
</treerow>
</treeitem>
-->
</treechildren>
</treeitem>
</treechildren>
-->
</overlay>

View File

@@ -40,17 +40,17 @@
<overlay id="editorTasksOverlay"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<!-- in stand alone mail, no editor? -->
<script type="application/x-javascript">
<![CDATA[
function toEditor()
{
if (!CycleWindow("composer:html"))
NewEditorWindow();
NewEditorWindow();
}
function NewEditorWindow()
{
// Open editor window with blank page
window.openDialog( "chrome://editor/content", "_blank", "chrome,all,dialog=no", "about:blank");
var launcher = Components.classes["@mozilla.org/uriloader/external-protocol-service;1"].getService(Components.interfaces.nsIExternalProtocolService);
launcher.launchApp("editor");
}
]]>
</script>
@@ -71,6 +71,5 @@
<menupopup id="windowPopup">
<menuitem label="&editorCmd.label;" accesskey="&editorCmd.accesskey;" key="key_editor" command="Tasks:Editor" id="tasksMenuEditor" insertafter="IMMenuItem,tasksMenuNavigator" class="menuitem-iconic icon-composer16 menu-iconic"/>
</menupopup>
</overlay>

View File

@@ -17,15 +17,19 @@
<!-- overlay information -->
<RDF:Seq about="urn:mozilla:overlays">
<RDF:li resource="chrome://communicator/content/contentAreaContextOverlay.xul"/>
<RDF:li resource="chrome://communicator/content/pref/preftree.xul"/>
<RDF:li resource="chrome://navigator/content/navigatorOverlay.xul"/>
<!--
<RDF:li resource="chrome://communicator/content/contentAreaContextOverlay.xul"/>
<RDF:li resource="chrome://messenger/content/mailWindowOverlay.xul"/>
-->
</RDF:Seq>
<!--
<RDF:Seq about="chrome://communicator/content/contentAreaContextOverlay.xul">
<RDF:li>chrome://cookie/content/cookieContextOverlay.xul</RDF:li>
</RDF:Seq>
-->
<RDF:Seq about="chrome://communicator/content/pref/preftree.xul">
<RDF:li>chrome://cookie/content/cookiePrefsOverlay.xul</RDF:li>
@@ -36,8 +40,10 @@
<RDF:li>chrome://cookie/content/cookieTasksOverlay.xul</RDF:li>
</RDF:Seq>
<!--
<RDF:Seq about="chrome://messenger/content/mailWindowOverlay.xul">
<RDF:li>chrome://cookie/content/cookieContextOverlay.xul</RDF:li>
</RDF:Seq>
-->
</RDF:RDF>

View File

@@ -14,13 +14,16 @@
</RDF:Description>
<!-- Declare overlay points used in this package -->
<!--
<RDF:Seq about="urn:mozilla:overlays">
<RDF:li resource="chrome://communicator/content/utilityOverlay.xul"/>
</RDF:Seq>
-->
<!-- Define the local overlay file(s) for each overlay point -->
<!--
<RDF:Seq about="chrome://communicator/content/utilityOverlay.xul">
<RDF:li>chrome://help/content/helpMenuOverlay.xul</RDF:li>
</RDF:Seq>
-->
</RDF:RDF>

View File

@@ -24,26 +24,8 @@ include <$(DEPTH)/config/config.mak>
DIRS = wallet \
cookie \
inspector \
irc \
!if !defined(DISABLE_JSD) && !defined(DISABLE_VENKMAN)
venkman \
!endif
content-packs \
help \
!if defined(MOZ_ENABLE_P3P)
p3p \
!endif
pref \
!if !defined(DISABLE_XSLT)
transformiix \
!endif
universalchardet \
xml-rpc \
!if defined(MOZ_ENABLE_IIX)
interfaceinfo \
!endif
xmlextras \
$(NULL)

View File

@@ -17,9 +17,21 @@
# Rights Reserved.
#
# Contributor(s):
#
DEPTH=..\..
DEPTH = ../../../..
topsrcdir = @top_srcdir@
srcdir = @srcdir@
VPATH = @srcdir@
DIRS = src
include $(DEPTH)/config/autoconf.mk
!include $(DEPTH)\config\rules.mak
include $(topsrcdir)/config/rules.mk
libs::
@$(REGCHROME) content autoconfig comm.jar
@$(REGCHROME) locale en-US/autoconfig en-US.jar
install::
@$(REGCHROME_INSTALL) content autoconfig comm.jar
@$(REGCHROME_INSTALL) locale en-US/autoconfig en-US.jar

View File

@@ -0,0 +1,18 @@
<?xml version="1.0"?>
<RDF:RDF xmlns:RDF="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:chrome="http://www.mozilla.org/rdf/chrome#">
<!-- list all the packages being supplied -->
<RDF:Seq about="urn:mozilla:package:root">
<RDF:li resource="urn:mozilla:package:autoconfig"/>
</RDF:Seq>
<!-- package information -->
<RDF:Description about="urn:mozilla:package:autoconfig"
chrome:displayName="AutoConfig"
chrome:author="mozilla.org"
chrome:name="autoconfig"
chrome:localeVersion="1.0.1rc1">
</RDF:Description>
</RDF:RDF>

View File

@@ -0,0 +1,6 @@
comm.jar:
content/autoconfig/contents.rdf (content/contents.rdf)
en-US.jar:
locale/en-US/autoconfig/contents.rdf (locale/en-US/contents.rdf)
locale/en-US/autoconfig/autoconfig.properties (locale/en-US/autoconfig.properties)

View File

@@ -0,0 +1,5 @@
readConfigTitle = Configuration Error
readConfigMsg = Failed to read the configuration file. Please contact your system administrator.
autoConfigTitle = AutoConfig Alert
autoConfigMsg = Netscape.cfg/AutoConfig failed. Please contact your system administrator. \n Error: %S failed:

View File

@@ -0,0 +1,23 @@
<?xml version="1.0"?>
<RDF:RDF xmlns:RDF="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:chrome="http://www.mozilla.org/rdf/chrome#">
<!-- list all the locales being supplied -->
<RDF:Seq about="urn:mozilla:locale:root">
<RDF:li resource="urn:mozilla:locale:en-US"/>
</RDF:Seq>
<!-- locale information -->
<RDF:Description about="urn:mozilla:locale:en-US">
<chrome:packages>
<RDF:Seq about="urn:mozilla:locale:en-US:packages">
<RDF:li resource="urn:mozilla:locale:en-US:autoconfig"/>
</RDF:Seq>
</chrome:packages>
</RDF:Description>
<!-- Version Information. State that we work only with major version of this
package. -->
<RDF:Description about="urn:mozilla:locale:en-US:autoconfig"
chrome:localeVersion="1.0.1rc1"/>
</RDF:RDF>

View File

@@ -1,3 +1,4 @@
#!nmake
#
# The contents of this file are subject to the Netscape Public
# License Version 1.1 (the "License"); you may not use this file
@@ -18,11 +19,10 @@
#
# Contributor(s):
DEPTH=..\..\..
DEPTH=..\..\..\..
DIRS = libical \
libicalss \
libicalvcal \
$(NULL)
include <$(DEPTH)\config\rules.mak>
!include $(DEPTH)\config\rules.mak
chrome::
$(REGCHROME) content autoconfig comm.jar
$(REGCHROME) locale en-US/autoconfig en-US.jar

View File

@@ -18,7 +18,9 @@
<!-- overlay information -->
<RDF:Seq about="urn:mozilla:overlays">
<RDF:li resource="chrome://navigator/content/navigator.xul"/>
<!--
<RDF:li resource="chrome://communicator/content/tasksOverlay.xul"/>
-->
<RDF:li resource="chrome://communicator/content/pref/preftree.xul"/>
</RDF:Seq>
@@ -26,9 +28,11 @@
<RDF:li>chrome://wallet/content/walletNavigatorOverlay.xul</RDF:li>
</RDF:Seq>
<!--
<RDF:Seq about="chrome://communicator/content/tasksOverlay.xul">
<RDF:li>chrome://wallet/content/walletTasksOverlay.xul</RDF:li>
</RDF:Seq>
-->
<RDF:Seq about="chrome://communicator/content/pref/preftree.xul">
<RDF:li>chrome://wallet/content/walletPrefsOverlay.xul</RDF:li>

View File

@@ -0,0 +1,136 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/* ***** BEGIN LICENSE BLOCK *****
* Version: NPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Netscape Public License
* Version 1.1 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
* http://www.mozilla.org/NPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is
* Netscape Communications Corporation.
* Portions created by the Initial Developer are Copyright (C) 2001
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
*
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the NPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the NPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
/* Interface to the Service for gwetting the Global PrintSettings object
or a unique PrintSettings object
*/
#include "nsISupports.idl"
interface nsIPrintSettings;
[scriptable, uuid(841387C8-72E6-484b-9296-BF6EEA80D58A)]
interface nsIPrintSettingsService : nsISupports
{
/**
* Returns a "global" PrintSettings object
* Creates a new the first time, if one doesn't exist.
*
* Then returns the same object each time after that.
*
* Initializes the globalPrintSettings from the default printer
*/
readonly attribute nsIPrintSettings globalPrintSettings;
/**
* Returns a new, unique PrintSettings object each time.
*
* For example, if each browser was to have its own unique
* PrintSettings, then each browser window would call this to
* create its own unique PrintSettings object.
*
* If each browse window was to use the same PrintSettings object
* then it should use "globalPrintSettings"
*
* Initializes the newPrintSettings from the default printer
*
*/
readonly attribute nsIPrintSettings newPrintSettings;
/**
* The name of the default printer
*/
readonly attribute wstring defaultPrinterName;
/**
* Initializes certain settings from the native printer into the PrintSettings
* if aPrinterName is null then it uses the default printer name if it can
* These settings include, but are not limited to:
* Page Orientation
* Page Size
* Number of Copies
*/
void initPrintSettingsFromPrinter(in wstring aPrinterName, in nsIPrintSettings aPrintSettings);
/**
* Reads PrintSettings values from Prefs,
* the values to be read are indicated by the "flags" arg.
*
* First it reads in the "generic" set of PrintSetings not associated with any printer
* then it uses the PrinterName in the PrinterSettings to read any settings that were saved
* just for that printer.
*
* aPS - PrintSettings to have its settings read
* aUsePrinterNamePrefix - indicates whether to use the printer name as a prefix
* aFlags - indicates which prefs to read, see nsIPrintSettings.idl for the const values.
*
* Items not read:
* startPageRange, endPageRange, scaling, printRange, title
* docURL, howToEnableFrameUI, isCancelled, printFrameTypeUsage
* printFrameType, printSilent, shrinkToFit, numCopies
*
*/
void initPrintSettingsFromPrefs(in nsIPrintSettings aPrintSettings, in boolean aUsePrinterNamePrefix, in unsigned long aFlags);
/**
* Writes PrintSettings values to Prefs,
* the values to be written are indicated by the "flags" arg.
*
* If there is no PrinterName in the PrinterSettings
* the values are saved as the "generic" values not associated with any printer.
* If a PrinterName is there, then it saves the items qualified for that Printer
*
* aPS - PrintSettings to have its settings saved
* aUsePrinterNamePrefix - indicates whether to use the printer name as a prefix
* aFlags - indicates which prefs to save, see nsIPrintSettings.idl for the const values.
*
* Items not written:
* startPageRange, endPageRange, scaling, printRange, title
* docURL, howToEnableFrameUI, isCancelled, printFrameTypeUsage
* printFrameType, printSilent, shrinkToFit, numCopies
*
*/
void savePrintSettingsToPrefs(in nsIPrintSettings aPrintSettings, in boolean aUsePrinterNamePrefix, in unsigned long aFlags);
};
%{C++
// {841387C8-72E6-484b-9296-BF6EEA80D58A}
#define NS_PRINTSETTINGSSERVICE_IID \
{0x841387c8, 0x72e6, 0x484b, { 0x92, 0x96, 0xbf, 0x6e, 0xea, 0x80, 0xd5, 0x8a}}
%}

View File

@@ -1,227 +0,0 @@
#! /usr/local/bin/perl5
use File::Path;
# The development branch is where primary development and checkins
# are done on a day-to-day basis.
$development_branch_prefix = "SpiderMonkey140";
# Space-separated list of CVS-controlled directories to tag/merge
$merge_dirs =
"mozilla/js/src " ;
# When line below uncommented, don't recurse into subdirs
#$recurse_flag = '-l';
#----------------------------------------------------------------------------
# The merge branch is itself a branch off of the development branch
# at a point where the development branch is thought to be stable.
# (A branch is used rather than a static tag because, inevitably,
# the development branch is not quite as stable/buildable as was
# thought.) The contents of the merge branch will be copied to
# the trunk when merging takes place.
# The following tags are created automatically by this script:
#
# JS_STABLE_DROP
#
# A static tag on the development branch (or a branch off the
# development branch) that indicates the code that should be merged
# into the trunk. This is a "variable" tag in the sense that it is
# redefined after each merge.
#
# JS_LAST_STABLE_DROP
#
# A static tag that is a copy of what the JS_STABLE_DROP tag was in
# the previous merge cycle. This is a "variable" tag that is
# redefined after each merge. Changes in the branch can be merged
# to the trunk by using:
#
# cvs up -jJS_LAST_STABLE_DROP -jJS_STABLE_DROP
#
# JS_LANDING
#
# A static tag that identifies the code on the trunk after the merge
# from the branch to the trunk takes place. This is a "variable"
# tag that is redefined after each merge. Changes on the trunk
# since the last branch landing can be seen by using:
#
# cvs diff -rJS_LANDING -rHEAD
#
# JS_LANDING_mmddyyyy
#
# This is a tag on the trunk which may be used for archaeological
# purposes. This tag is made from the JS_LANDING tag.
$development_branch = $development_branch_prefix . "_BRANCH";
$development_base = $development_branch_prefix . "_BASE";
sub help {
print <<"END";
$0: A tool for merging stable snapshots of JavaScript from a CVS
development branch onto the trunk
Landing a snapshot of the development branch consists of
the following steps:
1) Tag all/some files on the branch to identify files to be merged.
2) Merge files from the branch into the trunk using a temporary
working directory.
3) Resolve any conflicts that arise as a result of the merge.
4) Commit merged changes to the trunk.
5) Make changes to resolve (build) difficulties and re-commit.
Repeat as necessary.
6) Backpropagate changes on the trunk to the development branch.
This script will assist with steps #2, #4 and #6:
$0 -merge JS_STABLE_10131998
$0 -commit
$0 -backpatch
END
}
sub log {
local($msg) = @_;
print LOGFILE $msg if $logfile;
}
# Similar to die built-in
sub die {
local($msg) = @_;
&log($msg);
chomp($msg);
if ($logfile) {
$msg .= "\nSee $logfile for details.";
}
die "$msg\n";
}
# Similar to system() built-in
sub system {
local(@args) = @_;
local($cmd) = join(" ", @args);
&log("Executing: $cmd\n");
if ($logfile) {
$cmd .= " >> $logfile 2>&1";
close(LOGFILE);
}
local($result) = 0xffff & system($cmd);
if ($logfile) {
open(LOGFILE, ">>$logfile");
}
return unless ($result);
$msg = "Died while executing $cmd";
if ($result == 0xff00) {
&die("$msg\nWhile executExecution failed due to perl error: $!. ");
} else {
$result >>= 8;
&die("$msg\nExecution failed; exit status: $result. ");
}
}
chomp($root_dir = `pwd`);
# Default log file
$logfile = $root_dir . "/log";
while ($#ARGV >=0) {
$_ = shift;
if (/-merge/) {
$do_tag = 1;
$do_checkout = 1;
$do_merge = 1;
$tag = shift;
} elsif (/-commit/ || /-ci/) {
$do_commit = 1;
} elsif (/-backpatch/) {
$do_backpatch = 1;
} elsif (/-log/) {
$logfile = shift;
} elsif (/-tag/) { # Debugging option
$do_tag = 1;
$tag = shift;
} elsif (/-co/) { # Debugging option
$do_checkout = 1;
} else {
print STDERR "Illegal option: $_\n" unless (/-h/);
&help();
exit(1);
}
}
die "You must set your CVSROOT environment variable" if !$ENV{"CVSROOT"};
if ($logfile) {
open(LOGFILE, ">$logfile") || die "Couldn't open log file \"$logfile\"";
print("Logging to file \"$logfile\".\n");
}
$trunk_dir = $root_dir . "/trunk";
if ($do_tag) {
if (!$tag) {
&die("Must specify tag on command-line\n");
}
print("Tagging tree with tag JS_STABLE_DROP.\n");
&system("cvs rtag $recurse_flag -F -r $tag JS_STABLE_DROP $merge_dirs");
}
if ($do_checkout) {
# Delete trunk subdir if it already exists
if (-d $trunk_dir) {
&log("Deleting directory $trunk_dir\n");
rmtree ($trunk_dir, 0, 1);
}
&log("Creating directory $trunk_dir\n");
mkdir($trunk_dir, 0777) || die "Couldn't create directory $trunk_dir";
# Check out on trunk
print("Checking out $merge_dirs.\n");
chdir $trunk_dir;
&system("cvs co $recurse_flag -A $merge_dirs");
}
if ($do_merge) {
chdir $trunk_dir;
print("Merging from JS_STABLE_DROP into trunk\n");
&system("cvs up -jJS_LAST_STABLE_DROP -jJS_STABLE_DROP");
}
if ($do_commit) {
&die("No merged tree found. Wrong directory ?") if (!chdir $trunk_dir);
($_,$_,$_,$day,$mon,$year,$_,$_) = localtime(time());
if ($year < 30) {
$year = "20" . $year;
} else {
$year = "19" . $year;
}
$mmddyyyy = sprintf("%02d%02d%s", $mon, $day, $year);
print("Checking in code on trunk");
&system("cvs ci -m 'Stable drop of JavaScript interpreter code from " .
"$development_branch'");
# Tag merged result
&system("cvs tag -F JS_LANDING");
&system("cvs tag -F JS_LANDING_$mmddyyyy");
# Move JS_LAST_STABLE_DROP tag forward
&system("cvs tag -F -rJS_STABLE_DROP JS_LAST_STABLE_DROP");
}

View File

@@ -0,0 +1,137 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/* ***** BEGIN LICENSE BLOCK *****
* Version: NPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Netscape Public License
* Version 1.1 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
* http://www.mozilla.org/NPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is
* Netscape Communications Corporation.
* Portions created by the Initial Developer are Copyright (C) 2002
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
* Mike Shaver <shaver@mozilla.org>
* Randell Jesup <rjesup@wgate.com>
* Chris Waterson <waterson@netscape.com>
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the NPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the NPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
#include <stdio.h>
#include "pldhash.h"
#include "prenv.h"
#include "nsReflowPath.h"
#include "nsFrame.h"
#include "nsIFrame.h"
#include "nsHTMLReflowCommand.h"
nsReflowPath::~nsReflowPath()
{
for (PRInt32 i = mChildren.Count() - 1; i >= 0; --i)
delete NS_STATIC_CAST(nsReflowPath *, mChildren[i]);
delete mReflowCommand;
#ifdef DEBUG
::memset(this, 0xdd, sizeof(*this));
#endif
}
nsReflowPath::iterator
nsReflowPath::FindChild(nsIFrame *aFrame)
{
for (PRInt32 i = mChildren.Count() - 1; i >= 0; --i) {
nsReflowPath *subtree = NS_STATIC_CAST(nsReflowPath *, mChildren[i]);
if (subtree->mFrame == aFrame)
return iterator(this, i);
}
return iterator(this, -1);
}
nsReflowPath *
nsReflowPath::GetSubtreeFor(nsIFrame *aFrame) const
{
for (PRInt32 i = mChildren.Count() - 1; i >= 0; --i) {
nsReflowPath *subtree = NS_STATIC_CAST(nsReflowPath *, mChildren[i]);
if (subtree->mFrame == aFrame)
return subtree;
}
return nsnull;
}
nsReflowPath *
nsReflowPath::EnsureSubtreeFor(nsIFrame *aFrame)
{
for (PRInt32 i = mChildren.Count() - 1; i >= 0; --i) {
nsReflowPath *subtree = NS_STATIC_CAST(nsReflowPath *, mChildren[i]);
if (subtree->mFrame == aFrame)
return subtree;
}
nsReflowPath *subtree = new nsReflowPath(aFrame);
mChildren.AppendElement(subtree);
return subtree;
}
void
nsReflowPath::Remove(iterator &aIterator)
{
NS_ASSERTION(aIterator.mNode == this, "inconsistent iterator");
if (aIterator.mIndex >= 0 && aIterator.mIndex < mChildren.Count()) {
delete NS_STATIC_CAST(nsReflowPath *, mChildren[aIterator.mIndex]);
mChildren.RemoveElementAt(aIterator.mIndex);
}
}
#ifdef DEBUG
void
DebugListReflowPath(nsIPresContext *aPresContext, nsReflowPath *aReflowPath)
{
aReflowPath->Dump(aPresContext, stdout, 0);
}
void
nsReflowPath::Dump(nsIPresContext *aPresContext, FILE *aFile, int depth)
{
fprintf(aFile, "%*s nsReflowPath(%p): ", depth, "", this);
nsFrame::ListTag(aFile, mFrame);
if (mReflowCommand) {
fprintf(aFile, " <- ");
mReflowCommand->List(aFile);
}
fprintf(aFile, "\n");
for (PRInt32 i = 0; i < mChildren.Count(); ++i) {
nsReflowPath *child = NS_STATIC_CAST(nsReflowPath *, mChildren[i]);
child->Dump(aPresContext, aFile, depth + 1);
}
}
#endif

View File

@@ -0,0 +1,232 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/* ***** BEGIN LICENSE BLOCK *****
* Version: NPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Netscape Public License
* Version 1.1 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
* http://www.mozilla.org/NPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is
* Netscape Communications Corporation.
* Portions created by the Initial Developer are Copyright (C) 2002
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
* Mike Shaver <shaver@mozilla.org>
* Randell Jesup <rjesup@wgate.com>
* Chris Waterson <waterson@netscape.com>
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the NPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the NPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
#ifndef nsReflowPath_h__
#define nsReflowPath_h__
#include "nscore.h"
#include "pldhash.h"
#include "nsReflowType.h"
#include "nsVoidArray.h"
#ifdef DEBUG
#include <stdio.h>
#endif
class nsIFrame;
class nsHTMLReflowCommand;
class nsIPresContext;
/**
* A reflow `path' that is a sparse tree the parallels the frame
* hierarchy. This is used during an incremental reflow to record the
* path which the reflow must trace through the frame hierarchy.
*/
class nsReflowPath
{
public:
/**
* Construct a reflow path object that parallels the specified
* frame.
*/
nsReflowPath(nsIFrame *aFrame)
: mFrame(aFrame),
mReflowCommand(nsnull) {}
~nsReflowPath();
/**
* An iterator for enumerating the reflow path's immediate
* children.
*/
class iterator
{
protected:
nsReflowPath *mNode;
PRInt32 mIndex;
friend class nsReflowPath;
iterator(nsReflowPath *aNode, PRInt32 aIndex)
: mNode(aNode), mIndex(aIndex) {}
void
Advance() { --mIndex; }
public:
iterator()
: mNode(nsnull) {}
iterator(const iterator &iter)
: mNode(iter.mNode), mIndex(iter.mIndex) {}
iterator &
operator=(const iterator &iter) {
mNode = iter.mNode;
mIndex = iter.mIndex;
return *this; }
nsReflowPath *
get() const {
return NS_STATIC_CAST(nsReflowPath *, mNode->mChildren[mIndex]); }
nsReflowPath *
get() {
return NS_STATIC_CAST(nsReflowPath *, mNode->mChildren[mIndex]); }
nsIFrame *
operator*() const {
return get()->mFrame; }
nsIFrame *&
operator*() {
return get()->mFrame; }
iterator &
operator++() { Advance(); return *this; }
iterator
operator++(int) {
iterator temp(*this);
Advance();
return temp; }
PRBool
operator==(const iterator &iter) const {
return (mNode == iter.mNode) && (mIndex == iter.mIndex); }
PRBool
operator!=(const iterator &iter) const {
return !iter.operator==(*this); }
};
/**
* Return an iterator that points to the first immediate child of
* the reflow path.
*/
iterator FirstChild() { return iterator(this, mChildren.Count() - 1); }
/**
* Return an iterator that points `one past the end' of the
* immediate children of the reflow path.
*/
iterator EndChildren() { return iterator(this, -1); }
/**
* Determine if the reflow path contains the specified frame as
* one of its immediate children.
*/
PRBool
HasChild(nsIFrame *aFrame) const {
return GetSubtreeFor(aFrame) != nsnull; }
/**
* Return an iterator over the current reflow path that
* corresponds to the specified child frame. Returns EndChildren
* if aFrame is not an immediate child of the reflow path.
*/
iterator
FindChild(nsIFrame *aFrame);
/**
* Remove the specified child frame from the reflow path, along
* with any of its descendants. Does nothing if aFrame is not an
* immediate child of the reflow path.
*/
void
RemoveChild(nsIFrame *aFrame) {
iterator iter = FindChild(aFrame);
Remove(iter); }
/**
* Return the child reflow path that corresponds to the specified
* frame, or null if the frame is not an immediate descendant.
*/
nsReflowPath *
GetSubtreeFor(nsIFrame *aFrame) const;
/**
* Return the child reflow path that corresponds to the specified
* frame, constructing a new child reflow path if one doesn't
* exist already.
*/
nsReflowPath *
EnsureSubtreeFor(nsIFrame *aFrame);
/**
* Remove the child reflow path that corresponds to the specified
* iterator.
*/
void
Remove(iterator &aIterator);
#ifdef DEBUG
/**
* Recursively dump the reflow path object and its descendants.
*/
void
Dump(nsIPresContext *aPresContext, FILE *aFile, int aDepth);
#endif
/**
* The frame that this reflow path object is associated with.
*/
nsIFrame *mFrame;
/**
* If mFrame is the immediate target of an incremental reflow,
* this contains the reflow command that targeted it. Otherwise,
* this is null (and mFrame simply lies along the path to a target
* frame). The reflow path object assumes ownership of the reflow
* command.
*/
nsHTMLReflowCommand *mReflowCommand;
protected:
/**
* The children of this reflow path; also contains pointers to
* nsReflowPath objects.
*/
nsSmallVoidArray mChildren;
friend class iterator;
};
#endif

View File

@@ -1,149 +0,0 @@
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
* The contents of this file are subject to the Netscape Public
* License Version 1.1 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.mozilla.org/NPL/
*
* Software distributed under the License is distributed on an "AS
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
* implied. See the License for the specific language governing
* rights and limitations under the License.
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1999 Netscape Communications Corporation. All
* Rights Reserved.
*
* Contributor(s):
* Simon Fraser sfraser@netscape.com
*/
/*
About this file
---------------
This file contains some handy macros, and a stack-based class that makes
instrumenting functions with Apple's Instrumentation SDK easier.
Instrumentation SDK
-------------------
The Instrumentation SDK allows you to do code performance analysis,
collecting time-based data, and other data by putting instrumentation
points in your code, and running.
You can get the instrumentation SDK from:
ftp://ftp.apple.com/developer/Development_Kits/Instrumentation_SDK.hqx
To find out how to use the Instrumentation Toolkit, read the documentation
that comes with the SDK. I'm not going to explain all that here.
Setting up your tree
--------------------
Put the headers and libraries from the Instrumentation SDK into
a folder in your CodeWarrior 'Mac OS Support' folder.
How to use
----------
In C++ code, the following macros can be used thusly:
NS_IMETHODIMP nsBigThing::SlowFunction()
{
INST_TRACE("SomeLocationDescription"); // Descriptive label. Don't use :: here.
// code that might return anywhere.
...
return NS_OK;
}
Because the INST_TRACE macro makes a stack-based StInstrumentationLog,
exit from the function will be traced wherever it occurs.
You will also need to add the "InstrumentationLib" stub library to the
project.
Such instrumentation points will give you data for the
'Trace Time Line Viewer' in the viewer. There are many other types
of instrumentation data you can collect; see the docs in the SDK
for more information.
Stalking the wild time sink
---------------------------
Your general strategy when using the Instrumentation tools to
track down performance problems should be to start at the high
level, then drill down into subroutines. You want to avoid
instrumenting routines that are called hundreds of thousands
of times, because you'll end up with massive data files. Rather,
instrument their calling routines to get a good sense of where
the time goes.
This kind of performance analysis does not replace the more
traditional profiling tools. Rather, it allows you to analyse
performance problems in terms of behaviour and timing, rather
than a simply overview of % of time spent in different routines.
*/
#include <InstrumentationMacros.h>
#ifdef __cplusplus
/* Stack-based class to do logging */
class StInstrumentationLog
{
public:
StInstrumentationLog(const char* traceName, InstTraceClassRef &ioTraceClassRef)
{
if (ioTraceClassRef == 0)
{
if (InstCreateTraceClass( kInstRootClassRef, traceName, 0, kInstEnableClassMask, &ioTraceClassRef) != noErr)
{
DebugStr("\pFailed to make instrumentation trace class");
return;
}
}
mTraceClassRef = ioTraceClassRef;
mEventTag = InstCreateEventTag();
InstLogTraceEvent(mTraceClassRef, mEventTag, kInstStartEvent);
}
~StInstrumentationLog()
{
InstLogTraceEvent(mTraceClassRef, mEventTag, kInstEndEvent);
}
void LogMiddleEvent()
{
InstLogTraceEvent(mTraceClassRef, mEventTag, kInstMiddleEvent);
}
void LogMiddleEventWithData(const char* inFormatString, void* inEventData)
{
InstDataDescriptorRef dataDesc;
InstCreateDataDescriptor(inFormatString, &dataDesc);
InstLogTraceEventWithData(mTraceClassRef, mEventTag, kInstMiddleEvent, dataDesc, inEventData);
InstDisposeDataDescriptor(dataDesc);
}
protected:
InstTraceClassRef mTraceClassRef;
InstEventTag mEventTag;
};
#define INST_TRACE(n) static InstTraceClassRef __sTrace = 0; StInstrumentationLog traceLog((n), __sTrace)
#define INST_TRACE_MIDDLE do { traceLog.LogMiddleEvent(); } while(0)
#define INST_TRACE_DATA(s, d) do { traceLog.LogMiddleEventWithData((s), (d)); } while (0)
#endif /* __cplusplus */

View File

@@ -1 +0,0 @@
InstrumentationHelpers.h

View File

@@ -39,6 +39,7 @@ REQUIRES = xpcom \
docshell \
uriloader \
msgbase \
msgbaseutil \
intl \
addrbook \
mork \

View File

@@ -25,6 +25,7 @@ REQUIRES = xpcom \
docshell \
uriloader \
msgbase \
msgbaseutil \
intl \
addrbook \
mork \

View File

@@ -54,6 +54,7 @@ REQUIRES = xpcom \
CPPSRCS = \
nsAbSyncPostEngine.cpp \
nsAbSync.cpp \
nsAbSyncList.cpp \
nsAbSyncCRCModel.cpp \
nsABSyncDriver.cpp \
nsSyncDecoderRing.cpp \

View File

@@ -61,6 +61,7 @@ LIBRARY_NAME=absync_s
CPP_OBJS= .\$(OBJDIR)\nsAbSyncPostEngine.obj \
.\$(OBJDIR)\nsAbSync.obj \
.\$(OBJDIR)\nsAbSyncList.obj \
.\$(OBJDIR)\nsAbSyncCRCModel.obj \
.\$(OBJDIR)\nsSyncDecoderRing.obj \
.\$(OBJDIR)\nsABSyncDriver.obj \

File diff suppressed because it is too large Load Diff

View File

@@ -47,9 +47,11 @@
#include "nsIAbMDBCard.h"
#include "nsAbSyncCRCModel.h"
#include "nsVoidArray.h"
#include "nsUInt32Array.h"
#include "nsIStringBundle.h"
#include "nsIDocShell.h"
#include "nsIFileSpec.h"
#include "prlog.h"
//
// Basic Sync Logic
@@ -92,12 +94,25 @@ typedef struct {
PRUint32 flags;
} syncMappingRecord;
#define SYNC_MODIFIED 0x0001 // Must modify record on server
#define SYNC_ADD 0x0002 // Must add record to server
#define SYNC_DELETED 0x0004 // Must delete record from server
#define SYNC_RETRY 0x0008 // Sent to server but failed...must retry!
#define SYNC_RENUMBER 0x0010 // Renumber on the server
#define SYNC_PROCESSED 0x8000 // We processed the entry...nothing to do
typedef struct {
PRInt32 serverID;
PRInt32 localID;
ulong CRC;
nsUInt32Array memServerID;
nsUInt32Array memLocalID;
nsUInt32Array memFlags;
} syncListMappingRecord;
#define SYNC_MODIFIED 0x0001 // Must modify record on server
#define SYNC_ADD 0x0002 // Must add record to server
#define SYNC_DELETED 0x0004 // Must delete record from server
#define SYNC_RETRY 0x0008 // Sent to server but failed...must retry!
#define SYNC_RENUMBER 0x0010 // Renumber on the server
#define SYNC_IS_CARD 0x0100 // It's a user record
#define SYNC_IS_LIST 0x0200 // It's a list record
#define SYNC_IS_AOL_GROUPS 0x0400 // It's an aol 'groups'.
#define SYNC_IS_AOL_ADDITIONAL_EMAIL 0x0800 // It's an aol additional email address.
#define SYNC_PROCESSED 0x8000 // We processed the entry...nothing to do
#define SYNC_ALLTAGS 1000
#define SYNC_EMAILS 2000
@@ -120,34 +135,32 @@ typedef struct {
#define SYNC_ESCAPE_DEL "op%3Ddel"
//mailing list
#define SYNC_ESCAPE_MAIL_ADD "op%3DmaillistCreate"
#define SYNC_ESCAPE_MAIL_MOD "op%3DmaillistRen"
#define SYNC_ESCAPE_MAIL_DEL "op%3DmaillistDel"
#define SYNC_ESCAPE_MAIL_EMAIL_MOD "op%3DemailstringUpdate"
#define SYNC_ESCAPE_MAIL_CONTACT_ADD "op%3DmaillistAdd"
#define SYNC_ESCAPE_MAIL_CONTACT_DEL "op%3DmaillistMemberDel"
#define SYNC_ESCAPE_ADDLIST "op%3DmaillistCreate"
#define SYNC_ESCAPE_MODLIST "op%3DmaillistRen"
#define SYNC_ESCAPE_DELLIST "op%3DmaillistDel"
#define SYNC_ESCAPE_MOD_LIST_EMAIL "op%3DemailstringUpdate"
#define SYNC_ESCAPE_ADD_LIST_CONTACT "op%3DmaillistAdd"
#define SYNC_ESCAPE_DEL_LIST_CONTACT "op%3DmaillistMemberDel"
// group
#define SYNC_ESCAPE_GROUP_DEL "op%3DgrpDel"
#define SYNC_ESCAPE_DELGROUP "op%3DgrpDel"
// Defines for what type of add this may be?
#define SYNC_SINGLE_USER_TYPE 1
#define SYNC_MAILLIST_TYPE 2
#define SYNC_GROUP_TYPE 3
#define SYNC_MAILLIST_MEMBER_TYPE 4
#define SYNC_MAILLIST_MEMBER_EMAIL_TYPE 5
#define SYNC_UNKNOWN_TYPE 0
// Server errors that need to be converted to more user-friendly ones.
#define SYNC_ERROR_EXCEED_MAX_RECORD "exceed max record"
// Generic name tag for AIM screen name
#define SYNC_PREF_PREFIX_CLIENT_MAP "mail.absync.client_map."
#define SYNC_PREF_PREFIX_SERVER_MAP "mail.absync.server_map."
//
// We need this structure for mapping our field names to the server
// field names
//
#define kMaxColumns 38
#define kMaxColumns 47
typedef struct {
const char *abField;
@@ -180,9 +193,9 @@ private:
NS_IMETHOD InitSchemaColumns();
NS_IMETHOD OpenAB(char *aAbName, nsIAddrDatabase **aDatabase);
NS_IMETHOD AnalyzeAllRecords(nsIAddrDatabase *aDatabase, nsIAbDirectory *directory);
NS_IMETHOD AnalyzeAllRecords(nsIAddrDatabase *aDatabase, nsIAbDirectory *directory, PRBool analyzeUser);
NS_IMETHOD GenerateProtocolForCard(nsIAbCard *aCard, PRBool aAddId, nsString &protLine);
PRBool ThisCardHasChanged(nsIAbCard *aCard, syncMappingRecord *syncRecord, nsString &protLine);
PRBool ThisCardHasChanged(nsIAbCard *aCard, syncMappingRecord *syncRecord, nsString &protLine, PRBool cardIsUser);
void InternalInit();
nsresult InternalCleanup(nsresult aResult);
nsresult CleanServerTable(nsVoidArray *aArray);
@@ -210,6 +223,7 @@ private:
PRInt32 mCurrentPostRecord;
nsCOMPtr<nsIFileSpec> mHistoryFile;
nsCOMPtr<nsIFileSpec> mListHistoryFile;
nsCOMPtr<nsIFileSpec> mLockFile;
PRBool mLastSyncFailed;
@@ -218,6 +232,12 @@ private:
PRUint32 mNewTableSize;
syncMappingRecord *mNewSyncMapingTable; // New table after reading address book
nsVoidArray *mNewServerTable; // New entries from the server
// For lists
PRUint32 mListOldTableSize;
syncListMappingRecord *mListOldSyncMapingTable;// Old history table for list
PRUint32 mListNewTableSize;
syncListMappingRecord *mListNewSyncMapingTable;// New lis table for existing address book
nsVoidArray *mListNewServerTable; // New lists from the server
PRUint32 mCrashTableSize;
syncMappingRecord *mCrashTable; // Comparison table for crash recovery...
@@ -230,6 +250,7 @@ private:
///////////////////////////////////////////////
// The following is for protocol parsing
///////////////////////////////////////////////
long GetCRC(char *str);
PRBool EndOfStream(); // If this returns true, we are done with the data...
PRBool ParseNextSection(); // Deal with next section
nsresult AdvanceToNextLine();
@@ -239,29 +260,83 @@ private:
char *ExtractCharacterString(char *aLine, char *aTag, char aDelim);
nsresult PatchHistoryTableWithNewID(PRInt32 clientID, PRInt32 serverID, PRInt32 aMultiplier, ulong crc);
nsresult DeleteRecord();
nsresult DeleteList();
nsresult DeleteGroup();
nsresult DeleteUsers();
nsresult DeleteMailingLists();
nsresult DeleteGroups();
nsresult DeleteMailingListMembers();
nsresult DeleteCardByServerID(PRInt32 aServerID);
nsresult LocateClientIDFromServerID(PRInt32 aServerID, PRInt32 *aClientID);
nsresult LocateServerIDFromClientID(PRInt32 aClientID, PRInt32 *aServerID);
PRInt32 DetermineTagType(nsStringArray *aArray);
nsresult AddNewUsers();
nsresult AddNewMailingLists();
nsresult AddNewGroups();
nsresult AddNewMailingListMembers();
nsresult AddNewMailingListEmailMembers();
nsresult AddValueToNewCard(nsIAbCard *aCard, nsString *aTagName, nsString *aTagValue);
PRBool TagHit(const char *aTag, PRBool advanceToNextLine); // See if we are sitting on a particular tag...and advance if asked
PRBool ErrorFromServer(char **errString); // Return true if the server returned an error...
nsresult ProcessOpReturn();
nsresult ProcessNewRecords();
nsresult ProcessDeletedRecords();
nsresult ProcessNewRecords(PRUint32 sectionId);
nsresult ProcessDeletedRecords(PRUint32 sectionId);
nsresult ProcessLastChange();
nsresult ProcessPhoneNumbersTheyAreSpecial(nsIAbCard *aCard);
PRInt32 GetTypeOfPhoneNumber(const nsAString& tagName);
nsresult AddValueToProtocolLine(const PRUnichar *value, nsString &protocolLine);
nsresult RecoverUserSyncRecords(nsIEnumerator *cardEnum);
nsresult LoadUsersFromHistoryFile();
nsresult SaveCurrentUsersToHistoryFile();
void CheckDeletedRecords(nsIAddrDatabase *aDatabase, nsIAbDirectory *directory);
nsresult InitUserSyncTable(nsIEnumerator *cardEnum);
nsresult LoadInputValuesAndTags(nsStringArray **recordTags, nsStringArray **recordValues);
void MarkDeletedInSyncTable(PRInt32 clientID);
PRUint32 WhichCardType(nsIAbCard *card);
void ParseDateFields(nsIAbCard *aCard, nsString *aTagName, nsString *aTagValue);
// Routines for mail list sync
nsresult LoadListsFromHistoryFile();
nsresult SaveCurrentListsToHistoryFile();
nsresult InitListSyncTable(nsIEnumerator *cardEnum);
nsresult GetMemberListByCard(nsIAbCard *aCard, nsISupportsArray **aList);
nsresult GenerateMemberProtocolForNewList(nsIAbCard *aCard, PRUint32 listIndex, nsString &protLine);
nsresult CheckCurrentListForChangedMember(nsIAbCard *aCard, PRUint32 listIndex, nsString &protLine);
NS_IMETHOD GenerateProtocolForList(nsIAbCard *aCard, PRBool aAddId, nsString &protLine);
nsresult CreateANewMailingList(nsString listName, nsIAddrDatabase *pDb, nsIAbDirectory *directory, PRInt32 *localID);
nsresult CleanListServerTable(nsVoidArray *aArray);
nsresult ExtractMappedMemberIDs(char *aLine, char *aTag, PRInt32 *serverID, PRInt32 *memLocalID, PRInt32 *memServerID);
nsresult PatchListHistoryTableWithNewMemberID(PRInt32 listServerID, PRInt32 memLocalID, PRInt32 memServerID, PRInt32 aMultiplier);
nsresult PatchListHistoryTableWithNewID(PRInt32 clientID, PRInt32 listServerID, PRInt32 aMultiplier);
void ConvertListMappingEntryToString(syncListMappingRecord &listRecord, char **result);
PRUint32 CountListLines(const char *start, const char *end);
void ParseListMappingEntry(const char *start, const char *end, PRUint32 listNum);
void ExtractTwoIDs(const char *PCurPos, const char delim, PRInt32 *local, PRInt32 *server);
void ExtractThreeIDs(const char *str, const char delim, ulong *crc, PRInt32 *localId, PRInt32 *serverId);
nsresult LocateExistingListRecord(PRUint32 listID, syncListMappingRecord **result);
nsresult LocateHistoryListRecord(PRUint32 listID, syncListMappingRecord **result);
PRBool MemberNotFoundInHistory(syncListMappingRecord *listRecord, PRUint32 memberID);
void AddAListMememerToProtocolLine(PRUint32 listKey, PRUint32 memberKey, PRUint32 cid, nsString &protLine);
void CheckDeletedMembers(syncListMappingRecord *listRecord, nsString &protLine);
nsresult InitNewListTablesAndOpenDB(nsIAddrDatabase **aDatabase, nsIAbDirectory **directory);
nsresult AddMemberToList(nsIAbCard *listCard, nsIAbCard *newCard);
nsresult ChangeMailingListName(nsIAbDirectory *directory, nsString listName, nsIAbCard *listCard);
nsresult DeleteMemberFromList(nsIAddrDatabase *aDatabase, nsIAbCard *listCard, PRInt32 memberLocalID);
nsresult DeleteAllEmailMemberCards(syncListMappingRecord *listRecord);
PRBool MemberAlreadyExists(syncListMappingRecord *listRecord, PRInt32 localID, PRInt32 serverID);
nsresult AddGroupsValueToNewCard(nsIAbCard *aCard, nsString *aTagName, nsString *aTagValue);
nsresult InitNewTables();
nsresult ParseEmailMemberIds(nsString *idString, nsUInt32Array &memberServerIDs);
nsresult ParseEmailMemberAddresses(nsString *addrString, nsVoidArray &memberAddresses);
PRUint32 GetCardTypeByMemberId(PRUint32 aClientID);
void GenerateEmailStringUpdateProtocol(PRInt32 listServerID, nsString emailString, nsString &protLine);
void AppendProtocolCmdHeader(nsString &protLine, const char *cmd);
// For updating...
PRInt32 HuntForExistingABEntryInServerRecord(PRInt32 aPersonIndex,
nsIAddrDatabase *aDatabase,
nsIAbDirectory *directory,
PRBool isUser,
PRInt32 *aServerID,
nsIAbCard **newCard);
@@ -273,6 +348,9 @@ private:
PRBool CardAlreadyInAddressBook(nsIAbCard *newCard,
PRInt32 *aClientID,
ulong *aRetCRC);
// Logging
void Log(const char *logSubName, char *logData);
void ParseAndLogServerData(const char *logData);
nsString mLocale; // Charset of returned data!
nsStringArray *mDeletedRecordTags; // The deleted record tags from the server...
@@ -281,10 +359,6 @@ private:
nsStringArray *mNewRecordTags; // The new record tags from the server...
nsStringArray *mNewRecordValues; // The new record values from the server...
// Only support one column/value pair for now until #128567 is fixed to allow multiple pairs to be set.
nsCString mCurrentGenericColumn; // New generic column from server.
nsString mCurrentGenericValue; // New generic value from server.
nsStringArray *mPhoneTypes; // Phone number types...
nsStringArray *mPhoneValues; // Phone number values...

File diff suppressed because it is too large Load Diff

View File

@@ -54,6 +54,7 @@
#define kServerNicknameColumn NS_LITERAL_STRING("nick_name")
#define kServerPriEmailColumn NS_LITERAL_STRING("email1")
#define kServer2ndEmailColumn NS_LITERAL_STRING("email2")
#define kServerDefaultEmailColumn NS_LITERAL_STRING("default_email")
#define kServerPlainTextColumn NS_LITERAL_STRING("Pref_rich_email")
#define kServerWorkPhoneColumn NS_LITERAL_STRING("work_phone")
#define kServerHomePhoneColumn NS_LITERAL_STRING("home_phone")
@@ -75,17 +76,27 @@
#define kServerJobTitleColumn NS_LITERAL_STRING("job_title")
#define kServerDepartmentColumn NS_LITERAL_STRING("department")
#define kServerCompanyColumn NS_LITERAL_STRING("company")
#define kServerBirthdayColumn NS_LITERAL_STRING("birthday")
#define kServerAnniversaryColumn NS_LITERAL_STRING("anniversary")
#define kServerAnniversaryYearColumn NS_LITERAL_STRING("AnniversaryYear")
#define kServerAnniversaryMonthColumn NS_LITERAL_STRING("AnniversaryMonth")
#define kServerAnniversaryDayColumn NS_LITERAL_STRING("AnniversaryDay")
#define kServerSpouseNameColumn NS_LITERAL_STRING("spouse_name")
#define kServerFamilyNameColumn NS_LITERAL_STRING("family_name")
#define kServerDefaultAddressColumn NS_LITERAL_STRING("default_address")
#define kServerCategoryColumn NS_LITERAL_STRING("Category")
#define kServerWebPage1Column NS_LITERAL_STRING("Work_web_page")
#define kServerWebPage2Column NS_LITERAL_STRING("web_page")
#define kServerBirthYearColumn NS_LITERAL_STRING("OMIT:BirthYear")
#define kServerBirthMonthColumn NS_LITERAL_STRING("OMIT:BirthMonth")
#define kServerBirthDayColumn NS_LITERAL_STRING("OMIT:BirthDay")
#define kServerBirthYearColumn NS_LITERAL_STRING("BirthYear")
#define kServerBirthMonthColumn NS_LITERAL_STRING("BirthMonth")
#define kServerBirthDayColumn NS_LITERAL_STRING("BirthDay")
#define kServerCustom1Column NS_LITERAL_STRING("Custom_1")
#define kServerCustom2Column NS_LITERAL_STRING("Custom_2")
#define kServerCustom3Column NS_LITERAL_STRING("Custom_3")
#define kServerCustom4Column NS_LITERAL_STRING("Custom_4")
#define kServerNotesColumn NS_LITERAL_STRING("addl_info")
#define kServerLastModifiedDateColumn NS_LITERAL_STRING("OMIT:LastModifiedDate")
#define kServerAimScreenNameColumn NS_LITERAL_STRING("screen_name")
class nsSyncDecoderRing
{

View File

@@ -37,6 +37,21 @@
#include "nsISupports.idl"
%{C++
// Constants used for default email.
// "0": screen name, "1": other email #1, "2": other email #2
#define AB_DEFAULT_EMAIL_IS_SCREEN_NAME "0"
#define AB_DEFAULT_EMAIL_IS_EMAIL_1 "1"
#define AB_DEFAULT_EMAIL_IS_EMAIL_2 "2"
// Constants used for card types.
// "" or "0": normal, "1": AOL groups, "2": AOL additional email address
#define AB_CARD_IS_NORMAL_CRAD "0"
#define AB_CARD_IS_AOL_GROUPS "1"
#define AB_CARD_IS_AOL_ADDITIONAL_EMAIL "2"
%}
[scriptable, uuid(97448252-F189-11d4-A422-001083003D0C)]
interface nsIAbPreferMailFormat {
const unsigned long unknown = 0;
@@ -53,11 +68,18 @@ interface nsIAbCard : nsISupports {
attribute wstring nickName;
attribute wstring primaryEmail;
attribute wstring secondEmail;
attribute wstring defaultEmail;
attribute wstring cardType;
attribute wstring workPhone;
attribute wstring homePhone;
attribute wstring faxNumber;
attribute wstring pagerNumber;
attribute wstring cellularNumber;
attribute wstring workPhoneType;
attribute wstring homePhoneType;
attribute wstring faxNumberType;
attribute wstring pagerNumberType;
attribute wstring cellularNumberType;
attribute wstring homeAddress;
attribute wstring homeAddress2;
attribute wstring homeCity;
@@ -73,6 +95,14 @@ interface nsIAbCard : nsISupports {
attribute wstring jobTitle;
attribute wstring department;
attribute wstring company;
attribute wstring aimScreenName;
attribute wstring anniversaryYear;
attribute wstring anniversaryMonth;
attribute wstring anniversaryDay;
attribute wstring spouseName;
attribute wstring familyName;
attribute wstring defaultAddress;
attribute wstring category;
/**
* webPage1 is work web page
*/
@@ -81,9 +111,9 @@ interface nsIAbCard : nsISupports {
* webPage2 is home web page
*/
attribute wstring webPage2;
attribute wstring birthYear;
attribute wstring birthMonth;
attribute wstring birthDay;
attribute wstring birthYear;
attribute wstring birthMonth;
attribute wstring birthDay;
attribute wstring custom1;
attribute wstring custom2;
attribute wstring custom3;

View File

@@ -152,6 +152,10 @@ interface nsIAbDirectory : nsISupports {
// with the properties defined by list
void addMailList (in nsIAbDirectory list);
// Creates a new mailing list in the directory with
// the properties defined by list and return a db key
void addMailListWithKey (in nsIAbDirectory list, out PRUint32 key);
// Specific to a directory which is a mail list
attribute wstring listNickName;
attribute wstring description;

View File

@@ -65,12 +65,19 @@
#define kNicknameColumn "NickName"
#define kPriEmailColumn "PrimaryEmail"
#define k2ndEmailColumn "SecondEmail"
#define kDefaultEmailColumn "DefaultEmail"
#define kCardTypeColumn "CardType"
#define kPreferMailFormatColumn "PreferMailFormat"
#define kWorkPhoneColumn "WorkPhone"
#define kHomePhoneColumn "HomePhone"
#define kFaxColumn "FaxNumber"
#define kPagerColumn "PagerNumber"
#define kCellularColumn "CellularNumber"
#define kWorkPhoneTypeColumn "WorkPhoneType"
#define kHomePhoneTypeColumn "HomePhoneType"
#define kFaxTypeColumn "FaxNumberType"
#define kPagerTypeColumn "PagerNumberType"
#define kCellularTypeColumn "CellularNumberType"
#define kHomeAddressColumn "HomeAddress"
#define kHomeAddress2Column "HomeAddress2"
#define kHomeCityColumn "HomeCity"
@@ -86,6 +93,14 @@
#define kJobTitleColumn "JobTitle"
#define kDepartmentColumn "Department"
#define kCompanyColumn "Company"
#define kAimScreenNameColumn "_AimScreenName"
#define kAnniversaryYearColumn "AnniversaryYear"
#define kAnniversaryMonthColumn "AnniversaryMonth"
#define kAnniversaryDayColumn "AnniversaryDay"
#define kSpouseNameColumn "SpouseName"
#define kFamilyNameColumn "FamilyName"
#define kDefaultAddressColumn "DefaultAddress"
#define kCategoryColumn "Category"
// webPage1 is work web page
#define kWebPage1Column "WebPage1"
// webPage2 is home web page
@@ -133,6 +148,7 @@ interface nsIAddrDatabase : nsIAddrDBAnnouncer {
void createNewCardAndAddToDBWithKey(in nsIAbCard newCard, in boolean aNotify, out unsigned long key);
void createNewListCardAndAddToDB(in nsIAbDirectory list, in unsigned long listRowID, in nsIAbCard newCard, in boolean aNotify);
void createMailListAndAddToDB(in nsIAbDirectory newList, in boolean aNotify);
void createMailListAndAddToDBWithKey(in nsIAbDirectory newList, in boolean aNotify, out PRUint32 key);
nsIEnumerator enumerateCards(in nsIAbDirectory directory);
nsIEnumerator enumerateListAddresses(in nsIAbDirectory directory);
void getMailingListsFromDB(in nsIAbDirectory parentDir);
@@ -165,11 +181,18 @@ interface nsIAddrDatabase : nsIAddrDBAnnouncer {
[noscript] void addNickName(in nsIMdbRow row, in string value);
[noscript] void addPrimaryEmail(in nsIMdbRow row, in string value);
[noscript] void add2ndEmail(in nsIMdbRow row, in string value);
[noscript] void addDefaultEmail(in nsIMdbRow row, in string value);
[noscript] void addCardType(in nsIMdbRow row, in string value);
[noscript] void addWorkPhone(in nsIMdbRow row, in string value);
[noscript] void addHomePhone(in nsIMdbRow row, in string value);
[noscript] void addFaxNumber(in nsIMdbRow row, in string value);
[noscript] void addPagerNumber(in nsIMdbRow row, in string value);
[noscript] void addCellularNumber(in nsIMdbRow row, in string value);
[noscript] void addWorkPhoneType(in nsIMdbRow row, in string value);
[noscript] void addHomePhoneType(in nsIMdbRow row, in string value);
[noscript] void addFaxNumberType(in nsIMdbRow row, in string value);
[noscript] void addPagerNumberType(in nsIMdbRow row, in string value);
[noscript] void addCellularNumberType(in nsIMdbRow row, in string value);
[noscript] void addHomeAddress(in nsIMdbRow row, in string value);
[noscript] void addHomeAddress2(in nsIMdbRow row, in string value);
[noscript] void addHomeCity(in nsIMdbRow row, in string value);
@@ -185,11 +208,19 @@ interface nsIAddrDatabase : nsIAddrDBAnnouncer {
[noscript] void addJobTitle(in nsIMdbRow row, in string value);
[noscript] void addDepartment(in nsIMdbRow row, in string value);
[noscript] void addCompany(in nsIMdbRow row, in string value);
[noscript] void addAimScreenName(in nsIMdbRow row, in string value);
[noscript] void addAnniversaryYear(in nsIMdbRow row, in string value);
[noscript] void addAnniversaryMonth(in nsIMdbRow row, in string value);
[noscript] void addAnniversaryDay(in nsIMdbRow row, in string value);
[noscript] void addSpouseName(in nsIMdbRow row, in string value);
[noscript] void addFamilyName(in nsIMdbRow row, in string value);
[noscript] void addDefaultAddress(in nsIMdbRow row, in string value);
[noscript] void addCategory(in nsIMdbRow row, in string value);
[noscript] void addWebPage1(in nsIMdbRow row, in string value);
[noscript] void addWebPage2(in nsIMdbRow row, in string value);
[noscript] void addBirthYear(in nsIMdbRow row, in string value);
[noscript] void addBirthMonth(in nsIMdbRow row, in string value);
[noscript] void addBirthDay(in nsIMdbRow row, in string value);
[noscript] void addBirthYear(in nsIMdbRow row, in string value);
[noscript] void addBirthMonth(in nsIMdbRow row, in string value);
[noscript] void addBirthDay(in nsIMdbRow row, in string value);
[noscript] void addCustom1(in nsIMdbRow row, in string value);
[noscript] void addCustom2(in nsIMdbRow row, in string value);
[noscript] void addCustom3(in nsIMdbRow row, in string value);

View File

@@ -26,7 +26,9 @@ Contributor(s):
<?xul-overlay href="chrome://communicator/content/utilityOverlay.xul"?>
<?xul-overlay href="chrome://communicator/content/tasksOverlay.xul"?>
<!-- in stand alone mail, no sidebar
<?xul-overlay href="chrome://communicator/content/sidebar/sidebarOverlay.xul"?>
-->
<?xul-overlay href="chrome://messenger/content/addressbook/abDirTreeOverlay.xul"?>
<?xul-overlay href="chrome://messenger/content/addressbook/abResultsPaneOverlay.xul"?>
<?xul-overlay href="chrome://messenger/content/addressbook/abCardViewOverlay.xul"?>
@@ -74,6 +76,7 @@ Contributor(s):
<commandset id="selectEditMenuItems"/>
<commandset id="undoEditMenuItems"/>
<commandset id="globalEditMenuItems"/>
<!-- in stand alone mail, no nav, no editor -->
<command id="cmd_newNavigator"/>
<command id="cmd_newEditor"/>
<command id="cmd_printSetup" oncommand="goPageSetup()"/>
@@ -107,6 +110,7 @@ Contributor(s):
<keyset id="tasksKeys">
<!-- File Menu -->
<!-- in stand alone mail, no nav -->
<key id="key_newNavigator"/>
<key id="key_printCard" key="&printCardViewCmd.key;" command="cmd_printCard" modifiers="accel"/>
<key id="key_close"/>
@@ -143,6 +147,7 @@ Contributor(s):
<menuitem label="&newListCmd.label;" accesskey="&newListCmd.accesskey;" oncommand="AbNewList('dirTree')"/>
<menuitem label="&newAddressBookCmd.label;" accesskey="&newAddressBookCmd.accesskey;" oncommand="AbNewAddressBook()"/>
<menuitem label="&newLDAPDirectoryCmd.label;" id="addLDAP" accesskey="&newLDAPDirectoryCmd.accesskey;" oncommand="AbNewLDAPDirectory()"/>
<!-- in stand alone mail, no nav, no editor -->
<menuseparator/>
<menuitem id="menu_newNavigator"/>
<menuitem id="menu_newEditor"/>
@@ -328,7 +333,7 @@ Contributor(s):
<vbox id="sidebar-box">
<sidebarheader type="box" class="sidebarheader-main" label="&addressbook-sidebar-header.label;"/>
<tree id="dirTree" flex="1"/>
<tree style="min-width: 150px" id="dirTree" flex="1"/>
</vbox>
<splitter id="sidebar-splitter" collapse="before" persist="state"/>

View File

@@ -215,9 +215,25 @@ NS_IMETHODIMP nsAbCardProperty::GetCardValue(const char *attrname, PRUnichar **v
nsresult rv = NS_OK;
switch (attrname[0]) {
case '_': // _AimScreenName
rv = GetAimScreenName(value);
break;
case 'A':
// kAddressCharSetColumn?
rv = NS_ERROR_UNEXPECTED;
// AnniversaryYear, AnniversaryMonth, AnniversaryDay
switch (attrname[11]) {
case 'Y':
rv = GetAnniversaryYear(value);
break;
case 'M':
rv = GetAnniversaryMonth(value);
break;
case 'D':
rv = GetAnniversaryDay(value);
break;
default:
rv = NS_ERROR_UNEXPECTED;
break;
}
break;
case 'B':
// BirthYear, BirthMonth, BirthDay
@@ -241,8 +257,17 @@ NS_IMETHODIMP nsAbCardProperty::GetCardValue(const char *attrname, PRUnichar **v
case 'o':
rv = GetCompany(value);
break;
case 'a': // CardType, Category
if (attrname[2] == 't')
rv = GetCategory(value);
else
rv = GetCardType(value);
break;
case 'e':
rv = GetCellularNumber(value);
if (strlen(attrname) <= 14)
rv = GetCellularNumber(value);
else
rv = GetCellularNumberType(value);
break;
case 'u':
switch (attrname[6]) {
@@ -271,14 +296,34 @@ NS_IMETHODIMP nsAbCardProperty::GetCardValue(const char *attrname, PRUnichar **v
case 'D':
if (attrname[1] == 'i')
rv = GetDisplayName(value);
else if (attrname[2] == 'f')
{
if ((attrname[7] == 'E'))
rv = GetDefaultEmail(value);
else
rv = GetDefaultAddress(value);
}
else
rv = GetDepartment(value);
break;
case 'F':
if (attrname[1] == 'i')
switch (attrname[1]) {
case 'i':
rv = GetFirstName(value);
else
rv = GetFaxNumber(value);
break;
case 'a':
if ((attrname[2] == 'x'))
if (strlen(attrname) <= 9)
rv = GetFaxNumber(value);
else
rv = GetFaxNumberType(value);
else
rv = GetFamilyName(value);
break;
default:
rv = NS_ERROR_UNEXPECTED;
break;
}
break;
case 'H':
switch (attrname[4]) {
@@ -295,7 +340,10 @@ NS_IMETHODIMP nsAbCardProperty::GetCardValue(const char *attrname, PRUnichar **v
rv = GetHomeCountry(value);
break;
case 'P':
rv = GetHomePhone(value);
if (strlen(attrname) <= 9)
rv = GetHomePhone(value);
else
rv = GetHomePhoneType(value);
break;
case 'S':
rv = GetHomeState(value);
@@ -354,7 +402,10 @@ NS_IMETHODIMP nsAbCardProperty::GetCardValue(const char *attrname, PRUnichar **v
*value = nsCRT::strdup(formatStr);
break;
case 'g':
rv = GetPagerNumber(value);
if (strlen(attrname) <= 11)
rv = GetPagerNumber(value);
else
rv = GetPagerNumberType(value);
break;
case 'i':
rv = GetPrimaryEmail(value);
@@ -365,7 +416,10 @@ NS_IMETHODIMP nsAbCardProperty::GetCardValue(const char *attrname, PRUnichar **v
}
break;
case 'S':
rv = GetSecondEmail(value);
if (attrname[1] == 'e')
rv = GetSecondEmail(value);
else
rv = GetSpouseName(value);
break;
case 'W':
if (attrname[1] == 'e') {
@@ -389,7 +443,10 @@ NS_IMETHODIMP nsAbCardProperty::GetCardValue(const char *attrname, PRUnichar **v
rv = GetWorkCountry(value);
break;
case 'P':
rv = GetWorkPhone(value);
if (strlen(attrname) <= 9)
rv = GetWorkPhone(value);
else
rv = GetWorkPhoneType(value);
break;
case 'S':
rv = GetWorkState(value);
@@ -422,9 +479,25 @@ NS_IMETHODIMP nsAbCardProperty::SetCardValue(const char *attrname, const PRUnich
nsresult rv = NS_OK;
switch (attrname[0]) {
case '_': // _AimScreenName
rv = SetAimScreenName(value);
break;
case 'A':
// kAddressCharSetColumn?
rv = NS_ERROR_UNEXPECTED;
// AnniversaryYear, AnniversaryMonth, AnniversaryDay
switch (attrname[5]) {
case 'Y':
rv = SetAnniversaryYear(value);
break;
case 'M':
rv = SetAnniversaryMonth(value);
break;
case 'D':
rv = SetAnniversaryDay(value);
break;
default:
rv = NS_ERROR_UNEXPECTED;
break;
}
break;
case 'B':
// BirthYear, BirthMonth, BirthDay
@@ -448,8 +521,17 @@ NS_IMETHODIMP nsAbCardProperty::SetCardValue(const char *attrname, const PRUnich
case 'o':
rv = SetCompany(value);
break;
case 'a': // CardType, Category
if (attrname[2] == 't')
rv = SetCategory(value);
else
rv = SetCardType(value);
break;
case 'e':
rv = SetCellularNumber(value);
if (strlen(attrname) <= 14)
rv = SetCellularNumber(value);
else
rv = SetCellularNumberType(value);
break;
case 'u':
switch (attrname[6]) {
@@ -478,14 +560,34 @@ NS_IMETHODIMP nsAbCardProperty::SetCardValue(const char *attrname, const PRUnich
case 'D':
if (attrname[1] == 'i')
rv = SetDisplayName(value);
else if (attrname[2] == 'f')
{
if ((attrname[7] == 'E'))
rv = SetDefaultEmail(value);
else
rv = SetDefaultAddress(value);
}
else
rv = SetDepartment(value);
break;
case 'F':
if (attrname[1] == 'i')
switch (attrname[1]) {
case 'i':
rv = SetFirstName(value);
else
rv = SetFaxNumber(value);
break;
case 'a':
if ((attrname[2] == 'x'))
if (strlen(attrname) <= 9)
rv = SetFaxNumber(value);
else
rv = SetFaxNumberType(value);
else
rv = SetFamilyName(value);
break;
default:
rv = NS_ERROR_UNEXPECTED;
break;
}
break;
case 'H':
switch (attrname[4]) {
@@ -502,7 +604,10 @@ NS_IMETHODIMP nsAbCardProperty::SetCardValue(const char *attrname, const PRUnich
rv = SetHomeCountry(value);
break;
case 'P':
rv = SetHomePhone(value);
if (strlen(attrname) <= 9)
rv = SetHomePhone(value);
else
rv = SetHomePhoneType(value);
break;
case 'S':
rv = SetHomeState(value);
@@ -555,7 +660,10 @@ NS_IMETHODIMP nsAbCardProperty::SetCardValue(const char *attrname, const PRUnich
}
break;
case 'g':
rv = SetPagerNumber(value);
if (strlen(attrname) <= 11)
rv = SetPagerNumber(value);
else
rv = SetPagerNumberType(value);
break;
case 'i':
rv = SetPrimaryEmail(value);
@@ -566,7 +674,10 @@ NS_IMETHODIMP nsAbCardProperty::SetCardValue(const char *attrname, const PRUnich
}
break;
case 'S':
rv = SetSecondEmail(value);
if (attrname[1] == 'e')
rv = SetSecondEmail(value);
else
rv = SetSpouseName(value);
break;
case 'W':
if (attrname[1] == 'e') {
@@ -590,7 +701,10 @@ NS_IMETHODIMP nsAbCardProperty::SetCardValue(const char *attrname, const PRUnich
rv = SetWorkCountry(value);
break;
case 'P':
rv = SetWorkPhone(value);
if (strlen(attrname) <= 9)
rv = SetWorkPhone(value);
else
rv = SetWorkPhoneType(value);
break;
case 'S':
rv = SetWorkState(value);
@@ -637,6 +751,14 @@ NS_IMETHODIMP
nsAbCardProperty::GetSecondEmail(PRUnichar * *aSecondEmail)
{ return GetAttributeName(aSecondEmail, m_SecondEmail); }
NS_IMETHODIMP
nsAbCardProperty::GetDefaultEmail(PRUnichar * *aDefaultEmail)
{ return GetAttributeName(aDefaultEmail, m_DefaultEmail); }
NS_IMETHODIMP
nsAbCardProperty::GetCardType(PRUnichar * *aCardType)
{ return GetAttributeName(aCardType, m_CardType); }
NS_IMETHODIMP
nsAbCardProperty::GetWorkPhone(PRUnichar * *aWorkPhone)
{ return GetAttributeName(aWorkPhone, m_WorkPhone); }
@@ -657,6 +779,26 @@ NS_IMETHODIMP
nsAbCardProperty::GetCellularNumber(PRUnichar * *aCellularNumber)
{ return GetAttributeName(aCellularNumber, m_CellularNumber); }
NS_IMETHODIMP
nsAbCardProperty::GetWorkPhoneType(PRUnichar * *aWorkPhoneType)
{ return GetAttributeName(aWorkPhoneType, m_WorkPhoneType); }
NS_IMETHODIMP
nsAbCardProperty::GetHomePhoneType(PRUnichar * *aHomePhoneType)
{ return GetAttributeName(aHomePhoneType, m_HomePhoneType); }
NS_IMETHODIMP
nsAbCardProperty::GetFaxNumberType(PRUnichar * *aFaxNumberType)
{ return GetAttributeName(aFaxNumberType, m_FaxNumberType); }
NS_IMETHODIMP
nsAbCardProperty::GetPagerNumberType(PRUnichar * *aPagerNumberType)
{ return GetAttributeName(aPagerNumberType, m_PagerNumberType); }
NS_IMETHODIMP
nsAbCardProperty::GetCellularNumberType(PRUnichar * *aCellularNumberType)
{ return GetAttributeName(aCellularNumberType, m_CellularNumberType); }
NS_IMETHODIMP
nsAbCardProperty::GetHomeAddress(PRUnichar * *aHomeAddress)
{ return GetAttributeName(aHomeAddress, m_HomeAddress); }
@@ -717,6 +859,38 @@ NS_IMETHODIMP
nsAbCardProperty::GetCompany(PRUnichar * *aCompany)
{ return GetAttributeName(aCompany, m_Company); }
NS_IMETHODIMP
nsAbCardProperty::GetAimScreenName(PRUnichar * *aAimScreenName)
{ return GetAttributeName(aAimScreenName, m_AimScreenName); }
NS_IMETHODIMP
nsAbCardProperty::GetAnniversaryYear(PRUnichar * *aAnniversaryYear)
{ return GetAttributeName(aAnniversaryYear, m_AnniversaryYear); }
NS_IMETHODIMP
nsAbCardProperty::GetAnniversaryMonth(PRUnichar * *aAnniversaryMonth)
{ return GetAttributeName(aAnniversaryMonth, m_AnniversaryMonth); }
NS_IMETHODIMP
nsAbCardProperty::GetAnniversaryDay(PRUnichar * *aAnniversaryDay)
{ return GetAttributeName(aAnniversaryDay, m_AnniversaryDay); }
NS_IMETHODIMP
nsAbCardProperty::GetSpouseName(PRUnichar * *aSpouseName)
{ return GetAttributeName(aSpouseName, m_SpouseName); }
NS_IMETHODIMP
nsAbCardProperty::GetFamilyName(PRUnichar * *aFamilyName)
{ return GetAttributeName(aFamilyName, m_FamilyName); }
NS_IMETHODIMP
nsAbCardProperty::GetDefaultAddress(PRUnichar * *aDefaultAddress)
{ return GetAttributeName(aDefaultAddress, m_DefaultAddress); }
NS_IMETHODIMP
nsAbCardProperty::GetCategory(PRUnichar * *aCategory)
{ return GetAttributeName(aCategory, m_Category); }
NS_IMETHODIMP
nsAbCardProperty::GetWebPage1(PRUnichar * *aWebPage1)
{ return GetAttributeName(aWebPage1, m_WebPage1); }
@@ -785,6 +959,14 @@ NS_IMETHODIMP
nsAbCardProperty::SetSecondEmail(const PRUnichar * aSecondEmail)
{ return SetAttributeName(aSecondEmail, m_SecondEmail); }
NS_IMETHODIMP
nsAbCardProperty::SetDefaultEmail(const PRUnichar * aDefaultEmail)
{ return SetAttributeName(aDefaultEmail, m_DefaultEmail); }
NS_IMETHODIMP
nsAbCardProperty::SetCardType(const PRUnichar * aCardType)
{ return SetAttributeName(aCardType, m_CardType); }
NS_IMETHODIMP
nsAbCardProperty::SetWorkPhone(const PRUnichar * aWorkPhone)
{ return SetAttributeName(aWorkPhone, m_WorkPhone); }
@@ -805,6 +987,26 @@ NS_IMETHODIMP
nsAbCardProperty::SetCellularNumber(const PRUnichar * aCellularNumber)
{ return SetAttributeName(aCellularNumber, m_CellularNumber); }
NS_IMETHODIMP
nsAbCardProperty::SetWorkPhoneType(const PRUnichar * aWorkPhoneType)
{ return SetAttributeName(aWorkPhoneType, m_WorkPhoneType); }
NS_IMETHODIMP
nsAbCardProperty::SetHomePhoneType(const PRUnichar * aHomePhoneType)
{ return SetAttributeName(aHomePhoneType, m_HomePhoneType); }
NS_IMETHODIMP
nsAbCardProperty::SetFaxNumberType(const PRUnichar * aFaxNumberType)
{ return SetAttributeName(aFaxNumberType, m_FaxNumberType); }
NS_IMETHODIMP
nsAbCardProperty::SetPagerNumberType(const PRUnichar * aPagerNumberType)
{ return SetAttributeName(aPagerNumberType, m_PagerNumberType); }
NS_IMETHODIMP
nsAbCardProperty::SetCellularNumberType(const PRUnichar * aCellularNumberType)
{ return SetAttributeName(aCellularNumberType, m_CellularNumberType); }
NS_IMETHODIMP
nsAbCardProperty::SetHomeAddress(const PRUnichar * aHomeAddress)
{ return SetAttributeName(aHomeAddress, m_HomeAddress); }
@@ -865,6 +1067,38 @@ NS_IMETHODIMP
nsAbCardProperty::SetCompany(const PRUnichar * aCompany)
{ return SetAttributeName(aCompany, m_Company); }
NS_IMETHODIMP
nsAbCardProperty::SetAimScreenName(const PRUnichar *aAimScreenName)
{ return SetAttributeName(aAimScreenName, m_AimScreenName); }
NS_IMETHODIMP
nsAbCardProperty::SetAnniversaryYear(const PRUnichar * aAnniversaryYear)
{ return SetAttributeName(aAnniversaryYear, m_AnniversaryYear); }
NS_IMETHODIMP
nsAbCardProperty::SetAnniversaryMonth(const PRUnichar * aAnniversaryMonth)
{ return SetAttributeName(aAnniversaryMonth, m_AnniversaryMonth); }
NS_IMETHODIMP
nsAbCardProperty::SetAnniversaryDay(const PRUnichar * aAnniversaryDay)
{ return SetAttributeName(aAnniversaryDay, m_AnniversaryDay); }
NS_IMETHODIMP
nsAbCardProperty::SetSpouseName(const PRUnichar * aSpouseName)
{ return SetAttributeName(aSpouseName, m_SpouseName); }
NS_IMETHODIMP
nsAbCardProperty::SetFamilyName(const PRUnichar * aFamilyName)
{ return SetAttributeName(aFamilyName, m_FamilyName); }
NS_IMETHODIMP
nsAbCardProperty::SetDefaultAddress(const PRUnichar * aDefaultAddress)
{ return SetAttributeName(aDefaultAddress, m_DefaultAddress); }
NS_IMETHODIMP
nsAbCardProperty::SetCategory(const PRUnichar * aCategory)
{ return SetAttributeName(aCategory, m_Category); }
NS_IMETHODIMP
nsAbCardProperty::SetWebPage1(const PRUnichar * aWebPage1)
{ return SetAttributeName(aWebPage1, m_WebPage1); }
@@ -925,6 +1159,10 @@ NS_IMETHODIMP nsAbCardProperty::Copy(nsIAbCard* srcCard)
SetPrimaryEmail(str);
srcCard->GetSecondEmail(getter_Copies(str));
SetSecondEmail(str);
srcCard->GetDefaultEmail(getter_Copies(str));
SetDefaultEmail(str);
srcCard->GetCardType(getter_Copies(str));
SetCardType(str);
PRUint32 format;
srcCard->GetPreferMailFormat(&format);
@@ -940,6 +1178,16 @@ NS_IMETHODIMP nsAbCardProperty::Copy(nsIAbCard* srcCard)
SetPagerNumber(str);
srcCard->GetCellularNumber(getter_Copies(str));
SetCellularNumber(str);
srcCard->GetWorkPhoneType(getter_Copies(str));
SetWorkPhoneType(str);
srcCard->GetHomePhoneType(getter_Copies(str));
SetHomePhoneType(str);
srcCard->GetFaxNumberType(getter_Copies(str));
SetFaxNumberType(str);
srcCard->GetPagerNumberType(getter_Copies(str));
SetPagerNumberType(str);
srcCard->GetCellularNumberType(getter_Copies(str));
SetCellularNumberType(str);
srcCard->GetHomeAddress(getter_Copies(str));
SetHomeAddress(str);
srcCard->GetHomeAddress2(getter_Copies(str));
@@ -970,16 +1218,34 @@ NS_IMETHODIMP nsAbCardProperty::Copy(nsIAbCard* srcCard)
SetDepartment(str);
srcCard->GetCompany(getter_Copies(str));
SetCompany(str);
srcCard->GetAimScreenName(getter_Copies(str));
SetAimScreenName(str);
srcCard->GetAnniversaryYear(getter_Copies(str));
SetAnniversaryYear(str);
srcCard->GetAnniversaryMonth(getter_Copies(str));
SetAnniversaryMonth(str);
srcCard->GetAnniversaryDay(getter_Copies(str));
SetAnniversaryDay(str);
srcCard->GetSpouseName(getter_Copies(str));
SetSpouseName(str);
srcCard->GetFamilyName(getter_Copies(str));
SetFamilyName(str);
srcCard->GetDefaultAddress(getter_Copies(str));
SetDefaultAddress(str);
srcCard->GetCategory(getter_Copies(str));
SetCategory(str);
srcCard->GetWebPage1(getter_Copies(str));
SetWebPage1(str);
srcCard->GetWebPage2(getter_Copies(str));
SetWebPage2(str);
srcCard->GetBirthYear(getter_Copies(str));
SetBirthYear(str);
srcCard->GetBirthMonth(getter_Copies(str));
SetBirthMonth(str);
srcCard->GetBirthDay(getter_Copies(str));
SetBirthDay(str);
srcCard->GetBirthYear(getter_Copies(str));
SetBirthYear(str);
srcCard->GetBirthMonth(getter_Copies(str));
SetBirthMonth(str);
srcCard->GetBirthDay(getter_Copies(str));
SetBirthDay(str);
srcCard->GetCustom1(getter_Copies(str));
SetCustom1(str);
srcCard->GetCustom2(getter_Copies(str));

View File

@@ -78,11 +78,18 @@ protected:
nsString m_NickName;
nsString m_PrimaryEmail;
nsString m_SecondEmail;
nsString m_DefaultEmail;
nsString m_CardType; // "", "0": normal, "1": AOL groups, "2": AOL additional email address
nsString m_WorkPhone;
nsString m_HomePhone;
nsString m_FaxNumber;
nsString m_PagerNumber;
nsString m_CellularNumber;
nsString m_WorkPhoneType;
nsString m_HomePhoneType;
nsString m_FaxNumberType;
nsString m_PagerNumberType;
nsString m_CellularNumberType;
nsString m_HomeAddress;
nsString m_HomeAddress2;
nsString m_HomeCity;
@@ -98,11 +105,19 @@ protected:
nsString m_JobTitle;
nsString m_Department;
nsString m_Company;
nsString m_AimScreenName;
nsString m_AnniversaryYear;
nsString m_AnniversaryMonth;
nsString m_AnniversaryDay;
nsString m_SpouseName;
nsString m_FamilyName;
nsString m_DefaultAddress;
nsString m_Category;
nsString m_WebPage1;
nsString m_WebPage2;
nsString m_BirthYear;
nsString m_BirthMonth;
nsString m_BirthDay;
nsString m_BirthYear;
nsString m_BirthMonth;
nsString m_BirthDay;
nsString m_Custom1;
nsString m_Custom2;
nsString m_Custom3;

View File

@@ -255,6 +255,9 @@ NS_IMETHODIMP nsAbDirProperty::CreateDirectoryByURI(const PRUnichar *dirName, co
NS_IMETHODIMP nsAbDirProperty::AddMailList(nsIAbDirectory *list)
{ return NS_ERROR_NOT_IMPLEMENTED; }
NS_IMETHODIMP nsAbDirProperty::AddMailListWithKey(nsIAbDirectory *list, PRUint32 *key)
{ return NS_ERROR_NOT_IMPLEMENTED; }
NS_IMETHODIMP nsAbDirProperty::EditMailListToDatabase(const char *uri, nsIAbCard *listCard)
{ return NS_ERROR_NOT_IMPLEMENTED; }

View File

@@ -147,6 +147,10 @@ NS_IMETHODIMP nsAbMDBCardProperty::CopyCard(nsIAbMDBCard* srcCardDB)
SetPrimaryEmail(str);
srcCard->GetSecondEmail(getter_Copies(str));
SetSecondEmail(str);
srcCard->GetDefaultEmail(getter_Copies(str));
SetDefaultEmail(str);
srcCard->GetCardType(getter_Copies(str));
SetCardType(str);
PRUint32 format = nsIAbPreferMailFormat::unknown;
srcCard->GetPreferMailFormat(&format);
@@ -162,6 +166,16 @@ NS_IMETHODIMP nsAbMDBCardProperty::CopyCard(nsIAbMDBCard* srcCardDB)
SetPagerNumber(str);
srcCard->GetCellularNumber(getter_Copies(str));
SetCellularNumber(str);
srcCard->GetWorkPhoneType(getter_Copies(str));
SetWorkPhoneType(str);
srcCard->GetHomePhoneType(getter_Copies(str));
SetHomePhoneType(str);
srcCard->GetFaxNumberType(getter_Copies(str));
SetFaxNumberType(str);
srcCard->GetPagerNumberType(getter_Copies(str));
SetPagerNumberType(str);
srcCard->GetCellularNumberType(getter_Copies(str));
SetCellularNumberType(str);
srcCard->GetHomeAddress(getter_Copies(str));
SetHomeAddress(str);
srcCard->GetHomeAddress2(getter_Copies(str));
@@ -192,11 +206,29 @@ NS_IMETHODIMP nsAbMDBCardProperty::CopyCard(nsIAbMDBCard* srcCardDB)
SetDepartment(str);
srcCard->GetCompany(getter_Copies(str));
SetCompany(str);
srcCard->GetAimScreenName(getter_Copies(str));
SetAimScreenName(str);
srcCard->GetAnniversaryYear(getter_Copies(str));
SetAnniversaryYear(str);
srcCard->GetAnniversaryMonth(getter_Copies(str));
SetAnniversaryMonth(str);
srcCard->GetAnniversaryDay(getter_Copies(str));
SetAnniversaryDay(str);
srcCard->GetSpouseName(getter_Copies(str));
SetSpouseName(str);
srcCard->GetFamilyName(getter_Copies(str));
SetFamilyName(str);
srcCard->GetDefaultAddress(getter_Copies(str));
SetDefaultAddress(str);
srcCard->GetCategory(getter_Copies(str));
SetCategory(str);
srcCard->GetWebPage1(getter_Copies(str));
SetWebPage1(str);
srcCard->GetWebPage2(getter_Copies(str));
SetWebPage2(str);
srcCard->GetBirthYear(getter_Copies(str));
srcCard->GetBirthYear(getter_Copies(str));
SetBirthYear(str);
srcCard->GetBirthMonth(getter_Copies(str));
SetBirthMonth(str);

View File

@@ -654,7 +654,17 @@ NS_IMETHODIMP nsAbMDBDirectory::CreateDirectoryByURI(const PRUnichar *dirName, c
return NS_ERROR_NOT_IMPLEMENTED;
}
NS_IMETHODIMP nsAbMDBDirectory::AddMailListWithKey(nsIAbDirectory *list, PRUint32 *key)
{
return(InternalAddMailList(list, key));
}
NS_IMETHODIMP nsAbMDBDirectory::AddMailList(nsIAbDirectory *list)
{
return(InternalAddMailList(list, nsnull));
}
nsresult nsAbMDBDirectory::InternalAddMailList(nsIAbDirectory *list, PRUint32 *key)
{
if (mIsQueryURI)
return NS_ERROR_NOT_IMPLEMENTED;
@@ -679,7 +689,10 @@ NS_IMETHODIMP nsAbMDBDirectory::AddMailList(nsIAbDirectory *list)
rv = NS_OK;
}
if (!key)
mDatabase->CreateMailListAndAddToDB(list, PR_TRUE);
else
mDatabase->CreateMailListAndAddToDBWithKey(list, PR_TRUE, key);
mDatabase->Commit(nsAddrDBCommitType::kLargeCommit);
PRUint32 dbRowID;

View File

@@ -94,6 +94,7 @@ public:
NS_IMETHOD CreateNewDirectory(nsIAbDirectoryProperties *aProperties);
NS_IMETHOD CreateDirectoryByURI(const PRUnichar *dirName, const char *uri, PRBool migrating);
NS_IMETHOD AddMailList(nsIAbDirectory *list);
NS_IMETHOD AddMailListWithKey(nsIAbDirectory *list, PRUint32 *key);
NS_IMETHOD AddCard(nsIAbCard *card, nsIAbCard **addedCard);
NS_IMETHOD DropCard(nsIAbCard *card, PRBool needToCopyCard);
NS_IMETHOD EditMailListToDatabase(const char *uri, nsIAbCard *listCard);
@@ -113,6 +114,7 @@ protected:
nsresult NotifyItemDeleted(nsISupports *item);
nsresult NotifyItemChanged(nsISupports *item);
nsresult RemoveCardFromAddressList(nsIAbCard* card);
nsresult InternalAddMailList(nsIAbDirectory *list, PRUint32 *key);
nsresult AddMailList(const char *uriName);

View File

@@ -444,8 +444,7 @@ nsresult nsAbView::GetCardValue(nsIAbCard *card, const PRUnichar *colID, PRUnich
nsresult rv;
// "G" == "GeneratedName"
// "_" == generic column (like _AimScreenName)
// else, standard column (like PrimaryEmail)
// else, standard column (like PrimaryEmail and _AimScreenName)
if (colID[0] == PRUnichar('G')) {
// XXX todo
// cache the ab session?
@@ -456,9 +455,6 @@ nsresult nsAbView::GetCardValue(nsIAbCard *card, const PRUnichar *colID, PRUnich
NS_ENSURE_SUCCESS(rv,rv);
}
else {
if (colID[0] == PRUnichar('_'))
rv = mDirectory->GetValueForCard(card, NS_LossyConvertUCS2toASCII(colID).get(), _retval);
else
rv = card->GetCardValue(NS_LossyConvertUCS2toASCII(colID).get(), _retval);
}
return rv;

View File

@@ -106,11 +106,18 @@ nsAddrDatabase::nsAddrDatabase()
m_NickNameColumnToken(0),
m_PriEmailColumnToken(0),
m_2ndEmailColumnToken(0),
m_DefaultEmailColumnToken(0),
m_CardTypeColumnToken(0),
m_WorkPhoneColumnToken(0),
m_HomePhoneColumnToken(0),
m_FaxColumnToken(0),
m_PagerColumnToken(0),
m_CellularColumnToken(0),
m_WorkPhoneTypeColumnToken(0),
m_HomePhoneTypeColumnToken(0),
m_FaxTypeColumnToken(0),
m_PagerTypeColumnToken(0),
m_CellularTypeColumnToken(0),
m_HomeAddressColumnToken(0),
m_HomeAddress2ColumnToken(0),
m_HomeCityColumnToken(0),
@@ -123,6 +130,15 @@ nsAddrDatabase::nsAddrDatabase()
m_WorkStateColumnToken(0),
m_WorkZipCodeColumnToken(0),
m_WorkCountryColumnToken(0),
m_CompanyColumnToken(0),
m_AimScreenNameColumnToken(0),
m_AnniversaryYearColumnToken(0),
m_AnniversaryMonthColumnToken(0),
m_AnniversaryDayColumnToken(0),
m_SpouseNameColumnToken(0),
m_FamilyNameColumnToken(0),
m_DefaultAddressColumnToken(0),
m_CategoryColumnToken(0),
m_WebPage1ColumnToken(0),
m_WebPage2ColumnToken(0),
m_BirthYearColumnToken(0),
@@ -1054,12 +1070,19 @@ nsresult nsAddrDatabase::InitMDBInfo()
GetStore()->StringToToken(GetEnv(), kPriEmailColumn, &m_PriEmailColumnToken);
GetStore()->StringToToken(GetEnv(), kLowerPriEmailColumn, &m_LowerPriEmailColumnToken);
GetStore()->StringToToken(GetEnv(), k2ndEmailColumn, &m_2ndEmailColumnToken);
GetStore()->StringToToken(GetEnv(), kDefaultEmailColumn, &m_DefaultEmailColumnToken);
GetStore()->StringToToken(GetEnv(), kCardTypeColumn, &m_CardTypeColumnToken);
GetStore()->StringToToken(GetEnv(), kPreferMailFormatColumn, &m_MailFormatColumnToken);
GetStore()->StringToToken(GetEnv(), kWorkPhoneColumn, &m_WorkPhoneColumnToken);
GetStore()->StringToToken(GetEnv(), kHomePhoneColumn, &m_HomePhoneColumnToken);
GetStore()->StringToToken(GetEnv(), kFaxColumn, &m_FaxColumnToken);
GetStore()->StringToToken(GetEnv(), kPagerColumn, &m_PagerColumnToken);
GetStore()->StringToToken(GetEnv(), kCellularColumn, &m_CellularColumnToken);
GetStore()->StringToToken(GetEnv(), kWorkPhoneTypeColumn, &m_WorkPhoneTypeColumnToken);
GetStore()->StringToToken(GetEnv(), kHomePhoneTypeColumn, &m_HomePhoneTypeColumnToken);
GetStore()->StringToToken(GetEnv(), kFaxTypeColumn, &m_FaxTypeColumnToken);
GetStore()->StringToToken(GetEnv(), kPagerTypeColumn, &m_PagerTypeColumnToken);
GetStore()->StringToToken(GetEnv(), kCellularTypeColumn, &m_CellularTypeColumnToken);
GetStore()->StringToToken(GetEnv(), kHomeAddressColumn, &m_HomeAddressColumnToken);
GetStore()->StringToToken(GetEnv(), kHomeAddress2Column, &m_HomeAddress2ColumnToken);
GetStore()->StringToToken(GetEnv(), kHomeCityColumn, &m_HomeCityColumnToken);
@@ -1075,6 +1098,14 @@ nsresult nsAddrDatabase::InitMDBInfo()
GetStore()->StringToToken(GetEnv(), kJobTitleColumn, &m_JobTitleColumnToken);
GetStore()->StringToToken(GetEnv(), kDepartmentColumn, &m_DepartmentColumnToken);
GetStore()->StringToToken(GetEnv(), kCompanyColumn, &m_CompanyColumnToken);
GetStore()->StringToToken(GetEnv(), kAimScreenNameColumn, &m_AimScreenNameColumnToken);
GetStore()->StringToToken(GetEnv(), kAnniversaryYearColumn, &m_AnniversaryYearColumnToken);
GetStore()->StringToToken(GetEnv(), kAnniversaryMonthColumn, &m_AnniversaryMonthColumnToken);
GetStore()->StringToToken(GetEnv(), kAnniversaryDayColumn, &m_AnniversaryDayColumnToken);
GetStore()->StringToToken(GetEnv(), kSpouseNameColumn, &m_SpouseNameColumnToken);
GetStore()->StringToToken(GetEnv(), kFamilyNameColumn, &m_FamilyNameColumnToken);
GetStore()->StringToToken(GetEnv(), kDefaultAddressColumn, &m_DefaultAddressColumnToken);
GetStore()->StringToToken(GetEnv(), kCategoryColumn, &m_CategoryColumnToken);
GetStore()->StringToToken(GetEnv(), kWebPage1Column, &m_WebPage1ColumnToken);
GetStore()->StringToToken(GetEnv(), kWebPage2Column, &m_WebPage2ColumnToken);
GetStore()->StringToToken(GetEnv(), kBirthYearColumn, &m_BirthYearColumnToken);
@@ -1158,6 +1189,12 @@ nsresult nsAddrDatabase::AddAttributeColumnsToRow(nsIAbCard *card, nsIMdbRow *ca
card->GetSecondEmail(getter_Copies(unicodeStr));
Add2ndEmail(cardRow, NS_ConvertUCS2toUTF8(unicodeStr).get());
card->GetDefaultEmail(getter_Copies(unicodeStr));
AddDefaultEmail(cardRow, NS_ConvertUCS2toUTF8(unicodeStr).get());
card->GetCardType(getter_Copies(unicodeStr));
AddCardType(cardRow, NS_ConvertUCS2toUTF8(unicodeStr).get());
PRUint32 format = nsIAbPreferMailFormat::unknown;
card->GetPreferMailFormat(&format);
@@ -1177,6 +1214,21 @@ nsresult nsAddrDatabase::AddAttributeColumnsToRow(nsIAbCard *card, nsIMdbRow *ca
card->GetCellularNumber(getter_Copies(unicodeStr));
AddCellularNumber(cardRow,NS_ConvertUCS2toUTF8(unicodeStr).get());
card->GetWorkPhoneType(getter_Copies(unicodeStr));
AddWorkPhoneType(cardRow, NS_ConvertUCS2toUTF8(unicodeStr).get());
card->GetHomePhoneType(getter_Copies(unicodeStr));
AddHomePhoneType(cardRow, NS_ConvertUCS2toUTF8(unicodeStr).get());
card->GetFaxNumberType(getter_Copies(unicodeStr));
AddFaxNumberType(cardRow, NS_ConvertUCS2toUTF8(unicodeStr).get());
card->GetPagerNumberType(getter_Copies(unicodeStr));
AddPagerNumberType(cardRow,NS_ConvertUCS2toUTF8(unicodeStr).get());
card->GetCellularNumberType(getter_Copies(unicodeStr));
AddCellularNumberType(cardRow,NS_ConvertUCS2toUTF8(unicodeStr).get());
card->GetHomeAddress(getter_Copies(unicodeStr));
AddHomeAddress(cardRow, NS_ConvertUCS2toUTF8(unicodeStr).get());
@@ -1222,19 +1274,44 @@ nsresult nsAddrDatabase::AddAttributeColumnsToRow(nsIAbCard *card, nsIMdbRow *ca
card->GetCompany(getter_Copies(unicodeStr));
AddCompany(cardRow, NS_ConvertUCS2toUTF8(unicodeStr).get());
// AimScreenName
card->GetAimScreenName(getter_Copies(unicodeStr));
AddAimScreenName(cardRow, NS_ConvertUCS2toUTF8(unicodeStr).get());
card->GetAnniversaryYear(getter_Copies(unicodeStr));
AddAnniversaryYear(cardRow, NS_ConvertUCS2toUTF8(unicodeStr).get());
card->GetAnniversaryMonth(getter_Copies(unicodeStr));
AddAnniversaryMonth(cardRow, NS_ConvertUCS2toUTF8(unicodeStr).get());
card->GetAnniversaryDay(getter_Copies(unicodeStr));
AddAnniversaryDay(cardRow, NS_ConvertUCS2toUTF8(unicodeStr).get());
card->GetSpouseName(getter_Copies(unicodeStr));
AddSpouseName(cardRow, NS_ConvertUCS2toUTF8(unicodeStr).get());
card->GetFamilyName(getter_Copies(unicodeStr));
AddFamilyName(cardRow, NS_ConvertUCS2toUTF8(unicodeStr).get());
card->GetDefaultAddress(getter_Copies(unicodeStr));
AddDefaultAddress(cardRow, NS_ConvertUCS2toUTF8(unicodeStr).get());
card->GetCategory(getter_Copies(unicodeStr));
AddCategory(cardRow, NS_ConvertUCS2toUTF8(unicodeStr).get());
card->GetWebPage1(getter_Copies(unicodeStr));
AddWebPage1(cardRow,NS_ConvertUCS2toUTF8(unicodeStr).get());
card->GetWebPage2(getter_Copies(unicodeStr));
AddWebPage2(cardRow, NS_ConvertUCS2toUTF8(unicodeStr).get());
card->GetBirthYear(getter_Copies(unicodeStr));
AddBirthYear(cardRow, NS_ConvertUCS2toUTF8(unicodeStr).get());
card->GetBirthMonth(getter_Copies(unicodeStr));
AddBirthMonth(cardRow, NS_ConvertUCS2toUTF8(unicodeStr).get());
card->GetBirthDay(getter_Copies(unicodeStr));
AddBirthDay(cardRow, NS_ConvertUCS2toUTF8(unicodeStr).get());
@@ -2341,6 +2418,18 @@ nsresult nsAddrDatabase::GetCardFromDB(nsIAbCard *newCard, nsIMdbRow* cardRow)
newCard->SetSecondEmail(tempString.get());
}
err = GetStringColumn(cardRow, m_DefaultEmailColumnToken, tempString);
if (NS_SUCCEEDED(err) && tempString.Length())
{
newCard->SetDefaultEmail(tempString.get());
}
err = GetStringColumn(cardRow, m_CardTypeColumnToken, tempString);
if (NS_SUCCEEDED(err) && tempString.Length())
{
newCard->SetCardType(tempString.get());
}
PRUint32 format = nsIAbPreferMailFormat::unknown;
err = GetIntColumn(cardRow, m_MailFormatColumnToken, &format, 0);
if (NS_SUCCEEDED(err))
@@ -2376,6 +2465,26 @@ nsresult nsAddrDatabase::GetCardFromDB(nsIAbCard *newCard, nsIMdbRow* cardRow)
newCard->SetCellularNumber(tempString.get());
}
err = GetStringColumn(cardRow, m_WorkPhoneTypeColumnToken, tempString);
if (NS_SUCCEEDED(err) && tempString.Length())
newCard->SetWorkPhoneType(tempString.get());
err = GetStringColumn(cardRow, m_HomePhoneTypeColumnToken, tempString);
if (NS_SUCCEEDED(err) && tempString.Length())
newCard->SetHomePhoneType(tempString.get());
err = GetStringColumn(cardRow, m_FaxTypeColumnToken, tempString);
if (NS_SUCCEEDED(err) && tempString.Length())
newCard->SetFaxNumberType(tempString.get());
err = GetStringColumn(cardRow, m_PagerTypeColumnToken, tempString);
if (NS_SUCCEEDED(err) && tempString.Length())
newCard->SetPagerNumberType(tempString.get());
err = GetStringColumn(cardRow, m_CellularTypeColumnToken, tempString);
if (NS_SUCCEEDED(err) && tempString.Length())
newCard->SetCellularNumberType(tempString.get());
err = GetStringColumn(cardRow, m_HomeAddressColumnToken, tempString);
if (NS_SUCCEEDED(err) && tempString.Length())
{
@@ -2466,6 +2575,39 @@ nsresult nsAddrDatabase::GetCardFromDB(nsIAbCard *newCard, nsIMdbRow* cardRow)
newCard->SetCompany(tempString.get());
}
// AimScreenName
err = GetStringColumn(cardRow, m_AimScreenNameColumnToken, tempString);
if (NS_SUCCEEDED(err) && tempString.Length())
newCard->SetAimScreenName(tempString.get());
err = GetStringColumn(cardRow, m_AnniversaryYearColumnToken, tempString);
if (NS_SUCCEEDED(err) && tempString.Length())
newCard->SetAnniversaryYear(tempString.get());
err = GetStringColumn(cardRow, m_AnniversaryMonthColumnToken, tempString);
if (NS_SUCCEEDED(err) && tempString.Length())
newCard->SetAnniversaryMonth(tempString.get());
err = GetStringColumn(cardRow, m_AnniversaryDayColumnToken, tempString);
if (NS_SUCCEEDED(err) && tempString.Length())
newCard->SetAnniversaryDay(tempString.get());
err = GetStringColumn(cardRow, m_SpouseNameColumnToken, tempString);
if (NS_SUCCEEDED(err) && tempString.Length())
newCard->SetSpouseName(tempString.get());
err = GetStringColumn(cardRow, m_FamilyNameColumnToken, tempString);
if (NS_SUCCEEDED(err) && tempString.Length())
newCard->SetFamilyName(tempString.get());
err = GetStringColumn(cardRow, m_DefaultAddressColumnToken, tempString);
if (NS_SUCCEEDED(err) && tempString.Length())
newCard->SetDefaultAddress(tempString.get());
err = GetStringColumn(cardRow, m_CategoryColumnToken, tempString);
if (NS_SUCCEEDED(err) && tempString.Length())
newCard->SetCategory(tempString.get());
err = GetStringColumn(cardRow, m_WebPage1ColumnToken, tempString);
if (NS_SUCCEEDED(err) && tempString.Length())
{
@@ -3330,3 +3472,14 @@ NS_IMETHODIMP nsAddrDatabase::RemoveExtraCardsInCab(PRUint32 cardTotal, PRUint32
return NS_OK;
}
NS_IMETHODIMP nsAddrDatabase::CreateMailListAndAddToDBWithKey(nsIAbDirectory *newList, PRBool notify, PRUint32 *key)
{
NS_ENSURE_ARG_POINTER(key);
*key = 0;
nsresult rv;
rv = CreateMailListAndAddToDB(newList, notify);
if (NS_SUCCEEDED(rv))
*key = m_LastRecordKey;
return rv;
}

View File

@@ -87,6 +87,7 @@ public:
NS_IMETHOD CreateNewCardAndAddToDBWithKey(nsIAbCard *newCard, PRBool notify, PRUint32 *key);
NS_IMETHOD CreateNewListCardAndAddToDB(nsIAbDirectory *list, PRUint32 listRowID, nsIAbCard *newCard, PRBool notify);
NS_IMETHOD CreateMailListAndAddToDB(nsIAbDirectory *newList, PRBool notify);
NS_IMETHOD CreateMailListAndAddToDBWithKey(nsIAbDirectory *newList, PRBool notify, PRUint32 *key);
NS_IMETHOD EnumerateCards(nsIAbDirectory *directory, nsIEnumerator **result);
NS_IMETHOD GetMailingListsFromDB(nsIAbDirectory *parentDir);
NS_IMETHOD EnumerateListAddresses(nsIAbDirectory *directory, nsIEnumerator **result);
@@ -120,6 +121,12 @@ public:
NS_IMETHOD Add2ndEmail(nsIMdbRow * row, const char * value)
{ return AddCharStringColumn(row, m_2ndEmailColumnToken, value); }
NS_IMETHOD AddDefaultEmail(nsIMdbRow * row, const char * value)
{ return AddCharStringColumn(row, m_DefaultEmailColumnToken, value); }
NS_IMETHOD AddCardType(nsIMdbRow * row, const char * value)
{ return AddCharStringColumn(row, m_CardTypeColumnToken, value); }
NS_IMETHOD AddPreferMailFormat(nsIMdbRow * row, PRUint32 value)
{ return AddIntColumn(row, m_MailFormatColumnToken, value); }
@@ -138,6 +145,21 @@ public:
NS_IMETHOD AddCellularNumber(nsIMdbRow * row, const char * value)
{ return AddCharStringColumn(row, m_CellularColumnToken, value); }
NS_IMETHOD AddWorkPhoneType(nsIMdbRow * row, const char * value)
{ return AddCharStringColumn(row, m_WorkPhoneTypeColumnToken, value); }
NS_IMETHOD AddHomePhoneType(nsIMdbRow * row, const char * value)
{ return AddCharStringColumn(row, m_HomePhoneTypeColumnToken, value); }
NS_IMETHOD AddFaxNumberType(nsIMdbRow * row, const char * value)
{ return AddCharStringColumn(row, m_FaxTypeColumnToken, value); }
NS_IMETHOD AddPagerNumberType(nsIMdbRow * row, const char * value)
{ return AddCharStringColumn(row, m_PagerTypeColumnToken, value); }
NS_IMETHOD AddCellularNumberType(nsIMdbRow * row, const char * value)
{ return AddCharStringColumn(row, m_CellularTypeColumnToken, value); }
NS_IMETHOD AddHomeAddress(nsIMdbRow * row, const char * value)
{ return AddCharStringColumn(row, m_HomeAddressColumnToken, value); }
@@ -183,20 +205,44 @@ public:
NS_IMETHOD AddCompany(nsIMdbRow * row, const char * value)
{ return AddCharStringColumn(row, m_CompanyColumnToken, value); }
NS_IMETHOD AddAimScreenName(nsIMdbRow * row, const char * value)
{ return AddCharStringColumn(row, m_AimScreenNameColumnToken, value); }
NS_IMETHOD AddAnniversaryYear(nsIMdbRow * row, const char * value)
{ return AddCharStringColumn(row, m_AnniversaryYearColumnToken, value); }
NS_IMETHOD AddAnniversaryMonth(nsIMdbRow * row, const char * value)
{ return AddCharStringColumn(row, m_AnniversaryMonthColumnToken, value); }
NS_IMETHOD AddAnniversaryDay(nsIMdbRow * row, const char * value)
{ return AddCharStringColumn(row, m_AnniversaryDayColumnToken, value); }
NS_IMETHOD AddSpouseName(nsIMdbRow * row, const char * value)
{ return AddCharStringColumn(row, m_SpouseNameColumnToken, value); }
NS_IMETHOD AddFamilyName(nsIMdbRow * row, const char * value)
{ return AddCharStringColumn(row, m_FamilyNameColumnToken, value); }
NS_IMETHOD AddDefaultAddress(nsIMdbRow * row, const char * value)
{ return AddCharStringColumn(row, m_DefaultAddressColumnToken, value); }
NS_IMETHOD AddCategory(nsIMdbRow * row, const char * value)
{ return AddCharStringColumn(row, m_CategoryColumnToken, value); }
NS_IMETHOD AddWebPage1(nsIMdbRow * row, const char * value)
{ return AddCharStringColumn(row, m_WebPage1ColumnToken, value); }
NS_IMETHOD AddWebPage2(nsIMdbRow * row, const char * value)
{ return AddCharStringColumn(row, m_WebPage2ColumnToken, value); }
NS_IMETHOD AddBirthYear(nsIMdbRow * row, const char * value)
{ return AddCharStringColumn(row, m_BirthYearColumnToken, value); }
NS_IMETHOD AddBirthYear(nsIMdbRow * row, const char * value)
{ return AddCharStringColumn(row, m_BirthYearColumnToken, value); }
NS_IMETHOD AddBirthMonth(nsIMdbRow * row, const char * value)
{ return AddCharStringColumn(row, m_BirthMonthColumnToken, value); }
NS_IMETHOD AddBirthMonth(nsIMdbRow * row, const char * value)
{ return AddCharStringColumn(row, m_BirthMonthColumnToken, value); }
NS_IMETHOD AddBirthDay(nsIMdbRow * row, const char * value)
{ return AddCharStringColumn(row, m_BirthDayColumnToken, value); }
NS_IMETHOD AddBirthDay(nsIMdbRow * row, const char * value)
{ return AddCharStringColumn(row, m_BirthDayColumnToken, value); }
NS_IMETHOD AddCustom1(nsIMdbRow * row, const char * value)
{ return AddCharStringColumn(row, m_Custom1ColumnToken, value); }
@@ -349,11 +395,18 @@ protected:
mdb_token m_NickNameColumnToken;
mdb_token m_PriEmailColumnToken;
mdb_token m_2ndEmailColumnToken;
mdb_token m_DefaultEmailColumnToken;
mdb_token m_CardTypeColumnToken;
mdb_token m_WorkPhoneColumnToken;
mdb_token m_HomePhoneColumnToken;
mdb_token m_FaxColumnToken;
mdb_token m_PagerColumnToken;
mdb_token m_CellularColumnToken;
mdb_token m_WorkPhoneTypeColumnToken;
mdb_token m_HomePhoneTypeColumnToken;
mdb_token m_FaxTypeColumnToken;
mdb_token m_PagerTypeColumnToken;
mdb_token m_CellularTypeColumnToken;
mdb_token m_HomeAddressColumnToken;
mdb_token m_HomeAddress2ColumnToken;
mdb_token m_HomeCityColumnToken;
@@ -369,11 +422,19 @@ protected:
mdb_token m_JobTitleColumnToken;
mdb_token m_DepartmentColumnToken;
mdb_token m_CompanyColumnToken;
mdb_token m_AimScreenNameColumnToken;
mdb_token m_AnniversaryYearColumnToken;
mdb_token m_AnniversaryMonthColumnToken;
mdb_token m_AnniversaryDayColumnToken;
mdb_token m_SpouseNameColumnToken;
mdb_token m_FamilyNameColumnToken;
mdb_token m_DefaultAddressColumnToken;
mdb_token m_CategoryColumnToken;
mdb_token m_WebPage1ColumnToken;
mdb_token m_WebPage2ColumnToken;
mdb_token m_BirthYearColumnToken;
mdb_token m_BirthMonthColumnToken;
mdb_token m_BirthDayColumnToken;
mdb_token m_BirthYearColumnToken;
mdb_token m_BirthMonthColumnToken;
mdb_token m_BirthDayColumnToken;
mdb_token m_Custom1ColumnToken;
mdb_token m_Custom2ColumnToken;
mdb_token m_Custom3ColumnToken;

View File

@@ -180,7 +180,7 @@ function verifyAccounts(wizardcallback) {
ret = false;
}
// hack, set a time out to do this, so that the window can load first
setTimeout("showMailIntegrationDialog();",0);
//setTimeout("showMailIntegrationDialog();",0);
return ret;
}

View File

@@ -25,6 +25,8 @@ var gDefaultPickerMode = "1";
var gFccFolderWithDelim, gDraftsFolderWithDelim, gTemplatesFolderWithDelim;
var gPrefBranch = Components.classes["@mozilla.org/preferences-service;1"].getService(Components.interfaces.nsIPrefBranch);
// Picker IDs
var fccAccountPickerId = "msgFccAccountPicker";
var fccFolderPickerId = "msgFccFolderPicker";
@@ -61,6 +63,30 @@ function onInit() {
initBccSelf();
setupFccItems();
SetSpecialFolderNamesWithDelims();
SetupStoreReadMail();
}
function SetupStoreReadMail()
{
var groupbox = document.getElementById("store_read_mail_in_pfc");
var serverId = GetCurrentServerId();
var account = parent.getAccountFromServerId(serverId);
if (!account)
return;
var server = account.incomingServer;
var prefString = server.type + "." + server.redirectorType + ".showStoreReadMailInPFC";
try {
if (gPrefBranch.getBoolPref(prefString))
groupbox.removeAttribute("hidden");
else
groupbox.setAttribute("hidden","true");
}
catch (ex) {
groupbox.setAttribute("hidden","true");
}
}
// Initialize the picker mode choices (account/folder picker) into global vars

View File

@@ -94,6 +94,17 @@
</hbox>
</groupbox>
<groupbox id="store_read_mail_in_pfc">
<caption label="&readingPrefix.label;"/>
<hbox align="center">
<checkbox hidable="true" wsm_persist="true" id="imap.storeReadMailInPFC"
label="&readingMailFolder.label;"
prefattribute="value"
prefstring="mail.server.%serverkey%.store_read_mail_in_pfc"/>
</hbox>
</groupbox>
<groupbox>
<caption label="&specialFoldersTitle.label;"/>

View File

@@ -3,6 +3,8 @@
<!ENTITY copyAndFolderTitle.label "Copies &amp; Folders">
<!ENTITY sendingPrefix.label "When sending messages, automatically: ">
<!ENTITY fccMailFolder.label "Place a copy in:">
<!ENTITY readingPrefix.label "When reading messages, automatically: ">
<!ENTITY readingMailFolder.label "Place a copy in my &quot;Read Mail&quot; folder on Local Folders">
<!ENTITY chooseFolderButton.label "Choose Folder...">
<!-- LOCALIZATION NOTE (bccAccount.label): do not translate "Bcc" in below line -->
<!ENTITY bccAccount.label "Bcc ">
@@ -21,4 +23,4 @@
<!ENTITY otherFolder.label "Other:">
<!ENTITY specialFoldersTitle.label "Drafts and Templates">
<!ENTITY keepDrafts.label "Keep message drafts in:">
<!ENTITY keepTempltes.label "Keep message templates in:">
<!ENTITY keepTempltes.label "Keep message templates in:">

View File

@@ -79,6 +79,13 @@ interface nsIMessenger : nsISupports {
in boolean isMoveFolder);
void OpenURL(in string url);
// hack
// use the messenger as a way to load urls
// it will in turn act like a link was clicked
// which will cause us to load the url in the default browser
void loadURL(in nsIDOMWindowInternal ptr, in string url);
void RenameFolder(in nsIRDFCompositeDataSource db,
in nsIRDFResource folder, in wstring name);
void CompactFolder(in nsIRDFCompositeDataSource db,

View File

@@ -322,5 +322,5 @@ interface nsIMsgDBViewCommandUpdater : nsISupports
void updateCommandStatus();
/* displayed message has changed */
void displayMessageChanged(in nsIMsgFolder aFolder, in wstring aSubject);
void displayMessageChanged(in nsIMsgFolder aFolder, in wstring aSubject, in string aKeywords);
};

View File

@@ -58,7 +58,8 @@ interface nsIMsgHdr : nsISupports
header in the db */
[noscript] void getProperty(in string propertyName, in nsStringRef propertyValue);
[noscript] void setProperty(in string propertyName, in nsStringRef propertyStr);
void setStringProperty(in string propertyName, in string propertyValue);
string getStringProperty(in string propertyName);
unsigned long getUint32Property(in string propertyName);
void setUint32Property(in string propertyName,
in unsigned long propertyVal);

View File

@@ -48,6 +48,7 @@ interface nsIMsgSearchSession;
interface nsICacheEntryDescriptor;
interface nsICacheSession;
interface nsIMimeHeaders;
interface nsIMsgFolder;
[scriptable, uuid(6CFFCEB0-CB8C-11d2-8065-006008128C4E)]
interface nsIMsgMailNewsUrl : nsIURL {
///////////////////////////////////////////////////////////////////////////////
@@ -69,6 +70,7 @@ interface nsIMsgMailNewsUrl : nsIURL {
void GetUrlState(out boolean runningUrl);
readonly attribute nsIMsgIncomingServer server;
attribute nsIMsgFolder folder;
// the ownership model for msg feedback
attribute nsIMsgStatusFeedback statusFeedback;

View File

@@ -148,6 +148,10 @@ function UpdateMailToolbar(caller)
{
//dump("XXX update mail-toolbar " + caller + "\n");
document.commandDispatcher.updateCommands('mail-toolbar');
// hook for extra toolbar items
var observerService = Components.classes["@mozilla.org/observer-service;1"].getService(Components.interfaces.nsIObserverService);
observerService.notifyObservers(window, "mail:updateToolbarItems", null);
}
function ChangeFolderByURI(uri, viewType, viewFlags, sortType, sortOrder)
@@ -155,6 +159,11 @@ function ChangeFolderByURI(uri, viewType, viewFlags, sortType, sortOrder)
//dump("In ChangeFolderByURI uri = " + uri + " sortType = " + sortType + "\n");
if (uri == gCurrentLoadingFolderURI)
return;
// hook for extra toolbar items
var observerService = Components.classes["@mozilla.org/observer-service;1"].getService(Components.interfaces.nsIObserverService);
observerService.notifyObservers(window, "mail:setupToolbarItems", uri);
var resource = RDF.GetResource(uri);
var msgfolder =
resource.QueryInterface(Components.interfaces.nsIMsgFolder);
@@ -205,7 +214,7 @@ function ChangeFolderByURI(uri, viewType, viewFlags, sortType, sortOrder)
gCurrentLoadingFolderViewType = viewType;
gCurrentLoadingFolderSortType = sortType;
gCurrentLoadingFolderSortOrder = sortOrder;
if(msgfolder.manyHeadersToDownload)
if(msgfolder.manyHeadersToDownload || msgfolder.server.redirectorType == "aol")
{
gRerootOnFolderLoad = true;
try
@@ -309,7 +318,12 @@ function RerootFolder(uri, newFolder, viewType, viewFlags, sortType, sortOrder)
}
SetUpToolbarButtons(uri);
UpdateStatusMessageCounts(newFolder);
// hook for extra toolbar items
var observerService = Components.classes["@mozilla.org/observer-service;1"].getService(Components.interfaces.nsIObserverService);
observerService.notifyObservers(window, "mail:updateToolbarItems", null);
}
function SwitchView(command)
@@ -721,8 +735,10 @@ function FolderPaneSelectionChange()
if (gDisplayStartupPage)
{
loadStartPage();
gDisplayStartupPage = false;
if (window.frames["messagepane"].location != "about:blank") {
loadStartPage();
gDisplayStartupPage = false;
}
UpdateMailToolbar("gDisplayStartupPage");
}
}

View File

@@ -25,6 +25,7 @@
-->
<?xml-stylesheet href="chrome://messenger/skin/folderPane.css" type="text/css"?>
<?xml-stylesheet href="chrome://messenger/skin/folderPaneExtras.css" type="text/css"?>
<?xml-stylesheet href="chrome://messenger/skin/fakeAccount.css" type="text/css"?>
<!DOCTYPE window SYSTEM "chrome://messenger/locale/folderpane.dtd">
@@ -79,6 +80,9 @@
<binding subject="?member"
predicate="http://home.netscape.com/NC-rdf#ServerType"
object="?serverType" />
<binding subject="?member"
predicate="http://home.netscape.com/NC-rdf#RedirectorType"
object="?redirectorType" />
<binding subject="?member"
predicate="http://home.netscape.com/NC-rdf#NoSelect"
object="?noSelect" />
@@ -102,7 +106,7 @@
<treerow>
<treecell id="folderNameCell"
label="?folderTreeName"
properties="specialFolder-?specialFolder biffState-?biffState isServer-?isServer newMessages-?newMessages hasUnreadMessages-?hasUnreadMessages subfoldersHaveUnreadMessages-?subfoldersHaveUnreadMessages isSecure-?isSecure serverType-?serverType noSelect-?noSelect imapShared-?imapShared fakeAccount-?fakeAccount"/>
properties="specialFolder-?specialFolder biffState-?biffState isServer-?isServer newMessages-?newMessages hasUnreadMessages-?hasUnreadMessages subfoldersHaveUnreadMessages-?subfoldersHaveUnreadMessages isSecure-?isSecure serverType-?serverType redirectorType-?redirectorType noSelect-?noSelect imapShared-?imapShared fakeAccount-?fakeAccount"/>
<treecell label="?unreadCount"
properties="hasUnreadMessages-?hasUnreadMessages subfoldersHaveUnreadMessages-?subfoldersHaveUnreadMessages"/>
<treecell label="?totalCount"

View File

@@ -47,13 +47,17 @@ var FolderPaneController =
isCommandEnabled: function(command)
{
dump("FolderPaneController isCommandEnabled called\n");
//dump("FolderPaneController isCommandEnabled called\n");
if (IsFakeAccount())
return false;
switch ( command )
{
case "cmd_selectAll":
// the folder pane (currently)
// only handles single selection
// so we forward select all to the thread pane
return true;
case "cmd_cut":
case "cmd_copy":
case "cmd_paste":
@@ -112,6 +116,12 @@ var FolderPaneController =
case "button_delete":
MsgDeleteFolder();
break;
case "cmd_selectAll":
// the folder pane (currently)
// only handles single selection
// so we forward select all to the thread pane
SendCommandToThreadPane(command);
break;
}
},
@@ -146,7 +156,7 @@ var ThreadPaneController =
isCommandEnabled: function(command)
{
dump("ThreadPaneController isCommandEnabled called\n");
//dump("ThreadPaneController isCommandEnabled called\n");
switch ( command )
{
case "cmd_selectAll":
@@ -284,7 +294,7 @@ var DefaultController =
isCommandEnabled: function(command)
{
dump("DefaultController isCommandEnabled called" + command + "\n");
//dump("DefaultController isCommandEnabled called" + command + "\n");
var enabled = new Object();
enabled.value = false;
var checkStatus = new Object();
@@ -1103,4 +1113,12 @@ function IsFakeAccount() {
return false;
}
function SendCommandToThreadPane(command)
{
ThreadPaneController.doCommand(command);
// if we are sending the command so the thread pane
// we should focus the thread pane
SetFocusThreadPane();
}

View File

@@ -28,7 +28,12 @@ Rights Reserved.
<?xul-overlay href="chrome://messenger/content/msgHdrViewOverlay.xul"?>
<?xul-overlay href="chrome://messenger/content/mailWindowOverlay.xul"?>
<?xul-overlay href="chrome://messenger/content/mailOverlay.xul"?>
<!--
no side bar in stand alone mail
<?xul-overlay href="chrome://communicator/content/sidebar/sidebarOverlay.xul"?>
-->
<!-- we used to get this from sidebarOverlay.xul -->
<?xul-overlay href="chrome://communicator/content/contentAreaContextOverlay.xul"?>
<?xul-overlay href="chrome://communicator/content/tasksOverlay.xul"?>
<?xul-overlay href="chrome://communicator/content/communicatorOverlay.xul"?>
@@ -161,10 +166,12 @@ Rights Reserved.
<hbox id="mail3PaneVertLayoutBox" persist="collapsed width" flex="2">
<vbox id="searchAndthreadpaneBox" persist="width" flex ="1">
<vbox id="messagesBox" flex="1">
<hbox id="searchBox"/>
<vbox id="threadpaneBox" flex="1" persist="width">
<tree id="threadTree" flex="1" persist="width" style="width:0px" context="threadPaneContext"/>
</vbox>
</vbox>
</vbox>
<hbox id="accountCentralBox" flex="1" persist="width">
<iframe name="accountCentralPane" style="width:0px;" flex="1" src="about:blank"/>

View File

@@ -1,7 +1,9 @@
<?xml version="1.0"?>
<!-- platform specific commands -->
<!-- removing, this is empty on windows, and ns stand alone mail is windows only
<?xul-overlay href="chrome://messenger/content/platformMailOverlay.xul"?>
-->
<!DOCTYPE window SYSTEM "chrome://messenger/locale/mailOverlay.dtd">

View File

@@ -1,7 +1,9 @@
<?xml version="1.0"?>
<!-- platform specific commands -->
<!-- removing, this is empty on windows, and ns stand alone mail is windows only
<?xul-overlay href="chrome://messenger/content/platformMailOverlay.xul"?>
-->
<!DOCTYPE window SYSTEM "chrome://messenger/locale/mailOverlay.dtd">
<overlay id="mailOverlay.xul"

View File

@@ -94,6 +94,7 @@
<statusbarpanel id="component-bar">
<toolbarbutton class="taskbutton" id="mini-mail" oncommand="toMessengerWindow()"
position="2" tooltiptext="&taskMessenger.tooltip;"/>
<!-- stand alone mail, no composer -->
<toolbarbutton id="mini-comp" insertafter="mini-mail"/>
<toolbarbutton class="taskbutton" id="mini-addr" oncommand="toAddressBook();"
insertafter="mini-comp" tooltiptext="&taskAddressBook.tooltip;"/>
@@ -104,11 +105,13 @@
<menuitem label="&searchAddressesCmd.label;" accesskey="&searchAddressesCmd.accesskey;" oncommand="MsgSearchAddresses(null)" position="3"/>
</menupopup>
<menupopup id="windowPopup">
<menuitem accesskey="&messengerCmd.accesskey;" label="&messengerCmd.label;" key="key_mail" command="Tasks:Mail" id="tasksMenuMail" insertafter="tasksMenuNavigator" class="menuitem-iconic icon-mail16 menu-iconic"/>
<menuitem id="tasksMenuEditor" insertafter="tasksMenuMail"/>
<menuitem label="&addressBookCmd.label;" accesskey="&addressBookCmd.accesskey;" key="key_addressbook" command="Tasks:AddressBook" id="tasksMenuAddressBook" insertafter="tasksMenuEditor" class="menuitem-iconic icon-addressbook16 menu-iconic"/>
<menuitem accesskey="&messengerCmd.accesskey;" label="&messengerCmd.label;" key="key_mail" command="Tasks:Mail" id="tasksMenuMail" insertafter="tasksMenuNavigator" class="menuitem-iconic icon-mail16 menu-iconic"/>
<!-- stand alone mail, no editor -->
<menuitem id="tasksMenuEditor" insertafter="tasksMenuMail"/>
<menuitem label="&addressBookCmd.label;" accesskey="&addressBookCmd.accesskey;" key="key_addressbook" command="Tasks:AddressBook" id="tasksMenuAddressBook" insertafter="tasksMenuEditor" class="menuitem-iconic icon-addressbook16 menu-iconic"/>
</menupopup>
</overlay>

View File

@@ -20,11 +20,11 @@
<xul:spacer flex="1"/>
<xul:label class="headerName" xbl:inherits="value=label"/>
</xul:hbox>
<xul:label class="headerValue" anonid="headerValue" flex="1">*</xul:label>
<xul:textbox class="headerValue plain" anonid="headerValue" flex="1" readonly="true"/>
</content>
<implementation>
<property name="headerValue" onset="return document.getAnonymousElementByAttribute(this, 'anonid', 'headerValue').firstChild.nodeValue = val;"/>
<property name="headerValue" onset="return document.getAnonymousElementByAttribute(this, 'anonid', 'headerValue').value = val;"/>
</implementation>
</binding>
@@ -36,11 +36,11 @@
<xul:hbox class="headerNameBox" align="start">
<xul:label class="headerName" xbl:inherits="value=label" flex="1"/>
</xul:hbox>
<xul:label class="headerValue" anonid="headerValue" flex="1">*</xul:label>
<xul:textbox class="headerValue plain" anonid="headerValue" flex="1" readonly="true"/>
</content>
<implementation>
<property name="headerValue" onset="return document.getAnonymousElementByAttribute(this, 'anonid', 'headerValue').firstChild.nodeValue = val;" />
<property name="headerValue" onset="return document.getAnonymousElementByAttribute(this, 'anonid', 'headerValue').value = val;"/>
</implementation>
</binding>
@@ -368,548 +368,4 @@
</method>
</implementation>
</binding>
<binding id="search-menulist-abstract" name="searchMenulistAbstract" extends="xul:box">
<content>
<xul:menulist class="search-menulist" xbl:inherits="flex" oncommand="this.parentNode.onSelect(event)">
<xul:menupopup class="search-menulist-popup"/>
</xul:menulist>
</content>
<implementation>
<field name="internalScope">null</field>
<field readonly="true" name="validityManager">
<![CDATA[
Components.classes['@mozilla.org/mail/search/validityManager;1'].getService(Components.interfaces.nsIMsgSearchValidityManager);
]]>
</field>
<property name="searchScope" onget="return this.internalScope;">
<!-- scope ID - retrieve the table -->
<setter>
<![CDATA[
// if scope isn't changing this is a noop
if (this.internalScope == val) return val;
this.internalScope = val;
this.refreshList();
var targets = this.targets;
if (targets) {
for (var i=0; i< targets.length; i++) {
targets[i].searchScope = val;
}
}
return val;
]]>
</setter>
</property>
<property name="validityTable" readonly="true" onget="return this.validityManager.getTable(this.searchScope)"/>
<property name="valueStrings" readonly="true">
<getter>
<![CDATA[
var strings = new Array;
var ids = this.valueIds;
var pref = Components.classes["@mozilla.org/preferences-service;1"].getService(Components.interfaces.nsIPrefBranch);
var hdrs;
try
{
hdrs = pref.getCharPref("mailnews.customHeaders");
}
catch(ex)
{
hdrs=null;
}
var hdrsArray = new Array;
if (hdrs)
hdrsArray = hdrs.split(": ");
var bundle = this.stringBundle;
var j=0;
for (var i=0; i<ids.length; i++)
{
if(ids[i] > Components.interfaces.nsMsgSearchAttrib.OtherHeader && hdrs)
strings[i] = hdrsArray[j++];
else
strings[i] = this.stringBundle.GetStringFromID(ids[i]);
}
return strings;
]]>
</getter>
</property>
<property name="targets" readonly="true">
<getter>
<![CDATA[
var forAttrs = this.getAttribute("for");
if (!forAttrs) return null;
var targetIds = forAttrs.split(",");
if (targetIds.length == 0) return null;
var targets = new Array;
var j=0;
for (var i=0; i<targetIds.length;i++) {
var target = document.getElementById(targetIds[i]);
if (target) targets[j++] = target;
}
return targets;
]]>
</getter>
</property>
<!-- value forwards to the internal menulist's "value" attribute -->
<property name="value" onget="return document.getAnonymousNodes(this)[0].selectedItem.getAttribute('value');">
<setter>
<![CDATA[
var menulist = document.getAnonymousNodes(this)[0];
var dataItems = menulist.getElementsByAttribute("value", val);
if (dataItems.length > 0)
menulist.selectedItem = dataItems[0];
// now notify targets of new parent's value
var targets = this.targets;
if (targets) {
for (var i=0; i< targets.length; i++) {
targets[i].parentValue = val;
}
} else {
//dump("Doh! No targets!\n");
}
return val;
]]>
</setter>
</property>
<!-- label forwards to the internal menulist's "label" attribute -->
<property name="label" onget="return document.getAnonymousNodes(this)[0].selectedItem.getAttribute('label');">
</property>
<method name="refreshList">
<body>
<![CDATA[
var menuItemIds = this.valueIds;
var menuItemStrings = this.valueStrings;
var menulist = document.getAnonymousNodes(this)[0];
var popup = menulist.firstChild;
// save our old "value" so we can restore it later
var oldData = menulist.value;
// remove the old popup children
while (popup.hasChildNodes())
popup.removeChild(popup.lastChild);
var newSelection;
var customizePos=-1;
for (var i=0; i<menuItemIds.length; i++)
{
// create the menuitem
if (Components.interfaces.nsMsgSearchAttrib.OtherHeader == menuItemIds[i].toString())
customizePos = i;
else
{
var menuitem = document.createElement("menuitem");
menuitem.setAttribute("label", menuItemStrings[i]);
menuitem.setAttribute("value", menuItemIds[i]);
popup.appendChild(menuitem);
// try to restore the selection
if (!newSelection || oldData == menuItemIds[i].toString())
newSelection = menuitem;
}
}
if (customizePos != -1)
{
var separator = document.createElement("menuseparator");
popup.appendChild(separator);
menuitem = document.createElement("menuitem");
menuitem.setAttribute("label", menuItemStrings[customizePos]);
menuitem.setAttribute("value", menuItemIds[customizePos]);
popup.appendChild(menuitem);
}
// now restore the selection
menulist.selectedItem = newSelection;
]]>
</body>
</method>
<method name="onSelect">
<parameter name="event"/>
<body>
<![CDATA[
var menulist = document.getAnonymousNodes(this)[0];
// notify targets
var targets = this.targets;
if (targets) {
for (var i=0; i< targets.length; i++) {
targets[i].parentValue = menulist.value;
}
}
]]>
</body>
</method>
</implementation>
</binding>
<!-- searchattribute - Subject, Sender, To, CC, etc. -->
<binding id="searchattribute" name="searchAttribute"
extends="chrome://messenger/content/mailWidgets.xml#search-menulist-abstract">
<implementation>
<field name="stringBundle">
<![CDATA[
srGetStrBundle("chrome://messenger/locale/search-attributes.properties");
]]>
</field>
<property name="valueIds" readonly="true">
<getter>
<![CDATA[
var length = new Object;
return this.validityTable.getAvailableAttributes(length);
]]>
</getter>
</property>
<constructor>
<![CDATA[
initializeTermFromId(this.id);
]]>
</constructor>
</implementation>
</binding>
<!-- searchoperator - Contains, Is Less than, etc -->
<binding id="searchoperator" name="searchOperator"
extends="chrome://messenger/content/mailWidgets.xml#search-menulist-abstract">
<implementation>
<field name="searchAttribute">Components.interfaces.nsMsgSearchAttrib.Default</field>
<field name="stringBundle">
<![CDATA[
srGetStrBundle("chrome://messenger/locale/search-operators.properties");
]]>
</field>
<property name="valueIds" readonly="true">
<getter>
<![CDATA[
var length = new Object;
return this.validityTable.getAvailableOperators(this.searchAttribute,length);
]]>
</getter>
</property>
<property name="parentValue">
<setter>
<![CDATA[
if (this.searchAttribute == val && val != Components.interfaces.nsMsgSearchAttrib.OtherHeader) return val;
this.searchAttribute = val;
this.refreshList();
if (val == Components.interfaces.nsMsgSearchAttrib.OtherHeader)
{
window.openDialog('chrome://messenger/content/CustomHeaders.xul', "", 'modal,titlebar,chrome', null);
UpdateAfterCustomHeaderChange();
}
return val;
]]>
</setter>
<getter>
<![CDATA[
return this.searchAttribute;
]]>
</getter>
</property>
</implementation>
</binding>
<!-- searchvalue - a widget which dynamically changes it's user interface
depending on what type of data it's supposed to be showing
currently handles arbitrary text entry, and menulists for priority and
status
-->
<binding id="searchvalue" name="searchValue">
<content>
<xul:textbox flex="1" class="search-value-textbox"/>
<xul:menulist flex="1" class="search-value-menulist">
<xul:menupopup class="search-value-popup">
<xul:menuitem value="2" stringTag="priorityLowest" class="search-value-menuitem"/>
<xul:menuitem value="3" stringTag="priorityLow" class="search-value-menuitem"/>
<xul:menuitem value="4" stringTag="priorityNormal" class="search-value-menuitem"/>
<xul:menuitem value="5" stringTag="priorityHigh" class="search-value-menuitem"/>
<xul:menuitem value="6" stringTag="priorityHighest" class="search-value-menuitem"/>
</xul:menupopup>
</xul:menulist>
<xul:menulist flex="1" class="search-value-menulist">
<xul:menupopup class="search-value-popup">
<xul:menuitem value="2" stringTag="replied" class="search-value-menuitem"/>
<xul:menuitem value="1" stringTag="read" class="search-value-menuitem"/>
<xul:menuitem value="1048576" stringTag="new" class="search-value-menuitem"/>
<xul:menuitem value="65536" stringTag="forwarded" class="search-value-menuitem"/>
</xul:menupopup>
</xul:menulist>
<xul:textbox flex="1" class="search-value-textbox"/>
</content>
<implementation>
<field name="internalAttribute">null</field>
<field name="internalValue">null</field>
<!-- parentValue forwards to the attribute -->
<property name="parentValue" onset="return this.searchAttribute=val;"
onget="return this.searchAttribute;"/>
<property name="searchAttribute" onget="return this.internalAttribute;">
<setter>
<![CDATA[
// noop if we're not changing it
if (this.internalAttribute == val) return val;
this.internalAttribute = val;
// we inherit from a deck, so just use it's index attribute
// to hide/show widgets
if (val == Components.interfaces.nsMsgSearchAttrib.Priority)
this.setAttribute("selectedIndex", "1");
else if (val == Components.interfaces.nsMsgSearchAttrib.MsgStatus)
this.setAttribute("selectedIndex", "2");
else if (val == Components.interfaces.nsMsgSearchAttrib.Date)
this.setAttribute("selectedIndex", "3");
else
this.setAttribute("selectedIndex", "0");
return val;
]]>
</setter>
</property>
<property name="value" onget="return this.internalValue;">
<setter>
<![CDATA[
// val is a nsIMsgSearchValue object
this.internalValue = val;
var attrib = val.attrib;
var nsMsgSearchAttrib = Components.interfaces.nsMsgSearchAttrib;
var children = document.getAnonymousNodes(this);
this.searchAttribute = attrib;
if (attrib == nsMsgSearchAttrib.Priority) {
var matchingPriority =
children[1].getElementsByAttribute("value", val.priority);
if (matchingPriority.length > 0)
children[1].selectedItem = matchingPriority[0];
}
else if (attrib == nsMsgSearchAttrib.MsgStatus) {
var matchingStatus =
children[2].getElementsByAttribute("value", val.status);
if (matchingStatus.length > 0)
children[2].selectedItem = matchingStatus[0];
}
else if (attrib == nsMsgSearchAttrib.AgeInDays)
children[0].value = val.age;
else if (attrib == nsMsgSearchAttrib.Date)
children[3].value = convertPRTimeToString(val.date);
else
children[0].value = val.str;
return val;
]]>
</setter>
</property>
<method name="save">
<body>
<![CDATA[
var searchValue = this.value;
var searchAttribute = this.searchAttribute;
var nsMsgSearchAttrib = Components.interfaces.nsMsgSearchAttrib;
var children = document.getAnonymousNodes(this);
searchValue.attrib = searchAttribute;
if (searchAttribute == nsMsgSearchAttrib.Priority) {
searchValue.priority = children[1].selectedItem.value;
}
else if (searchAttribute == nsMsgSearchAttrib.MsgStatus)
searchValue.status = children[2].selectedItem.value;
else if (searchAttribute == nsMsgSearchAttrib.AgeInDays)
searchValue.age = children[0].value;
else if (searchAttribute == nsMsgSearchAttrib.Date)
searchValue.date = convertStringToPRTime(children[3].value);
else
searchValue.str = children[0].value;
]]>
</body>
</method>
<method name="saveTo">
<parameter name="searchValue"/>
<body>
<![CDATA[
this.internalValue = searchValue;
this.save();
]]>
</body>
</method>
<method name="fillStringsForChildren">
<parameter name="parentNode"/>
<parameter name="bundle"/>
<body>
<![CDATA[
var children = parentNode.childNodes;
var len=children.length;
for (var i=0; i<len; i++) {
var node = children[i];
var stringTag = node.getAttribute("stringTag");
if (stringTag) {
var attr = (node.tagName == "label") ? "value" : "label";
node.setAttribute(attr, bundle.GetStringFromName(stringTag));
}
}
]]>
</body>
</method>
<method name="initialize">
<parameter name="menulist"/>
<parameter name="bundle"/>
<body>
<![CDATA[
this.fillStringsForChildren(menulist.firstChild, bundle);
// to work around bug #78429, set and reset the selectedItem
var item = menulist.selectedItem;
menulist.selectedItem = null;
menulist.selectedItem = item;
]]>
</body>
</method>
<constructor>
<![CDATA[
// initialize strings
var bundle = srGetStrBundle("chrome://messenger/locale/messenger.properties");
// intialize the priority picker
this.initialize(document.getAnonymousNodes(this)[1], bundle);
// initialize the status picker
this.initialize(document.getAnonymousNodes(this)[2], bundle);
var datePicker = document.getAnonymousNodes(this)[3];
var searchAttribute = this.searchAttribute;
var nsMsgSearchAttrib = Components.interfaces.nsMsgSearchAttrib;
var time;
if (searchAttribute == nsMsgSearchAttrib.Date)
time = datePicker.value;
else
time = new Date();
datePicker.setAttribute("value",convertDateToString(time));
]]>
</constructor>
</implementation>
<handlers>
<handler event="keypress"><![CDATA[
if (event.keyCode == 13) {
onEnterInSearchTerm();
}
]]></handler>
</handlers>
</binding>
<binding id="searchterm" name="searchTerm" extends="xul:box">
<implementation>
<field name="internalSearchTerm">null</field>
<field name="internalBooleanAnd">null</field>
<!-- the actual nsIMsgSearchTerm object -->
<property name="searchTerm" onget="return this.internalSearchTerm">
<setter>
<![CDATA[
this.internalSearchTerm = val;
var term = val;
// val is a nsIMsgSearchTerm
var searchAttribute=this.searchattribute;
var searchOperator=this.searchoperator;
var searchValue=this.searchvalue;
// now reflect all attributes of the searchterm into the widgets
if (searchAttribute) searchAttribute.value = term.attrib;
if (searchOperator) searchOperator.value = val.op;
if (searchValue) searchValue.value = term.value;
this.booleanAnd = val.booleanAnd;
]]>
</setter>
</property>
<property name="searchScope">
<getter>
<![CDATA[
var searchAttribute = this.searchattribute;
if (searchAttribute)
return searchAttribute.searchScope;
return undefined;
]]>
</getter>
<setter>
<![CDATA[
var searchAttribute = this.searchattribute;
if (searchAttribute) searchAttribute.searchScope=val;
]]>
</setter>
</property>
<!-- the three tags that make up a term - to use, set the
attribute in the XUL to the ID of the term.
-->
<property name="searchattribute"
onget="return document.getElementById(this.getAttribute('searchattribute'));"
onset="this.setAttribute('searchattribute',val.id)"/>
<property name="searchoperator"
onget="return document.getElementById(this.getAttribute('searchoperator'));"
onset="this.setAttribute('searchoperator',val.id)"/>
<property name="searchvalue"
onget="return document.getElementById(this.getAttribute('searchvalue'));"
onset="this.setAttribute('searchvalue',val.id)"/>
<field name="booleanNodes">
<![CDATA[
null;
]]>
</field>
<field name="stringBundle">
<![CDATA[
srGetStrBundle("chrome://messenger/locale/search.properties");
]]>
</field>
<property name="booleanAnd" onget="return this.internalBooleanAnd">
<setter>
<![CDATA[
// whenever you set this, all nodes in booleanNodes
// are updated to reflect the string
if (this.internalBooleanAnd == val) return;
this.internalBooleanAnd = val;
var booleanNodes = this.booleanNodes;
if (!booleanNodes) return;
var stringBundle = this.stringBundle;
var andString = val ? "And" : "Or";
for (var i=0; i<booleanNodes.length; i++) {
try {
var staticString =
stringBundle.GetStringFromName("search" + andString + i);
if (staticString && staticString.length>0)
booleanNodes[i].setAttribute("value", staticString);
} catch (ex) { /* no error, means string not found */}
}
]]>
</setter>
</property>
<method name="save">
<body>
<![CDATA[
var searchTerm = this.searchTerm;
searchTerm.attrib = this.searchattribute.value;
if (this.searchAttribute > nsMsgSearchAttrib.OtherHeader && this.searchAttribute < nsMsgSearchAttrib.kNumMsgSearchAttributes)
searchTerm.arbitraryHeader = this.searchattribute.label;
searchTerm.op = this.searchoperator.value;
if (this.searchvalue.value)
this.searchvalue.save();
else
this.searchvalue.saveTo(searchTerm.value);
searchTerm.value = this.searchvalue.value;
searchTerm.booleanAnd = this.booleanAnd;
]]>
</body>
</method>
<!-- if you have a search term element with no search term -->
<method name="saveTo">
<parameter name="searchTerm"/>
<body>
<![CDATA[
this.internalSearchTerm = searchTerm;
this.save();
]]>
</body>
</method>
</implementation>
</binding>
</bindings>

View File

@@ -68,6 +68,8 @@ var gPaneConfig = null;
var gIsEditableMsgFolder = false;
var gOfflineManager;
// cache the last keywords
var gLastKeywords = "";
function OnMailWindowUnload()
{
@@ -439,6 +441,7 @@ function StopUrls()
}
function loadStartPage() {
//dump("XXX loadStartPage\n");
try {
var startpageenabled = pref.getBoolPref("mailnews.start_page.enabled");
@@ -576,3 +579,29 @@ function GetSearchSession()
else
return null;
}
function SetKeywords(aKeywords)
{
// we cache the last keywords.
// if there is no chagne, we do nothing.
// most of the time, this will be the case.
if (aKeywords == gLastKeywords)
return;
// these are the UI elements who care about keywords
var ids = ["expandedKeywordImage","expandedHeaderView","msgHeaderView","collapsedHeaderView","collapsedKeywordImage","editMessageBox","expandedAttachmentBox"];
for (i in ids) {
var element = document.getElementById(ids[i]);
if (element) {
if (aKeywords)
element.setAttribute("class", aKeywords);
else {
// if no keywords, reset class to the original class
element.setAttribute("class", element.getAttribute("originalclass"));
}
}
}
// cache the keywords
gLastKeywords = aKeywords;
}

View File

@@ -0,0 +1,27 @@
<!--
The contents of this file are subject to the Netscape Public
License Version 1.1 (the "License"); you may not use this file
except in compliance with the License. You may obtain a copy of
the License at http://www.mozilla.org/NPL/
Software distributed under the License is distributed on an "AS
IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
implied. See the License for the specific language governing
rights and limitations under the License.
The Original Code is Mozilla Communicator client code, released
March 31, 1998.
The Initial Developer of the Original Code is Netscape
Communications Corporation. Portions created by Netscape are
Copyright (C) 1998-1999 Netscape Communications Corporation. All
Rights Reserved.
-->
<overlay
xmlns:nc="http://home.netscape.com/NC-rdf#"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<!-- plug in your mail window extras here. -->
</overlay>

View File

@@ -303,6 +303,12 @@ function IsNewsMessage(messageUri)
return (messageUri.substring(0,14) == "news-message:/")
}
function IsImapMessage(messageUri)
{
if (!messageUri) return false;
return (messageUri.substring(0,14) == "imap-message:/")
}
function SetMenuItemLabel(menuItemId, customLabel)
{
var menuItem = document.getElementById(menuItemId);
@@ -1309,8 +1315,7 @@ var gMarkButton = null;
function SetUpToolbarButtons(uri)
{
// dump("SetUpToolbarButtons("+uri+")\n");
///dump("XXX SetUpToolbarButtons("+uri+")\n");
// eventually, we might want to set up the toolbar differently for imap,
// pop, and news. for now, just tweak it based on if it is news or not.
var forNews = isNewsURI(uri);
@@ -1530,6 +1535,11 @@ function CommandUpdate_UndoRedo()
function SetupUndoRedoCommand(command)
{
var loadedFolder = GetLoadedMsgFolder();
// if we have selected a server, and are viewing account central
// there is no loaded folder
if (!loadedFolder)
return false;
var server = loadedFolder.server;
if (!(server.canUndoDeleteOnServer))
return false;
@@ -1574,3 +1584,116 @@ function SetupUndoRedoCommand(command)
return canUndoOrRedo;
}
function OnMsgLoaded(folder, msgURI)
{
var currentMsgFolder = folder.QueryInterface(Components.interfaces.nsIMsgFolder);
if (!IsImapMessage(msgURI))
return;
var imapServer = currentMsgFolder.server.QueryInterface(Components.interfaces.nsIImapIncomingServer);
var storeReadMailInPFC = imapServer.storeReadMailInPFC;
if (storeReadMailInPFC)
{
var messageID;
var copyToOfflineFolder = true;
// look in read mail PFC for msg with same msg id - if we find one,
// don't put this message in the read mail pfc.
var outputPFC = imapServer.GetReadMailPFC(true);
var messageURI = GetLoadedMessage();
if (messageURI != msgURI)
{
dump("not loading msg into this window - loaded message = " + messageURI + "loading " + msgURI + "\n");
// return;
}
var msgHdr = messenger.messageServiceFromURI(messageURI).messageURIToMsgHdr(messageURI);
if (msgHdr)
{
messageID = msgHdr.messageId;
if (messageID.length > 0)
{
var readMailDB = outputPFC.getMsgDatabase(msgWindow);
if (readMailDB)
{
var hdrInDestDB = readMailDB.getMsgHdrForMessageID(messageID);
if (hdrInDestDB)
copyToOfflineFolder = false;
}
}
}
if (copyToOfflineFolder)
{
var messages = Components.classes["@mozilla.org/supports-array;1"].createInstance(Components.interfaces.nsISupportsArray);
messages.AppendElement(msgHdr);
res = outputPFC.copyMessages(currentMsgFolder, messages, false /*isMove*/, msgWindow /* nsIMsgWindow */, null /* listener */, false /* isFolder */, false /*allowUndo*/ );
}
}
}
function toEditor()
{
NewEditorWindow();
}
function NewEditorWindow()
{
var launcher = Components.classes["@mozilla.org/uriloader/external-protocol-service;1"].getService(Components.interfaces.nsIExternalProtocolService);
launcher.launchApp("editor");
}
function toMessengerWindow()
{
var pref = Components.classes["@mozilla.org/preferences-service;1"]
.getService(Components.interfaces.nsIPrefBranch);
var windowDoc = "chrome://messenger/content/messenger.xul";
try
{
var layoutType = pref.getIntPref("mail.pane_config");
windowDoc = !layoutType ? "chrome://messenger/content/messenger.xul" :
"chrome://messenger/content/mail3PaneWindowVertLayout.xul";
}
catch(ex)
{
}
toOpenWindowByType("mail:3pane", windowDoc);
}
function toAddressBook()
{
toOpenWindowByType("mail:addressbook", "chrome://messenger/content/addressbook/addressbook.xul");
}
function toImport()
{
window.openDialog("chrome://messenger/content/importDialog.xul","importDialog","chrome, modal, titlebar", {importType: "addressbook"});
}
function MsgSearchMessages()
{
var preselectedFolder = null;
if ("GetFirstSelectedMsgFolder" in window)
preselectedFolder = GetFirstSelectedMsgFolder();
var windowManager = Components.classes['@mozilla.org/rdf/datasource;1?name=window-mediator'].getService();
var windowManagerInterface = windowManager.QueryInterface(Components.interfaces.nsIWindowMediator);
var searchWindow = windowManagerInterface.getMostRecentWindow("mailnews:search");
if (searchWindow)
searchWindow.focus();
else
window.openDialog("chrome://messenger/content/SearchDialog.xul", "",
"chrome,resizable,status,centerscreen,dialog=no", { folder: preselectedFolder });
}
function MsgSearchAddresses()
{
var windowManager = Components.classes['@mozilla.org/rdf/datasource;1?name=window-mediator'].getService();
var windowManagerInterface = windowManager.QueryInterface(Components.interfaces.nsIWindowMediator);
var abSearchWindow = windowManagerInterface.getMostRecentWindow("mailnews:absearch");
if (abSearchWindow)
abSearchWindow.focus();
else
window.openDialog("chrome://messenger/content/ABSearchDialog.xul", "",
"chrome,resizable,status,centerscreen,dialog=no", {directory: null});
}

View File

@@ -20,10 +20,15 @@ Communications Corporation. Portions created by Netscape are
Rights Reserved.
-->
<!--
<?xml-stylesheet href="chrome://messenger/skin/folderMenus.css" type="text/css"?>
-->
<?xml-stylesheet href="chrome://messenger/skin/smime/msgReadSMIMEOverlay.css" type="text/css"?>
<!-- no charset overlay, blah
<?xul-overlay href="chrome://global/content/charsetOverlay.xul"?>
<?xul-overlay href="chrome://communicator/content/viewZoomOverlay.xul"?>
-->
<?xul-overlay href="chrome://messenger/content/mailWindowExtrasOverlay.xul"?>
<!DOCTYPE window [
<!ENTITY % messengerDTD SYSTEM "chrome://messenger/locale/messenger.dtd" >
@@ -32,24 +37,31 @@ Rights Reserved.
%contentAreaCommandsDTD;
<!ENTITY % brandDTD SYSTEM "chrome://global/locale/brand.dtd" >
%brandDTD;
<!ENTITY % smimeDTD SYSTEM "chrome://messenger-smime/locale/msgReadSMIMEOverlay.dtd" >
%smimeDTD;
<!ENTITY % tasksDTD SYSTEM "chrome://communicator/locale/tasksOverlay.dtd" >
%tasksDTD;
<!ENTITY % mailTasksOverlayDTD SYSTEM "chrome://messenger/locale/mailTasksOverlay.dtd" >
%mailTasksOverlayDTD;
]>
<overlay
xmlns:nc="http://home.netscape.com/NC-rdf#"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<script src="chrome://messenger/content/mailCommands.js"/>
<script src="chrome://messenger/content/mailWindowOverlay.js"/>
<script src="chrome://messenger/content/commandglue.js"/>
<script src="chrome://messenger/content/mail-offline.js"/>
<script type="application/x-javascript" src="chrome://communicator/content/findUtils.js"/>
<script type="application/x-javascript" src="chrome://communicator/content/bookmarks/bookmarksOverlay.js"/>
<!-- no zoom
<script type="application/x-javascript" src="chrome://communicator/content/viewZoomOverlay.js"/>
-->
<stringbundleset id="stringbundleset">
<stringbundle id="bundle_messenger" src="chrome://messenger/locale/messenger.properties"/>
<stringbundle id="bundle_offlinePrompts" src="chrome://messenger/locale/offline.properties"/>
<stringbundle id="bundle_viewZoom"/>
<stringbundle id="findBundle" src="chrome://global/locale/finddialog.properties"/>
<stringbundle id="bundle_read_smime" src="chrome://messenger-smime/locale/msgReadSMIMEOverlay.properties"/>
<!-- no zoom
<stringbundle id="bundle_viewZoom" src="chrome://communicator/locale/viewZoomOverlay.properties"/>
-->
</stringbundleset>
<!-- Performance optimization...we include utilityOverlay.xul which defines some command sets
@@ -68,6 +80,14 @@ Rights Reserved.
events="create-menu-edit"
oncommandupdate="goUpdateSelectEditMenuItems()"/>
<commandset id="tasksCommands">
<command id="Tasks:Editor" oncommand="toEditor();"/>
<command id="Tasks:Mail" oncommand="toMessengerWindow();"/>
<command id="Tasks:AddressBook" oncommand="toAddressBook();"/>
<command id="cmd_searchMsgs" oncommand="MsgSearchMessages();"/>
</commandset>
<!-- End command set merging -->
<commandset id="mailFileMenuItems"
@@ -99,6 +119,7 @@ Rights Reserved.
</commandset>
<commandset id="mailCommands">
<!-- in stand alone mail app, no nav, no editor -->
<command id="cmd_newNavigator"/>
<command id="cmd_newEditor"/>
<command id="cmd_quit"/>
@@ -111,7 +132,8 @@ Rights Reserved.
commandupdater="true"
events="create-menu-view"
oncommandupdate="goUpdateMailMenuItems(this)">
<command id="cmd_viewSecurityStatus" oncommand="showMessageReadSecurityInfo();" disabled="true"/>
<command id="cmd_viewPageSource" oncommand="goDoCommand('cmd_viewPageSource')" disabled="true"/>
<command id="cmd_setFolderCharset" oncommand="goDoCommand('cmd_setFolderCharset')" />
<command id="cmd_reload" oncommand="goDoCommand('cmd_reload')" disabled="true"/>
@@ -124,9 +146,16 @@ Rights Reserved.
<command id="cmd_viewWatchedThreadsWithUnread" oncommand="goDoCommand('cmd_viewWatchedThreadsWithUnread')" disabled="true"/>
<command id="cmd_viewIgnoredThreads" oncommand="goDoCommand('cmd_viewIgnoredThreads')" disabled="true"/>
<command id="cmd_sortByThread" oncommand="goDoCommand('cmd_sortByThread')" disabled="true"/>
<commandset id="viewZoomCommands"/>
</commandset>
<!-- no zoom
<commandset id="viewZoomCommands">
<command id="cmd_textZoomReduce" oncommand="ZoomManager.prototype.getInstance().reduce();"/>
<command id="cmd_textZoomEnlarge" oncommand="ZoomManager.prototype.getInstance().enlarge();"/>
<command id="cmd_textZoomReset" oncommand="ZoomManager.prototype.getInstance().reset();"/>
</commandset>
-->
<commandset id="mailEditMenuItems"
commandupdater="true"
events="create-menu-edit"
@@ -217,15 +246,15 @@ Rights Reserved.
events="mail-toolbar"
oncommandupdate="goUpdateMailMenuItems(this)">
<command id="button_reply"/>
<command id="button_replyall"/>
<command id="button_forward"/>
<command id="button_delete"/>
<command id="button_reply" disabled="true" />
<command id="button_replyall" disabled="true" />
<command id="button_forward" disabled="true" />
<command id="button_delete" disabled="true" />
<command id="button_mark"/>
<command id="button_getNewMessages"/>
<command id="button_print"/>
<command id="button_print" disabled="true" />
<command id="button_next"/>
<command id="button_file"/>
<command id="button_file" disabled="true" />
<command id="cmd_delete"/>
</commandset>
@@ -264,10 +293,29 @@ Rights Reserved.
<command id="cmd_label5" oncommand="goDoCommand('cmd_label5');" disabled="true"/>
</commandset>
<!-- no zoom
<keyset id="viewZoomKeys">
<key id="key_textZoomReduce" key="&textZoomReduceCmd.commandkey;" command="cmd_textZoomReduce" modifiers="accel"/>
<key id="key_textZoomEnlarge" key="&textZoomEnlargeCmd.commandkey;" command="cmd_textZoomEnlarge" modifiers="accel"/>
<key key="&textZoomEnlargeCmd.commandkey;" command="cmd_textZoomEnlarge" modifiers="accel,shift"/>
<key key="&textZoomEnlargeCmd.commandkey2;" command="cmd_textZoomEnlarge" modifiers="accel"/>
<key key="&textZoomResetCmd.commandkey;" command="cmd_textZoomReset" modifiers="accel"/>
</keyset>
-->
<keyset id="tasksKeys">
<key id="key_editor" key="&editorCmd.commandkey;" command="Tasks:Editor" modifiers="accel"/>
<key id="key_mail" key="&messengerCmd.commandkey;" command="Tasks:Mail" modifiers="accel"/>
<key id="key_addressbook" key="&addressBookCmd.commandkey;" command="Tasks:AddressBook" modifiers="accel"/>
<key id="key_searchMail" key="&searchMailCmd.key;" command="cmd_searchMsgs" modifiers="accel, shift"/>
</keyset>
<keyset id="mailKeys">
<key id="space" key=" " oncommand="SpaceHit()"/>
<!-- File Menu -->
<!-- in stand alone mail app, no nav, no editor -->
<key id="key_newNavigator"/>
<key id="key_newBlankPage"/>
<key id="key_close"/>
@@ -279,7 +327,8 @@ Rights Reserved.
<key id="key_copy"/>
<key id="key_paste"/>
<key id="key_delete" oncommand="goDoCommand('cmd_delete');" shift="false"/>
<key id="cmd_shiftDelete" oncommand="goDoCommand('cmd_shiftDelete')"/>
<!-- collapsed in from platformMailnewsOverlay.xul, stand alone mail is win32 only right now -->
<key id="cmd_shiftDelete" oncommand="goDoCommand('cmd_shiftDelete')" keycode="VK_DELETE" xulkey="false" modifiers="shift"/>
<key id="key_selectAll"/>
<key id="key_selectThread" key="&selectThreadCmd.key;" oncommand="goDoCommand('cmd_selectThread');" modifiers="accel, shift"/>
@@ -311,8 +360,7 @@ Rights Reserved.
<key id="key_find" key="&findCmd.key;" oncommand="goDoCommand('cmd_find')" modifiers="accel"/>
<key id="key_findAgain" key="&findAgainCmd.key;" oncommand="goDoCommand('cmd_findAgain')" modifiers="accel"/>
<key id="key_stop" keycode="VK_ESCAPE" command="cmd_stop"/>
<keyset id="viewZoomKeys"/>
<!-- Tab/F6 Keys -->
<key keycode="VK_TAB" oncommand="SwitchPaneFocus(event);" modifiers="control,shift"/>
<key keycode="VK_TAB" oncommand="SwitchPaneFocus(event);" modifiers="control"/>
@@ -367,143 +415,7 @@ Rights Reserved.
label="&copyMessageLocation.label;"
accesskey="&copyMessageLocation.accesskey;"
oncommand="CopyMessageUrl()"/>
<menu id="threadPaneContext-moveMenu"
label="&contextMoveMsgMenu.label;"
accesskey="&contextMoveMsgMenu.accesskey;"
sortResource="http://home.netscape.com/NC-rdf#FolderTreeName"
sortDirection="ascending"
datasources="rdf:null">
<menupopup/>
<template>
<rule nc:NoSelect="true" iscontainer="true" isempty="false">
<menupopup>
<menu uri="..." class="folderMenuItem menu-iconic" label="rdf:http://home.netscape.com/NC-rdf#Name">
<menupopup>
<menuitem label="&fileHereMenu.label;" accesskey="&fileHereMenu.accesskey;" disabled="true"/>
<menuseparator/>
</menupopup>
</menu>
</menupopup>
</rule>
<rule nc:NoSelect="true">
<menupopup>
<menuitem uri="..." class="folderMenuItem menu-iconic" label="rdf:http://home.netscape.com/NC-rdf#Name" disabled="true"/>
</menupopup>
</rule>
<rule nc:CanFileMessages="true" iscontainer="true" isempty="false">
<menupopup>
<menu uri="..." class="folderMenuItem menu-iconic" label="rdf:http://home.netscape.com/NC-rdf#Name"
SpecialFolder="rdf:http://home.netscape.com/NC-rdf#SpecialFolder"
BiffState="rdf:http://home.netscape.com/NC-rdf#BiffState"
IsServer="rdf:http://home.netscape.com/NC-rdf#IsServer"
IsSecure="rdf:http://home.netscape.com/NC-rdf#IsSecure"
ServerType="rdf:http://home.netscape.com/NC-rdf#ServerType">
<menupopup>
<menuitem label="&fileHereMenu.label;" accesskey="&fileHereMenu.accesskey;"
oncommand="MsgMoveMessage(event.target.parentNode.parentNode)"/>
<menuseparator/>
</menupopup>
</menu>
</menupopup>
</rule>
<rule nc:CanFileMessagesOnServer="false">
<!-- don't show servers (nntp & any others) which does not allow message filing -->
<!-- File, Move & Copy menus -->
</rule>
<rule nc:CanFileMessages="false" iscontainer="true" isempty="false">
<!-- note, there is no "file here" -->
<menupopup>
<menu uri="..." class="folderMenuItem menu-iconic" label="rdf:http://home.netscape.com/NC-rdf#Name"
SpecialFolder="rdf:http://home.netscape.com/NC-rdf#SpecialFolder"
BiffState="rdf:http://home.netscape.com/NC-rdf#BiffState"
IsServer="rdf:http://home.netscape.com/NC-rdf#IsServer"
IsSecure="rdf:http://home.netscape.com/NC-rdf#IsSecure"
ServerType="rdf:http://home.netscape.com/NC-rdf#ServerType">
<menupopup/>
</menu>
</menupopup>
</rule>
<rule nc:CanFileMessages="true">
<menupopup>
<menuitem uri="..." class="folderMenuItem menuitem-iconic" label="rdf:http://home.netscape.com/NC-rdf#Name" oncommand="MsgMoveMessage(event.target)"
SpecialFolder="rdf:http://home.netscape.com/NC-rdf#SpecialFolder"
BiffState="rdf:http://home.netscape.com/NC-rdf#BiffState"
IsServer="rdf:http://home.netscape.com/NC-rdf#IsServer"
IsSecure="rdf:http://home.netscape.com/NC-rdf#IsSecure"
ServerType="rdf:http://home.netscape.com/NC-rdf#ServerType"/>
</menupopup>
</rule>
</template>
</menu>
<menu id="threadPaneContext-copyMenu"
label="&contextCopyMsgMenu.label;"
accesskey="&contextCopyMsgMenu.accesskey;"
sortResource="http://home.netscape.com/NC-rdf#FolderTreeName"
sortDirection="ascending"
datasources="rdf:null">
<menupopup/>
<template>
<rule nc:NoSelect="true" iscontainer="true" isempty="false">
<menupopup>
<menu uri="..." class="folderMenuItem menu-iconic" label="rdf:http://home.netscape.com/NC-rdf#Name">
<menupopup>
<menuitem label="&fileHereMenu.label;" accesskey="&fileHereMenu.accesskey;" disabled="true"/>
<menuseparator/>
</menupopup>
</menu>
</menupopup>
</rule>
<rule nc:NoSelect="true">
<menupopup>
<menuitem uri="..." class="folderMenuItem menu-iconic" label="rdf:http://home.netscape.com/NC-rdf#Name" disabled="true"/>
</menupopup>
</rule>
<rule nc:CanFileMessages="true" iscontainer="true" isempty="false">
<menupopup>
<menu uri="..." class="folderMenuItem menu-iconic" label="rdf:http://home.netscape.com/NC-rdf#Name"
SpecialFolder="rdf:http://home.netscape.com/NC-rdf#SpecialFolder"
BiffState="rdf:http://home.netscape.com/NC-rdf#BiffState"
IsServer="rdf:http://home.netscape.com/NC-rdf#IsServer"
IsSecure="rdf:http://home.netscape.com/NC-rdf#IsSecure"
ServerType="rdf:http://home.netscape.com/NC-rdf#ServerType">
<menupopup>
<menuitem label="&fileHereMenu.label;" accesskey="&fileHereMenu.accesskey;"
oncommand="MsgCopyMessage(event.target.parentNode.parentNode)"/>
<menuseparator/>
</menupopup>
</menu>
</menupopup>
</rule>
<rule nc:CanFileMessagesOnServer="false">
<!-- don't show servers (nntp & any others) which does not allow message filing -->
<!-- File, Move & Copy menus -->
</rule>
<rule nc:CanFileMessages="false" iscontainer="true" isempty="false">
<!-- note, there is no "file here" -->
<menupopup>
<menu uri="..." class="folderMenuItem menu-iconic" label="rdf:http://home.netscape.com/NC-rdf#Name"
SpecialFolder="rdf:http://home.netscape.com/NC-rdf#SpecialFolder"
BiffState="rdf:http://home.netscape.com/NC-rdf#BiffState"
IsServer="rdf:http://home.netscape.com/NC-rdf#IsServer"
IsSecure="rdf:http://home.netscape.com/NC-rdf#IsSecure"
ServerType="rdf:http://home.netscape.com/NC-rdf#ServerType">
<menupopup/>
</menu>
</menupopup>
</rule>
<rule nc:CanFileMessages="true">
<menupopup>
<menuitem uri="..." class="folderMenuItem menuitem-iconic" label="rdf:http://home.netscape.com/NC-rdf#Name"
oncommand="MsgCopyMessage(event.target)"
SpecialFolder="rdf:http://home.netscape.com/NC-rdf#SpecialFolder"
BiffState="rdf:http://home.netscape.com/NC-rdf#BiffState"
IsServer="rdf:http://home.netscape.com/NC-rdf#IsServer"
IsSecure="rdf:http://home.netscape.com/NC-rdf#IsSecure"
ServerType="rdf:http://home.netscape.com/NC-rdf#ServerType"/>
</menupopup>
</rule>
</template>
</menu>
<menuseparator/>
<menu id="threadPaneContext-labels" label="&labelMenu.label;" accesskey="&labelMenu.accesskey;">
<menupopup onpopupshowing="InitMessageLabel('threadPaneContext')">
@@ -624,10 +536,12 @@ Rights Reserved.
<popup id="messagePaneContext"
onpopupshowing="gContextMenu = new nsContextMenu(this); return fillMessagePaneContextMenu();"
onpopuphiding="gContextMenu.onDestroy(); gContextMenu = null;">
<!-- stand alone mail. why do we need this any way, if clicking on it will open the link in a new browser window anyways? seems like a bug on the trunk
<menuitem id="context-openlink"
label="&openLinkCmd.label;"
accesskey="&openLinkCmd.accesskey;"
oncommand="gContextMenu.openLink();"/>
-->
<menuseparator id="messagePaneContext-sep-link"/>
<menuitem id="context-selectall"
label="&selectAllCmd.label;"
@@ -663,143 +577,7 @@ Rights Reserved.
label="&copyMessageLocation.label;"
accesskey="&copyMessageLocation.accesskey;"
oncommand="CopyMessageUrl()"/>
<menu id="messagePaneContext-moveMenu"
label="&contextMoveMsgMenu.label;"
accesskey="&contextMoveMsgMenu.accesskey;"
sortResource="http://home.netscape.com/NC-rdf#FolderTreeName"
sortDirection="ascending"
datasources="rdf:null">
<menupopup/>
<template>
<rule nc:NoSelect="true" iscontainer="true" isempty="false">
<menupopup>
<menu uri="..." class="folderMenuItem menu-iconic" label="rdf:http://home.netscape.com/NC-rdf#Name">
<menupopup>
<menuitem label="&fileHereMenu.label;" accesskey="&fileHereMenu.accesskey;" disabled="true"/>
<menuseparator/>
</menupopup>
</menu>
</menupopup>
</rule>
<rule nc:NoSelect="true">
<menupopup>
<menuitem uri="..." class="folderMenuItem menu-iconic" label="rdf:http://home.netscape.com/NC-rdf#Name" disabled="true"/>
</menupopup>
</rule>
<rule nc:CanFileMessages="true" iscontainer="true" isempty="false">
<menupopup>
<menu uri="..." class="folderMenuItem menu-iconic" label="rdf:http://home.netscape.com/NC-rdf#Name"
SpecialFolder="rdf:http://home.netscape.com/NC-rdf#SpecialFolder"
BiffState="rdf:http://home.netscape.com/NC-rdf#BiffState"
IsServer="rdf:http://home.netscape.com/NC-rdf#IsServer"
IsSecure="rdf:http://home.netscape.com/NC-rdf#IsSecure"
ServerType="rdf:http://home.netscape.com/NC-rdf#ServerType">
<menupopup>
<menuitem label="&fileHereMenu.label;" accesskey="&fileHereMenu.accesskey;"
oncommand="MsgMoveMessage(event.target.parentNode.parentNode)"/>
<menuseparator/>
</menupopup>
</menu>
</menupopup>
</rule>
<rule nc:CanFileMessagesOnServer="false">
<!-- don't show servers (nntp & any others) which does not allow message filing -->
<!-- File, Move & Copy menus -->
</rule>
<rule nc:CanFileMessages="false" iscontainer="true" isempty="false">
<!-- note, there is no "file here" -->
<menupopup>
<menu uri="..." class="folderMenuItem menu-iconic" label="rdf:http://home.netscape.com/NC-rdf#Name"
SpecialFolder="rdf:http://home.netscape.com/NC-rdf#SpecialFolder"
BiffState="rdf:http://home.netscape.com/NC-rdf#BiffState"
IsServer="rdf:http://home.netscape.com/NC-rdf#IsServer"
IsSecure="rdf:http://home.netscape.com/NC-rdf#IsSecure"
ServerType="rdf:http://home.netscape.com/NC-rdf#ServerType">
<menupopup/>
</menu>
</menupopup>
</rule>
<rule nc:CanFileMessages="true">
<menupopup>
<menuitem uri="..." class="folderMenuItem menuitem-iconic" label="rdf:http://home.netscape.com/NC-rdf#Name" oncommand="MsgMoveMessage(event.target)"
SpecialFolder="rdf:http://home.netscape.com/NC-rdf#SpecialFolder"
BiffState="rdf:http://home.netscape.com/NC-rdf#BiffState"
IsServer="rdf:http://home.netscape.com/NC-rdf#IsServer"
IsSecure="rdf:http://home.netscape.com/NC-rdf#IsSecure"
ServerType="rdf:http://home.netscape.com/NC-rdf#ServerType"/>
</menupopup>
</rule>
</template>
</menu>
<menu id="messagePaneContext-copyMenu"
label="&contextCopyMsgMenu.label;"
accesskey="&contextCopyMsgMenu.accesskey;"
sortResource="http://home.netscape.com/NC-rdf#FolderTreeName"
sortDirection="ascending"
datasources="rdf:null">
<menupopup/>
<template>
<rule nc:NoSelect="true" iscontainer="true" isempty="false">
<menupopup>
<menu uri="..." class="folderMenuItem menu-iconic" label="rdf:http://home.netscape.com/NC-rdf#Name">
<menupopup>
<menuitem label="&fileHereMenu.label;" accesskey="&fileHereMenu.accesskey;" disabled="true"/>
<menuseparator/>
</menupopup>
</menu>
</menupopup>
</rule>
<rule nc:NoSelect="true">
<menupopup>
<menuitem uri="..." class="folderMenuItem menu-iconic" label="rdf:http://home.netscape.com/NC-rdf#Name" disabled="true"/>
</menupopup>
</rule>
<rule nc:CanFileMessages="true" iscontainer="true" isempty="false">
<menupopup>
<menu uri="..." class="folderMenuItem menu-iconic" label="rdf:http://home.netscape.com/NC-rdf#Name"
SpecialFolder="rdf:http://home.netscape.com/NC-rdf#SpecialFolder"
BiffState="rdf:http://home.netscape.com/NC-rdf#BiffState"
IsServer="rdf:http://home.netscape.com/NC-rdf#IsServer"
IsSecure="rdf:http://home.netscape.com/NC-rdf#IsSecure"
ServerType="rdf:http://home.netscape.com/NC-rdf#ServerType">
<menupopup>
<menuitem label="&fileHereMenu.label;" accesskey="&fileHereMenu.accesskey;"
oncommand="MsgCopyMessage(event.target.parentNode.parentNode)"/>
<menuseparator/>
</menupopup>
</menu>
</menupopup>
</rule>
<rule nc:CanFileMessagesOnServer="false">
<!-- don't show servers (nntp & any others) which does not allow message filing -->
<!-- File, Move & Copy menus -->
</rule>
<rule nc:CanFileMessages="false" iscontainer="true" isempty="false">
<!-- note, there is no "file here" -->
<menupopup>
<menu uri="..." class="folderMenuItem menu-iconic" label="rdf:http://home.netscape.com/NC-rdf#Name"
SpecialFolder="rdf:http://home.netscape.com/NC-rdf#SpecialFolder"
BiffState="rdf:http://home.netscape.com/NC-rdf#BiffState"
IsServer="rdf:http://home.netscape.com/NC-rdf#IsServer"
IsSecure="rdf:http://home.netscape.com/NC-rdf#IsSecure"
ServerType="rdf:http://home.netscape.com/NC-rdf#ServerType">
<menupopup/>
</menu>
</menupopup>
</rule>
<rule nc:CanFileMessages="true">
<menupopup>
<menuitem uri="..." class="folderMenuItem menuitem-iconic" label="rdf:http://home.netscape.com/NC-rdf#Name"
oncommand="MsgCopyMessage(event.target)"
SpecialFolder="rdf:http://home.netscape.com/NC-rdf#SpecialFolder"
BiffState="rdf:http://home.netscape.com/NC-rdf#BiffState"
IsServer="rdf:http://home.netscape.com/NC-rdf#IsServer"
IsSecure="rdf:http://home.netscape.com/NC-rdf#IsSecure"
ServerType="rdf:http://home.netscape.com/NC-rdf#ServerType"/>
</menupopup>
</rule>
</template>
</menu>
<menuseparator id="messagePaneContext-sep-labels-1"/>
<menu id="messagePaneContext-labels" label="&labelMenu.label;" accesskey="&labelMenu.accesskey;">
<menupopup onpopupshowing="InitMessageLabel('messagePaneContext')">
@@ -880,11 +658,13 @@ Rights Reserved.
label="&saveImageCmd.label;"
accesskey="&saveImageCmd.accesskey;"
oncommand="gContextMenu.saveImage();"/>
<!-- stand alone mail, no bookmarking
<menuitem id="context-bookmarklink"
label="&bookmarkLinkCmd.label;"
accesskey="&bookmarkLinkCmd.accesskey;"
oncommand="BookmarksUtils.addBookmark(gContextMenu.linkURL(),
gContextMenu.linkText());"/>
-->
</popup>
@@ -903,6 +683,7 @@ Rights Reserved.
<menuitem id="newAccountMenuItem" label="&newAccountCmd.label;"
accesskey="&newAccountCmd.accesskey;"
oncommand="MsgAccountWizard();"/>
<!-- in stand alone mail app, no nav, no editor -->
<menuseparator/>
<menuitem id="menu_newNavigator"/>
<menuitem id="menu_newEditor"/>
@@ -1106,11 +887,25 @@ Rights Reserved.
<menuitem id="stopMenuitem" label="&stopCmd.label;" accesskey="&stopCmd.accesskey;" key="key_stop" disabled="true" command="cmd_stop"/>
<menuitem label="&reloadCmd.label;" accesskey="&reloadCmd.accesskey;" observes="cmd_reload"/>
<menuseparator/>
<!-- overlayed from viewZoomOverlay.xul -->
<menu id="menu_textZoom"/>
<!-- no zoom
<menu id="menu_textZoom" accesskey="&textZoomMenu.accesskey;">
<menupopup id="menu_textZoomPopup" onpopupshowing="updateTextZoomMenu();">
<menuitem key="key_textZoomReduce" label="&textZoomReduceCmd.label;" accesskey="&textZoomReduceCmd.accesskey;" command="cmd_textZoomReduce"/>
<menuitem key="key_textZoomEnlarge" label="&textZoomEnlargeCmd.label;" accesskey="&textZoomEnlargeCmd.accesskey;" command="cmd_textZoomEnlarge"/>
<menuseparator/>
<menuseparator id="menu_textZoomInsertBefore"/>
<menuitem id="menu_textZoomOther" type="radio" name="textZoom" accesskey="&textZoomOtherCmd.accesskey;" oncommand="setTextZoomOther();"/>
</menupopup>
</menu>
-->
<!-- no charset
<menu id="mailviewCharsetMenu" />
<menuseparator/>
-->
<menuitem id="pageSourceMenuItem" label="&pageSourceCmd.label;" key="key_viewPageSource" accesskey="&pageSourceCmd.accesskey;" observes="cmd_viewPageSource"/>
<menuitem label="&menu_securityStatus.label;"
accesskey="&menu_securityStatus.accesskey;" observes="cmd_viewSecurityStatus"/>
</menupopup>
</menu>
<menu label="&goMenu.label;" accesskey="&goMenu.accesskey;">
@@ -1172,137 +967,7 @@ Rights Reserved.
key="key_editAsNew"
observes="cmd_editAsNew"/>
<menuseparator/>
<menu label="&moveMsgMenu.label;" accesskey="&moveMsgMenu.accesskey;" id="moveMenu" datasources="rdf:null"
sortResource="http://home.netscape.com/NC-rdf#FolderTreeName"
sortDirection="ascending">
<menupopup/>
<template>
<rule nc:NoSelect="true" iscontainer="true" isempty="false">
<menupopup>
<menu uri="..." class="folderMenuItem menu-iconic" label="rdf:http://home.netscape.com/NC-rdf#Name">
<menupopup>
<menuitem label="&fileHereMenu.label;" accesskey="&fileHereMenu.accesskey;" disabled="true"/>
<menuseparator/>
</menupopup>
</menu>
</menupopup>
</rule>
<rule nc:NoSelect="true">
<menupopup>
<menuitem uri="..." class="folderMenuItem menu-iconic" label="rdf:http://home.netscape.com/NC-rdf#Name" disabled="true"/>
</menupopup>
</rule>
<rule nc:CanFileMessages="true" iscontainer="true" isempty="false">
<menupopup>
<menu uri="..." class="folderMenuItem menu-iconic" label="rdf:http://home.netscape.com/NC-rdf#Name"
SpecialFolder="rdf:http://home.netscape.com/NC-rdf#SpecialFolder"
BiffState="rdf:http://home.netscape.com/NC-rdf#BiffState"
IsServer="rdf:http://home.netscape.com/NC-rdf#IsServer"
IsSecure="rdf:http://home.netscape.com/NC-rdf#IsSecure"
ServerType="rdf:http://home.netscape.com/NC-rdf#ServerType">
<menupopup>
<menuitem label="&fileHereMenu.label;" accesskey="&fileHereMenu.accesskey;"
oncommand="MsgMoveMessage(event.target.parentNode.parentNode)"/>
<menuseparator/>
</menupopup>
</menu>
</menupopup>
</rule>
<rule nc:CanFileMessagesOnServer="false">
<!-- don't show servers (nntp & any others) which does not allow message filing -->
<!-- File, Move & Copy menus -->
</rule>
<rule nc:CanFileMessages="false" iscontainer="true" isempty="false">
<!-- note, there is no "file here" -->
<menupopup>
<menu uri="..." class="folderMenuItem menu-iconic" label="rdf:http://home.netscape.com/NC-rdf#Name"
SpecialFolder="rdf:http://home.netscape.com/NC-rdf#SpecialFolder"
BiffState="rdf:http://home.netscape.com/NC-rdf#BiffState"
IsServer="rdf:http://home.netscape.com/NC-rdf#IsServer"
IsSecure="rdf:http://home.netscape.com/NC-rdf#IsSecure"
ServerType="rdf:http://home.netscape.com/NC-rdf#ServerType">
<menupopup/>
</menu>
</menupopup>
</rule>
<rule nc:CanFileMessages="true">
<menupopup>
<menuitem uri="..." class="folderMenuItem menuitem-iconic" label="rdf:http://home.netscape.com/NC-rdf#Name" oncommand="MsgMoveMessage(event.target)"
SpecialFolder="rdf:http://home.netscape.com/NC-rdf#SpecialFolder"
BiffState="rdf:http://home.netscape.com/NC-rdf#BiffState"
IsServer="rdf:http://home.netscape.com/NC-rdf#IsServer"
IsSecure="rdf:http://home.netscape.com/NC-rdf#IsSecure"
ServerType="rdf:http://home.netscape.com/NC-rdf#ServerType"/>
</menupopup>
</rule>
</template>
</menu>
<menu label="&copyMsgMenu.label;" accesskey="&copyMsgMenu.accesskey;" id="copyMenu" datasources="rdf:null"
sortResource="http://home.netscape.com/NC-rdf#FolderTreeName"
sortDirection="ascending">
<menupopup/>
<template>
<rule nc:NoSelect="true" iscontainer="true" isempty="false">
<menupopup>
<menu uri="..." class="folderMenuItem menu-iconic" label="rdf:http://home.netscape.com/NC-rdf#Name">
<menupopup>
<menuitem label="&fileHereMenu.label;" accesskey="&fileHereMenu.accesskey;" disabled="true"/>
<menuseparator/>
</menupopup>
</menu>
</menupopup>
</rule>
<rule nc:NoSelect="true">
<menupopup>
<menuitem uri="..." class="folderMenuItem menu-iconic" label="rdf:http://home.netscape.com/NC-rdf#Name" disabled="true"/>
</menupopup>
</rule>
<rule nc:CanFileMessages="true" iscontainer="true" isempty="false">
<menupopup>
<menu uri="..." class="folderMenuItem menu-iconic" label="rdf:http://home.netscape.com/NC-rdf#Name"
SpecialFolder="rdf:http://home.netscape.com/NC-rdf#SpecialFolder"
BiffState="rdf:http://home.netscape.com/NC-rdf#BiffState"
IsServer="rdf:http://home.netscape.com/NC-rdf#IsServer"
IsSecure="rdf:http://home.netscape.com/NC-rdf#IsSecure"
ServerType="rdf:http://home.netscape.com/NC-rdf#ServerType">
<menupopup>
<menuitem label="&fileHereMenu.label;" accesskey="&fileHereMenu.accesskey;"
oncommand="MsgCopyMessage(event.target.parentNode.parentNode)"/>
<menuseparator/>
</menupopup>
</menu>
</menupopup>
</rule>
<rule nc:CanFileMessagesOnServer="false">
<!-- don't show servers (nntp & any others) which does not allow message filing -->
<!-- File, Move & Copy menus -->
</rule>
<rule nc:CanFileMessages="false" iscontainer="true" isempty="false">
<!-- note, there is no "file here" -->
<menupopup>
<menu uri="..." class="folderMenuItem menu-iconic" label="rdf:http://home.netscape.com/NC-rdf#Name"
SpecialFolder="rdf:http://home.netscape.com/NC-rdf#SpecialFolder"
BiffState="rdf:http://home.netscape.com/NC-rdf#BiffState"
IsServer="rdf:http://home.netscape.com/NC-rdf#IsServer"
IsSecure="rdf:http://home.netscape.com/NC-rdf#IsSecure"
ServerType="rdf:http://home.netscape.com/NC-rdf#ServerType">
<menupopup/>
</menu>
</menupopup>
</rule>
<rule nc:CanFileMessages="true">
<menupopup>
<menuitem uri="..." class="folderMenuItem menuitem-iconic" label="rdf:http://home.netscape.com/NC-rdf#Name"
oncommand="MsgCopyMessage(event.target)"
SpecialFolder="rdf:http://home.netscape.com/NC-rdf#SpecialFolder"
BiffState="rdf:http://home.netscape.com/NC-rdf#BiffState"
IsServer="rdf:http://home.netscape.com/NC-rdf#IsServer"
IsSecure="rdf:http://home.netscape.com/NC-rdf#IsSecure"
ServerType="rdf:http://home.netscape.com/NC-rdf#ServerType"/>
</menupopup>
</rule>
</template>
</menu>
<menu label="&labelMenu.label;" accesskey="&labelMenu.accesskey;">
<menupopup id="menuPopup-labels" onpopupshowing="InitMessageLabel('menuPopup')">
<menuitem
@@ -1371,17 +1036,25 @@ Rights Reserved.
</menupopup>
</menu>
<menu id="tasksMenu">
<menu id="tasksMenu" label="&tasksMenu.label;" accesskey="&tasksMenu.accesskey;">
<menupopup id="taskPopup">
<menuitem label="&searchMailCmd.label;" key="key_searchMail" accesskey="&searchMailCmd.accesskey;" command="cmd_searchMsgs"/>
<menuitem label="&filtersCmd.label;"
accesskey="&filtersCmd.accesskey;"
oncommand="MsgFilters(null);"/>
<menuitem label="&importCmd.label;" accesskey="&importCmd.accesskey;" oncommand="toImport();"/>
<menuseparator/>
</menupopup>
</menu>
<menu id="windowMenu"/>
<menu id="windowMenu" label="&windowMenu.label;" accesskey="&windowMenu.accesskey;">
<menupopup id="windowPopup">
<menuitem label="&navigatorCmd.label;" accesskey="&navigatorCmd.accesskey;" key="key_navigator" command="Tasks:Navigator" id="tasksMenuNavigator" class="menuitem-iconic icon-navigator16"/>
<menuitem accesskey="&messengerCmd.accesskey;" label="&messengerCmd.label;" key="key_mail" command="Tasks:Mail" id="tasksMenuMail" class="menuitem-iconic icon-mail16 menu-iconic"/>
<menuitem label="&editorCmd.label;" accesskey="&editorCmd.accesskey;" key="key_editor" command="Tasks:Editor" id="tasksMenuEditor" class="menuitem-iconic icon-composer16 menu-iconic"/>
<menuitem label="&addressBookCmd.label;" accesskey="&addressBookCmd.accesskey;" key="key_addressbook" command="Tasks:AddressBook" id="tasksMenuAddressBook" class="menuitem-iconic icon-addressbook16 menu-iconic"/>
</menupopup>
</menu>
<menu id="menu_Help"/>
<spacer flex="100%"/>
</menubar>
@@ -1516,6 +1189,7 @@ Rights Reserved.
</toolbar>
</toolbox>
<hbox id="searchBox" persist="collapsed" align="center">
<label id="searchCriteria" value="&SearchSubjectOrSender.label;" control="searchInput"
accesskey="&SearchSubjectOrSender.accesskey;"/>
@@ -1528,16 +1202,31 @@ Rights Reserved.
<statusbar class="chromeclass-status" id="status-bar">
<hbox insertbefore="unreadMessageCount" flex="1">
<statusbarpanel id="component-bar"/>
<statusbarpanel id="component-bar" persist="collapsed">
<toolbarbutton class="taskbutton" id="mini-nav" oncommand="toNavigator();"
tooltiptext="&taskNavigator.tooltip;"/>
<toolbarbutton class="taskbutton" id="mini-mail" oncommand="toMessengerWindow()"
tooltiptext="&taskMessenger.tooltip;"/>
<toolbarbutton class="taskbutton" id="mini-comp" command="Tasks:Editor"
tooltiptext="&taskComposer.tooltip;"/>
<toolbarbutton class="taskbutton" id="mini-addr" oncommand="toAddressBook();"
tooltiptext="&taskAddressBook.tooltip;"/>
</statusbarpanel>
<statusbarpanel id="statusText" label="&statusText.label;" flex="1"/>
<statusbarpanel class="statusbarpanel-progress">
<progressmeter class="progressmeter-statusbar" id="statusbar-icon" mode="normal" value="0" oncommand="dumpProgress()"/>
</statusbarpanel>
</hbox>
<hbox insertafter="totalMessageCount" id="status-bar-end-box">
<hbox insertafter="totalMessageCount" id="status-bar-end-box">
<statusbarpanel class="statusbarpanel-iconic"
id="signed-status" collapsed="true" oncommand="showMessageReadSecurityInfo();"/>
<statusbarpanel class="statusbarpanel-iconic"
id="encrypted-status" collapsed="true" oncommand="showMessageReadSecurityInfo();"/>
<statusbarpanel checkfunc="MailCheckBeforeOfflineChange()" id="offline-status" class="statusbarpanel-iconic"/>
</hbox>
</statusbar>
</overlay>

View File

@@ -62,12 +62,22 @@ var folderListener = {
else if (event.GetUnicode() == "DeleteOrMoveMsgFailed") {
HandleDeleteOrMoveMsgFailed(folder);
}
}
else if (event.GetUnicode() == "msgLoaded") {
OnMsgLoaded(folder, gCurrentMessageUri);
}
}
}
function nsMsgDBViewCommandUpdater()
{}
function UpdateStandAloneMessageCounts()
{
// hook for extra toolbar items
var observerService = Components.classes["@mozilla.org/observer-service;1"].getService(Components.interfaces.nsIObserverService);
observerService.notifyObservers(window, "mail:updateStandAloneMessageCounts", "");
}
nsMsgDBViewCommandUpdater.prototype =
{
updateCommandStatus : function()
@@ -77,10 +87,12 @@ nsMsgDBViewCommandUpdater.prototype =
UpdateMailToolbar("dbview, std alone window");
},
displayMessageChanged : function(aFolder, aSubject)
displayMessageChanged : function(aFolder, aSubject, aKeywords)
{
setTitleFromFolder(aFolder, aSubject);
gCurrentMessageUri = gDBView.URIForFirstSelectedMessage;
UpdateStandAloneMessageCounts();
SetKeywords(aKeywords);
},
QueryInterface : function(iid)
@@ -204,19 +216,26 @@ function OnLoadMessageWindow()
var msgFolder = GetLoadedMsgFolder();
CreateBareDBView(msgFolder,viewType, viewFlags, sortType, sortOrder); // create a db view for
if (gCurrentMessageUri) {
SetUpToolbarButtons(gCurrentMessageUri);
}
else if (gCurrentFolderUri) {
SetUpToolbarButtons(gCurrentFolderUri);
}
setTimeout("var msgKey = extractMsgKeyFromURI(gCurrentMessageUri); gDBView.loadMessageByMsgKey(msgKey); gNextMessageViewIndexAfterDelete = gDBView.msgToSelectAfterDelete;", 0);
var uri;
if (gCurrentMessageUri)
uri = gCurrentMessageUri;
else if (gCurrentFolderUri)
uri = gCurrentFolderUri;
else
uri = null;
SetUpToolbarButtons(uri);
// hook for extra toolbar items
var observerService = Components.classes["@mozilla.org/observer-service;1"].getService(Components.interfaces.nsIObserverService);
observerService.notifyObservers(window, "mail:setupToolbarItems", uri);
setTimeout("var msgKey = extractMsgKeyFromURI(gCurrentMessageUri); gDBView.loadMessageByMsgKey(msgKey); gNextMessageViewIndexAfterDelete = gDBView.msgToSelectAfterDelete; UpdateStandAloneMessageCounts();", 0);
SetupCommandUpdateHandlers();
var messagePaneFrame = top.frames['messagepane'];
if(messagePaneFrame)
messagePaneFrame.focus();
if (messagePaneFrame)
messagePaneFrame.focus();
}
function extractMsgKeyFromURI()
@@ -398,7 +417,6 @@ function SelectMessage(messageUri)
var msgHdr = messenger.messageServiceFromURI(messageUri).messageURIToMsgHdr(messageUri)
gDBView.loadMessageByMsgKey(msgHdr.messageKey);
}
function ReloadMessage()
{
@@ -765,6 +783,8 @@ function performNavigation(type)
{
// load the message key
gDBView.loadMessageByMsgKey(resultId.value);
// if we changed folders, the message counts changed.
UpdateStandAloneMessageCounts();
return;
}

View File

@@ -23,7 +23,9 @@ Rights Reserved.
<?xul-overlay href="chrome://global/content/globalOverlay.xul"?>
<?xul-overlay href="chrome://communicator/content/utilityOverlay.xul"?>
<?xul-overlay href="chrome://communicator/content/tasksOverlay.xul"?>
<!-- collapsed for performance
<?xul-overlay href="chrome://messenger/content/platformMailnewsOverlay.xul"?>
-->
<?xul-overlay href="chrome://messenger/content/msgHdrViewOverlay.xul"?>
<?xul-overlay href="chrome://messenger/content/mailWindowOverlay.xul"?>
<?xul-overlay href="chrome://messenger/content/mailOverlay.xul"?>
@@ -68,6 +70,11 @@ Rights Reserved.
<script type="application/x-javascript" src="chrome://global/content/nsTransferable.js"/>
<script type="application/x-javascript" src="chrome://global/content/nsDragAndDrop.js"/>
<script type="application/x-javascript" src="chrome://messenger/content/msgViewNavigation.js"/>
<script src="chrome://messenger/content/mailCommands.js"/>
<script src="chrome://messenger/content/mailWindowOverlay.js"/>
<script src="chrome://messenger/content/commandglue.js"/>
<script src="chrome://messenger/content/mail-offline.js"/>
<script type="application/x-javascript" src="chrome://messenger-smime/content/msgReadSMIMEOverlay.js"/>
<commandset id="mailCommands">
<commandset id="mailFileMenuItems"/>
@@ -126,6 +133,7 @@ Rights Reserved.
</toolbox>
<!-- msg header view -->
<vbox id="messagesBox" flex="1">
<vbox id="messagepanebox" flex="3" persist="collapsed">
<hbox id="msgHeaderView"/>
@@ -133,7 +141,7 @@ Rights Reserved.
<browser id="messagepane" context="messagePaneContext" style="height: 0px" flex="1" name="messagepane"
disableHistory="true" type="content-primary" src="about:blank" onclick="contentAreaClick(event);"/>
</vbox>
</vbox>
<statusbar class="chromeclass-status" id="status-bar"/>

View File

@@ -49,23 +49,7 @@ mail-headerfield {
-moz-binding: url("chrome://messenger/content/mailWidgets.xml#mail-headerfield");
}
searchattribute {
-moz-binding: url("chrome://messenger/content/mailWidgets.xml#searchattribute");
}
searchoperator {
-moz-binding: url("chrome://messenger/content/mailWidgets.xml#searchoperator");
}
searchvalue {
display: -moz-deck;
-moz-binding: url("chrome://messenger/content/mailWidgets.xml#searchvalue");
}
searchterm {
-moz-binding: url("chrome://messenger/content/mailWidgets.xml#searchterm");
}
dummy.usesMailWidgets {
-moz-binding: url("chrome://messenger/content/mailWidgets.xml#dummy");
}

View File

@@ -18,25 +18,44 @@ Communications Corporation. Portions created by Netscape are
Copyright (C) 1998-1999 Netscape Communications Corporation. All
Rights Reserved.
-->
<?xml-stylesheet href="chrome://messenger/skin/mailWindow1.css" type="text/css"?>
<?xml-stylesheet href="chrome://messenger/skin/threadPaneExtras.css" type="text/css"?>
<?xml-stylesheet href="chrome://messenger/skin/folderPaneExtras.css" type="text/css"?>
<?xml-stylesheet href="chrome://messenger/skin/fakeAccount.css" type="text/css"?>
<?xml-stylesheet href="chrome://communicator/skin/tasksOverlay.css" type="text/css"?>
<?xul-overlay href="chrome://global/content/globalOverlay.xul"?>
<?xul-overlay href="chrome://communicator/content/utilityOverlay.xul"?>
<?xul-overlay href="chrome://messenger/content/platformMailnewsOverlay.xul"?>
<?xul-overlay href="chrome://messenger/content/threadPane.xul"?>
<?xul-overlay href="chrome://messenger/content/folderPane.xul"?>
<!-- collapsed in, for performance
threadPane.xul, folderPane.xul -> messenger.xul
threadPane.css, threadPaneLabels.css, folderPane.css -> mailWindow1.css
folderpane.dtd, threadpane.dtd -> messenger.dtd
platformMailnewsOverlay.xul
-->
<?xul-overlay href="chrome://messenger/content/msgHdrViewOverlay.xul"?>
<?xul-overlay href="chrome://messenger/content/mailWindowOverlay.xul"?>
<?xul-overlay href="chrome://messenger/content/mailOverlay.xul"?>
<!--
no side bar in stand alone mail
<?xul-overlay href="chrome://communicator/content/sidebar/sidebarOverlay.xul"?>
<?xul-overlay href="chrome://communicator/content/tasksOverlay.xul"?>
-->
<!-- we used to get this from sidebarOverlay.xul -->
<?xul-overlay href="chrome://communicator/content/contentAreaContextOverlay.xul"?>
<?xul-overlay href="chrome://communicator/content/communicatorOverlay.xul"?>
<!DOCTYPE window [
<!ENTITY % brandDTD SYSTEM "chrome://global/locale/brand.dtd" >
%brandDTD;
<!ENTITY % messengerDTD SYSTEM "chrome://messenger/locale/messenger.dtd" >
%messengerDTD;
<!ENTITY % tasksDTD SYSTEM "chrome://communicator/locale/tasksOverlay.dtd" >
%tasksDTD;
]>
<window id="messengerWindow"
@@ -59,23 +78,11 @@ Rights Reserved.
<stringbundle id="bundle_search" src="chrome://messenger/locale/search.properties"/>
</stringbundleset>
<script type="application/x-javascript" src="chrome://messenger/content/widgetglue.js"/>
<script type="application/x-javascript" src="chrome://messenger/content/commandglue.js"/>
<script type="application/x-javascript" src="chrome://messenger/content/shareglue.js"/>
<script type="application/x-javascript" src="chrome://messenger/content/msgViewNavigation.js"/>
<script type="application/x-javascript" src="chrome://messenger/content/mailWindow.js"/>
<script type="application/x-javascript" src="chrome://messenger/content/msgMail3PaneWindow.js"/>
<script type="application/x-javascript" src="chrome://messenger/content/mail3PaneWindowCommands.js"/>
<script type="application/x-javascript" src="chrome://messenger/content/mailContextMenus.js"/>
<script type="application/x-javascript" src="chrome://messenger/content/messengerdnd.js"/>
<script type="application/x-javascript" src="chrome://messenger/content/accountUtils.js"/>
<script type="application/x-javascript" src="chrome://messenger/content/msgAccountCentral.js"/>
<script type="application/x-javascript" src="chrome://messenger/content/mail-offline.js"/>
<script type="application/x-javascript" src="chrome://messenger/content/searchBar.js"/>
<script type="application/x-javascript" src="chrome://communicator/content/contentAreaClick.js"/>
<script type="application/x-javascript" src="chrome://global/content/nsTransferable.js"/>
<script type="application/x-javascript" src="chrome://global/content/nsDragAndDrop.js"/>
<script type="application/x-javascript" src="chrome://communicator/content/tasksOverlay.js"/>
<script type="application/x-javascript" src="chrome://messenger/content/mailbase.js"/>
<commandset id="mailCommands">
<commandset id="mailFileMenuItems"/>
@@ -97,9 +104,12 @@ Rights Reserved.
commandupdater="true"
events="focus"
oncommandupdate="FocusRingUpdate_Mail()"/>
<commandset id="tasksCommands"/>
<command id="toggleSidebar"/>
<commandset id="tasksCommands">
<command id="Tasks:Navigator" oncommand="toNavigator();"/>
</commandset>
</commandset>
<broadcasterset id="mailBroadcasters">
<!-- File Menu -->
@@ -108,9 +118,10 @@ Rights Reserved.
</broadcasterset>
<keyset id="mailKeys">
<key id="showHideSidebar"/>
<keyset id="tasksKeys"/>
</keyset>
<keyset id="tasksKeys">
<key id="key_navigator" key="&navigatorCmd.commandkey;" command="Tasks:Navigator" modifiers="accel"/>
</keyset>
</keyset>
<popup id="threadPaneContext"/>
<popup id="folderPaneContext"/>
@@ -147,19 +158,157 @@ Rights Reserved.
<hbox style="height:100px" flex="1">
<vbox id="sidebar-box">
<tree id="folderTree" persist="height width" flex="1" context="folderPaneContext"/>
<tree id="folderTree" class="plain" style="min-width: 200px" persist="height width" flex="1" context="folderPaneContext" seltype="single"
datasources="rdf:null"
statedatasource="rdf:mailnewsfolders"
flags="dont-build-content"
ondraggesture="BeginDragFolderTree(event);"
onselect="FolderPaneSelectionChange();">
<template>
<rule>
<conditions>
<treeitem uri="?container"/>
<member container="?container" child="?member" />
</conditions>
<bindings>
<binding subject="?member"
predicate="http://home.netscape.com/NC-rdf#FolderTreeName"
object="?folderTreeName" />
<binding subject="?member"
predicate="http://home.netscape.com/NC-rdf#FolderTreeName?sort=true"
object="?folderTreeNameSort" />
<binding subject="?member"
predicate="http://home.netscape.com/NC-rdf#FolderTreeSimpleName"
object="?folderTreeSimpleName" />
<binding subject="?member"
predicate="http://home.netscape.com/NC-rdf#SpecialFolder"
object="?specialFolder" />
<binding subject="?member"
predicate="http://home.netscape.com/NC-rdf#BiffState"
object="?biffState" />
<binding subject="?member"
predicate="http://home.netscape.com/NC-rdf#IsServer"
object="?isServer" />
<binding subject="?member"
predicate="http://home.netscape.com/NC-rdf#NewMessages"
object="?newMessages" />
<binding subject="?member"
predicate="http://home.netscape.com/NC-rdf#HasUnreadMessages"
object="?hasUnreadMessages" />
<binding subject="?member"
predicate="http://home.netscape.com/NC-rdf#SubfoldersHaveUnreadMessages"
object="?subfoldersHaveUnreadMessages" />
<binding subject="?member"
predicate="http://home.netscape.com/NC-rdf#IsSecure"
object="?isSecure" />
<binding subject="?member"
predicate="http://home.netscape.com/NC-rdf#ServerType"
object="?serverType" />
<binding subject="?member"
predicate="http://home.netscape.com/NC-rdf#RedirectorType"
object="?redirectorType" />
<binding subject="?member"
predicate="http://home.netscape.com/NC-rdf#NoSelect"
object="?noSelect" />
<binding subject="?member"
predicate="http://home.netscape.com/NC-rdf#ImapShared"
object="?imapShared" />
<binding subject="?member"
predicate="http://home.netscape.com/NC-rdf#TotalUnreadMessages"
object="?unreadCount" />
<binding subject="?member"
predicate="http://home.netscape.com/NC-rdf#TotalMessages"
object="?totalCount" />
<binding subject="?member"
predicate="http://home.netscape.com/NC-rdf#PageTitleFakeAccount"
object="?fakeAccount" />
</bindings>
<action>
<treechildren>
<treeitem uri="?member">
<treerow>
<treecell id="folderNameCell"
label="?folderTreeName"
properties="specialFolder-?specialFolder biffState-?biffState isServer-?isServer newMessages-?newMessages hasUnreadMessages-?hasUnreadMessages subfoldersHaveUnreadMessages-?subfoldersHaveUnreadMessages isSecure-?isSecure serverType-?serverType redirectorType-?redirectorType noSelect-?noSelect imapShared-?imapShared fakeAccount-?fakeAccount"/>
<treecell label="?unreadCount"
properties="hasUnreadMessages-?hasUnreadMessages subfoldersHaveUnreadMessages-?subfoldersHaveUnreadMessages"/>
<treecell label="?totalCount"
properties="hasUnreadMessages-?hasUnreadMessages subfoldersHaveUnreadMessages-?subfoldersHaveUnreadMessages"/>
</treerow>
</treeitem>
</treechildren>
</action>
</rule>
</template>
<treecols>
<treecol id="folderNameCol"
flex="5"
label="&nameColumn.label;"
crop="center"
persist="width"
ignoreincolumnpicker="true"
primary="true"
sort="?folderTreeNameSort"
sortActive="true"
sortDirection="ascending"/>
<splitter class="tree-splitter"/>
<treecol id="folderUnreadCol"
persist="hidden width"
flex="1"
label="&unreadColumn.label;"/>
<splitter class="tree-splitter"/>
<treecol id="folderTotalCol"
persist="hidden width"
flex="1"
label="&totalColumn.label;"/>
</treecols>
</tree>
</vbox>
<splitter id="sidebar-splitter"/>
<vbox flex="1">
<vbox id="accountCentralBox" flex="1">
<iframe name="accountCentralPane" flex="1" src="about:blank"/>
</vbox>
<vbox id="accountCentralBox" flex="1" collapsed="true">
<iframe name="accountCentralPane" flex="1" src="about:blank"/>
</vbox>
<vbox id="messagesBox" flex="1">
<hbox id="searchBox"/>
<tree id="threadTree" flex="2" persist="height" style="height:0px" context="threadPaneContext"/>
<tree id="threadTree" flex="1" enableColumnDrag="true" class="plain" persist="height" style="height:0px" context="threadPaneContext"
onkeypress="ThreadPaneKeyPress(event);"
onselect="ThreadPaneSelectionChanged();">
<treecols>
<treecol id="threadCol" display="&threadColumn.label;" class="treecol-image threadColumnHeader" currentView="unthreaded" cycler="true" persist="hidden ordinal" fixed="true" />
<treecol id="subjectCol" class="sortDirectionIndicator" persist="hidden ordinal width" flex="7" label="&subjectColumn.label;" primary="true"/>
<splitter class="tree-splitter"/>
<treecol id="senderOrRecipientCol" class="sortDirectionIndicator" persist="hidden ordinal width" flex="4" label="&senderColumn.label;"/>
<splitter class="tree-splitter"/>
<treecol id="unreadButtonColHeader" fixed="true" persist="hidden ordinal" class="treecol-image readColumnHeader" display="&readColumn.label;" cycler="true"/>
<splitter class="tree-splitter"/>
<treecol id="dateCol" class="sortDirectionIndicator" persist="hidden ordinal width" flex="2" label="&dateColumn.label;"/>
<splitter class="tree-splitter"/>
<treecol id="statusCol" class="sortDirectionIndicator" persist="hidden ordinal width" flex="1" label="&statusColumn.label;"/>
<splitter class="tree-splitter"/>
<treecol id="sizeCol" class="sortDirectionIndicator" persist="hidden ordinal width" flex="1" label="&sizeColumn.label;"/>
<splitter class="tree-splitter"/>
<treecol id="flaggedCol" fixed="true" persist="hidden ordinal" class="treecol-image flagColumnHeader" display="&flagColumn.label;" cycler="true"/>
<splitter class="tree-splitter"/>
<treecol id="labelCol" class="sortDirectionIndicator" persist="hidden ordinal width" flex="1" label="&labelColumn.label;"/>
<splitter class="tree-splitter"/>
<treecol id="priorityCol" class="sortDirectionIndicator" persist="hidden ordinal width" flex="1" label="&priorityColumn.label;"/>
<splitter class="tree-splitter"/>
<treecol id="unreadCol" class="sortDirectionIndicator" persist="hidden ordinal width" flex="1" label="&unreadColumn.label;"/>
<splitter class="tree-splitter"/>
<treecol id="totalCol" class="sortDirectionIndicator" persist="hidden ordinal width" flex="1" label="&totalColumn.label;"/>
<treecol id="locationCol" class="sortDirectionIndicator" persist="width" flex="1" hidden="true" ignoreincolumnpicker="true" label="&locationColumn.label;"/>
</treecols>
<treechildren ondraggesture="BeginDragThreadPane(event);"/>
</tree>
<!-- if you change this id, please change GetThreadAndMessagePaneSplitter() and MsgToggleMessagePane() -->
<splitter collapse="after" persist="state"

View File

@@ -34,6 +34,11 @@
var msgHeaderParserContractID = "@mozilla.org/messenger/headerparser;1";
var abAddressCollectorContractID = "@mozilla.org/addressbook/services/addressCollecter;1";
// get the "msgLoad" atom
var atomService = Components.classes["@mozilla.org/atom-service;1"].getService().QueryInterface(Components.interfaces.nsIAtomService);
var gMsgLoadedAtom = atomService.getAtom("msgLoaded").QueryInterface(Components.interfaces.nsISupports);
var gViewAllHeaders = false;
var gNumAddressesToShow = 3;
var gShowUserAgent = false;
@@ -354,6 +359,17 @@ var messageHeaderSink = {
displayAttachmentsForExpandedView();
},
onEndMsgDownload: function(url)
{
var msgFolder;
if (url)
{
msgFolder = url.folder;
if (msgFolder)
msgFolder.NotifyFolderEvent(gMsgLoadedAtom);
}
},
mSecurityInfo : null,
getSecurityInfo: function()
{

View File

@@ -22,6 +22,8 @@ Rights Reserved.
<!DOCTYPE window SYSTEM "chrome://messenger/locale/msgHdrViewOverlay.dtd">
<?xml-stylesheet href="chrome://messenger/skin/messageHeader.css" type="text/css"?>
<?xml-stylesheet href="chrome://messenger/skin/messageKeywords.css" type="text/css"?>
<?xml-stylesheet href="chrome://messenger/skin/smime/msgHdrViewSMIMEOverlay.css" type="text/css"?>
<overlay xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
@@ -50,9 +52,9 @@ Rights Reserved.
<tooltip id="attachmentListTooltip"
onpopupshowing="return FillInAttachmentTooltip(document.tooltipNode);"/>
<hbox id="msgHeaderView" persist="state">
<hbox id="msgHeaderView" originalclass="none" persist="state">
<grid id="collapsedHeaderView" class="header-part1" flex="1" collapsed="true">
<grid id="collapsedHeaderView" class="header-part1" originalclass="header-part1" flex="1" collapsed="true">
<rows>
<row flex="1"/>
</rows>
@@ -67,7 +69,7 @@ Rights Reserved.
<column id="collapsedsubjectBox" collapsed="true" flex="1">
<hbox align="start">
<label class="collapsedHeaderDisplayName" value="&subjectField.label;"/>
<label id="collapsedsubjectValue" class="collapsedHeaderValue" crop="right" flex="1"/>
<textbox id="collapsedsubjectValue" class="collapsedHeaderValue plain" readonly="true" crop="right" flex="1"/>
</hbox>
</column>
@@ -78,9 +80,15 @@ Rights Reserved.
</hbox>
</column>
<column id = "collapseddateBox" collapsed="true">
<column id="collapseddateBox" collapsed="true">
<hbox align="start">
<label id="collapseddateValue" class="collapsedHeaderValue"/>
<textbox id="collapseddateValue" class="collapsedHeaderValue plain" readonly="true"/>
</hbox>
</column>
<column id="collapsedKeywordBox">
<hbox align="start">
<image id="collapsedKeywordImage" originalclass="none"/>
</hbox>
</column>
@@ -92,7 +100,7 @@ Rights Reserved.
</columns>
</grid>
<hbox id="expandedHeaderView" class="header-part1" flex="1" collapsed="true">
<hbox id="expandedHeaderView" class="header-part1" originalclass="header-part1" flex="1" collapsed="true">
<vbox id="expandedHeaders" flex="1">
<mail-toggle-headerfield id="expandedsubjectBox" class="subjectvalue" label="&subjectField.label;" ontwistyclick="ToggleHeaderView();" collapsed="true"/>
@@ -110,12 +118,29 @@ Rights Reserved.
<mail-headerfield id="expandeduser-agentBox" label="&userAgentField.label;" collapsed="true"/>
</vbox>
<vbox id="smimeBox" insertafter="expandedHeaders" collapsed="true">
<spacer flex="1"/>
<image id="signedHdrIcon"
onclick="showMessageReadSecurityInfo();" collapsed="true"/>
<image id="encryptedHdrIcon"
onclick="showMessageReadSecurityInfo();" collapsed="true"/>
<spacer flex="1"/>
</vbox>
<vbox id="editMessageBox" class="header-part1" collapsed="true">
<vbox id="expandedKeywordBox">
<spacer flex="1"/>
<image id="expandedKeywordImage" originalclass="none" />
<spacer flex="1"/>
</vbox>
<vbox id="editMessageBox" class="header-part1" originalclass="header-part1" collapsed="true">
<spacer flex="1"/>
<button id="editMessageButton" label="&editMessage.label;" oncommand="MsgComposeDraftMessage()"/>
<spacer flex="1"/>
</vbox>
<vbox id="expandedAttachmentBox" class="header-part1" collapsed="true">
<vbox id="expandedAttachmentBox" class="header-part1" originalclass="header-part1" collapsed="true">
<label id="attachmentText" value="&attachmentsTree.label;" crop="right"/>
<listbox id="attachmentList" flex="2"
onclick="attachmentListClick(event);" context="attachmentListContext"/>

View File

@@ -184,6 +184,27 @@ var folderListener = {
}
}
}
else if (eventType == "ImapHdrDownloaded") {
if (folder) {
var imapFolder = folder.QueryInterface(Components.interfaces.nsIMsgImapMailFolder);
if (imapFolder) {
var hdrParser = imapFolder.hdrParser;
if (hdrParser) {
var msgHdr = hdrParser.GetNewMsgHdr();
if (msgHdr)
{
var hdrs = hdrParser.headers;
if (hdrs && hdrs.indexOf("X-attachment-size:") > 0) {
msgHdr.OrFlags(0x10000000); // 0x10000000 is MSG_FLAG_ATTACHMENT
}
if (hdrs && hdrs.indexOf("X-image-size:") > 0) {
msgHdr.setStringProperty("imageSize", "1");
}
}
}
}
}
}
else if (eventType == "DeleteOrMoveMsgCompleted") {
HandleDeleteOrMoveMsgCompleted(folder);
}
@@ -196,6 +217,9 @@ var folderListener = {
else if(eventType == "RenameCompleted") {
SelectFolder(folder.URI);
}
else if (eventType == "msgLoaded") {
OnMsgLoaded(folder, gCurrentDisplayedMessage);
}
}
}
@@ -269,6 +293,11 @@ function HandleDeleteOrMoveMsgFailed(folder)
function HandleDeleteOrMoveMsgCompleted(folder)
{
// you might not have a db view. this can happen if
// biff fires when the 3 pane is set to account central.
if (!gDBView)
return;
gDBView.onDeleteCompleted(true);
if (gNextMessageViewIndexAfterDelete != -2)
{
@@ -321,9 +350,15 @@ function HandleDeleteOrMoveMsgCompleted(folder)
if (treeView)
treeView.selectionChanged();
EnsureRowInThreadTreeIsVisible(gNextMessageViewIndexAfterDelete);
gDBView.suppressCommandUpdating = false;
// hook for extra toolbar items
// XXX I think there is a bug in the suppression code above.
// what if I have two rows selected, and I hit delete, and so we load the next row.
// what if I have commands that only enable where exactly one row is selected?
var observerService = Components.classes["@mozilla.org/observer-service;1"].getService(Components.interfaces.nsIObserverService);
observerService.notifyObservers(window, "mail:updateToolbarItems", null);
}
}
gNextMessageViewIndexAfterDelete = -2;
@@ -450,17 +485,25 @@ var gThreePaneIncomingServerListener = {
}
}
function OnLoadMessenger()
{
setTimeout(delayedOnLoadMessenger, 0);
}
/* Functions related to startup */
function OnLoadMessenger()
function delayedOnLoadMessenger()
{
AddMailOfflineObserver();
CreateMailWindowGlobals();
Create3PaneGlobals();
verifyAccounts(null);
HideAccountCentral();
loadStartPage();
// skip these for now, since account central is hidden
// and we are selecting the inbox by default
// and the start page is about:blank
//HideAccountCentral();
//loadStartPage();
InitMsgWindow();
messenger.SetWindow(window, msgWindow);
@@ -613,7 +656,7 @@ function loadStartFolder(initialUri)
// we don't persist the "open" state of news servers across sessions,
// but we do within a session, so if you open another 3 pane
// and a news server is "open", we'll update the unread counts.
PerformExpandForAllOpenServers();
//PerformExpandForAllOpenServers();
}
catch(ex)
{
@@ -1080,7 +1123,18 @@ function GetFirstSelectedMessage()
// Use this instead of gDBView.URIForFirstSelectedMessage, else it
// will return the currentIndex message instead of the highlighted
// message.
return GetSelectedMessages()[0];
//
// note, there may not be any selected messages
//
// XXX todo
// this is bad when we've got a lot of messages selected
// use gDBView.URIForFirstSelectedMessage or
// gDBView.hdrForFirstSelectedMessage
var selectedMessages = GetSelectedMessages();
if (selectedMessages)
return selectedMessages[0];
else
return null;
}
catch (ex) {
return null;

View File

@@ -77,10 +77,11 @@ nsMsgDBViewCommandUpdater.prototype =
UpdateMailToolbar("dbview driven, thread pane");
},
displayMessageChanged : function(aFolder, aSubject)
displayMessageChanged : function(aFolder, aSubject, aKeywords)
{
setTitleFromFolder(aFolder, aSubject);
gHaveLoadedMessage = true;
SetKeywords(aKeywords);
},
QueryInterface : function(iid)

View File

@@ -21,6 +21,7 @@ Rights Reserved.
-->
<?xml-stylesheet href="chrome://messenger/skin/threadPane.css" type="text/css"?>
<?xml-stylesheet href="chrome://messenger/skin/threadPaneExtras.css" type="text/css"?>
<?xml-stylesheet href="chrome://messenger/skin/threadPaneLabels.css" type="text/css"?>
<!DOCTYPE window SYSTEM "chrome://messenger/locale/threadpane.dtd">

View File

@@ -549,3 +549,30 @@ Rights Reserved.
<!ENTITY searchAddressesCmd.label "Search Addresses...">
<!ENTITY searchAddressesCmd.accesskey "S">
<!-- threadpane.dtd -->
<!ENTITY threadColumn.label "Thread">
<!ENTITY senderColumn.label "Sender">
<!ENTITY subjectColumn.label "Subject">
<!ENTITY dateColumn.label "Date">
<!ENTITY priorityColumn.label "Priority">
<!ENTITY labelColumn.label "Label">
<!ENTITY statusColumn.label "Status">
<!ENTITY sizeColumn.label "Size">
<!ENTITY linesColumn.label "Lines">
<!ENTITY unreadColumn.label "Unread">
<!ENTITY totalColumn.label "Total">
<!ENTITY orderReceivedColumn.label "Order Received">
<!ENTITY readColumn.label "Read">
<!ENTITY flagColumn.label "Flag">
<!ENTITY locationColumn.label "Location">
<!ENTITY threadColumnHeader.tooltip "Click to display message threads">
<!ENTITY columnChooser.tooltip "Click to select columns to display">
<!-- folderpane.dtd -->
<!ENTITY nameColumn.label "Name">
<!ENTITY unreadColumn.label "Unread">
<!ENTITY totalColumn.label "Total">
<!ENTITY accounts.label "Accounts">
<!-- LOCALIZATION NOTE (accounts.img) : DONT_TRANSLATE -->
<!ENTITY accounts.img "chrome://messenger/skin/local-mailhost.gif">

View File

@@ -1,10 +1,10 @@
#
# messenger.properties
# mailnews.js
mailnews.start_page.url=http://www.mozilla.org/mailnews/start.html
messenger.throbber.url=http://www.mozilla.org/
compose.throbber.url=http://www.mozilla.org/
addressbook.throbber.url=http://www.mozilla.org/
mailnews.start_page.url=about:blank
messenger.throbber.url=http://www.mozilla.org/mailnews/minotaur/index.html
compose.throbber.url=http://www.mozilla.org/mailnews/minotaur/index.html
addressbook.throbber.url=http://www.mozilla.org/mailnews/minotaur/index.html
# To make mapit buttons to disappear in the addressbook, specify empty string. For example:
# mail.addr_book.mapit_url.format=
# The format for "mail.addr_book.mapit_url.format" is:

View File

@@ -69,7 +69,7 @@ interface nsIMsgFilterList : nsISupports {
attribute nsIMsgFolder folder;
readonly attribute short version;
readonly attribute string arbitraryHeaders;
readonly attribute boolean shouldDownloadArbitraryHeaders;
readonly attribute boolean shouldDownloadAllHeaders;
readonly attribute unsigned long filterCount;
nsIMsgFilter getFilterAt(in unsigned long filterIndex);
nsIMsgFilter getFilterNamed(in wstring filterName);

View File

@@ -439,7 +439,7 @@ nsMsgSearchCommandUpdater.prototype =
// when the # of items in the selection has actually changed.
document.commandDispatcher.updateCommands('mail-search');
},
displayMessageChanged : function(aFolder, aSubject)
displayMessageChanged : function(aFolder, aSubject, aKeywords)
{
},

View File

@@ -985,7 +985,16 @@ NS_IMETHODIMP nsMsgFilterList::MatchOrChangeFilterTarget(const char *oldFolderUr
return rv;
}
NS_IMETHODIMP nsMsgFilterList::GetShouldDownloadArbitraryHeaders(PRBool *aResult)
// this would only return true if any filter was on "any header", which we
// don't support in 6.x
NS_IMETHODIMP nsMsgFilterList::GetShouldDownloadAllHeaders(PRBool *aResult)
{
*aResult = PR_FALSE;
return NS_OK;
}
// leaves m_arbitraryHeaders filed in with the arbitrary headers.
nsresult nsMsgFilterList::ComputeArbitraryHeaders()
{
nsresult rv = NS_OK;
if (m_arbitraryHeaders.Length() == 0)
@@ -1025,16 +1034,12 @@ NS_IMETHODIMP nsMsgFilterList::GetShouldDownloadArbitraryHeaders(PRBool *aResult
}
}
}
if (m_arbitraryHeaders.Length() > 0) //if any arbitraryHeaders;
*aResult=PR_TRUE;
return NS_OK;
return rv;
}
NS_IMETHODIMP nsMsgFilterList::GetArbitraryHeaders(char **aResult)
{
PRBool headers=PR_FALSE;
GetShouldDownloadArbitraryHeaders(&headers);
if (headers)
ComputeArbitraryHeaders();
*aResult = ToNewCString(m_arbitraryHeaders);
return NS_OK;
}

View File

@@ -83,6 +83,7 @@ protected:
void Dump();
#endif
protected:
nsresult ComputeArbitraryHeaders();
nsresult SaveTextFilters(nsIOFileStream *aStream);
// file streaming methods
char ReadChar(nsIOFileStream *aStream);

View File

@@ -73,6 +73,10 @@
#include "nsIContentViewer.h"
#include "nsIWebShell.h"
#ifndef ENABLE_BROWSER
#include "nsILinkHandler.h"
#endif
// embedding
#include "nsIWebBrowserPrint.h"
@@ -662,6 +666,41 @@ nsMessenger::OpenURL(const char * url)
return NS_OK;
}
#ifndef ENABLE_BROWSER
NS_IMETHODIMP
nsMessenger::LoadURL(nsIDOMWindowInternal *aWin, const char *aUrl)
{
nsresult rv;
nsCOMPtr<nsIScriptGlobalObject> globalObj = do_QueryInterface(aWin, &rv);
NS_ENSURE_SUCCESS(rv,rv);
nsCOMPtr <nsIDocShell> docShell;
rv = globalObj->GetDocShell(getter_AddRefs(docShell));
NS_ENSURE_SUCCESS(rv,rv);
if (!docShell)
return NS_ERROR_FAILURE;
nsCOMPtr<nsILinkHandler> lh = do_QueryInterface(docShell, &rv);
NS_ENSURE_SUCCESS(rv,rv);
// this works, because of the hack to nsWebShell.cpp
rv = lh->OnLinkClick(nsnull,
eLinkVerb_Replace,
NS_ConvertASCIItoUCS2(aUrl).get(),
nsnull,nsnull,nsnull);
NS_ENSURE_SUCCESS(rv,rv);
return rv;
}
#else
NS_IMETHODIMP
nsMessenger::LoadURL(nsIDOMWindowInternal *aWin, const char *url)
{
// if you are a browser, you should not be in here.
return NS_ERROR_UNEXPECTED;
}
#endif
nsresult
nsMessenger::SaveAttachment(nsIFileSpec * fileSpec,
const char * unescapedUrl,

View File

@@ -86,6 +86,7 @@ nsIAtom * nsMsgDBView::kAttachMsgAtom = nsnull;
nsIAtom * nsMsgDBView::kHasUnreadAtom = nsnull;
nsIAtom * nsMsgDBView::kWatchThreadAtom = nsnull;
nsIAtom * nsMsgDBView::kIgnoreThreadAtom = nsnull;
nsIAtom * nsMsgDBView::kHasImageAtom = nsnull;
nsIAtom * nsMsgDBView::mLabelPrefColorAtoms[PREF_LABELS_MAX] = {nsnull, nsnull, nsnull, nsnull, nsnull};
@@ -158,6 +159,7 @@ void nsMsgDBView::InitializeAtomsAndLiterals()
kHasUnreadAtom = NS_NewAtom("hasUnread");
kWatchThreadAtom = NS_NewAtom("watch");
kIgnoreThreadAtom = NS_NewAtom("ignore");
kHasImageAtom = NS_NewAtom("hasimage");
#ifdef SUPPORT_PRIORITY_COLORS
kHighestPriorityAtom = NS_NewAtom("priority-highest");
@@ -201,6 +203,7 @@ nsMsgDBView::~nsMsgDBView()
NS_IF_RELEASE(kHasUnreadAtom);
NS_IF_RELEASE(kWatchThreadAtom);
NS_IF_RELEASE(kIgnoreThreadAtom);
NS_IF_RELEASE(kHasImageAtom);
#ifdef SUPPORT_PRIORITY_COLORS
NS_IF_RELEASE(kHighestPriorityAtom);
@@ -497,7 +500,6 @@ nsresult nsMsgDBView::FetchAuthor(nsIMsgHdr * aHdr, PRUnichar ** aSenderString)
return NS_OK;
}
}
// if we got here then just return the original string
*aSenderString = nsCRT::strdup(unparsedAuthor);
return NS_OK;
@@ -880,7 +882,11 @@ nsresult nsMsgDBView::UpdateDisplayMessage(nsMsgKey aMsgKey)
NS_ENSURE_SUCCESS(rv,rv);
nsXPIDLString subject;
FetchSubject(msgHdr, m_flags[viewPosition], getter_Copies(subject));
mCommandUpdater->DisplayMessageChanged(m_folder, subject);
nsXPIDLCString keywords;
rv = msgHdr->GetStringProperty("keywords", getter_Copies(keywords));
NS_ENSURE_SUCCESS(rv,rv);
mCommandUpdater->DisplayMessageChanged(m_folder, subject, keywords);
} // if view position is valid
} // if we have an updater
return NS_OK;
@@ -1103,9 +1109,39 @@ NS_IMETHODIMP nsMsgDBView::GetCellProperties(PRInt32 aRow, const PRUnichar *colI
if ((mDeleteModel == nsMsgImapDeleteModels::IMAPDelete) && (flags & MSG_FLAG_IMAP_DELETED))
properties->AppendElement(kImapDeletedMsgAtom);
if (mRedirectorTypeAtom)
properties->AppendElement(mRedirectorTypeAtom);
if (mIsNews)
properties->AppendElement(kNewsMsgAtom);
nsXPIDLCString imageSize;
msgHdr->GetStringProperty("imageSize", getter_Copies(imageSize));
if (!imageSize.IsEmpty())
{
properties->AppendElement(kHasImageAtom);
}
nsXPIDLCString keywordProperty;
msgHdr->GetStringProperty("keywords", getter_Copies(keywordProperty));
if (!keywordProperty.IsEmpty())
{
nsCAutoString keywords(keywordProperty);
nsCAutoString nextKeyword;
PRInt32 spaceIndex = 0;
do
{
spaceIndex = keywords.FindChar(' ');
PRInt32 endOfKeyword = (spaceIndex == -1) ? keywords.Length() : spaceIndex;
keywords.Left(nextKeyword, endOfKeyword);
nextKeyword.Insert("kw-", 0);
nsCOMPtr <nsIAtom> keywordAtom = NS_NewAtom(nextKeyword.get());
properties->AppendElement(keywordAtom);
if (spaceIndex > 0)
keywords.Cut(0, endOfKeyword + 1);
}
while (spaceIndex > 0);
}
#ifdef SUPPORT_PRIORITY_COLORS
// add special styles for priority
nsMsgPriorityValue priority;
@@ -1562,6 +1598,16 @@ NS_IMETHODIMP nsMsgDBView::Open(nsIMsgFolder *folder, nsMsgViewSortTypeValue sor
nsXPIDLCString type;
rv = server->GetType(getter_Copies(type));
NS_ENSURE_SUCCESS(rv,rv);
// turn the redirector type into an atom
nsXPIDLCString redirectorType;
rv = server->GetRedirectorType(getter_Copies(redirectorType));
NS_ENSURE_SUCCESS(rv,rv);
if (redirectorType.IsEmpty())
mRedirectorTypeAtom = nsnull;
else
mRedirectorTypeAtom = getter_AddRefs(NS_NewAtom(redirectorType.get()));
mIsNews = !nsCRT::strcmp("nntp",type.get());
GetImapDeleteModel(nsnull);
// for sent, unsent and draft folders, be sure to set mIsSpecialFolder so we'll show the recipient field

View File

@@ -116,6 +116,7 @@ protected:
static nsIAtom* kHasUnreadAtom;
static nsIAtom* kWatchThreadAtom;
static nsIAtom* kIgnoreThreadAtom;
static nsIAtom* kHasImageAtom;
#ifdef SUPPORT_PRIORITY_COLORS
static nsIAtom* kHighestPriorityAtom;
@@ -326,6 +327,7 @@ protected:
nsCOMPtr <nsIMsgDatabase> m_db;
nsCOMPtr <nsIMsgFolder> m_folder;
nsCOMPtr <nsIAtom> mRedirectorTypeAtom;
nsWeakPtr m_searchSession;
nsMsgViewSortTypeValue m_sortType;
nsMsgViewSortOrderValue m_sortOrder;

View File

@@ -76,6 +76,7 @@ nsIRDFResource* nsMsgFolderDataSource::kNC_NameSort= nsnull;
nsIRDFResource* nsMsgFolderDataSource::kNC_FolderTreeNameSort= nsnull;
nsIRDFResource* nsMsgFolderDataSource::kNC_SpecialFolder= nsnull;
nsIRDFResource* nsMsgFolderDataSource::kNC_ServerType = nsnull;
nsIRDFResource* nsMsgFolderDataSource::kNC_RedirectorType = nsnull;
nsIRDFResource* nsMsgFolderDataSource::kNC_CanCreateFoldersOnServer = nsnull;
nsIRDFResource* nsMsgFolderDataSource::kNC_CanFileMessagesOnServer = nsnull;
nsIRDFResource* nsMsgFolderDataSource::kNC_IsServer = nsnull;
@@ -140,6 +141,7 @@ nsMsgFolderDataSource::nsMsgFolderDataSource()
rdf->GetResource(NC_RDF_FOLDERTREENAME_SORT, &kNC_FolderTreeNameSort);
rdf->GetResource(NC_RDF_SPECIALFOLDER, &kNC_SpecialFolder);
rdf->GetResource(NC_RDF_SERVERTYPE, &kNC_ServerType);
rdf->GetResource(NC_RDF_REDIRECTORTYPE, &kNC_RedirectorType);
rdf->GetResource(NC_RDF_CANCREATEFOLDERSONSERVER, &kNC_CanCreateFoldersOnServer);
rdf->GetResource(NC_RDF_CANFILEMESSAGESONSERVER, &kNC_CanFileMessagesOnServer);
rdf->GetResource(NC_RDF_ISSERVER, &kNC_IsServer);
@@ -208,6 +210,7 @@ nsMsgFolderDataSource::~nsMsgFolderDataSource (void)
NS_RELEASE2(kNC_FolderTreeNameSort, refcnt);
NS_RELEASE2(kNC_SpecialFolder, refcnt);
NS_RELEASE2(kNC_ServerType, refcnt);
NS_RELEASE2(kNC_RedirectorType, refcnt);
NS_RELEASE2(kNC_CanCreateFoldersOnServer, refcnt);
NS_RELEASE2(kNC_CanFileMessagesOnServer, refcnt);
NS_RELEASE2(kNC_IsServer, refcnt);
@@ -453,6 +456,7 @@ NS_IMETHODIMP nsMsgFolderDataSource::GetTargets(nsIRDFResource* source,
(kNC_CanRename == property) ||
(kNC_CanCompact == property) ||
(kNC_ServerType == property) ||
(kNC_RedirectorType == property) ||
(kNC_CanCreateFoldersOnServer == property) ||
(kNC_CanFileMessagesOnServer == property) ||
(kNC_NoSelect == property) ||
@@ -542,6 +546,7 @@ nsMsgFolderDataSource::HasArcOut(nsIRDFResource *aSource, nsIRDFResource *aArc,
aArc == kNC_FolderTreeSimpleName ||
aArc == kNC_SpecialFolder ||
aArc == kNC_ServerType ||
aArc == kNC_RedirectorType ||
aArc == kNC_CanCreateFoldersOnServer ||
aArc == kNC_CanFileMessagesOnServer ||
aArc == kNC_IsServer ||
@@ -608,6 +613,7 @@ nsMsgFolderDataSource::getFolderArcLabelsOut(nsISupportsArray **arcs)
(*arcs)->AppendElement(kNC_FolderTreeSimpleName);
(*arcs)->AppendElement(kNC_SpecialFolder);
(*arcs)->AppendElement(kNC_ServerType);
(*arcs)->AppendElement(kNC_RedirectorType);
(*arcs)->AppendElement(kNC_CanCreateFoldersOnServer);
(*arcs)->AppendElement(kNC_CanFileMessagesOnServer);
(*arcs)->AppendElement(kNC_IsServer);
@@ -1009,6 +1015,8 @@ nsresult nsMsgFolderDataSource::createFolderNode(nsIMsgFolder* folder,
rv = createFolderSpecialNode(folder,target);
else if ((kNC_ServerType == property))
rv = createFolderServerTypeNode(folder, target);
else if ((kNC_RedirectorType == property))
rv = createFolderRedirectorTypeNode(folder, target);
else if ((kNC_CanCreateFoldersOnServer == property))
rv = createFolderCanCreateFoldersOnServerNode(folder, target);
else if ((kNC_CanFileMessagesOnServer == property))
@@ -1173,10 +1181,24 @@ nsMsgFolderDataSource::createFolderServerTypeNode(nsIMsgFolder* folder,
rv = server->GetType(getter_Copies(serverType));
if (NS_FAILED(rv)) return rv;
nsAutoString type;
type.AssignWithConversion(serverType.get());
createNode(NS_ConvertASCIItoUCS2(serverType).get(), target, getRDFService());
return NS_OK;
}
createNode(type.get(), target, getRDFService());
nsresult
nsMsgFolderDataSource::createFolderRedirectorTypeNode(nsIMsgFolder* folder,
nsIRDFNode **target)
{
nsresult rv;
nsCOMPtr<nsIMsgIncomingServer> server;
rv = folder->GetServer(getter_AddRefs(server));
if (NS_FAILED(rv) || !server) return NS_ERROR_FAILURE;
nsXPIDLCString redirectorType;
rv = server->GetRedirectorType(getter_Copies(redirectorType));
if (NS_FAILED(rv)) return rv;
createNode(NS_ConvertASCIItoUCS2(redirectorType).get(), target, getRDFService());
return NS_OK;
}
@@ -2100,6 +2122,7 @@ nsresult nsMsgFolderDataSource::DoFolderHasAssertion(nsIMsgFolder *folder,
(kNC_FolderTreeSimpleName == property) ||
(kNC_SpecialFolder == property) ||
(kNC_ServerType == property) ||
(kNC_RedirectorType == property) ||
(kNC_CanCreateFoldersOnServer == property) ||
(kNC_CanFileMessagesOnServer == property) ||
(kNC_IsServer == property) ||

View File

@@ -133,6 +133,8 @@ protected:
nsresult createFolderSpecialNode(nsIMsgFolder *folder, nsIRDFNode **target);
nsresult createFolderServerTypeNode(nsIMsgFolder *folder,
nsIRDFNode **target);
nsresult createFolderRedirectorTypeNode(nsIMsgFolder *folder,
nsIRDFNode **target);
nsresult createFolderCanCreateFoldersOnServerNode(nsIMsgFolder *folder,
nsIRDFNode **target);
nsresult createFolderCanFileMessagesOnServerNode(nsIMsgFolder *folder,
@@ -219,6 +221,7 @@ protected:
static nsIRDFResource* kNC_MSGFolderRoot;
static nsIRDFResource* kNC_SpecialFolder;
static nsIRDFResource* kNC_ServerType;
static nsIRDFResource* kNC_RedirectorType;
static nsIRDFResource* kNC_CanCreateFoldersOnServer;
static nsIRDFResource* kNC_CanFileMessagesOnServer;
static nsIRDFResource* kNC_IsServer;

View File

@@ -81,6 +81,7 @@ typedef struct _nsMsgRDFNotification {
#define NC_RDF_FOLDER NC_NAMESPACE_URI "Folder"
#define NC_RDF_SPECIALFOLDER NC_NAMESPACE_URI "SpecialFolder"
#define NC_RDF_SERVERTYPE NC_NAMESPACE_URI "ServerType"
#define NC_RDF_REDIRECTORTYPE NC_NAMESPACE_URI "RedirectorType"
#define NC_RDF_CANCREATEFOLDERSONSERVER NC_NAMESPACE_URI "CanCreateFoldersOnServer"
#define NC_RDF_CANFILEMESSAGESONSERVER NC_NAMESPACE_URI "CanFileMessagesOnServer"
#define NC_RDF_ISSERVER NC_NAMESPACE_URI "IsServer"

View File

@@ -802,3 +802,13 @@ NS_IMETHODIMP nsMsgMailNewsUrl::SetMimeHeaders(nsIMimeHeaders *mimeHeaders)
mMimeHeaders = mimeHeaders;
return NS_OK;
}
NS_IMETHODIMP nsMsgMailNewsUrl::SetFolder(nsIMsgFolder * /* aFolder */)
{
return NS_ERROR_NOT_IMPLEMENTED;
}
NS_IMETHODIMP nsMsgMailNewsUrl::GetFolder(nsIMsgFolder ** /* aFolder */)
{
return NS_ERROR_NOT_IMPLEMENTED;
}

View File

@@ -267,7 +267,7 @@ void nsUInt32Array::CopyArray(nsUInt32Array &oldA)
if (m_pData)
PR_Free(m_pData);
m_nSize = oldA.m_nSize;
m_nMaxSize = oldA.m_nMaxSize;
m_nMaxSize = oldA.m_nSize;
m_pData = (PRUint32 *)PR_Malloc(m_nSize * sizeof(PRUint32));
if (m_pData)
memcpy(m_pData, oldA.m_pData, m_nSize * sizeof(PRUint32));

View File

@@ -29,7 +29,6 @@ var nsIMsgCompFormat = Components.interfaces.nsIMsgCompFormat;
var nsIAbPreferMailFormat = Components.interfaces.nsIAbPreferMailFormat;
var nsIPlaintextEditorMail = Components.interfaces.nsIPlaintextEditor;
/**
* In order to distinguish clearly globals that are initialized once when js load (static globals) and those that need to be
* initialize every time a compose window open (globals), I (ducarroz) have decided to prefix by s... the static one and
@@ -51,6 +50,7 @@ var sOther_header = "";
*/
var msgWindow = Components.classes["@mozilla.org/messenger/msgwindow;1"].createInstance();
const kDefaultFont = "Times New Roman";
/**
* Global variables, need to be re-initialized every time mostly because we need to release them when the window close
@@ -171,13 +171,23 @@ function enableEditableFields()
var gComposeRecyclingListener = {
onClose: function() {
//Reset recipients and attachments
awResetAllRows();
RemoveAllAttachments();
var ccField = document.getElementById("ccField");
var bccField = document.getElementById("bccField");
var toField = document.getElementById("toField");
toField.value = "";
bccField.value = "";
ccField.value = "";
//Hide bcc row again
var bccRow = document.getElementById("bccRow");
bccRow.hidden = true;
//We need to clear the identity popup menu in case the user will change them. It will be rebuilded later in ComposeStartup
//We need to clear the identity popup menu in case the user will change them. It will be rebuilded later in ComposeStartup
ClearIdentityListPopup(document.getElementById("msgIdentityPopup"));
RemoveAllAttachments();
//Clear the subject
document.getElementById("msgSubject").value = "";
SetComposeWindowTitle(13);
@@ -207,9 +217,9 @@ var gComposeRecyclingListener = {
var event = document.createEvent('Events');
event.initEvent('compose-window-close', false, true);
document.getElementById("msgcomposeWindow").dispatchEvent(event);
},
},
onReopen: function(params) {
onReopen: function(params) {
//Reset focus to work around bug 141648
var identityElement = document.getElementById("msgIdentity");
if (identityElement)
@@ -223,7 +233,7 @@ var gComposeRecyclingListener = {
var event = document.createEvent('Events');
event.initEvent('compose-window-reopen', false, true);
document.getElementById("msgcomposeWindow").dispatchEvent(event);
}
}
};
var stateListener = {
@@ -1041,9 +1051,10 @@ function setupLdapAutocompleteSession()
// succeeded; add the session for all recipients, and
// remember that we've done so
var autoCompleteWidget;
for (i=1; i <= awGetMaxRecipients(); i++)
var fields = ["to", "cc", "bcc"];
for (i=0; i < fields.length; ++i)
{
autoCompleteWidget = document.getElementById("addressCol2#" + i);
autoCompleteWidget = document.getElementById(fields[i] + "field");
if (autoCompleteWidget)
{
autoCompleteWidget.addSession(LDAPSession);
@@ -1064,9 +1075,10 @@ function setupLdapAutocompleteSession()
gCurrentAutocompleteDirectory = null;
}
if (gLDAPSession && gSessionAdded) {
for (i=1; i <= awGetMaxRecipients(); i++)
document.getElementById("addressCol2#" + i).
removeSession(gLDAPSession);
var fields = ["to", "cc", "bcc"];
for (i=0; i < fields.length; ++i) {
document.getElementById(fields[i] + "field").removeSession(gLDAPSession);
}
gSessionAdded = false;
}
}
@@ -1207,6 +1219,23 @@ function ComposeFieldsReady(msgType)
AdjustFocus();
}
function AdjustFocus()
{
var toField = document.getElementById("toField");
if (!toField.value) {
toField.focus();
return;
}
var msgSubject = document.getElementById("msgSubject");
if (!msgSubject.value) {
msgSubject.focus();
return;
}
editorShell.contentWindow.focus();
}
function ComposeStartup(recycled, aParams)
{
var params = null; // New way to pass parameters to the compose window as a nsIMsgComposeParameters object
@@ -1230,8 +1259,6 @@ function ComposeStartup(recycled, aParams)
var identityList = document.getElementById("msgIdentity");
var identityListPopup = document.getElementById("msgIdentityPopup");
document.addEventListener("keypress", awDocumentKeyPress, true);
if (identityListPopup)
FillIdentityListPopup(identityListPopup);
@@ -1317,6 +1344,7 @@ function ComposeStartup(recycled, aParams)
break;
}
}
LoadIdentity(true);
if (sMsgComposeService)
{
@@ -1399,6 +1427,11 @@ function ComposeStartup(recycled, aParams)
if (attachments)
for (i = 0; i < attachments.Count(); i ++)
AddAttachment(attachments.QueryElementAt(i, Components.interfaces.nsIMsgAttachment));
if (attachments.Count()) {
var attachmentBox = document.getElementById("attachments-box");
attachmentBox.hidden = false;
}
}
gMsgCompose.RegisterStateListener(stateListener);
@@ -1423,6 +1456,11 @@ function WizCallback(state)
}
function ComposeLoad()
{
setTimeout(DelayedComposeLoad, 0);
}
function DelayedComposeLoad()
{
// First get the preferences service
try {
@@ -1435,12 +1473,7 @@ function ComposeLoad()
dump("failed to preferences services\n");
}
try {
sOther_header = sPrefs.getCharPref("mail.compose.other.header");
}
catch (ex) {
dump("failed to get the mail.compose.other.header pref\n");
}
// add back support for mail.compose.other.header
AddMessageComposeOfflineObserver();
AddDirectoryServerObserver(true);
@@ -1480,6 +1513,27 @@ function ComposeLoad()
return;
}
window.tryToClose=ComposeCanClose;
// Populate the font dropdown
var fontsList = document.getElementById("FontFacePopup");
var fontEnumerator = Components.classes["@mozilla.org/gfx/fontenumerator;1"].createInstance(Components.interfaces.nsIFontEnumerator);
var fontName, fontNameStr, itemNode;
var fontArray = fontEnumerator.EnumerateAllFonts({});
for (var i = 0; i < fontArray.length; ++i) {
fontName = fontArray[i];
fontNameStr = fontName.toString();
itemNode = document.createElement("menuitem");
itemNode.setAttribute("value", fontNameStr);
itemNode.setAttribute("label", fontNameStr);
fontsList.appendChild(itemNode);
itemNode.setAttribute("style", itemNode.getAttribute("style") + " font-family: " + fontNameStr + " !important;");
}
var defaultSelection = fontsList.getElementsByAttribute("value", kDefaultFont)[0];
if (!defaultSelection)
defaultSelection = fontsList.firstChild;
document.getElementById("fontsMenulist").selectedItem = defaultSelection;
if (gLogComposePerformance)
sMsgComposeService.TimeStamp("Done with the initialization (ComposeLoad). Waiting on editor to load about:blank", false);
}
@@ -1620,10 +1674,16 @@ function GenericSendMessage( msgType )
var msgCompFields = gMsgCompose.compFields;
if (msgCompFields)
{
try {
Recipients2CompFields(msgCompFields);
var subject = document.getElementById("msgSubject").value;
msgCompFields.subject = subject;
Attachments2CompFields(msgCompFields);
}
catch(ex) {
alert(ex);
}
var event = document.createEvent('Events');
event.initEvent('compose-send-message', false, true);
@@ -1706,6 +1766,10 @@ function GenericSendMessage( msgType )
}
}
// hook for extra compose pre-processing
var observerService = Components.classes["@mozilla.org/observer-service;1"].getService(Components.interfaces.nsIObserverService);
observerService.notifyObservers(window, "mail:composeOnSend", null);
// Check if the headers of composing mail can be converted to a mail charset.
if (msgType == nsIMsgCompDeliverMode.Now ||
msgType == nsIMsgCompDeliverMode.Later ||
@@ -1995,7 +2059,6 @@ function getIdentityForKey(key)
return gAccountManager.getIdentity(key);
}
function SuppressComposeCommandUpdating(suppress)
{
gSuppressCommandUpdating = suppress;
@@ -2003,39 +2066,8 @@ function SuppressComposeCommandUpdating(suppress)
CommandUpdate_MsgCompose();
}
function AdjustFocus()
{
//dump("XXX adjusting focus\n");
SuppressComposeCommandUpdating(true);
var element = document.getElementById("addressCol2#" + awGetNumberOfRecipients());
if (element.value == "") {
//dump("XXX focus on address\n");
awSetFocus(awGetNumberOfRecipients(), element);
//awSetFocus() will call SuppressComposeCommandUpdating(false);
}
else
{
element = document.getElementById("msgSubject");
if (element.value == "") {
//dump("XXX focus on subject\n");
element.focus();
}
else {
//dump("XXX focus on body\n");
editorShell.contentWindow.focus();
}
SuppressComposeCommandUpdating(false);
}
}
function SetComposeWindowTitle(event)
{
/* dump("event = " + event + "\n"); */
/* only set the title when they hit return (or tab?)
*/
var newTitle = document.getElementById('msgSubject').value;
/* dump("newTitle = " + newTitle + "\n"); */
@@ -2195,6 +2227,9 @@ function AttachFile()
attachment.url = currentAttachment;
AddAttachment(attachment);
gContentChanged = true;
var attachmentBox = document.getElementById("attachments-box");
attachmentBox.hidden = false;
}
}
@@ -2307,6 +2342,7 @@ function RemoveAllAttachments()
// Let's release the attachment object hold by the node else it won't go away until the window is destroyed
child.attachment = null;
}
document.getElementById("attachments-box").setAttribute("hidden", "true");
}
function RemoveSelectedAttachment()
@@ -2316,12 +2352,15 @@ function RemoveSelectedAttachment()
if (bucket.selectedItems.length > 0) {
for (var item = bucket.selectedItems.length - 1; item >= 0; item-- )
{
child = bucket.removeChild(bucket.selectedItems[item]) = null;
child = bucket.removeChild(bucket.selectedItems[item]);
// Let's release the attachment object hold by the node else it won't go away until the window is destroyed
child.attachment = null;
}
gContentChanged = true;
}
if (!MessageHasAttachments())
document.getElementById("attachments-box").setAttribute("hidden", "true");
}
function FocusOnFirstAttachment()
@@ -2452,7 +2491,7 @@ function LoadIdentity(startup)
{
var prefstring = "mail.identity." + prevIdentity.key;
RemoveDirectoryServerObserver(prefstring);
var prevReplyTo = prevIdentity.replyTo;
var prevBcc = "";
if (prevIdentity.bccSelf)
prevBcc += prevIdentity.email;
@@ -2463,7 +2502,6 @@ function LoadIdentity(startup)
prevBcc += prevIdentity.bccList;
}
var newReplyTo = gCurrentIdentity.replyTo;
var newBcc = "";
if (gCurrentIdentity.bccSelf)
newBcc += gCurrentIdentity.email;
@@ -2477,15 +2515,6 @@ function LoadIdentity(startup)
var needToCleanUp = false;
var msgCompFields = gMsgCompose.compFields;
if (newReplyTo != prevReplyTo)
{
needToCleanUp = true;
if (prevReplyTo != "")
awRemoveRecipients(msgCompFields, "addr_reply", prevReplyTo);
if (newReplyTo != "")
awAddRecipients(msgCompFields, "addr_reply", newReplyTo);
}
if (newBcc != prevBcc)
{
needToCleanUp = true;
@@ -2521,9 +2550,9 @@ function setupAutocomplete()
if (!gAutocompleteSession) {
gAutocompleteSession = Components.classes["@mozilla.org/autocompleteSession;1?type=addrbook"].getService(Components.interfaces.nsIAbAutoCompleteSession);
if (gAutocompleteSession) {
var emailAddr = gCurrentIdentity.email;
var start = emailAddr.lastIndexOf("@");
gAutocompleteSession.defaultDomain = emailAddr.slice(start + 1, emailAddr.length);
//var emailAddr = gCurrentIdentity.email;
//var start = emailAddr.lastIndexOf("@");
//gAutocompleteSession.defaultDomain = emailAddr.slice(start + 1, emailAddr.length);
// if the pref is set to turn on the comment column, honor it here.
// this element then gets cloned for subsequent rows, so they should
@@ -2698,24 +2727,10 @@ function DisplaySaveFolderDlg(folderURI)
return;
}
function SetMsgAddressingWidgetTreeElementFocus()
{
SuppressComposeCommandUpdating(true);
var element = document.getElementById("msgRecipient#" + awGetNumberOfRecipients());
awSetFocus(awGetNumberOfRecipients(), element);
//awSetFocus() will call SuppressComposeCommandUpdating(false);
}
function SetMsgIdentityElementFocus()
{
// We're only changing focus from element to element.
// There's no need to update the composer commands.
SuppressComposeCommandUpdating(true);
GetMsgIdentityElement().focus();
SuppressComposeCommandUpdating(false);
var element = document.getElementById("toField");
element.focus();
}
function SetMsgSubjectElementFocus()
@@ -2743,19 +2758,11 @@ function SetMsgBodyFrameFocus()
function GetMsgAddressingWidgetTreeElement()
{
if (!gMsgAddressingWidgetTreeElement)
gMsgAddressingWidgetTreeElement = document.getElementById("addressingWidgetTree");
gMsgAddressingWidgetTreeElement = document.getElementById("toField");
return gMsgAddressingWidgetTreeElement;
}
function GetMsgIdentityElement()
{
if (!gMsgIdentityElement)
gMsgIdentityElement = document.getElementById("msgIdentity");
return gMsgIdentityElement;
}
function GetMsgSubjectElement()
{
if (!gMsgSubjectElement)
@@ -2799,7 +2806,6 @@ function IsMsgHeadersToolbarCollapsed()
function WhichElementHasFocus()
{
var msgIdentityElement = GetMsgIdentityElement();
var msgAddressingWidgetTreeElement = GetMsgAddressingWidgetTreeElement();
var msgSubjectElement = GetMsgSubjectElement();
var msgAttachmentElement = GetMsgAttachmentElement();
@@ -2811,8 +2817,7 @@ function WhichElementHasFocus()
var currentNode = top.document.commandDispatcher.focusedElement;
while (currentNode)
{
if (currentNode == msgIdentityElement ||
currentNode == msgAddressingWidgetTreeElement ||
if (currentNode == msgAddressingWidgetTreeElement ||
currentNode == msgSubjectElement ||
currentNode == msgAttachmentElement)
return currentNode;
@@ -2840,10 +2845,6 @@ function SwitchElementFocus(event)
{
if (IsMsgHeadersToolbarCollapsed())
SetMsgBodyFrameFocus();
else if (focusedElement == gMsgAddressingWidgetTreeElement)
SetMsgIdentityElementFocus();
else if (focusedElement == gMsgIdentityElement)
SetMsgBodyFrameFocus();
else if (focusedElement == gMsgBodyFrame)
{
// only set focus to the attachment element if there
@@ -2875,10 +2876,69 @@ function SwitchElementFocus(event)
}
else if (focusedElement == gMsgAttachmentElement)
SetMsgBodyFrameFocus();
else if (focusedElement == gMsgBodyFrame)
SetMsgIdentityElementFocus();
else
SetMsgAddressingWidgetTreeElementFocus();
}
}
function toggleBccRowVisibility()
{
var bccRow = document.getElementById("bccRow");
bccRow.hidden = !bccRow.hidden;
}
function toggleCcRowVisibility()
{
var ccRow = document.getElementById("ccRow");
ccRow.hidden = !ccRow.hidden;
}
function Recipients2CompFields(msgCompFields)
{
if (msgCompFields)
{
var toValue = document.getElementById("toField").value;
try {
msgCompFields.to = gMimeHeaderParser.reformatUnquotedAddresses(toValue);
} catch (ex) {
msgCompFields.to = toValue;
}
var ccValue = document.getElementById("ccField").value;
try {
msgCompFields.cc = gMimeHeaderParser.reformatUnquotedAddresses(ccValue);
} catch (ex) {
msgCompFields.cc = ccValue;
}
var bccValue = document.getElementById("bccField").value;
try {
msgCompFields.bcc = gMimeHeaderParser.reformatUnquotedAddresses(bccValue);
} catch (ex) {
msgCompFields.bcc = bccValue;
}
gMimeHeaderParser = null;
}
else
dump("Message Compose Error: msgCompFields is null (ExtractRecipients)");
}
function CompFields2Recipients(msgCompFields, msgType)
{
if (msgCompFields) {
top.MAX_RECIPIENTS = 0;
var msgReplyTo = msgCompFields.replyTo;
var msgTo = msgCompFields.to;
var msgCC = msgCompFields.cc;
var msgBCC = msgCompFields.bcc;
if(msgTo)
document.getElementById("toField").value = msgTo;
if(msgCC)
document.getElementById("ccField").value = msgCC;
if(msgBCC)
document.getElementById("bccField").value = msgBCC;
}
}

View File

@@ -1,39 +1,3 @@
/* ***** BEGIN LICENSE BLOCK *****
* Version: NPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Netscape Public License
* Version 1.1 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
* http://www.mozilla.org/NPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is
* Netscape Communications Corporation.
* Portions created by the Initial Developer are Copyright (C) 1998
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the NPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the NPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
top.MAX_RECIPIENTS = 0;
var inputElementType = "";
@@ -114,52 +78,28 @@ function Recipients2CompFields(msgCompFields)
{
if (msgCompFields)
{
var i = 1;
var addrTo = "";
var addrCc = "";
var addrBcc = "";
var addrReply = "";
var addrNg = "";
var addrFollow = "";
var addrOther = "";
var to_Sep = "";
var cc_Sep = "";
var bcc_Sep = "";
var reply_Sep = "";
var ng_Sep = "";
var follow_Sep = "";
var toValue = document.getElementById("toField").value;
try {
msgCompFields.to = gMimeHeaderParser.reformatUnquotedAddresses(toValue);
} catch (ex) {
msgCompFields.to = toValue;
}
var inputField;
while ((inputField = awGetInputElement(i)))
{
var fieldValue = inputField.value;
var ccValue = document.getElementById("ccField").value;
try {
msgCompFields.cc = gMimeHeaderParser.reformatUnquotedAddresses(ccValue);
} catch (ex) {
msgCompFields.cc = ccValue;
}
if (fieldValue == null)
fieldValue = inputField.getAttribute("value");
var bccValue = document.getElementById("bccField").value;
try {
msgCompFields.bcc = gMimeHeaderParser.reformatUnquotedAddresses(bccValue);
} catch (ex) {
msgCompFields.bcc = bccValue;
}
if (fieldValue != "")
{
switch (awGetPopupElement(i).selectedItem.getAttribute("value"))
{
case "addr_to" : addrTo += to_Sep + fieldValue; to_Sep = ","; break;
case "addr_cc" : addrCc += cc_Sep + fieldValue; cc_Sep = ","; break;
case "addr_bcc" : addrBcc += bcc_Sep + fieldValue; bcc_Sep = ","; break;
case "addr_reply" : addrReply += reply_Sep + fieldValue; reply_Sep = ","; break;
case "addr_newsgroups" : addrNg += ng_Sep + fieldValue; ng_Sep = ","; break;
case "addr_followup" : addrFollow += follow_Sep + fieldValue; follow_Sep = ","; break;
case "addr_other" : addrOther += sOther_header + ": " + fieldValue + "\n"; break;
}
}
i ++;
}
msgCompFields.to = addrTo;
msgCompFields.cc = addrCc;
msgCompFields.bcc = addrBcc;
msgCompFields.replyTo = addrReply;
msgCompFields.newsgroups = addrNg;
msgCompFields.followupTo = addrFollow;
msgCompFields.otherRandomHeaders = addrOther;
gMimeHeaderParser = null;
}
else
dump("Message Compose Error: msgCompFields is null (ExtractRecipients)");
@@ -168,199 +108,21 @@ function Recipients2CompFields(msgCompFields)
function CompFields2Recipients(msgCompFields, msgType)
{
if (msgCompFields) {
var listbox = document.getElementById('addressingWidget');
var newListBoxNode = listbox.cloneNode(false);
var listBoxColsClone = listbox.firstChild.cloneNode(true);
newListBoxNode.appendChild(listBoxColsClone);
var templateNode = listbox.getElementsByTagName("listitem")[0];
top.MAX_RECIPIENTS = 0;
var msgReplyTo = msgCompFields.replyTo;
var msgTo = msgCompFields.to;
var msgCC = msgCompFields.cc;
var msgBCC = msgCompFields.bcc;
var msgRandomHeaders = msgCompFields.otherRandomHeaders;
var msgNewsgroups = msgCompFields.newsgroups;
var msgFollowupTo = msgCompFields.followupTo;
if(msgReplyTo)
awSetInputAndPopupFromArray(msgCompFields.SplitRecipients(msgReplyTo, false),
"addr_reply", newListBoxNode, templateNode);
if(msgTo)
awSetInputAndPopupFromArray(msgCompFields.SplitRecipients(msgTo, false),
"addr_to", newListBoxNode, templateNode);
document.getElementById("toField").value = msgTo;
if(msgCC)
awSetInputAndPopupFromArray(msgCompFields.SplitRecipients(msgCC, false),
"addr_cc", newListBoxNode, templateNode);
document.getElementById("ccField").value = msgCC;
if(msgBCC)
awSetInputAndPopupFromArray(msgCompFields.SplitRecipients(msgBCC, false),
"addr_bcc", newListBoxNode, templateNode);
if(msgRandomHeaders)
awSetInputAndPopup(msgRandomHeaders, "addr_other", newListBoxNode, templateNode);
if(msgNewsgroups)
awSetInputAndPopup(msgNewsgroups, "addr_newsgroups", newListBoxNode, templateNode);
if(msgFollowupTo)
awSetInputAndPopup(msgFollowupTo, "addr_followup", newListBoxNode, templateNode);
//If it's a new message, we need to add an extrat empty recipient.
if (!msgTo && !msgNewsgroups)
_awSetInputAndPopup("", "addr_to", newListBoxNode, templateNode);
// dump("replacing child in comp fields 2 recips \n");
var parent = listbox.parentNode;
parent.replaceChild(newListBoxNode, listbox);
awFitDummyRows(2);
setTimeout("awFinishCopyNodes();", 0);
document.getElementById("bccField").value = msgBCC;
}
}
function awSetInputAndPopupValue(inputElem, inputValue, popupElem, popupValue, rowNumber)
{
// remove leading spaces
while (inputValue && inputValue[0] == " " )
inputValue = inputValue.substring(1, inputValue.length);
inputElem.setAttribute("value", inputValue);
inputElem.value = inputValue;
popupElem.selectedItem = popupElem.childNodes[0].childNodes[awGetSelectItemIndex(popupValue)];
if (rowNumber >= 0)
{
inputElem.setAttribute("id", "addressCol2#" + rowNumber);
popupElem.setAttribute("id", "addressCol1#" + rowNumber);
}
_awSetAutoComplete(popupElem, inputElem);
}
function _awSetInputAndPopup(inputValue, popupValue, parentNode, templateNode)
{
top.MAX_RECIPIENTS++;
var newNode = templateNode.cloneNode(true);
parentNode.appendChild(newNode); // we need to insert the new node before we set the value of the select element!
var input = newNode.getElementsByTagName(awInputElementName());
var select = newNode.getElementsByTagName(awSelectElementName());
if (input && input.length == 1 && select && select.length == 1)
awSetInputAndPopupValue(input[0], inputValue, select[0], popupValue, top.MAX_RECIPIENTS)
}
function awSetInputAndPopup(inputValue, popupValue, parentNode, templateNode)
{
if ( inputValue && popupValue )
{
var addressArray = inputValue.split(",");
for ( var index = 0; index < addressArray.length; index++ )
_awSetInputAndPopup(addressArray[index], popupValue, parentNode, templateNode);
}
}
function awSetInputAndPopupFromArray(inputArray, popupValue, parentNode, templateNode)
{
if ( inputArray && popupValue )
{
for ( var index = 0; index < inputArray.count; index++ )
_awSetInputAndPopup(inputArray.StringAt(index), popupValue, parentNode, templateNode);
}
}
function awRemoveRecipients(msgCompFields, recipientType, recipientsList)
{
if (!msgCompFields)
return;
var recipientArray = msgCompFields.SplitRecipients(recipientsList, false);
if (! recipientArray)
return;
for ( var index = 0; index < recipientArray.count; index++ )
for (var row = 1; row <= top.MAX_RECIPIENTS; row ++)
{
var popup = awGetPopupElement(row);
if (popup.selectedItem.getAttribute("value") == recipientType)
{
var input = awGetInputElement(row);
if (input.value == recipientArray.StringAt(index))
{
awSetInputAndPopupValue(input, "", popup, "addr_to", -1);
break;
}
}
}
}
function awAddRecipients(msgCompFields, recipientType, recipientsList)
{
if (!msgCompFields)
return;
var recipientArray = msgCompFields.SplitRecipients(recipientsList, false);
if (! recipientArray)
return;
for ( var index = 0; index < recipientArray.count; index++ )
{
for (var row = 1; row <= top.MAX_RECIPIENTS; row ++)
{
if (awGetInputElement(row).value == "")
break;
}
if (row > top.MAX_RECIPIENTS)
awAppendNewRow(false);
awSetInputAndPopupValue(awGetInputElement(row), recipientArray.StringAt(index), awGetPopupElement(row), recipientType, row);
/* be sure we still have an empty row left at the end */
if (row == top.MAX_RECIPIENTS)
{
awAppendNewRow(true);
awSetInputAndPopupValue(awGetInputElement(top.MAX_RECIPIENTS), "", awGetPopupElement(top.MAX_RECIPIENTS), "addr_to", top.MAX_RECIPIENTS);
}
}
}
function awTestRowSequence()
{
/*
This function is for debug and testing purpose only, normal user should not run it!
Everytime we insert or delete a row, we must be sure we didn't break the ID sequence of
the addressing widget rows. This function will run a quick test to see if the sequence still ok
You need to define the pref mail.debug.test_addresses_sequence to true in order to activate it
*/
if (! test_addresses_sequence)
return true;
/* debug code to verify the sequence still good */
var listbox = document.getElementById('addressingWidget');
var listitems = listbox.getElementsByTagName('listitem');
if (listitems.length >= top.MAX_RECIPIENTS )
{
for (var i = 1; i <= listitems.length; i ++)
{
var item = listitems [i - 1];
var inputID = item.getElementsByTagName(awInputElementName())[0].getAttribute("id").split("#")[1];
var popupID = item.getElementsByTagName(awSelectElementName())[0].getAttribute("id").split("#")[1];
if (inputID != i || popupID != i)
{
dump("#ERROR: sequence broken at row " + i + ", inputID=" + inputID + ", popupID=" + popupID + "\n");
return false;
}
dump("---SEQUENCE OK---\n");
return true;
}
}
else
dump("#ERROR: listitems.length(" + listitems.length + ") < top.MAX_RECIPIENTS(" + top.MAX_RECIPIENTS + ")\n");
return false;
}
function awResetAllRows()
{
var maxRecipients = top.MAX_RECIPIENTS;
@@ -407,46 +169,6 @@ function awDeleteRow(rowToDelete)
awTestRowSequence();
}
function awClickEmptySpace(target, setFocus)
{
if (target == null ||
(target.localName != "listboxbody" &&
target.localName != "listcell" &&
target.localName != "listitem"))
return;
var lastInput = awGetInputElement(top.MAX_RECIPIENTS);
if ( lastInput && lastInput.value )
awAppendNewRow(setFocus);
else
if (setFocus)
awSetFocus(top.MAX_RECIPIENTS, lastInput);
}
function awReturnHit(inputElement)
{
var row = awGetRowByInputElement(inputElement);
var nextInput = awGetInputElement(row+1);
if ( !nextInput )
{
if ( inputElement.value )
awAppendNewRow(true);
else // No address entered, switch to Subject field
{
var subjectField = document.getElementById( 'msgSubject' );
subjectField.select();
subjectField.focus();
}
}
else
{
nextInput.select();
awSetFocus(row+1, nextInput);
}
}
function awDeleteHit(inputElement)
{
var row = awGetRowByInputElement(inputElement);
@@ -472,9 +194,6 @@ function awDeleteHit(inputElement)
function awInputChanged(inputElement)
{
dump("awInputChanged\n");
// AutoCompleteAddress(inputElement);
//Do we need to add a new row?
var lastInput = awGetInputElement(top.MAX_RECIPIENTS);
if ( lastInput && lastInput.value && !top.doNotCreateANewRow)
@@ -625,44 +344,6 @@ function awSetFocus(row, inputElement)
setTimeout("_awSetFocus();", 0);
}
function _awSetFocus()
{
var listbox = document.getElementById('addressingWidget');
//try
//{
var theNewRow = awGetListItem(top.awRow);
//temporary patch for bug 26344
awFinishCopyNode(theNewRow);
//Warning: firstVisibleRow is zero base but top.awRow is one base!
var firstVisibleRow = listbox.getIndexOfFirstVisibleRow();
var numOfVisibleRows = listbox.getNumberOfVisibleRows();
//Do we need to scroll in order to see the selected row?
if (top.awRow <= firstVisibleRow)
listbox.scrollToIndex(top.awRow - 1);
else
if (top.awRow - 1 >= (firstVisibleRow + numOfVisibleRows))
listbox.scrollToIndex(top.awRow - numOfVisibleRows);
top.awInputElement.focus();
// stop supressing command updating and update the toolbar, since focus has changed
SuppressComposeCommandUpdating(false);
/*}
catch(ex)
{
top.awFocusRetry ++;
if (top.awFocusRetry < 3)
{
dump("_awSetFocus failed, try it again...\n");
setTimeout("_awSetFocus();", 0);
}
else
dump("_awSetFocus failed, forget about it!\n");
}*/
}
//temporary patch for bug 26344 & 26528
function awFinishCopyNode(node)
{
@@ -677,30 +358,6 @@ function awFinishCopyNodes()
awFinishCopyNode(listbox);
}
function awTabFromRecipient(element, event)
{
//If we are le last element in the listbox, we don't want to create a new row.
if (element == awGetInputElement(top.MAX_RECIPIENTS))
top.doNotCreateANewRow = true;
var row = awGetRowByInputElement(element);
if (!event.shiftKey && row < top.MAX_RECIPIENTS) {
var listBoxRow = row - 1; // listbox row indices are 0-based, ours are 1-based.
var listBox = document.getElementById("addressingWidget");
listBox.listBoxObject.ensureIndexIsVisible(listBoxRow + 1);
}
}
function awTabFromMenulist(element, event)
{
var row = awGetRowByInputElement(element);
if (event.shiftKey && row > 1) {
var listBoxRow = row - 1; // listbox row indices are 0-based, ours are 1-based.
var listBox = document.getElementById("addressingWidget");
listBox.listBoxObject.ensureIndexIsVisible(listBoxRow - 1);
}
}
function awGetNumberOfRecipients()
{
return top.MAX_RECIPIENTS;
@@ -770,12 +427,6 @@ function awSetAutoComplete(rowNumber)
_awSetAutoComplete(selectElem, inputElem)
}
function awRecipientTextCommand(userAction, element)
{
if (userAction == "typing" || userAction == "scrolling")
awReturnHit(element);
}
// Called when an autocomplete session item is selected and the status of
// the session it was selected from is nsIAutoCompleteStatus::failureItems.
//
@@ -864,15 +515,6 @@ function awKeyDown(event, listboxElement)
}
}
function awMenulistKeyPress(event, element)
{
switch(event.keyCode) {
case 9:
awTabFromMenulist(element, event);
break;
}
}
/* ::::::::::: addressing widget dummy rows ::::::::::::::::: */
var gAWContentHeight = 0;
@@ -980,12 +622,3 @@ function awSizerMouseUp()
document.removeEventListener("mousemove", awSizerMouseUp, false);
document.removeEventListener("mouseup", awSizerMouseUp, false);
}
function awDocumentKeyPress(event)
{
try {
var id = event.target.getAttribute('id');
if (id.substr(0, 11) == 'addressCol1')
awMenulistKeyPress(event, event.target);
} catch (e) { }
}

View File

@@ -0,0 +1,27 @@
<!--
The contents of this file are subject to the Netscape Public
License Version 1.1 (the "License"); you may not use this file
except in compliance with the License. You may obtain a copy of
the License at http://www.mozilla.org/NPL/
Software distributed under the License is distributed on an "AS
IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
implied. See the License for the specific language governing
rights and limitations under the License.
The Original Code is Mozilla Communicator client code, released
March 31, 1998.
The Initial Developer of the Original Code is Netscape
Communications Corporation. Portions created by Netscape are
Copyright (C) 1998-1999 Netscape Communications Corporation. All
Rights Reserved.
-->
<overlay
xmlns:nc="http://home.netscape.com/NC-rdf#"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<!-- plug in your mail compose window extras here. -->
</overlay>

View File

@@ -1,41 +1,17 @@
<?xml version="1.0"?>
<!--
- The contents of this file are subject to the Netscape Public
- License Version 1.1 (the "License"); you may not use this file
- except in compliance with the License. You may obtain a copy of
- the License at http://www.mozilla.org/NPL/
-
- Software distributed under the License is distributed on an "AS
- IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
- implied. See the License for the specific language governing
- rights and limitations under the License.
-
- The Original Code is Mozilla Communicator client code, released
- March 31, 1998.
-
- The Initial Developer of the Original Code is Netscape
- Communications Corporation. Portions created by Netscape are
- Copyright (C) 1999 Netscape Communications Corporation. All
- Rights Reserved.
-
- Contributor(s):
- Ben Goodger <ben@netscape.com> (ass'td polish fixes)
- Hkan Waara <hwaara@chello.se>
-->
<?xml-stylesheet href="chrome://messenger/skin/messengercompose/messengercompose.css" type="text/css"?>
<?xml-stylesheet href="chrome://messenger/skin/folderMenus.css" type="text/css"?>
<?xml-stylesheet href="chrome://editor/skin/editorFormatToolbar.css" type="text/css"?>
<?xml-stylesheet href="chrome://messenger/skin/addressingWidget.css" type="text/css"?>
<?xul-overlay href="chrome://global/content/charsetOverlay.xul"?>
<?xul-overlay href="chrome://communicator/content/tasksOverlay.xul"?>
<?xul-overlay href="chrome://communicator/content/communicatorOverlay.xul"?>
<?xul-overlay href="chrome://messenger/content/messengercompose/addressingWidgetOverlay.xul"?>
<?xul-overlay href="chrome://global/content/globalOverlay.xul"?>
<?xul-overlay href="chrome://communicator/content/utilityOverlay.xul"?>
<?xul-overlay href="chrome://editor/content/editorOverlay.xul"?>
<?xul-overlay href="chrome://messenger/content/messengercompose/mailComposeExtrasOverlay.xul"?>
<!DOCTYPE window [
<!ENTITY % messengercomposeDTD SYSTEM "chrome://messenger/locale/messengercompose/messengercompose.dtd" >
@@ -67,9 +43,9 @@
<script type="application/x-javascript" src="chrome://messenger/content/accountUtils.js"/>
<script type="application/x-javascript" src="chrome://messenger/content/widgetglue.js"/>
<script type="application/x-javascript" src="chrome://messenger/content/mail-offline.js"/>
<script type="application/x-javascript" src="chrome://editor/content/editor.js"/>
<!--script type="application/x-javascript" src="chrome://editor/content/EditorCommandsDebug.js"/-->
<script type="application/x-javascript" src="chrome://messenger/content/messengercompose/MsgComposeCommands.js"/>
<!-- <script type="application/x-javascript" src="chrome://messenger/content/messengercompose/addressingWidgetOverlay.js"/> -->
<script type="application/x-javascript" src="chrome://editor/content/editor.js"/>
<!-- drag and drop -->
<script type="application/x-javascript" src="chrome://global/content/nsDragAndDrop.js"/>
@@ -95,6 +71,7 @@
<commandset id="tasksCommands"/>
<command id="cmd_quit"/>
<!-- File Menu -->
<!-- in stand alone mail, no nav, no editor -->
<command id="cmd_newNavigator"/>
<command id="cmd_newEditor"/>
<command id="cmd_new" oncommand="goDoCommand('cmd_newMessage')"/>
@@ -140,6 +117,7 @@
<keyset id="tasksKeys">
<!-- File Menu -->
<!-- in stand alone mail, no nav, no editor -->
<key id="key_newNavigator"/>
<key id="key_newBlankPage"/>
<key id="key_close"/>
@@ -201,6 +179,7 @@
<menu id="menu_New">
<menupopup id="menu_NewPopup">
<menuitem label="&newMessage.label;" accesskey="&newMessage.accesskey;" key="key_newMessage" oncommand="goOpenNewMessage();"/>
<!-- in stand alone mail, no nav, no editor -->
<menuseparator/>
<menuitem id="menu_newNavigator"/>
<menuitem id="menu_newEditor"/>
@@ -245,13 +224,23 @@
<menuitem label="&findAgainCmd.label;" key="key_findNext" accesskey="&findAgainCmd.accesskey;" command="cmd_findNext"/>
<menuseparator/>
<menuitem label="&accountManagerCmd.label;" accesskey="&accountManagerCmd.accesskey;" command="cmd_account"/>
<menuitem id="menu_preferences" oncommand="goDoCommand('cmd_preferences')"/>
<menuitem id="menu_preferences" oncommand="goPreferences('messenger.xul','chrome://messenger/content/pref-mailnews.xul','mailnews')"/>
</menupopup>
</menu>
<menu id="menu_View">
<menupopup id="menu_View_Popup">
<menu id="menu_Toolbars">
<menupopup>
<menuitem id="toggleCcRowVisibility"
label="&toggleCcRow.label;"
accesskey="&toggleCcRow.label;"
type="checkbox"
oncommand="toggleCcRowVisibility();"/>
<menuitem id="toggleBccRowVisibility"
label="&toggleBccRow.label;"
accesskey="&toggleBccRow.label;"
type="checkbox"
oncommand="toggleBccRowVisibility();"/>
<menuitem id="menu_showComposeToolbar"
type="checkbox"
label="&showComposeToolbarCmd.label;"
@@ -411,32 +400,77 @@
</hbox>
</hbox>
</toolbar>
</toolbox>
<toolbar id="MsgHeadersToolbar" persist="collapsed" flex="1"
<toolbar id="MsgHeadersToolbar" persist="collapsed"
tborient="vertical" tbalign="stretch"
grippytooltiptext="&addressBar.tooltip;">
<hbox id="msgheaderstoolbar-box" flex="1">
<vbox flex="1" id="addresses-box">
<hbox align="center">
<label value="&fromAddr.label;"/>
<menulist id="msgIdentity" label="..." flex="1" oncommand="LoadIdentity(false);">
<menupopup id="msgIdentityPopup"/>
</menulist>
</hbox>
<listbox id="addressingWidget" flex="1"/>
<hbox align="center">
<label value="&subject.label;" accesskey="&subject.accesskey;"/>
<textbox id="msgSubject" flex="1" class="toolbar" disableonsend="true"
onkeyup="SetComposeWindowTitle(event.which);"
onkeypress="subjectKeyPress(event);"
oninput="gContentChanged=true;"/>
</hbox>
</vbox>
<splitter id="attachmentbucket-sizer" collapse="after"/>
<vbox id="attachments-box">
<vbox id="addresses-box" flex="1">
<grid>
<columns>
<column/>
<column flex="1"/>
</columns>
<rows>
<row flex="1">
<hbox align="center" pack="end">
<label value="&fromAddr.label;"/>
</hbox>
<menulist id="msgIdentity" label="..." flex="1" oncommand="LoadIdentity(false);">
<menupopup id="msgIdentityPopup"/>
</menulist>
</row>
<row flex="1">
<hbox align="center" pack="end">
<label value="&toField.label;"/>
</hbox>
<textbox id="toField" type="autocomplete" flex="1"
searchSessions="addrbook" timeout="20" maxrows="4"
autoFill="true" autoFillAfterMatch="true" forceComplete="true"
minResultsForPopup="3"
onerrorcommand="awRecipientErrorCommand(eventParam, this)"
oninput="gContentChanged=true; setupAutocomplete();" disableonsend="true"/>
</row>
<row flex="1" id="ccRow">
<hbox align="center" pack="end">
<label value="&ccField.label;"/>
</hbox>
<textbox id="ccField" type="autocomplete" flex="1"
searchSessions="addrbook" timeout="20" maxrows="4"
autoFill="true" autoFillAfterMatch="true" forceComplete="true"
minResultsForPopup="3"
onerrorcommand="awRecipientErrorCommand(eventParam, this)"
oninput="gContentChanged=true; setupAutocomplete();" disableonsend="true"/>
</row>
<row flex="1" id="bccRow" hidden="true">
<hbox align="center" pack="end">
<label value="&bccField.label;"/>
</hbox>
<textbox id="bccField" type="autocomplete" flex="1"
searchSessions="addrbook" timeout="20" maxrows="4"
autoFill="true" autoFillAfterMatch="true" forceComplete="true"
minResultsForPopup="3"
onerrorcommand="awRecipientErrorCommand(eventParam, this)"
oninput="gContentChanged=true; setupAutocomplete();" disableonsend="true"/>
</row>
<row flex="1">
<hbox align="center" pack="end">
<label value="&subject.label;" accesskey="&subject.accesskey;" control="msgSubject"/>
</hbox>
<textbox id="msgSubject" flex="1" disableonsend="true"
onkeyup="SetComposeWindowTitle();"
onkeypress="subjectKeyPress(event);"
oninput="gContentChanged=true;"/>
</row>
</rows>
</grid>
</vbox>
<vbox id="attachments-box" hidden="true">
<label id="attachmentBucketText" value="&attachments.label;" crop="right"
accesskey="&attachments.accesskey;"/>
<listbox id="attachmentBucket" flex="1" rows="4"
<listbox id="attachmentBucket" flex="1" rows="2"
context="msgComposeAttachmentContext"
onkeypress="if (event.keyCode == 8 || event.keyCode == 46) RemoveSelectedAttachment();"
onclick="AttachmentBucketClicked(event);"
@@ -449,8 +483,10 @@
<!-- These toolbar items get filled out from the editorOverlay -->
<toolbar class="chromeclass-toolbar" id="FormatToolbar" persist="collapsed" tbautostretch="never" grippytooltiptext="&formatToolbar.tooltip;">
<menulist id="ParagraphSelect"/>
<menulist id="FontFaceSelect"/>
<menulist id="fontsMenulist" style="max-width: 15em;">
<observes element="cmd_fontFace" attribute="state" onbroadcast="onFontFaceChange(this.parentNode, 'cmd_fontFace')"/>
<menupopup id="FontFacePopup" oncommand="doStatefulCommand('cmd_fontFace', event.target.value);"/>
</menulist>
<stack id="ColorButtons"/>
<toolbarbutton id="DecreaseFontSizeButton"/>
<toolbarbutton id="IncreaseFontSizeButton"/>
@@ -461,19 +497,25 @@
<toolbarseparator class="toolbarseparator-standard"/>
<toolbarbutton id="ulButton"/>
<toolbarbutton id="olButton"/>
<toolbarbutton id="outdentButton"/>
<toolbarbutton id="indentButton"/>
<toolbarseparator class="toolbarseparator-standard"/>
<toolbarbutton id="AlignPopupButton"/>
<toolbarbutton id="InsertPopupButton"/>
<toolbarbutton id="AlignLeftItem" oncommand="doStatefulCommand('cmd_align', 'left')">
<observes element="cmd_align" attribute="disabled"/>
</toolbarbutton>
<toolbarbutton id="AlignCenterItem" oncommand="doStatefulCommand('cmd_align', 'center')">
<observes element="cmd_align" attribute="disabled"/>
</toolbarbutton>
<toolbarbutton id="AlignRightItem" oncommand="doStatefulCommand('cmd_align', 'right')">
<observes element="cmd_align" attribute="disabled"/>
</toolbarbutton>
<toolbarseparator class="toolbarseparator-standard"/>
<toolbarbutton id="InsertLinkItem" class="insert" command="cmd_link"/>
<toolbarbutton id="InsertImageItem" class="insert" command="cmd_image"/>
<toolbarbutton id="smileButtonMenu" padwithspace="true"/>
<spacer flex="1"/>
</toolbar>
</toolbox>
<splitter id="compose-toolbar-sizer" onmousedown="awSizerListen()" collapse="after"/>
<!--<splitter id="compose-toolbar-sizer" onmousedown="awSizerListen()" collapse="after"/>-->
<!-- The mail message body frame -->
<vbox id="appcontent" flex="1">
<editor type="content-primary" id="content-frame" src="about:blank" name="browser.message.body" flex="1"
onkeypress="editorKeyPress(event);" context="msgComposeContext"/>

View File

@@ -206,3 +206,25 @@
<!ENTITY selectAll.accesskey "A">
<!ENTITY addAttachment.label "Add Attachment">
<!ENTITY addAttachment.accesskey "t">
<!ENTITY toField.label "To:">
<!ENTITY ccField.label "Cc:">
<!ENTITY bccField.label "Bcc:">
<!ENTITY toBtn.label "To">
<!ENTITY ccBtn.label "Cc">
<!ENTITY bccBtn.label "Bcc">
<!ENTITY toggleCcRow.label "Show Cc Field">
<!ENTITY toggleCcRow.accesskey "c">
<!ENTITY toggleBccRow.label "Show Bcc Field">
<!ENTITY toggleBccRow.accesskey "B">
<!ENTITY abFind.label "Find:">
<!ENTITY addressButton.label "Addresses">
<!ENTITY attachButton.label "Add Attachments">
<!ENTITY spellButton.label "Check Spelling">
<!ENTITY saveButton.label "Save Draft">
<!ENTITY moreButton.label "More">

View File

@@ -124,6 +124,7 @@ interface nsIMsgDatabase : nsIDBChangeAnnouncer {
// get a message header for the given key. Caller must release()!
nsIMsgDBHdr GetMsgHdrForKey(in nsMsgKey key);
nsIMsgDBHdr getMsgHdrForMessageID(in string messageID);
//Returns whether or not this database contains the given key
boolean ContainsKey(in nsMsgKey key);

View File

@@ -158,7 +158,6 @@ protected:
nsIMsgThread * GetThreadForSubject(nsCString &subject);
nsIMsgThread * GetThreadForThreadId(nsMsgKey threadId);
nsMsgHdr * GetMsgHdrForReference(nsCString &reference);
nsIMsgDBHdr * GetMsgHdrForMessageID(nsCString &msgID);
nsIMsgDBHdr * GetMsgHdrForSubject(nsCString &msgID);
// threading interfaces
virtual nsresult CreateNewThread(nsMsgKey key, const char *subject, nsMsgThread **newThread);

View File

@@ -3283,7 +3283,8 @@ nsresult nsMsgDatabase::CreateNewThread(nsMsgKey threadId, const char *subject,
nsIMsgThread *nsMsgDatabase::GetThreadForReference(nsCString &msgID, nsIMsgDBHdr **pMsgHdr)
{
nsIMsgDBHdr *msgHdr = GetMsgHdrForMessageID(msgID);
nsIMsgDBHdr *msgHdr = nsnull;
GetMsgHdrForMessageID(msgID.get(), &msgHdr);
nsIMsgThread *thread = NULL;
if (msgHdr != NULL)
@@ -3418,37 +3419,38 @@ nsMsgHdr * nsMsgDatabase::GetMsgHdrForReference(nsCString &reference)
NS_ASSERTION(PR_FALSE, "not implemented yet.");
return nsnull;
}
nsIMsgDBHdr *nsMsgDatabase::GetMsgHdrForMessageID(nsCString &msgID)
NS_IMETHODIMP nsMsgDatabase::GetMsgHdrForMessageID(const char *msgID, nsIMsgDBHdr **aHdr)
{
nsIMsgDBHdr *msgHdr = nsnull;
nsresult rv = NS_OK;
mdbYarn messageIdYarn;
NS_ENSURE_ARG_POINTER(aHdr);
nsIMsgDBHdr *msgHdr = nsnull;
nsresult rv = NS_OK;
mdbYarn messageIdYarn;
messageIdYarn.mYarn_Buf = (void*)msgID.get();
messageIdYarn.mYarn_Fill = PL_strlen(msgID.get());
messageIdYarn.mYarn_Form = 0;
messageIdYarn.mYarn_Size = messageIdYarn.mYarn_Fill;
messageIdYarn.mYarn_Buf = (void *) msgID;
messageIdYarn.mYarn_Fill = PL_strlen(msgID);
messageIdYarn.mYarn_Form = 0;
messageIdYarn.mYarn_Size = messageIdYarn.mYarn_Fill;
nsIMdbRow *hdrRow;
mdbOid outRowId;
mdb_err result = GetStore()->FindRow(GetEnv(), m_hdrRowScopeToken,
m_messageIdColumnToken, &messageIdYarn, &outRowId,
&hdrRow);
if (NS_SUCCEEDED(result) && hdrRow)
{
//Get key from row
mdbOid outOid;
nsMsgKey key=0;
if (hdrRow->GetOid(GetEnv(), &outOid) == NS_OK)
key = outOid.mOid_Id;
rv = GetHdrFromUseCache(key, &msgHdr);
if (NS_SUCCEEDED(rv) && msgHdr)
hdrRow->Release();
else
rv = CreateMsgHdr(hdrRow, key, &msgHdr);
}
return msgHdr;
nsIMdbRow *hdrRow;
mdbOid outRowId;
mdb_err result = GetStore()->FindRow(GetEnv(), m_hdrRowScopeToken,
m_messageIdColumnToken, &messageIdYarn, &outRowId,
&hdrRow);
if (NS_SUCCEEDED(result) && hdrRow)
{
//Get key from row
mdbOid outOid;
nsMsgKey key=0;
if (hdrRow->GetOid(GetEnv(), &outOid) == NS_OK)
key = outOid.mOid_Id;
rv = GetHdrFromUseCache(key, &msgHdr);
if (NS_SUCCEEDED(rv) && msgHdr)
hdrRow->Release();
else
rv = CreateMsgHdr(hdrRow, key, &msgHdr);
}
NS_IF_ADDREF(*aHdr = msgHdr);
return NS_OK; // it's not an error not to find a msg hdr.
}
nsIMsgDBHdr *nsMsgDatabase::GetMsgHdrForSubject(nsCString &subject)

View File

@@ -286,6 +286,16 @@ NS_IMETHODIMP nsMsgHdr::SetProperty(const char *propertyName, nsString &property
return m_mdb->SetPropertyFromNSString(m_mdbRow, propertyName, &propertyStr);
}
NS_IMETHODIMP nsMsgHdr::SetStringProperty(const char *propertyName, const char *propertyValue)
{
return m_mdb->SetProperty(m_mdbRow, propertyName, propertyValue);
}
NS_IMETHODIMP nsMsgHdr::GetStringProperty(const char *propertyName, char **aPropertyValue)
{
return m_mdb->GetProperty(m_mdbRow, propertyName, aPropertyValue);
}
NS_IMETHODIMP nsMsgHdr::GetUint32Property(const char *propertyName, PRUint32 *pResult)
{
return m_mdb->GetUint32Property(GetMDBRow(), propertyName, pResult);
@@ -350,7 +360,14 @@ NS_IMETHODIMP nsMsgHdr::GetDate(PRTime *result)
NS_IMETHODIMP nsMsgHdr::SetMessageId(const char *messageId)
{
return SetStringColumn(messageId, m_mdb->m_messageIdColumnToken);
if (messageId && *messageId == '<')
{
nsCAutoString tempMessageID(messageId + 1);
if (tempMessageID.Last() == '>')
tempMessageID.SetLength(tempMessageID.Length() - 1);
return SetStringColumn(tempMessageID.get(), m_mdb->m_messageIdColumnToken);
}
return SetStringColumn(messageId, m_mdb->m_messageIdColumnToken);
}
NS_IMETHODIMP nsMsgHdr::SetSubject(const char *subject)

View File

@@ -4,8 +4,6 @@ messenger.jar:
content/messenger-smime/msgCompSMIMEOverlay.js (resources/content/msgCompSMIMEOverlay.js)
content/messenger-smime/msgCompSMIMEOverlay.xul (resources/content/msgCompSMIMEOverlay.xul)
content/messenger-smime/msgReadSMIMEOverlay.js (resources/content/msgReadSMIMEOverlay.js)
content/messenger-smime/msgReadSMIMEOverlay.xul (resources/content/msgReadSMIMEOverlay.xul)
content/messenger-smime/msgHdrViewSMIMEOverlay.xul (resources/content/msgHdrViewSMIMEOverlay.xul)
content/messenger-smime/msgHdrViewSMIMEOverlay.js (resources/content/msgHdrViewSMIMEOverlay.js)
content/messenger-smime/msgCompSecurityInfo.xul (resources/content/msgCompSecurityInfo.xul)
content/messenger-smime/msgCompSecurityInfo.js (resources/content/msgCompSecurityInfo.js)

View File

@@ -0,0 +1,289 @@
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is Mozilla Communicator.
*
* The Initial Developer of the Original Code is
* Netscape Communications Corporation.
* Portions created by the Initial Developer are Copyright (C) 2002
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
/* We expect the following arguments:
- pref name of LDAP directory to fetch from
- array with email addresses
Display modal dialog with message and stop button.
In onload, kick off binding to LDAP.
When bound, kick off the searches.
On finding certificates, import into permanent cert database.
When all searches are finished, close the dialog.
*/
const nsIX509CertDB = Components.interfaces.nsIX509CertDB;
const nsX509CertDB = "@mozilla.org/security/x509certdb;1";
const CertAttribute = "usercertificate;binary";
var gEmailAddresses;
var gDirectoryPref;
var gLdapServerURL;
var gLdapConnection;
var gCertDB;
var gLdapOperation;
function onLoad()
{
gDirectoryPref = window.arguments[0];
gEmailAddresses = window.arguments[1];
if (!gEmailAddresses.length)
{
window.close();
return;
}
setTimeout(search, 1);
}
function search()
{
var prefService =
Components.classes["@mozilla.org/preferences-service;1"]
.getService(Components.interfaces.nsIPrefService);
var prefs = prefService.getBranch(null);
gLdapServerURL =
Components.classes["@mozilla.org/network/ldap-url;1"]
.createInstance().QueryInterface(Components.interfaces.nsILDAPURL);
try {
gLdapServerURL.spec = prefs.getCharPref(gDirectoryPref + ".uri");
gLdapConnection = Components.classes["@mozilla.org/network/ldap-connection;1"]
.createInstance().QueryInterface(Components.interfaces.nsILDAPConnection);
gLdapConnection.init(
gLdapServerURL.asciiHost,
gLdapServerURL.port,
gLdapServerURL.options,
null,
getProxyOnUIThread(new boundListener(),
Components.interfaces.nsILDAPMessageListener));
} catch (ex) {
window.close();
}
}
function stopFetching()
{
if (gLdapOperation) {
try {
gLdapOperation.abandon();
}
catch (e) {
}
}
window.close();
}
function importCert(ber_value)
{
if (!gCertDB) {
gCertDB = Components.classes[nsX509CertDB].getService(nsIX509CertDB);
}
var cert_length = new Object();
var cert_bytes = ber_value.get(cert_length);
if (cert_bytes) {
gCertDB.importEmailCertificate2(cert_length.value, cert_bytes);
}
}
function kickOffBind()
{
try {
gLdapOperation = Components.classes["@mozilla.org/network/ldap-operation;1"]
.createInstance().QueryInterface(Components.interfaces.nsILDAPOperation);
gLdapOperation.init(gLdapConnection,
getProxyOnUIThread(new ldapMessageListener(),
Components.interfaces.nsILDAPMessageListener));
gLdapOperation.simpleBind(null);
}
catch (e) {
window.close();
}
}
function kickOffSearch()
{
try {
var prefix1 = "";
var suffix1 = "";
var urlFilter = gLdapServerURL.filter;
if (urlFilter != null && urlFilter.length > 0 && urlFilter != "(objectclass=*)") {
if (urlFilter[0] == '(') {
prefix1 = "(&" + urlFilter;
}
else {
prefix1 = "(&(" + urlFilter + ")";
}
suffix1 = ")";
}
var prefix2 = "";
var suffix2 = "";
if (gEmailAddresses.length > 1) {
prefix2 = "(|";
suffix2 = ")";
}
var mailFilter = "";
for (var i = 0; i < gEmailAddresses.length; ++i) {
mailFilter += "(mail=" + gEmailAddresses[i] + ")";
}
var filter = prefix1 + prefix2 + mailFilter + suffix2 + suffix1;
var wanted_attributes = new Array();
wanted_attributes[0] = CertAttribute;
// Max search results =>
// Double number of email addresses, because each person might have
// multiple certificates listed. We expect at most two certificates,
// one for signing, one for encrypting.
// Maybe that number should be larger, to allow for deployments,
// where even more certs can be stored per user???
var maxEntriesWanted = gEmailAddresses.length * 2;
gLdapOperation.searchExt(gLdapServerURL.dn, gLdapServerURL.scope,
filter, 1, wanted_attributes, 0, maxEntriesWanted);
}
catch (e) {
window.close();
}
}
function boundListener() {
}
boundListener.prototype.QueryInterface =
function(iid) {
if (!iid.equals(Components.interfaces.nsISupports) &&
!iid.equals(Components.interfaces.nsILDAPMessageListener))
throw Components.results.NS_ERROR_NO_INTERFACE;
return this;
}
boundListener.prototype.onLDAPMessage =
function(aMessage) {
}
boundListener.prototype.onLDAPInit =
function(aStatus) {
kickOffBind();
}
function ldapMessageListener() {
}
ldapMessageListener.prototype.QueryInterface =
function(iid) {
if (!iid.equals(Components.interfaces.nsISupports) &&
!iid.equals(Components.interfaces.nsILDAPMessageListener))
throw Components.results.NS_ERROR_NO_INTERFACE;
return this;
}
ldapMessageListener.prototype.onLDAPMessage =
function(aMessage) {
if (Components.interfaces.nsILDAPMessage.RES_SEARCH_RESULT == aMessage.type) {
window.close();
return;
}
if (Components.interfaces.nsILDAPMessage.RES_BIND == aMessage.type) {
if (Components.interfaces.nsILDAPErrors.SUCCESS != aMessage.errorCode) {
window.close();
}
else {
kickOffSearch();
}
return;
}
if (Components.interfaces.nsILDAPMessage.RES_SEARCH_ENTRY == aMessage.type) {
var outSize = new Object();
try {
var outBinValues = aMessage.getBinaryValues(CertAttribute, outSize);
var i;
for (i=0; i < outSize.value; ++i) {
importCert(outBinValues[i]);
}
}
catch (e) {
}
return;
}
}
ldapMessageListener.prototype.onLDAPInit =
function(aStatus) {
}
function getProxyOnUIThread(aObject, aInterface) {
var eventQSvc = Components.
classes["@mozilla.org/event-queue-service;1"].
getService(Components.interfaces.nsIEventQueueService);
var uiQueue = eventQSvc.
getSpecialEventQueue(Components.interfaces.
nsIEventQueueService.UI_THREAD_EVENT_QUEUE);
var proxyMgr = Components.
classes["@mozilla.org/xpcomproxy;1"].
getService(Components.interfaces.nsIProxyObjectManager);
return proxyMgr.getProxyForObject(uiQueue,
aInterface, aObject, 5);
// 5 == PROXY_ALWAYS | PROXY_SYNC
}

View File

@@ -0,0 +1,65 @@
<?xml version="1.0"?>
<!-- ***** BEGIN LICENSE BLOCK *****
- Version: MPL 1.1/GPL 2.0/LGPL 2.1
-
- The contents of this file are subject to the Mozilla Public License Version
- 1.1 (the "License"); you may not use this file except in compliance with
- the License. You may obtain a copy of the License at
- http://www.mozilla.org/MPL/
-
- Software distributed under the License is distributed on an "AS IS" basis,
- WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
- for the specific language governing rights and limitations under the
- License.
-
- The Original Code is Mozilla Communicator
-
- The Initial Developer of the Original Code is
- Netscape Communications Corp..
- Portions created by the Initial Developer are Copyright (C) 2002
- the Initial Developer. All Rights Reserved.
-
- Contributor(s):
-
- Alternatively, the contents of this file may be used under the terms of
- either the GNU General Public License Version 2 or later (the "GPL"), or
- the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- in which case the provisions of the GPL or the LGPL are applicable instead
- of those above. If you wish to allow use of your version of this file only
- under the terms of either the GPL or the LGPL, and not to allow others to
- use your version of this file under the terms of the MPL, indicate your
- decision by deleting the provisions above and replace them with the notice
- and other provisions required by the LGPL or the GPL. If you do not delete
- the provisions above, a recipient may use your version of this file under
- the terms of any one of the MPL, the GPL or the LGPL.
-
- ***** END LICENSE BLOCK ***** -->
<?xml-sheet href="chrome://global/skin/" type="text/css"?>
<?xml-stylesheet href="chrome://messenger/skin/smime/certFetchingStatus.css" type="text/css"?>
<?xul-overlay href="chrome://global/content/dialogOverlay.xul"?>
<!DOCTYPE window SYSTEM "chrome://messenger-smime/locale/certFetchingStatus.dtd">
<window id="certFetchingStatus" title="&title.label;"
class="dialog"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
style="width: 50em;"
onload="onLoad();">
<script type="application/x-javascript" src="chrome://messenger-smime/content/certFetchingStatus.js"/>
<vbox>
<description>&info.message;</description>
<separator class="thin"/>
<hbox align="center">
<button id="stopButton"
label="&stop.label;"
oncommand="stopFetching();"/>
</hbox>
</vbox>
</window>

Some files were not shown because too many files have changed in this diff Show More