зеркало из https://github.com/mozilla/gecko-dev.git
add scriptable version of search term value object
This commit is contained in:
Родитель
93e3b2054f
Коммит
d7b3266a9e
|
@ -0,0 +1,46 @@
|
|||
/* -*- Mode: C++; tab-width: 4; 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 Communicator client code.
|
||||
*
|
||||
* The Initial Developer of the Original Code is Netscape Communications
|
||||
* Corporation. Portions created by Netscape are
|
||||
* Copyright (C) 1998 Netscape Communications Corporation. All
|
||||
* Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Alec Flett <alecf@netscape.com>
|
||||
*/
|
||||
|
||||
#include "nsMsgSearchCore.idl"
|
||||
|
||||
interface nsIMsgFolder;
|
||||
|
||||
// for now
|
||||
native nsMsgPriority(nsMsgPriority);
|
||||
|
||||
[scriptable, uuid(12156d67-6071-4354-b204-4cb9b561cc94)]
|
||||
interface nsIMsgSearchValue : nsISupports {
|
||||
// type of object
|
||||
attribute nsMsgSearchAttribValue attrib;
|
||||
|
||||
// accessing these will throw an exception if the above
|
||||
// attribute does not match the type!
|
||||
attribute string str;
|
||||
[noscript] attribute nsMsgPriority priority;
|
||||
attribute PRTime date;
|
||||
attribute unsigned long status; // see MSG_FLAG in msgcom.h
|
||||
attribute unsigned long size;
|
||||
attribute nsMsgKey msgKey;
|
||||
attribute unsigned long age; // in days
|
||||
attribute nsIMsgFolder folder;
|
||||
};
|
|
@ -0,0 +1,141 @@
|
|||
/* -*- Mode: C++; tab-width: 4; 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 Communicator client code.
|
||||
*
|
||||
* The Initial Developer of the Original Code is Netscape Communications
|
||||
* Corporation. Portions created by Netscape are
|
||||
* Copyright (C) 1998 Netscape Communications Corporation. All
|
||||
* Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Alec Flett <alecf@netscape.com>
|
||||
*/
|
||||
|
||||
#include "MailNewsTypes.h"
|
||||
#include "nsMsgSearchValue.h"
|
||||
|
||||
nsMsgSearchValueImpl::nsMsgSearchValueImpl(nsMsgSearchValue *aInitialValue)
|
||||
{
|
||||
mValue = *aInitialValue;
|
||||
// XXX TODO - make a copy of the string if it's a string attribute
|
||||
// (right now we dont' know when it's a string!)
|
||||
|
||||
}
|
||||
|
||||
nsMsgSearchValueImpl::~nsMsgSearchValueImpl()
|
||||
{
|
||||
// XXX TODO - free the string if it's a string attribute
|
||||
|
||||
}
|
||||
|
||||
NS_IMPL_ISUPPORTS1(nsMsgSearchValueImpl, nsIMsgSearchValue)
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsMsgSearchValueImpl::GetStr(char** aResult)
|
||||
{
|
||||
*aResult = nsCRT::strdup(mValue.u.string);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsMsgSearchValueImpl::SetStr(const char* aValue)
|
||||
{
|
||||
if (mValue.u.string)
|
||||
nsCRT::free(mValue.u.string);
|
||||
mValue.u.string = nsCRT::strdup(aValue);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsMsgSearchValueImpl::GetPriority(nsMsgPriority *aResult)
|
||||
{
|
||||
*aResult = mValue.u.priority;
|
||||
return NS_OK;
|
||||
}
|
||||
NS_IMETHODIMP
|
||||
nsMsgSearchValueImpl::SetPriority(nsMsgPriority aValue)
|
||||
{
|
||||
aValue = mValue.u.priority;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsMsgSearchValueImpl::GetStatus(PRUint32 *aResult)
|
||||
{
|
||||
*aResult = mValue.u.msgStatus;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsMsgSearchValueImpl::SetStatus(PRUint32 aValue)
|
||||
{
|
||||
mValue.u.msgStatus = aValue;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsMsgSearchValueImpl::GetSize(PRUint32 *aResult)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsMsgSearchValueImpl::SetSize(PRUint32 aValue)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsMsgSearchValueImpl::GetMsgKey(nsMsgKey *aResult)
|
||||
{
|
||||
|
||||
}
|
||||
NS_IMETHODIMP
|
||||
nsMsgSearchValueImpl::SetMsgKey(nsMsgKey aValue)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsMsgSearchValueImpl::GetAge(PRUint32 *aResult)
|
||||
{
|
||||
|
||||
}
|
||||
NS_IMETHODIMP
|
||||
nsMsgSearchValueImpl::SetAge(PRUint32 aValue)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsMsgSearchValueImpl::GetFolder(nsIMsgFolder* *aResult)
|
||||
{
|
||||
|
||||
}
|
||||
NS_IMETHODIMP
|
||||
nsMsgSearchValueImpl::SetFolder(nsIMsgFolder* aValue)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsMsgSearchValueImpl::GetDate(PRTime *aResult)
|
||||
{
|
||||
|
||||
}
|
||||
NS_IMETHODIMP
|
||||
nsMsgSearchValueImpl::SetDate(PRTime aValue)
|
||||
{
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,39 @@
|
|||
/* -*- Mode: C++; tab-width: 4; 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 Communicator client code.
|
||||
*
|
||||
* The Initial Developer of the Original Code is Netscape Communications
|
||||
* Corporation. Portions created by Netscape are
|
||||
* Copyright (C) 1998 Netscape Communications Corporation. All
|
||||
* Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Alec Flett <alecf@netscape.com>
|
||||
*/
|
||||
|
||||
#include "nsIMsgSearchValue.h"
|
||||
#include "nsMsgSearchCore.h"
|
||||
|
||||
class nsMsgSearchValueImpl : nsIMsgSearchValue {
|
||||
public:
|
||||
nsMsgSearchValueImpl(nsMsgSearchValue *aInitialValue);
|
||||
virtual ~nsMsgSearchValueImpl();
|
||||
|
||||
NS_DECL_ISUPPORTS
|
||||
NS_DECL_NSIMSGSEARCHVALUE
|
||||
|
||||
private:
|
||||
nsMsgSearchValue mValue;
|
||||
|
||||
};
|
||||
|
Загрузка…
Ссылка в новой задаче