зеркало из https://github.com/mozilla/gecko-dev.git
make tree view implement nsIContentConnector, obsoleting nsITreeView
This commit is contained in:
Родитель
ef2d844690
Коммит
e65fe08c19
|
@ -27,7 +27,7 @@
|
|||
#include "nsTreeView.h"
|
||||
#include "nsHTTreeDataModel.h"
|
||||
|
||||
static NS_DEFINE_IID(kITreeViewIID, NS_ITREEVIEW_IID);
|
||||
static NS_DEFINE_IID(kIContentConnectorIID, NS_ICONTENTCONNECTOR_IID);
|
||||
|
||||
NS_IMPL_ADDREF(nsTreeView)
|
||||
NS_IMPL_RELEASE(nsTreeView)
|
||||
|
@ -36,8 +36,8 @@ static nsEventStatus PR_CALLBACK
|
|||
HandleTreeEvent(nsGUIEvent *aEvent)
|
||||
{
|
||||
nsEventStatus result = nsEventStatus_eIgnore;
|
||||
nsITreeView * tree;
|
||||
if (NS_OK == aEvent->widget->QueryInterface(kITreeViewIID,(void**)&tree)) {
|
||||
nsIContentConnector * tree;
|
||||
if (NS_OK == aEvent->widget->QueryInterface(kIContentConnectorIID,(void**)&tree)) {
|
||||
result = tree->HandleEvent(aEvent);
|
||||
NS_RELEASE(tree);
|
||||
}
|
||||
|
@ -62,7 +62,7 @@ NS_METHOD nsTreeView::Create(nsIWidget *aParent,
|
|||
return answer;
|
||||
}
|
||||
|
||||
nsTreeView::nsTreeView() : nsITreeView(), nsDataModelWidget()
|
||||
nsTreeView::nsTreeView() : nsIContentConnector(), nsDataModelWidget()
|
||||
{
|
||||
NS_INIT_REFCNT();
|
||||
mDataModel = nsnull;
|
||||
|
@ -90,8 +90,8 @@ nsresult nsTreeView::QueryInterface(REFNSIID aIID, void** aInstancePtr)
|
|||
if (NULL == aInstancePtr) {
|
||||
return NS_ERROR_NULL_POINTER;
|
||||
}
|
||||
if (aIID.Equals(kITreeViewIID)) {
|
||||
*aInstancePtr = (void*) (nsITreeView *)this;
|
||||
if (aIID.Equals(kIContentConnectorIID)) {
|
||||
*aInstancePtr = (void*) (nsIContentConnector *)this;
|
||||
AddRef();
|
||||
return NS_OK;
|
||||
}
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
#ifndef nsTreeView_h___
|
||||
#define nsTreeView_h___
|
||||
|
||||
#include "nsITreeView.h"
|
||||
#include "nsIContentConnector.h"
|
||||
#include "nsTreeDataModel.h"
|
||||
#include "nsTreeItem.h"
|
||||
#include "nsTreeColumn.h"
|
||||
|
@ -40,7 +40,7 @@ class nsIImage;
|
|||
// to display the data. It passes all expand/collapse/deletion/etc. events back
|
||||
// to the data model.
|
||||
|
||||
class nsTreeView : public nsITreeView,
|
||||
class nsTreeView : public nsIContentConnector,
|
||||
public nsDataModelWidget
|
||||
{
|
||||
public:
|
||||
|
@ -50,7 +50,7 @@ public:
|
|||
// nsISupports Interface --------------------------------
|
||||
NS_DECL_ISUPPORTS
|
||||
|
||||
// nsITreeView Interface --------------------------------
|
||||
// nsIContentConnector Interface --------------------------------
|
||||
NS_IMETHOD SetContentRoot(nsIContent* pContent);
|
||||
NS_IMETHOD_(nsEventStatus) HandleEvent(nsGUIEvent *aEvent);
|
||||
|
||||
|
@ -113,7 +113,7 @@ protected:
|
|||
const nsRect& rect);
|
||||
|
||||
protected:
|
||||
// Data members
|
||||
// Data members (*** these should both be smart pointers***)
|
||||
nsTreeDataModel* mDataModel; // The data source from which everything to draw is obtained.
|
||||
nsIImageGroup* mImageGroup; // Used to make requests for tree images.
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче