mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-13 05:15:45 +00:00
add thread object and interface
This commit is contained in:
parent
cbb6e9025e
commit
e66106e976
54
mailnews/db/msgdb/public/nsIMsgThread.h
Normal file
54
mailnews/db/msgdb/public/nsIMsgThread.h
Normal file
@ -0,0 +1,54 @@
|
||||
/* -*- 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.0 (the "NPL"); you may not use this file except in
|
||||
* compliance with the NPL. You may obtain a copy of the NPL at
|
||||
* http://www.mozilla.org/NPL/
|
||||
*
|
||||
* Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
* for the specific language governing rights and limitations under the
|
||||
* NPL.
|
||||
*
|
||||
* The Initial Developer of this code under the NPL is Netscape
|
||||
* Communications Corporation. Portions created by Netscape are
|
||||
* Copyright (C) 1999 Netscape Communications Corporation. All Rights
|
||||
* Reserved.
|
||||
*/
|
||||
|
||||
#ifndef _nsIMsgThread_H
|
||||
#define _nsIMsgThread_H
|
||||
|
||||
#include "nsISupports.h"
|
||||
#include "nsString.h"
|
||||
#include "MailNewsTypes.h"
|
||||
#include "mdb.h"
|
||||
|
||||
class nsIMessage;
|
||||
|
||||
#define NS_IMSGTHREAD_IID \
|
||||
{/* df64af90-e2da-11d2-8d6c-00805f8a6617 */ \
|
||||
0xdf64af90, \
|
||||
0xe2da, \
|
||||
0x11d2, \
|
||||
0x8d, 0x6c, 0x00, 0x80, 0x5f, 0x8a, 0x66, 0x17 \
|
||||
}
|
||||
|
||||
class nsIMsgThread : public nsISupports {
|
||||
public:
|
||||
|
||||
static const nsIID& GetIID() { static nsIID iid = NS_IMSGTHREAD_IID; return iid; }
|
||||
NS_IMETHOD GetFlags(PRUint32 *result) = 0;
|
||||
NS_IMETHOD SetFlags(PRUint32 flags) = 0;
|
||||
NS_IMETHOD GetNumChildren(PRUint32 *result) = 0;
|
||||
NS_IMETHOD GetNumUnreadChildren (PRUint32 *result) = 0;
|
||||
NS_IMETHOD AddChild(nsIMessage *child, PRBool threadInThread) = 0;
|
||||
NS_IMETHOD GetChildAt(PRUint32 index, nsIMessage **result) = 0;
|
||||
NS_IMETHOD GetChild(nsMsgKey msgKey, nsIMessage **result) = 0;
|
||||
NS_IMETHOD GetChildHdrAt(PRUint32 index, nsIMessage **result) = 0;
|
||||
NS_IMETHOD RemoveChildAt(PRUint32 index) = 0;
|
||||
NS_IMETHOD RemoveChild(nsMsgKey msgKey) = 0;
|
||||
NS_IMETHOD MarkChildRead(PRBool bRead) = 0;
|
||||
};
|
||||
|
||||
#endif
|
57
mailnews/db/msgdb/public/nsMsgThread.h
Normal file
57
mailnews/db/msgdb/public/nsMsgThread.h
Normal file
@ -0,0 +1,57 @@
|
||||
/* -*- 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.0 (the "NPL"); you may not use this file except in
|
||||
* compliance with the NPL. You may obtain a copy of the NPL at
|
||||
* http://www.mozilla.org/NPL/
|
||||
*
|
||||
* Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
* for the specific language governing rights and limitations under the
|
||||
* NPL.
|
||||
*
|
||||
* The Initial Developer of this code under the NPL is Netscape
|
||||
* Communications Corporation. Portions created by Netscape are
|
||||
* Copyright (C) 1999 Netscape Communications Corporation. All Rights
|
||||
* Reserved.
|
||||
*/
|
||||
|
||||
#ifndef _nsMsgThread_H
|
||||
#define _nsMsgThread_H
|
||||
|
||||
#include "nsIMsgThread.h"
|
||||
#include "nsString.h"
|
||||
#include "MailNewsTypes.h"
|
||||
|
||||
class nsIMessage;
|
||||
|
||||
class nsMsgThread : public nsIMsgThread {
|
||||
public:
|
||||
nsMsgThread();
|
||||
virtual ~nsMsgThread();
|
||||
|
||||
NS_DECL_ISUPPORTS
|
||||
|
||||
NS_IMETHOD GetFlags(PRUint32 *result);
|
||||
NS_IMETHOD SetFlags(PRUint32 flags);
|
||||
NS_IMETHOD GetNumChildren(PRUint32 *result);
|
||||
NS_IMETHOD GetNumUnreadChildren (PRUint32 *result);
|
||||
NS_IMETHOD AddChild(nsIMessage *child, PRBool threadInThread);
|
||||
NS_IMETHOD GetChildAt(PRUint32 index, nsIMessage **result);
|
||||
NS_IMETHOD GetChild(nsMsgKey msgKey, nsIMessage **result);
|
||||
NS_IMETHOD GetChildHdrAt(PRUint32 index, nsIMessage **result);
|
||||
NS_IMETHOD RemoveChildAt(PRUint32 index);
|
||||
NS_IMETHOD RemoveChild(nsMsgKey msgKey);
|
||||
NS_IMETHOD MarkChildRead(PRBool bRead);
|
||||
|
||||
protected:
|
||||
nsMsgKey m_threadKey;
|
||||
PRUint32 m_numChildren;
|
||||
PRUint32 m_numNewChildren;
|
||||
PRUint32 m_flags;
|
||||
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
|
125
mailnews/db/msgdb/src/nsMsgThread.cpp
Normal file
125
mailnews/db/msgdb/src/nsMsgThread.cpp
Normal file
@ -0,0 +1,125 @@
|
||||
/* -*- 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.0 (the "NPL"); you may not use this file except in
|
||||
* compliance with the NPL. You may obtain a copy of the NPL at
|
||||
* http://www.mozilla.org/NPL/
|
||||
*
|
||||
* Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
* for the specific language governing rights and limitations under the
|
||||
* NPL.
|
||||
*
|
||||
* The Initial Developer of this code under the NPL is Netscape
|
||||
* Communications Corporation. Portions created by Netscape are
|
||||
* Copyright (C) 1999 Netscape Communications Corporation. All Rights
|
||||
* Reserved.
|
||||
*/
|
||||
|
||||
#include "msgCore.h"
|
||||
#include "nsMsgThread.h"
|
||||
#include "nsMsgDatabase.h"
|
||||
|
||||
|
||||
NS_IMPL_ISUPPORTS(nsMsgThread, nsMsgThread::GetIID())
|
||||
|
||||
nsMsgThread::nsMsgThread()
|
||||
{
|
||||
m_threadKey = nsMsgKey_None;
|
||||
m_numChildren = 0;
|
||||
m_numNewChildren = 0;
|
||||
m_flags = 0;
|
||||
NS_INIT_REFCNT();
|
||||
}
|
||||
|
||||
nsMsgThread::~nsMsgThread()
|
||||
{
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsMsgThread::GetFlags(PRUint32 *result)
|
||||
{
|
||||
nsresult ret = NS_OK;
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsMsgThread::SetFlags(PRUint32 flags)
|
||||
{
|
||||
nsresult ret = NS_OK;
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
NS_IMETHODIMP nsMsgThread::GetNumChildren(PRUint32 *result)
|
||||
{
|
||||
nsresult ret = NS_OK;
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
NS_IMETHODIMP nsMsgThread::GetNumUnreadChildren (PRUint32 *result)
|
||||
{
|
||||
nsresult ret = NS_OK;
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
NS_IMETHODIMP nsMsgThread::AddChild(nsIMessage *child, PRBool threadInThread)
|
||||
{
|
||||
nsresult ret = NS_OK;
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
NS_IMETHODIMP nsMsgThread::GetChildAt(PRUint32 index, nsIMessage **result)
|
||||
{
|
||||
nsresult ret = NS_OK;
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
NS_IMETHODIMP nsMsgThread::GetChild(nsMsgKey msgKey, nsIMessage **result)
|
||||
{
|
||||
nsresult ret = NS_OK;
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
NS_IMETHODIMP nsMsgThread::GetChildHdrAt(PRUint32 index, nsIMessage **result)
|
||||
{
|
||||
nsresult ret = NS_OK;
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
NS_IMETHODIMP nsMsgThread::RemoveChildAt(PRUint32 index)
|
||||
{
|
||||
nsresult ret = NS_OK;
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
NS_IMETHODIMP nsMsgThread::RemoveChild(nsMsgKey msgKey)
|
||||
{
|
||||
nsresult ret = NS_OK;
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
NS_IMETHODIMP nsMsgThread::MarkChildRead(PRBool bRead)
|
||||
{
|
||||
nsresult ret = NS_OK;
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user