Whacked to use XPIDL-generated RDF interfaces.
git-svn-id: svn://10.0.0.236/branches/RDF_19990326_BRANCH@25386 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
@@ -52,7 +52,7 @@ public:
|
||||
NS_IMETHOD Clear(void);
|
||||
|
||||
// nsIFolder methods:
|
||||
NS_IMETHOD GetURI(char* *name) { return nsRDFResource::GetValue((const char**)&name); }
|
||||
NS_IMETHOD GetURI(char* *name) { return nsRDFResource::GetValue(name); }
|
||||
NS_IMETHOD GetName(char **name);
|
||||
NS_IMETHOD SetName(char *name);
|
||||
NS_IMETHOD GetChildNamed(const char *name, nsISupports* *result);
|
||||
|
||||
@@ -45,6 +45,7 @@
|
||||
#include "nsMsgCompPrefs.h"
|
||||
#include "nsIDOMMsgAppCore.h"
|
||||
#include "nsIMessage.h"
|
||||
#include "nsXPIDLString.h"
|
||||
|
||||
#include "nsMsgCompCID.h"
|
||||
#include "nsIMsgCompose.h"
|
||||
@@ -615,8 +616,8 @@ nsComposeAppCore::NewMessage(nsAutoString& aUrl,
|
||||
getter_AddRefs(rdfResource));
|
||||
if (rdfResource)
|
||||
{
|
||||
const char *uri = 0;
|
||||
rdfResource->GetValue(&uri);
|
||||
nsXPIDLCString uri;
|
||||
rdfResource->GetValue( getter_Copies(uri) );
|
||||
nsString messageUri = uri;
|
||||
}
|
||||
if (messageType == 2)
|
||||
|
||||
@@ -42,6 +42,7 @@
|
||||
#include "nsIMsgRFC822Parser.h"
|
||||
#include "nsMsgBaseCID.h"
|
||||
#include "nsCOMPtr.h"
|
||||
#include "nsXPIDLString.h"
|
||||
//This is a temporary dependency. I need this for parsemessageURI. In the future
|
||||
//we should have the nsIMessage have the ability to get the folder from it.
|
||||
#include "nsLocalMailFolder.h"
|
||||
@@ -238,7 +239,7 @@ NS_IMETHODIMP nsMSGFolderDataSource::Init(const char* uri)
|
||||
if ((mURI = PL_strdup(uri)) == nsnull)
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
|
||||
gRDFService->RegisterDataSource(this);
|
||||
gRDFService->RegisterDataSource(this, PR_FALSE);
|
||||
|
||||
if (! kNC_Child) {
|
||||
gRDFService->GetResource(kURINC_child, &kNC_Child);
|
||||
@@ -284,10 +285,12 @@ NS_IMETHODIMP nsMSGFolderDataSource::Init(const char* uri)
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsMSGFolderDataSource::GetURI(const char* *uri) const
|
||||
NS_IMETHODIMP nsMSGFolderDataSource::GetURI(char* *uri)
|
||||
{
|
||||
*uri = mURI;
|
||||
return NS_OK;
|
||||
if ((*uri = nsXPIDLCString::Copy(mURI)) == nsnull)
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
else
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsMSGFolderDataSource::GetSource(nsIRDFResource* property,
|
||||
@@ -719,7 +722,8 @@ nsMSGFolderDataSource::GetAllCommands(nsIRDFResource* source,
|
||||
NS_IMETHODIMP
|
||||
nsMSGFolderDataSource::IsCommandEnabled(nsISupportsArray/*<nsIRDFResource>*/* aSources,
|
||||
nsIRDFResource* aCommand,
|
||||
nsISupportsArray/*<nsIRDFResource>*/* aArguments)
|
||||
nsISupportsArray/*<nsIRDFResource>*/* aArguments,
|
||||
PRBool* aResult)
|
||||
{
|
||||
nsIMsgFolder* folder;
|
||||
nsIMessage* message;
|
||||
@@ -731,8 +735,10 @@ nsMSGFolderDataSource::IsCommandEnabled(nsISupportsArray/*<nsIRDFResource>*/* aS
|
||||
NS_RELEASE(folder); // release now that we know it's a folder
|
||||
|
||||
// we don't care about the arguments -- folder commands are always enabled
|
||||
if (!(peq(aCommand, kNC_Delete)))
|
||||
return NS_COMFALSE;
|
||||
if (!(peq(aCommand, kNC_Delete))) {
|
||||
*aResult = PR_FALSE;
|
||||
return NS_OK;
|
||||
}
|
||||
}
|
||||
else if (NS_SUCCEEDED(source->QueryInterface(nsIMessage::GetIID(), (void**)&message))) {
|
||||
NS_RELEASE(message); // release now that we know it's a message
|
||||
@@ -740,10 +746,13 @@ nsMSGFolderDataSource::IsCommandEnabled(nsISupportsArray/*<nsIRDFResource>*/* aS
|
||||
// we don't care about the arguments -- message commands are always enabled
|
||||
if (!(peq(aCommand, kNC_Delete) ||
|
||||
peq(aCommand, kNC_Reply) ||
|
||||
peq(aCommand, kNC_Forward)))
|
||||
return NS_COMFALSE;
|
||||
peq(aCommand, kNC_Forward))) {
|
||||
*aResult = PR_FALSE;
|
||||
return NS_OK;
|
||||
}
|
||||
}
|
||||
}
|
||||
*aResult = PR_TRUE;
|
||||
return NS_OK; // succeeded for all sources
|
||||
}
|
||||
|
||||
@@ -847,11 +856,11 @@ nsresult nsMSGFolderDataSource::GetFolderFromMessage(nsIMessage *message, nsIMsg
|
||||
{
|
||||
nsresult rv;
|
||||
|
||||
const char *uri;
|
||||
nsXPIDLCString uri;
|
||||
nsIRDFResource *resource;
|
||||
if(NS_SUCCEEDED( rv = message->QueryInterface(nsIRDFResource::GetIID(), (void**)&resource)))
|
||||
{
|
||||
resource->GetValue(&uri);
|
||||
resource->GetValue( getter_Copies(uri) );
|
||||
nsString messageFolderURIStr;
|
||||
nsMsgKey key;
|
||||
nsParseLocalMessageURI(uri, messageFolderURIStr, &key);
|
||||
|
||||
@@ -46,7 +46,7 @@ public:
|
||||
// nsIRDFDataSource methods
|
||||
NS_IMETHOD Init(const char* uri);
|
||||
|
||||
NS_IMETHOD GetURI(const char* *uri) const;
|
||||
NS_IMETHOD GetURI(char* *uri);
|
||||
|
||||
NS_IMETHOD GetSource(nsIRDFResource* property,
|
||||
nsIRDFNode* target,
|
||||
@@ -102,7 +102,8 @@ public:
|
||||
|
||||
NS_IMETHOD IsCommandEnabled(nsISupportsArray/*<nsIRDFResource>*/* aSources,
|
||||
nsIRDFResource* aCommand,
|
||||
nsISupportsArray/*<nsIRDFResource>*/* aArguments);
|
||||
nsISupportsArray/*<nsIRDFResource>*/* aArguments,
|
||||
PRBool* aResult);
|
||||
|
||||
NS_IMETHOD DoCommand(nsISupportsArray/*<nsIRDFResource>*/* aSources,
|
||||
nsIRDFResource* aCommand,
|
||||
|
||||
Reference in New Issue
Block a user