Add new icons to mail news 3 pane UI. r=mscott

This commit is contained in:
putterman%netscape.com 2000-04-03 02:58:21 +00:00
Родитель 18e1151bcf
Коммит c6139de89e
41 изменённых файлов: 206 добавлений и 220 удалений

Просмотреть файл

@ -29,6 +29,13 @@ interface nsIMessage : nsIMsgHdr {
readonly attribute nsMsgKey msgKey;
nsIMsgFolder GetMsgFolder();
void SetMsgFolder(in nsIMsgFolder folder);
//I hate to do this, but I really don't want to use a string due to all of the
//copying around so I'm using these constants and making them part of the base interface.
const unsigned long MailMessage = 0;
const unsigned long NewsMessage = 1;
readonly attribute unsigned long messageType;
};
[scriptable, uuid(82702556-01A2-11d3-8A69-0060B0FC04D2)]

Просмотреть файл

@ -55,7 +55,9 @@ Rights Reserved.
Flagged="rdf:http://home.netscape.com/NC-rdf#Flagged"
Priority="rdf:http://home.netscape.com/NC-rdf#Priority"
IsUnread="rdf:http://home.netscape.com/NC-rdf#IsUnread"
IsImapDeleted="rdf:http://home.netscape.com/NC-rdf#IsImapDeleted">
HasAttachment="rdf:http://home.netscape.com/NC-rdf#HasAttachment"
IsImapDeleted="rdf:http://home.netscape.com/NC-rdf#IsImapDeleted"
MessageType="rdf:http://home.netscape.com/NC-rdf#MessageType">
<treerow>
<treecell value="rdf:http://home.netscape.com/NC-rdf#Thread"/>

Просмотреть файл

@ -27,7 +27,12 @@ msgHdrViewOverlay.css
subscribe.css
mailfolder.gif
open-mailfolder.gif
mail-message.gif
message-mail.gif
message-mail-new.gif
message-mail-attach.gif
message-mail-imapdelete.gif
message-news.gif
message-news-new.gif
inbox.gif
trash.gif
outbox.gif
@ -49,7 +54,7 @@ threadcol.gif
unthreadcol.gif
flagcol.gif
flaggedmail.gif
Folder.gif
folder-closed.gif
folder-draft.gif
folder-draft-open.gif
folder-draft-share.gif
@ -64,6 +69,7 @@ folder-inbox-share-open.gif
folder-mailserver.gif
folder-new.gif
folder-new-open.gif
folder-new-closed.gif
folder-newsgroup.gif
folder-newsgroup-new.gif
folder-open.gif
@ -85,8 +91,12 @@ folder-trash.gif
folder-trash-open.gif
folder-trash-share.gif
folder-trash-share-open.gif
server.gif
server-mail.gif
server-mail-new.gif
server-local.gif
server-local-new.gif
server-news.gif
server-news-new.gif
server-news-lock.gif
server-remote.gif
server-remote-lock.gif

Просмотреть файл

@ -35,7 +35,12 @@ EXPORT_RESOURCE_SAMPLES = \
msgHdrViewOverlay.css \
mailfolder.gif \
open-mailfolder.gif \
mail-message.gif \
message-mail.gif \
message-mail-new.gif \
message-mail-attach.gif \
message-imapdelete.gif \
message-news.gif \
message-news-new.gif \
inbox.gif \
trash.gif \
outbox.gif \
@ -58,7 +63,7 @@ EXPORT_RESOURCE_SAMPLES = \
unthreadcol.gif \
flagcol.gif \
flaggedmail.gif \
Folder.gif \
folder-closed.gif \
folder-draft.gif \
folder-draft-open.gif \
folder-draft-share.gif \
@ -73,6 +78,7 @@ EXPORT_RESOURCE_SAMPLES = \
folder-mailserver.gif \
folder-new.gif \
folder-new-open.gif \
folder-new-closed.gif \
folder-newsgroup.gif \
folder-newsgroup-new.gif \
folder-open.gif \
@ -94,8 +100,12 @@ EXPORT_RESOURCE_SAMPLES = \
folder-trash-open.gif \
folder-trash-share.gif \
folder-trash-share-open.gif \
server.gif \
server-mail.gif \
server-mail-new.gif \
server-local.gif \
server-local-new.gif \
server-news.gif \
server-news-new.gif \
server-remote.gif \
server-news-lock.gif \
server-remote-lock.gif \

Двоичные данные
mailnews/base/resources/skin/flaggedmail.gif

Двоичный файл не отображается.

До

Ширина:  |  Высота:  |  Размер: 97 B

После

Ширина:  |  Высота:  |  Размер: 0 B

Просмотреть файл

Двоичный файл не отображается.

До

Ширина:  |  Высота:  |  Размер: 190 B

После

Ширина:  |  Высота:  |  Размер: 0 B

Двоичные данные
mailnews/base/resources/skin/folder-inbox.gif

Двоичный файл не отображается.

До

Ширина:  |  Высота:  |  Размер: 172 B

После

Ширина:  |  Высота:  |  Размер: 0 B

Просмотреть файл

Двоичные данные
mailnews/base/resources/skin/folder-new-open.gif

Двоичный файл не отображается.

До

Ширина:  |  Высота:  |  Размер: 167 B

После

Ширина:  |  Высота:  |  Размер: 0 B

Двоичный файл не отображается.

До

Ширина:  |  Высота:  |  Размер: 141 B

После

Ширина:  |  Высота:  |  Размер: 0 B

Двоичные данные
mailnews/base/resources/skin/folder-open.gif

Двоичный файл не отображается.

До

Ширина:  |  Высота:  |  Размер: 126 B

После

Ширина:  |  Высота:  |  Размер: 0 B

Двоичные данные
mailnews/base/resources/skin/folder-trash.gif

Двоичный файл не отображается.

До

Ширина:  |  Высота:  |  Размер: 171 B

После

Ширина:  |  Высота:  |  Размер: 0 B

Просмотреть файл

@ -21,7 +21,7 @@
/* basic mail folders */
treeitem.folderTreeItem > treerow > treecell > .tree-icon
{
list-style-image: url("chrome://messenger/skin/Folder.gif");
list-style-image: url("chrome://messenger/skin/folder-closed.gif");
}
treeitem.folderTreeItem[open="true"] > treerow > treecell > .tree-icon
@ -29,11 +29,6 @@ treeitem.folderTreeItem[open="true"] > treerow > treecell > .tree-icon
list-style-image: url("chrome://messenger/skin/folder-open.gif");
}
treeitem[IsServer="true"] > treerow > treecell > .tree-icon
{
list-style-image: url("chrome://messenger/skin/server.gif");
}
/* special folder */
treeitem[SpecialFolder="Inbox"] > treerow > treecell > .tree-icon
{
@ -42,7 +37,7 @@ treeitem[SpecialFolder="Inbox"] > treerow > treecell > .tree-icon
treeitem[SpecialFolder="Inbox"][open="true"] > treerow > treecell > .tree-icon
{
list-style-image: url("chrome://messenger/skin/folder-inbox-open.gif");
list-style-image: url("chrome://messenger/skin/folder-inbox.gif");
}
treeitem[SpecialFolder="Trash"] > treerow > treecell > .tree-icon
@ -52,47 +47,17 @@ treeitem[SpecialFolder="Trash"] > treerow > treecell > .tree-icon
treeitem[SpecialFolder="Trash"][open="true"] > treerow > treecell > .tree-icon
{
list-style-image: url("chrome://messenger/skin/folder-trash-open.gif");
}
treeitem[SpecialFolder="Sent"] > treerow > treecell > .tree-icon
{
list-style-image: url("chrome://messenger/skin/folder-sent.gif");
}
treeitem[SpecialFolder="Sent"][open="true"] > treerow > treecell > .tree-icon
{
list-style-image: url("chrome://messenger/skin/folder-sent-open.gif");
}
treeitem[SpecialFolder="Templates"] > treerow > treecell > .tree-icon
{
list-style-image: url("chrome://messenger/skin/folder-template.gif");
}
treeitem[SpecialFolder="Templates"][open="true"] > treerow > treecell > .tree-icon
{
list-style-image: url("chrome://messenger/skin/folder-template-open.gif");
}
treeitem[SpecialFolder="Drafts"] > treerow > treecell > .tree-icon
{
list-style-image: url("chrome://messenger/skin/folder-draft.gif");
}
treeitem[SpecialFolder="Drafts"][open="true"] > treerow > treecell > .tree-icon
{
list-style-image: url("chrome://messenger/skin/folder-draft-open.gif");
}
treeitem[SpecialFolder="Unsent Messages"] > treerow > treecell > .tree-icon
{
list-style-image: url("chrome://messenger/skin/folder-outbox.gif");
list-style-image: url("chrome://messenger/skin/folder-trash.gif");
}
treeitem[BiffState="NewMail"] > treerow > treecell > .tree-icon
{
list-style-image: url("chrome://messenger/skin/folder-new.gif");
list-style-image: url("chrome://messenger/skin/folder-new-closed.gif");
}
treeitem[BiffState="NewMail"][open="true"] > treerow > treecell > .tree-icon
{
list-style-image: url("chrome://messenger/skin/folder-new-open.gif");
}
treeitem[SpecialFolder="Inbox"][BiffState="NewMail"] > treerow > treecell > .tree-icon
@ -100,25 +65,27 @@ treeitem[SpecialFolder="Inbox"][BiffState="NewMail"] > treerow > treecell > .tre
list-style-image: url("chrome://messenger/skin/folder-inbox-new.gif");
}
/* IMAP folders */
treeitem[ServerType="imap"] > treerow > treecell > .tree-icon
treeitem[IsServer="true"] > treerow > treecell > .tree-icon
{
list-style-image: url("chrome://messenger/skin/folder-server.gif");
list-style-image: url("chrome://messenger/skin/server-mail.gif");
}
treeitem[ServerType="imap"][open="true"] > treerow > treecell > .tree-icon
treeitem[IsServer="true"][open="true"] > treerow > treecell > .tree-icon
{
list-style-image: url("chrome://messenger/skin/folder-server-open.gif");
list-style-image: url("chrome://messenger/skin/server-mail.gif");
}
/* IMAP folders */
treeitem[IsServer="true"][ServerType="imap"][IsSecure="true"] > treerow > treecell > .tree-icon
{
list-style-image: url("chrome://messenger/skin/server-remote-lock.gif");
}
treeitem[IsServer="true"][ServerType="imap"] > treerow > treecell > .tree-icon
/* Local servers */
treeitem[IsServer="true"][ServerType="none"] > treerow > treecell > .tree-icon
{
list-style-image: url("chrome://messenger/skin/server-remote.gif");
list-style-image: url("chrome://messenger/skin/server-local.gif");
}

Двоичные данные
mailnews/base/resources/skin/mail-message.gif

Двоичный файл не отображается.

До

Ширина:  |  Высота:  |  Размер: 85 B

После

Ширина:  |  Высота:  |  Размер: 0 B

Просмотреть файл

@ -30,7 +30,12 @@ install::
$(MAKE_INSTALL) msgHdrViewOverlay.css $(DIST)\bin\chrome\messenger\skin\default
$(MAKE_INSTALL) mailfolder.gif $(DIST)\bin\chrome\messenger\skin\default
$(MAKE_INSTALL) open-mailfolder.gif $(DIST)\bin\chrome\messenger\skin\default
$(MAKE_INSTALL) mail-message.gif $(DIST)\bin\chrome\messenger\skin\default
$(MAKE_INSTALL) message-mail.gif $(DIST)\bin\chrome\messenger\skin\default
$(MAKE_INSTALL) message-mail-new.gif $(DIST)\bin\chrome\messenger\skin\default
$(MAKE_INSTALL) message-mail-attach.gif $(DIST)\bin\chrome\messenger\skin\default
$(MAKE_INSTALL) message-mail-imapdelete.gif $(DIST)\bin\chrome\messenger\skin\default
$(MAKE_INSTALL) message-news.gif $(DIST)\bin\chrome\messenger\skin\default
$(MAKE_INSTALL) message-news-new.gif $(DIST)\bin\chrome\messenger\skin\default
$(MAKE_INSTALL) inbox.gif $(DIST)\bin\chrome\messenger\skin\default
$(MAKE_INSTALL) trash.gif $(DIST)\bin\chrome\messenger\skin\default
$(MAKE_INSTALL) outbox.gif $(DIST)\bin\chrome\messenger\skin\default
@ -53,7 +58,7 @@ install::
$(MAKE_INSTALL) unthreadcol.gif $(DIST)\bin\chrome\messenger\skin\default
$(MAKE_INSTALL) flagcol.gif $(DIST)\bin\chrome\messenger\skin\default
$(MAKE_INSTALL) flaggedmail.gif $(DIST)\bin\chrome\messenger\skin\default
$(MAKE_INSTALL) Folder.gif $(DIST)\bin\chrome\messenger\skin\default
$(MAKE_INSTALL) folder-closed.gif $(DIST)\bin\chrome\messenger\skin\default
$(MAKE_INSTALL) folder-draft.gif $(DIST)\bin\chrome\messenger\skin\default
$(MAKE_INSTALL) folder-draft-open.gif $(DIST)\bin\chrome\messenger\skin\default
$(MAKE_INSTALL) folder-draft-share.gif $(DIST)\bin\chrome\messenger\skin\default
@ -68,6 +73,7 @@ install::
$(MAKE_INSTALL) folder-mailserver.gif $(DIST)\bin\chrome\messenger\skin\default
$(MAKE_INSTALL) folder-new.gif $(DIST)\bin\chrome\messenger\skin\default
$(MAKE_INSTALL) folder-new-open.gif $(DIST)\bin\chrome\messenger\skin\default
$(MAKE_INSTALL) folder-new-closed.gif $(DIST)\bin\chrome\messenger\skin\default
$(MAKE_INSTALL) folder-newsgroup.gif $(DIST)\bin\chrome\messenger\skin\default
$(MAKE_INSTALL) folder-newsgroup-new.gif $(DIST)\bin\chrome\messenger\skin\default
$(MAKE_INSTALL) folder-open.gif $(DIST)\bin\chrome\messenger\skin\default
@ -89,8 +95,12 @@ install::
$(MAKE_INSTALL) folder-trash-open.gif $(DIST)\bin\chrome\messenger\skin\default
$(MAKE_INSTALL) folder-trash-share.gif $(DIST)\bin\chrome\messenger\skin\default
$(MAKE_INSTALL) folder-trash-share-open.gif $(DIST)\bin\chrome\messenger\skin\default
$(MAKE_INSTALL) server.gif $(DIST)\bin\chrome\messenger\skin\default
$(MAKE_INSTALL) server-mail.gif $(DIST)\bin\chrome\messenger\skin\default
$(MAKE_INSTALL) server-mail-new.gif $(DIST)\bin\chrome\messenger\skin\default
$(MAKE_INSTALL) server-local.gif $(DIST)\bin\chrome\messenger\skin\default
$(MAKE_INSTALL) server-local-new.gif $(DIST)\bin\chrome\messenger\skin\default
$(MAKE_INSTALL) server-news.gif $(DIST)\bin\chrome\messenger\skin\default
$(MAKE_INSTALL) server-news-new.gif $(DIST)\bin\chrome\messenger\skin\default
$(MAKE_INSTALL) server-news-lock.gif $(DIST)\bin\chrome\messenger\skin\default
$(MAKE_INSTALL) server-remote.gif $(DIST)\bin\chrome\messenger\skin\default
$(MAKE_INSTALL) server-remote-lock.gif $(DIST)\bin\chrome\messenger\skin\default
@ -103,7 +113,12 @@ clobber::
rm -f $(DIST)\chrome\messenger\skin\default\threadPane.css
rm -f $(DIST)\chrome\messenger\skin\default\mailfolder.gif
rm -f $(DIST)\chrome\messenger\skin\default\open-mailfolder.gif
rm -f $(DIST)\chrome\messenger\skin\default\mail-message.gif
rm -f $(DIST)\chrome\messenger\skin\default\message-mail.gif
rm -f $(DIST)\chrome\messenger\skin\default\message-mail-new.gif
rm -f $(DIST)\chrome\messenger\skin\default\message-mail-attach.gif
rm -f $(DIST)\chrome\messenger\skin\default\message-mail-imapdelete.gif
rm -f $(DIST)\chrome\messenger\skin\default\message-news.gif
rm -f $(DIST)\chrome\messenger\skin\default\message-news-new.gif
rm -f $(DIST)\chrome\messenger\skin\default\inbox.gif
rm -f $(DIST)\chrome\messenger\skin\default\trash.gif
rm -f $(DIST)\chrome\messenger\skin\default\outbox.gif
@ -126,13 +141,21 @@ clobber::
rm -f $(DIST)\chrome\messenger\skin\default\unthreadcol.gif
rm -f $(DIST)\chrome\messenger\skin\default\flagcol.gif
rm -f $(DIST)\chrome\messenger\skin\default\flaggedmail.gif
rm -f $(DIST)\chrome\messenger\skin\default\server.gif
rm -f $(DIST)\chrome\messenger\skin\default\server-mail.gif
rm -f $(DIST)\chrome\messenger\skin\default\server-mail-new.gif
rm -f $(DIST)\chrome\messenger\skin\default\server-local.gif
rm -f $(DIST)\chrome\messenger\skin\default\server-local-new.gif
rm -f $(DIST)\chrome\messenger\skin\default\server-news.gif
rm -f $(DIST)\chrome\messenger\skin\default\server-news-new.gif
rm -f $(DIST)\chrome\messenger\skin\default\server-remote.gif
rm -f $(DIST)\chrome\messenger\skin\default\server-remote-lock.gif
rm -f $(DIST)\chrome\messenger\skin\default\server-news-lock.gif
rm -f $(DIST)\chrome\messenger\skin\default\attach.gif
rm -f $(DIST)\chrome\messenger\skin\default\addtoab.gif
rm -f $(DIST)\chrome\messenger\skin\default\folder-closed.gif
rm -f $(DIST)\chrome\messenger\skin\default\folder-open.gif
rm -f $(DIST)\chrome\messenger\skin\default\folder-new-closed.gif
rm -f $(DIST)\chrome\messenger\skin\default\folder-new-open.gif
rm -f $(DIST)\chrome\messenger\skin\default\attach.gif
rm -f $(DIST)\chrome\messenger\skin\default\addtoab.gif

Просмотреть файл

Просмотреть файл

Просмотреть файл

Просмотреть файл

Просмотреть файл

Просмотреть файл

Просмотреть файл

Просмотреть файл

Просмотреть файл

Просмотреть файл

Просмотреть файл

Двоичные данные
mailnews/base/resources/skin/server-news.gif

Двоичный файл не отображается.

До

Ширина:  |  Высота:  |  Размер: 142 B

После

Ширина:  |  Высота:  |  Размер: 0 B

Двоичные данные
mailnews/base/resources/skin/server.gif

Двоичный файл не отображается.

До

Ширина:  |  Высота:  |  Размер: 130 B

После

Ширина:  |  Высота:  |  Размер: 0 B

Просмотреть файл

@ -22,11 +22,6 @@ treeitem[IsUnread="true"] > treerow {
font-weight: bold;
}
treeitem[IsImapDeleted="true"] > treerow {
font-weight: lighter;
font-style: italic;
}
treeitem[Priority="Highest"] > treerow > treecell.prioritycol > .tree-button
{
color:red;
@ -48,13 +43,44 @@ treeitem[Priority="Low"] > treerow > treecell.prioritycol > .tree-button
}
treeitem > treerow > treecell > .tree-icon {
list-style-image: url("chrome://messenger/skin/mail-message.gif");
list-style-image: url("chrome://messenger/skin/message-mail.gif");
min-height: 14px;
}
treeitem[open="true"] > treerow > treecell > .tree-icon
{
list-style-image: url("chrome://messenger/skin/mail-message.gif");
list-style-image: url("chrome://messenger/skin/message-mail.gif");
min-height: 14px;
}
treeitem[Status="new"] > treerow > treecell > .tree-icon {
list-style-image: url("chrome://messenger/skin/message-mail-new.gif");
min-height: 14px;
}
treeitem[MessageType="news"] > treerow > treecell > .tree-icon {
list-style-image: url("chrome://messenger/skin/message-news.gif");
min-height: 14px;
}
treeitem[MessageType="news"][open="true"] > treerow > treecell > .tree-icon
{
list-style-image: url("chrome://messenger/skin/message-news.gif");
min-height: 14px;
}
treeitem[MessageType="news"][Status="new"] > treerow > treecell > .tree-icon {
list-style-image: url("chrome://messenger/skin/message-news-new.gif");
min-height: 14px;
}
treeitem[MessageType="mail"][HasAttachment="true"] > treerow > treecell > .tree-icon {
list-style-image: url("chrome://messenger/skin/message-mail-attach.gif");
min-height: 14px;
}
treeitem[IsImapDeleted="true"] > treerow > treecell > .tree-icon{
list-style-image: url("chrome://messenger/skin/message-mail-imapdelete.gif");
min-height: 14px;
}
@ -87,9 +113,9 @@ treecell.threadColumnHeader[currentView="unthreaded"] > .tree-button{
}
treecell.readColumnHeader > .tree-button {
list-style-image: url("chrome://messenger/skin/readcol.gif");
list-style-image: url("chrome://messenger/skin/unreadmail.gif");
}
treecell.flagColumnHeader > .tree-button {
list-style-image: url("chrome://messenger/skin/flagcol.gif");
list-style-image: url("chrome://messenger/skin/flaggedmail.gif");
}

Двоичные данные
mailnews/base/resources/skin/unreadmail.gif

Двоичный файл не отображается.

До

Ширина:  |  Высота:  |  Размер: 91 B

После

Ширина:  |  Высота:  |  Размер: 0 B

Просмотреть файл

@ -61,7 +61,9 @@ nsIRDFResource* nsMsgMessageDataSource::kNC_Total = nsnull;
nsIRDFResource* nsMsgMessageDataSource::kNC_Unread = nsnull;
nsIRDFResource* nsMsgMessageDataSource::kNC_MessageChild = nsnull;
nsIRDFResource* nsMsgMessageDataSource::kNC_IsUnread = nsnull;
nsIRDFResource* nsMsgMessageDataSource::kNC_HasAttachment = nsnull;
nsIRDFResource* nsMsgMessageDataSource::kNC_IsImapDeleted = nsnull;
nsIRDFResource* nsMsgMessageDataSource::kNC_MessageType = nsnull;
nsIRDFResource* nsMsgMessageDataSource::kNC_OrderReceived = nsnull;
nsIRDFResource* nsMsgMessageDataSource::kNC_OrderReceivedSort = nsnull;
@ -115,7 +117,9 @@ nsMsgMessageDataSource::~nsMsgMessageDataSource (void)
NS_RELEASE2(kNC_Unread, refcnt);
NS_RELEASE2(kNC_MessageChild, refcnt);
NS_RELEASE2(kNC_IsUnread, refcnt);
NS_RELEASE2(kNC_HasAttachment, refcnt);
NS_RELEASE2(kNC_IsImapDeleted, refcnt);
NS_RELEASE2(kNC_MessageType, refcnt);
NS_RELEASE2(kNC_OrderReceived, refcnt);
NS_RELEASE2(kNC_OrderReceivedSort, refcnt);
@ -170,7 +174,9 @@ nsresult nsMsgMessageDataSource::Init()
rdf->GetResource(NC_RDF_TOTALUNREADMESSAGES, &kNC_Unread);
rdf->GetResource(NC_RDF_MESSAGECHILD, &kNC_MessageChild);
rdf->GetResource(NC_RDF_ISUNREAD, &kNC_IsUnread);
rdf->GetResource(NC_RDF_HASATTACHMENT, &kNC_HasAttachment);
rdf->GetResource(NC_RDF_ISIMAPDELETED, &kNC_IsImapDeleted);
rdf->GetResource(NC_RDF_MESSAGETYPE, &kNC_MessageType);
rdf->GetResource(NC_RDF_ORDERRECEIVED, &kNC_OrderReceived);
rdf->GetResource(NC_RDF_ORDERRECEIVED_SORT, &kNC_OrderReceivedSort);
@ -222,6 +228,10 @@ nsresult nsMsgMessageDataSource::CreateLiterals(nsIRDFService *rdf)
createNode(str, getter_AddRefs(kTrueLiteral), rdf);
str = "false";
createNode(str, getter_AddRefs(kFalseLiteral), rdf);
str = "news";
createNode(str, getter_AddRefs(kNewsLiteral), rdf);
str = "mail";
createNode(str, getter_AddRefs(kMailLiteral), rdf);
return NS_OK;
}
@ -395,7 +405,9 @@ NS_IMETHODIMP nsMsgMessageDataSource::GetTargets(nsIRDFResource* source,
else if((kNC_Subject == property) || (kNC_Date == property) ||
(kNC_Status == property) || (kNC_Flagged == property) ||
(kNC_Priority == property) || (kNC_Size == property) ||
(kNC_IsUnread == property) || (kNC_IsImapDeleted == property) || (kNC_OrderReceived == property))
(kNC_IsUnread == property) || (kNC_IsImapDeleted == property) ||
(kNC_OrderReceived == property) || (kNC_HasAttachment == property) ||
(kNC_MessageType == property))
{
nsSingletonEnumerator* cursor =
new nsSingletonEnumerator(source);
@ -520,7 +532,9 @@ nsMsgMessageDataSource::getMessageArcLabelsOut(PRBool showThreads,
(*arcs)->AppendElement(kNC_Priority);
(*arcs)->AppendElement(kNC_Size);
(*arcs)->AppendElement(kNC_IsUnread);
(*arcs)->AppendElement(kNC_HasAttachment);
(*arcs)->AppendElement(kNC_IsImapDeleted);
(*arcs)->AppendElement(kNC_MessageType);
(*arcs)->AppendElement(kNC_OrderReceived);
return NS_OK;
@ -917,8 +931,12 @@ nsMsgMessageDataSource::createMessageNode(nsIMessage *message,
rv = createMessageUnreadNode(message, target);
else if((kNC_IsUnread == property))
rv = createMessageIsUnreadNode(message, target);
else if((kNC_HasAttachment == property))
rv = createMessageHasAttachmentNode(message, target);
else if((kNC_IsImapDeleted == property))
rv = createMessageIsImapDeletedNode(message, target);
else if((kNC_MessageType == property))
rv = createMessageMessageTypeNode(message, target);
else if ((kNC_MessageChild == property))
rv = createMessageMessageChildNode(message, target);
else if ((kNC_OrderReceived == property))
@ -1051,6 +1069,23 @@ nsMsgMessageDataSource::createMessageIsUnreadNode(nsIMessage *message, nsIRDFNod
return NS_OK;
}
nsresult
nsMsgMessageDataSource::createMessageHasAttachmentNode(nsIMessage *message, nsIRDFNode **target)
{
nsresult rv;
PRUint32 flags;
rv = message->GetFlags(&flags);
if(NS_FAILED(rv))
return rv;
if(flags & MSG_FLAG_ATTACHMENT)
*target = kTrueLiteral;
else
*target = kFalseLiteral;
NS_IF_ADDREF(*target);
return NS_OK;
}
nsresult
nsMsgMessageDataSource::createMessageIsImapDeletedNode(nsIMessage *message, nsIRDFNode **target)
{
@ -1068,6 +1103,22 @@ nsMsgMessageDataSource::createMessageIsImapDeletedNode(nsIMessage *message, nsIR
return NS_OK;
}
nsresult
nsMsgMessageDataSource::createMessageMessageTypeNode(nsIMessage *message, nsIRDFNode **target)
{
nsresult rv;
PRUint32 type;
rv = message->GetMessageType(&type);
if(NS_FAILED(rv))
return rv;
if(type == nsIMessage::NewsMessage)
*target = kNewsLiteral;
else
*target = kMailLiteral;
NS_IF_ADDREF(*target);
return NS_OK;
}
nsresult
nsMsgMessageDataSource::createMessageOrderReceivedNode(nsIMessage *message, nsIRDFNode **target)

Просмотреть файл

@ -142,7 +142,9 @@ protected:
nsIRDFNode **target);
nsresult createMessageIsUnreadNode(nsIMessage *message, nsIRDFNode **target);
nsresult createMessageHasAttachmentNode(nsIMessage *message, nsIRDFNode **target);
nsresult createMessageIsImapDeletedNode(nsIMessage *message, nsIRDFNode **target);
nsresult createMessageMessageTypeNode(nsIMessage *message, nsIRDFNode **target);
nsresult createMessageOrderReceivedNode(nsIMessage *message, nsIRDFNode **target);
nsresult createMessageOrderReceivedSortNode(nsIMessage *message, nsIRDFNode **target);
@ -195,7 +197,9 @@ protected:
static nsIRDFResource* kNC_Unread;
static nsIRDFResource* kNC_MessageChild;
static nsIRDFResource* kNC_IsUnread;
static nsIRDFResource* kNC_HasAttachment;
static nsIRDFResource* kNC_IsImapDeleted;
static nsIRDFResource* kNC_MessageType;
static nsIRDFResource* kNC_OrderReceived;
static nsIRDFResource* kNC_OrderReceivedSort;
@ -221,6 +225,8 @@ protected:
nsCOMPtr<nsIRDFNode> kReadLiteral;
nsCOMPtr<nsIRDFNode> kTrueLiteral;
nsCOMPtr<nsIRDFNode> kFalseLiteral;
nsCOMPtr<nsIRDFNode> kNewsLiteral;
nsCOMPtr<nsIRDFNode> kMailLiteral;
// message properties
static nsIAtom *kStatusAtom;

Просмотреть файл

@ -48,6 +48,8 @@ typedef struct _nsMsgRDFNotification {
#define NC_RDF_ISUNREAD NC_NAMESPACE_URI "IsUnread"
#define NC_RDF_ISIMAPDELETED NC_NAMESPACE_URI "IsImapDeleted"
#define NC_RDF_ORDERRECEIVED NC_NAMESPACE_URI "OrderReceived"
#define NC_RDF_HASATTACHMENT NC_NAMESPACE_URI "HasAttachment"
#define NC_RDF_MESSAGETYPE NC_NAMESPACE_URI "MessageType"
#define NC_RDF_CHILD NC_NAMESPACE_URI "child"
#define NC_RDF_MESSAGECHILD NC_NAMESPACE_URI "MessageChild"

Просмотреть файл

@ -594,3 +594,10 @@ NS_IMETHODIMP nsMessage::GetMsgKey(nsMsgKey *aMsgKey)
return NS_ERROR_FAILURE;
}
NS_IMETHODIMP nsMessage::GetMessageType(PRUint32 *aMessageType)
{
// base classes need to define this
return NS_ERROR_NOT_IMPLEMENTED;
}

Просмотреть файл

@ -54,6 +54,15 @@ NS_IMETHODIMP nsImapMessage::GetMsgFolder(nsIMsgFolder **folder)
return rv;
}
NS_IMETHODIMP nsImapMessage::GetMessageType(PRUint32 *aMessageType)
{
if(!aMessageType)
return NS_ERROR_NULL_POINTER;
*aMessageType = nsIMessage::MailMessage;
return NS_OK;
}
nsresult nsImapMessage::GetFolderFromURI(nsIMsgFolder **folder)
{
nsresult rv;

Просмотреть файл

@ -39,7 +39,7 @@ public:
NS_DECL_ISUPPORTS_INHERITED
NS_IMETHOD GetMsgFolder(nsIMsgFolder **folder);
NS_IMETHOD GetMessageType(PRUint32 *aMessageType);
protected:
nsresult GetFolderFromURI(nsIMsgFolder **folder);

Просмотреть файл

@ -56,6 +56,15 @@ NS_IMETHODIMP nsLocalMessage::GetMsgFolder(nsIMsgFolder **folder)
return rv;
}
NS_IMETHODIMP nsLocalMessage::GetMessageType(PRUint32 *aMessageType)
{
if(!aMessageType)
return NS_ERROR_NULL_POINTER;
*aMessageType = nsIMessage::MailMessage;
return NS_OK;
}
nsresult nsLocalMessage::GetFolderFromURI(nsIMsgFolder **folder)
{
nsresult rv;

Просмотреть файл

@ -39,6 +39,7 @@ public:
NS_DECL_ISUPPORTS_INHERITED
NS_IMETHOD GetMsgFolder(nsIMsgFolder **folder);
NS_IMETHOD GetMessageType(PRUint32 *aMessageType);
protected:
nsresult GetFolderFromURI(nsIMsgFolder **folder);

Просмотреть файл

@ -1,95 +0,0 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* 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):
* Pierre Phaneuf <pp@ludusdesign.com>
*/
#include "msgCore.h" // precompiled header...
#include "nsIMsgHdr.h"
#include "nsIMsgFolder.h"
#include "nsNewsMessage.h"
#include "nsIRDFService.h"
#include "nsIServiceManager.h"
#include "nsRDFCID.h"
#include "nsXPIDLString.h"
#include "nsNewsUtils.h"
static NS_DEFINE_CID(kRDFServiceCID, NS_RDFSERVICE_CID);
nsNewsMessage::nsNewsMessage(void)
{
// NS_INIT_REFCNT(); done by superclass
}
nsNewsMessage::~nsNewsMessage(void)
{
}
NS_IMPL_ISUPPORTS_INHERITED(nsNewsMessage, nsMessage, nsIDBMessage)
NS_IMETHODIMP nsNewsMessage::GetMsgFolder(nsIMsgFolder **folder)
{
nsresult rv;
rv = nsMessage::GetMsgFolder(folder);
if (NS_FAILED(rv))
rv = GetFolderFromURI(folder);
return rv;
}
//Note this is the same as the function in LocalMessage except for news uri specific stuff.
//I'm not convinced that parsing the url is going to be different so I'm setting this up as a
//separate function. If it turns out this isn't the case we could write a utility function that
//both message classes can use.
nsresult nsNewsMessage::GetFolderFromURI(nsIMsgFolder **folder)
{
nsresult rv;
nsXPIDLCString uri;
nsCOMPtr <nsIRDFResource> resource;
if(NS_SUCCEEDED( rv = QueryInterface(NS_GET_IID(nsIRDFResource), getter_AddRefs(resource))))
{
resource->GetValue( getter_Copies(uri) );
nsCAutoString messageFolderURIStr;
nsMsgKey key;
nsParseNewsMessageURI(uri, messageFolderURIStr, &key);
nsCAutoString folderOnly;
nsCAutoString folderURIStr;
if (messageFolderURIStr.Find(kNewsMessageRootURI) != ((PRInt32)-1)) {
messageFolderURIStr.Right(folderOnly, messageFolderURIStr.Length() - kNewsMessageRootURILen);
folderURIStr = kNewsRootURI;
folderURIStr+= folderOnly;
nsCOMPtr <nsIRDFResource> folderResource;
NS_WITH_SERVICE(nsIRDFService, rdfService, kRDFServiceCID, &rv);
if (NS_SUCCEEDED(rv)) // always check this before proceeding
{
rv = rdfService->GetResource(folderURIStr, getter_AddRefs(folderResource));
if(NS_SUCCEEDED(rv))
{
rv = NS_SUCCEEDED(folderResource->QueryInterface(NS_GET_IID(nsIMsgFolder), (void**)folder));
}
}
}
}
return rv;
}

Просмотреть файл

@ -1,49 +0,0 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* 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):
*/
/********************************************************************************************************
Interface for representing Local Mail folders.
*********************************************************************************************************/
#ifndef nsNewsMessage_h__
#define nsNewsMessage_h__
#include "nsMessage.h" /* include the interface we are going to support */
class nsNewsMessage : public nsMessage
{
public:
nsNewsMessage(void);
virtual ~nsNewsMessage(void);
NS_DECL_ISUPPORTS_INHERITED
NS_IMETHOD GetMsgFolder(nsIMsgFolder **folder);
protected:
nsresult GetFolderFromURI(nsIMsgFolder **folder);
};
#endif //nsNewsMessage_h__