Removing some native widget cruft. rs=blizzard. Not part of the build.

This commit is contained in:
bryner%netscape.com 2001-11-02 18:21:50 +00:00
Родитель d158dba04b
Коммит c08946375f
9 изменённых файлов: 0 добавлений и 1224 удалений

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

@ -62,10 +62,6 @@ CPPSRCS = \
nsKeyCode.cpp \
nsLabel.cpp \
nsLookAndFeel.cpp \
nsMenu.cpp \
nsMenuBar.cpp \
nsMenuItem.cpp \
nsPopUpMenu.cpp \
nsScrollBar.cpp \
nsSound.cpp \
nsTextHelper.cpp \

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

@ -1,235 +0,0 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* ***** BEGIN LICENSE BLOCK *****
* Version: NPL 1.1/GPL 2.0/LGPL 2.1
*
* 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 the Initial Developer are Copyright (C) 1998
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the NPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the NPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
#include "nsMenu.h"
#include "nsIMenu.h"
#include "nsIMenuItem.h"
#include "nsIMenuListener.h"
NS_IMPL_ISUPPORTS2(nsMenu, nsIMenu, nsIMenuListener)
nsMenu::nsMenu()
{
NS_INIT_ISUPPORTS();
mMenuBarParent = nsnull;
mMenuParent = nsnull;
mListener = nsnull;
// nsresult result = NS_NewISupportsArray(&mItems);
}
nsMenu::~nsMenu()
{
// NS_IF_RELEASE(mMenuBarParent);
NS_IF_RELEASE(mMenuParent);
NS_IF_RELEASE(mListener);
// Remove all references to the items
mItems->Clear();
}
NS_METHOD nsMenu::Create(nsISupports * aParent, const nsAReadableString &aLabel,
const nsAReadableString &aAccessKey,
nsIChangeManager* aManager, nsIWebShell* aShell,
nsIContent* aContent )
{
return NS_OK;
}
NS_METHOD nsMenu::GetParent(nsISupports*& aParent)
{
return NS_OK;
}
NS_METHOD nsMenu::GetLabel(nsString &aText)
{
return NS_OK;
}
NS_METHOD nsMenu::SetLabel(const nsAReadableString &aText)
{
return NS_OK;
}
NS_METHOD nsMenu::GetEnabled(PRBool* aIsEnabled)
{
return NS_OK;
}
NS_METHOD nsMenu::IsHelpMenu(PRBool* aIsHelpMenu)
{
return NS_OK;
}
NS_METHOD nsMenu::AddItem(nsISupports * aItem)
{
return NS_OK;
}
nsIMenuBar * nsMenu::GetMenuBar(nsIMenu * aMenu)
{
return NS_OK;
}
nsIWidget * nsMenu::GetParentWidget()
{
return nsnull;
}
NS_METHOD nsMenu::AddMenuItem(nsIMenuItem * aMenuItem)
{
return NS_OK;
}
NS_METHOD nsMenu::AddMenu(nsIMenu * aMenu)
{
return NS_OK;
}
NS_METHOD nsMenu::AddSeparator()
{
return NS_OK;
}
NS_METHOD nsMenu::GetItemCount(PRUint32 &aCount)
{
return NS_OK;
}
NS_METHOD nsMenu::GetItemAt(const PRUint32 aCount, nsISupports *& aMenuItem)
{
return NS_OK;
}
NS_METHOD nsMenu::InsertItemAt(const PRUint32 aCount, nsISupports * aMenuItem)
{
return NS_OK;
}
NS_METHOD nsMenu::InsertSeparator(const PRUint32 aCount)
{
return NS_OK;
}
NS_METHOD nsMenu::RemoveItem(const PRUint32 aCount)
{
return NS_OK;
}
NS_METHOD nsMenu::RemoveAll()
{
return NS_OK;
}
NS_METHOD nsMenu::SetNativeData(void * aData)
{
return NS_OK;
}
NS_METHOD nsMenu::GetNativeData(void ** aData)
{
return NS_OK;
}
NS_METHOD nsMenu::AddMenuListener(nsIMenuListener * aMenuListener)
{
return NS_OK;
}
NS_METHOD nsMenu::RemoveMenuListener(nsIMenuListener * aMenuListener)
{
return NS_OK;
}
NS_METHOD nsMenu::SetEnabled(PRBool aIsEnabled)
{
return NS_OK;
}
nsEventStatus nsMenu::MenuItemSelected(const nsMenuEvent & aMenuEvent)
{
return nsEventStatus_eIgnore;
}
nsEventStatus nsMenu::MenuSelected(const nsMenuEvent & aMenuEvent)
{
return nsEventStatus_eIgnore;
}
nsEventStatus nsMenu::MenuDeselected(const nsMenuEvent & aMenuEvent)
{
return nsEventStatus_eIgnore;
}
nsEventStatus nsMenu::MenuConstruct(const nsMenuEvent & aMenuEvent,
nsIWidget * aParentWindow,
void * menubarNode,
void * aWebShell)
{
return nsEventStatus_eIgnore;
}
nsEventStatus nsMenu::MenuDestruct(const nsMenuEvent & aMenuEvent)
{
return nsEventStatus_eIgnore;
}
NS_METHOD nsMenu::SetDOMNode(nsIDOMNode * menuNode)
{
return NS_OK;
}
NS_METHOD nsMenu::SetDOMElement(nsIDOMElement * menuElement)
{
return NS_OK;
}
NS_METHOD nsMenu::SetWebShell(nsIWebShell * aWebShell)
{
return NS_OK;
}
//-------------------------------------------------------------------------
NS_METHOD nsMenu::GetAccessKey(nsString &aText)
{
return NS_OK;
}
//-------------------------------------------------------------------------
NS_METHOD nsMenu::SetAccessKey(const nsAReadableString &aText)
{
return NS_OK;
}

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

@ -1,129 +0,0 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* ***** BEGIN LICENSE BLOCK *****
* Version: NPL 1.1/GPL 2.0/LGPL 2.1
*
* 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 the Initial Developer are Copyright (C) 1998
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the NPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the NPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
#ifndef nsMenu_h__
#define nsMenu_h__
#include "nsWidget.h"
#include "nsIMenu.h"
#include "nsISupportsArray.h"
#include "nsIMenuListener.h"
class nsIContent;
class nsIDOMElement;
class nsIDOMNode;
class nsMenu : public nsIMenu, public nsIMenuListener
{
public:
nsMenu();
virtual ~nsMenu();
NS_DECL_ISUPPORTS
// nsIMenuListener interface
nsEventStatus MenuItemSelected(const nsMenuEvent & aMenuEvent);
nsEventStatus MenuSelected(const nsMenuEvent & aMenuEvent);
nsEventStatus MenuDeselected(const nsMenuEvent & aMenuEvent);
nsEventStatus MenuConstruct(const nsMenuEvent & aMenuEvent,
nsIWidget * aParentWindow,
void * menubarNode,
void * aWebShell);
nsEventStatus MenuDestruct(const nsMenuEvent & aMenuEvent);
// nsIMenu Methods
NS_IMETHOD Create(nsISupports * aParent, const nsAReadableString &aLabel,
const nsAReadableString &aAccessKey,
nsIChangeManager* aManager, nsIWebShell* aShell,
nsIContent* aContent );
NS_IMETHOD GetParent(nsISupports *&aParent);
NS_IMETHOD GetLabel(nsString &aText);
NS_IMETHOD SetLabel(const nsAReadableString &aText);
NS_IMETHOD GetAccessKey(nsString &aText);
NS_IMETHOD SetAccessKey(const nsAReadableString &aText);
NS_IMETHOD AddItem(nsISupports * aItem);
NS_IMETHOD AddSeparator();
NS_IMETHOD GetItemCount(PRUint32 &aCount);
NS_IMETHOD GetItemAt(const PRUint32 aPos, nsISupports *& aMenuItem);
NS_IMETHOD InsertItemAt(const PRUint32 aPos, nsISupports * aMenuItem);
NS_IMETHOD RemoveItem(const PRUint32 aPos);
NS_IMETHOD RemoveAll();
NS_IMETHOD GetNativeData(void** aData);
NS_IMETHOD SetNativeData(void* aData);
NS_IMETHOD AddMenuListener(nsIMenuListener * aMenuListener);
NS_IMETHOD RemoveMenuListener(nsIMenuListener * aMenuListener);
NS_IMETHOD SetEnabled(PRBool aIsEnabled);
NS_IMETHOD GetEnabled(PRBool* aIsEnabled);
NS_IMETHOD IsHelpMenu(PRBool* aIsHelp);
//
NS_IMETHOD AddMenuItem(nsIMenuItem * aMenuItem);
NS_IMETHOD AddMenu(nsIMenu * aMenu);
NS_IMETHOD InsertSeparator(const PRUint32 aCount);
NS_IMETHOD SetDOMNode(nsIDOMNode * menuNode);
NS_IMETHOD SetDOMElement(nsIDOMElement * menuElement);
NS_IMETHOD SetWebShell(nsIWebShell * aWebShell);
// Native Impl Methods
// These are not ref counted
nsIMenu * GetMenuParent() { return mMenuParent; }
nsIMenuBar * GetMenuBarParent() { return mMenuBarParent; }
protected:
nsIMenuBar * GetMenuBar(nsIMenu * aMenu);
nsIWidget * GetParentWidget();
nsString mLabel;
nsIMenuBar * mMenuBarParent;
nsIMenu * mMenuParent;
nsISupportsArray * mItems;
nsIMenuListener * mListener;
};
#endif // nsMenu_h__

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

@ -1,167 +0,0 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* ***** BEGIN LICENSE BLOCK *****
* Version: NPL 1.1/GPL 2.0/LGPL 2.1
*
* 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 the Initial Developer are Copyright (C) 1998
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the NPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the NPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
#include "nsMenuBar.h"
static NS_DEFINE_IID(kIMenuBarIID, NS_IMENUBAR_IID);
static NS_DEFINE_IID(kISupportsIID, NS_ISUPPORTS_IID);
nsresult nsMenuBar::QueryInterface(REFNSIID aIID, void** aInstancePtr)
{
if (NULL == aInstancePtr) {
return NS_ERROR_NULL_POINTER;
}
*aInstancePtr = NULL;
if (aIID.Equals(kIMenuBarIID)) {
*aInstancePtr = (void*) ((nsIMenuBar*) this);
NS_ADDREF_THIS();
return NS_OK;
}
if (aIID.Equals(kISupportsIID)) {
*aInstancePtr = (void*) ((nsISupports*)(nsIMenuBar*) this);
NS_ADDREF_THIS();
return NS_OK;
}
if (aIID.Equals(NS_GET_IID(nsIMenuListener))) {
*aInstancePtr = (void*) ((nsIMenuListener*)this);
NS_ADDREF_THIS();
return NS_OK;
}
return NS_NOINTERFACE;
}
NS_IMPL_ADDREF(nsMenuBar)
NS_IMPL_RELEASE(nsMenuBar)
nsEventStatus nsMenuBar::MenuItemSelected(const nsMenuEvent & aMenuEvent)
{
return nsEventStatus_eIgnore;
}
nsEventStatus nsMenuBar::MenuSelected(const nsMenuEvent & aMenuEvent)
{
return nsEventStatus_eIgnore;
}
nsEventStatus nsMenuBar::MenuDeselected(const nsMenuEvent & aMenuEvent)
{
return nsEventStatus_eIgnore;
}
nsEventStatus nsMenuBar::MenuConstruct(const nsMenuEvent & aMenuEvent,
nsIWidget * aParentWindow,
void * menubarNode,
void * aWebShell)
{
return nsEventStatus_eIgnore;
}
nsEventStatus nsMenuBar::MenuDestruct(const nsMenuEvent & aMenuEvent)
{
return nsEventStatus_eIgnore;
}
nsMenuBar::nsMenuBar() : nsIMenuBar(), nsIMenuListener()
{
NS_INIT_REFCNT();
}
nsMenuBar::~nsMenuBar()
{
}
NS_METHOD nsMenuBar::Create(nsIWidget *aParent)
{
return NS_OK;
}
NS_METHOD nsMenuBar::GetParent(nsIWidget *&aParent)
{
return NS_OK;
}
NS_METHOD nsMenuBar::SetParent(nsIWidget *aParent)
{
return NS_OK;
}
NS_METHOD nsMenuBar::AddMenu(nsIMenu * aMenu)
{
return NS_OK;
}
NS_METHOD nsMenuBar::GetMenuCount(PRUint32 &aCount)
{
return NS_OK;
}
NS_METHOD nsMenuBar::InsertMenuAt(const PRUint32 aPos, nsIMenu *& aMenu)
{
return NS_OK;
}
NS_METHOD nsMenuBar::RemoveMenu(const PRUint32 aPos)
{
return NS_OK;
}
NS_METHOD nsMenuBar::RemoveAll()
{
return NS_OK;
}
NS_METHOD nsMenuBar::GetNativeData(void *& aData)
{
return NS_OK;
}
NS_METHOD nsMenuBar::SetNativeData(void * aData)
{
return NS_OK;
}
NS_METHOD nsMenuBar::Paint()
{
return NS_OK;
}
NS_METHOD nsMenuBar::GetMenuAt(const PRUint32 aPos, nsIMenu *& aMenu)
{
return NS_OK;
}

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

@ -1,84 +0,0 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* ***** BEGIN LICENSE BLOCK *****
* Version: NPL 1.1/GPL 2.0/LGPL 2.1
*
* 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 the Initial Developer are Copyright (C) 1998
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the NPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the NPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
#ifndef nsMenuBar_h__
#define nsMenuBar_h__
#include "nsWidget.h"
#include "nsIMenuBar.h"
#include "nsIMenuListener.h"
#include "nsVoidArray.h"
class nsIWidget;
class nsMenuBar : public nsIMenuBar, public nsIMenuListener
{
public:
nsMenuBar();
virtual ~nsMenuBar();
// nsIMenuListener interface
nsEventStatus MenuItemSelected(const nsMenuEvent & aMenuEvent);
nsEventStatus MenuSelected(const nsMenuEvent & aMenuEvent);
nsEventStatus MenuDeselected(const nsMenuEvent & aMenuEvent);
nsEventStatus MenuConstruct(const nsMenuEvent & aMenuEvent,
nsIWidget * aParentWindow,
void * menubarNode,
void * aWebShell);
nsEventStatus MenuDestruct(const nsMenuEvent & aMenuEvent);
NS_DECL_ISUPPORTS
NS_IMETHOD Create(nsIWidget * aParent);
// nsIMenuBar Methods
NS_IMETHOD GetParent(nsIWidget *&aParent);
NS_IMETHOD SetParent(nsIWidget * aParent);
NS_IMETHOD AddMenu(nsIMenu * aMenu);
NS_IMETHOD GetMenuCount(PRUint32 &aCount);
NS_IMETHOD GetMenuAt(const PRUint32 aPos, nsIMenu *& aMenu);
NS_IMETHOD InsertMenuAt(const PRUint32 aPos, nsIMenu *& aMenu);
NS_IMETHOD RemoveMenu(const PRUint32 aPos);
NS_IMETHOD RemoveAll();
NS_IMETHOD GetNativeData(void*& aData);
NS_IMETHOD Paint();
NS_IMETHOD SetNativeData(void* aData);
};
#endif // nsMenuBar_h__

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

@ -1,270 +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) 1998 Netscape Communications Corporation. All
* Rights Reserved.
*
* Contributor(s):
*/
#include "nsMenuItem.h"
#include "nsIMenu.h"
#include "nsIMenuBar.h"
#include "nsIPopUpMenu.h"
static NS_DEFINE_IID(kIMenuIID, NS_IMENU_IID);
static NS_DEFINE_IID(kIMenuBarIID, NS_IMENUBAR_IID);
static NS_DEFINE_IID(kISupportsIID, NS_ISUPPORTS_IID);
static NS_DEFINE_IID(kIPopUpMenuIID, NS_IPOPUPMENU_IID);
static NS_DEFINE_IID(kIMenuItemIID, NS_IMENUITEM_IID);
nsresult nsMenuItem::QueryInterface(REFNSIID aIID, void** aInstancePtr)
{
if (NULL == aInstancePtr) {
return NS_ERROR_NULL_POINTER;
}
*aInstancePtr = NULL;
if (aIID.Equals(kIMenuItemIID)) {
*aInstancePtr = (void*)(nsIMenuItem*)this;
NS_ADDREF_THIS();
return NS_OK;
}
if (aIID.Equals(NS_GET_IID(nsIMenuListener))) {
*aInstancePtr = (void*)(nsIMenuListener*)this;
NS_ADDREF_THIS();
return NS_OK;
}
if (aIID.Equals(kISupportsIID)) {
*aInstancePtr = (void*)(nsISupports*)(nsIMenuItem*)this;
NS_ADDREF_THIS();
return NS_OK;
}
return NS_NOINTERFACE;
}
NS_IMPL_ADDREF(nsMenuItem)
NS_IMPL_RELEASE(nsMenuItem)
nsMenuItem::nsMenuItem() : nsIMenuItem()
{
NS_INIT_REFCNT();
}
nsMenuItem::~nsMenuItem()
{
}
nsIWidget * nsMenuItem::GetMenuBarParent(nsISupports * aParent)
{
return nsnull;
}
NS_METHOD nsMenuItem::Create(nsISupports *aParent,
const nsString &aLabel,
PRBool aIsSeparator)
{
return NS_OK;
}
NS_METHOD nsMenuItem::Create(nsIPopUpMenu *aParent,
const nsString &aLabel,
PRUint32 aCommand)
{
return NS_OK;
}
NS_METHOD nsMenuItem::Create(nsIMenu * aParent)
{
return NS_OK;
}
NS_METHOD nsMenuItem::Create(nsIPopUpMenu * aParent)
{
return NS_OK;
}
NS_METHOD nsMenuItem::GetLabel(nsString &aText)
{
return NS_OK;
}
NS_METHOD nsMenuItem::SetLabel(nsString &aText)
{
return NS_OK;
}
NS_METHOD nsMenuItem::GetCheckboxType(PRBool *aIsCheckbox)
{
return NS_OK;
}
NS_METHOD nsMenuItem::SetCheckboxType(PRBool aIsCheckbox)
{
return NS_OK;
}
NS_METHOD nsMenuItem::GetCommand(PRUint32 & aCommand)
{
return NS_OK;
}
NS_METHOD nsMenuItem::GetTarget(nsIWidget *& aTarget)
{
return NS_OK;
}
NS_METHOD nsMenuItem::GetNativeData(void *& aData)
{
return NS_OK;
}
NS_METHOD nsMenuItem::AddMenuListener(nsIMenuListener * aMenuListener)
{
return NS_OK;
}
NS_METHOD nsMenuItem::RemoveMenuListener(nsIMenuListener * aMenuListener)
{
return NS_OK;
}
void nsMenuItem::SetCmdId(PRInt32 aId)
{
}
PRInt32 nsMenuItem::GetCmdId()
{
return 0;
}
NS_METHOD nsMenuItem::IsSeparator(PRBool & aIsSep)
{
return NS_OK;
}
NS_METHOD nsMenuItem::SetEnabled(PRBool aIsEnabled)
{
return NS_OK;
}
NS_METHOD nsMenuItem::GetEnabled(PRBool *aIsEnabled)
{
return NS_OK;
}
NS_METHOD nsMenuItem::SetChecked(PRBool aIsEnabled)
{
return NS_OK;
}
NS_METHOD nsMenuItem::GetChecked(PRBool *aIsEnabled)
{
return NS_OK;
}
nsEventStatus nsMenuItem::MenuItemSelected(const nsMenuEvent & aMenuEvent)
{
return nsEventStatus_eIgnore;
}
nsEventStatus nsMenuItem::MenuSelected(const nsMenuEvent & aMenuEvent)
{
return nsEventStatus_eIgnore;
}
nsEventStatus nsMenuItem::MenuDeselected(const nsMenuEvent & aMenuEvent)
{
return nsEventStatus_eIgnore;
}
nsEventStatus nsMenuItem::MenuConstruct(const nsMenuEvent & aMenuEvent,
nsIWidget * aParentWindow,
void * menubarNode,
void * aWebShell)
{
return nsEventStatus_eIgnore;
}
nsEventStatus nsMenuItem::MenuDestruct(const nsMenuEvent & aMenuEvent)
{
return nsEventStatus_eIgnore;
}
NS_METHOD nsMenuItem::SetDOMNode(nsIDOMNode * aDOMNode)
{
return NS_OK;
}
//-------------------------------------------------------------------------
NS_METHOD nsMenuItem::GetDOMNode(nsIDOMNode ** aDOMNode)
{
return NS_OK;
}
NS_METHOD nsMenuItem::SetDOMElement(nsIDOMElement * aDOMElement)
{
return NS_OK;
}
NS_METHOD nsMenuItem::GetDOMElement(nsIDOMElement ** aDOMElement)
{
return NS_OK;
}
NS_METHOD nsMenuItem::SetWebShell(nsIWebShell * aWebShell)
{
return NS_OK;
}
NS_METHOD nsMenuItem::SetCommand(const nsString & aStrCmd)
{
return NS_OK;
}
NS_METHOD nsMenuItem::DoCommand()
{
return NS_OK;
}
NS_IMETHODIMP nsMenuItem::SetShortcutChar(const nsString &aText)
{
mKeyEquivalent = aText;
return NS_OK;
}
//----------------------------------------------------------------------
NS_IMETHODIMP nsMenuItem::GetShortcutChar(nsString &aText)
{
aText = mKeyEquivalent;
return NS_OK;
}
//----------------------------------------------------------------------
NS_IMETHODIMP nsMenuItem::SetModifiers(PRUint8 aModifiers)
{
mModifiers = aModifiers;
return NS_OK;
}
//----------------------------------------------------------------------
NS_IMETHODIMP nsMenuItem::GetModifiers(PRUint8 * aModifiers)
{
*aModifiers = mModifiers;
return NS_OK;
}

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

@ -1,132 +0,0 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* ***** BEGIN LICENSE BLOCK *****
* Version: NPL 1.1/GPL 2.0/LGPL 2.1
*
* 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 the Initial Developer are Copyright (C) 1998
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the NPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the NPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
#ifndef nsMenuItem_h__
#define nsMenuItem_h__
#include "nsISupports.h"
#include "nsIWidget.h"
#include "nsIMenuItem.h"
#include "nsIMenuListener.h"
class nsIMenu;
class nsIPopUpMenu;
class nsIMenuListener;
/**
* Native Win32 MenuItem wrapper
*/
class nsMenuItem : public nsIMenuItem, public nsIMenuListener
{
public:
nsMenuItem();
virtual ~nsMenuItem();
// nsISupports
NS_DECL_ISUPPORTS
// methods for nsIMenuBar
NS_IMETHOD Create(nsISupports *aParent,
const nsString &aLabel,
PRBool aIsSeparator);
NS_IMETHOD Create(nsIPopUpMenu *aParent,
const nsString &aLabel,
PRUint32 aCommand) ;
NS_IMETHOD Create(nsIMenu * aParent);
NS_IMETHOD Create(nsIPopUpMenu * aParent);
// nsIMenuBar Methods
NS_IMETHOD SetDOMElement(nsIDOMElement * aDOMElement);
NS_IMETHOD GetDOMElement(nsIDOMElement ** aDOMElement);
NS_IMETHOD SetDOMNode(nsIDOMNode * aDOMNode);
NS_IMETHOD GetDOMNode(nsIDOMNode ** aDOMNode);
NS_IMETHOD SetWebShell(nsIWebShell * aWebShell);
NS_IMETHOD SetCommand(const nsString & aStrCmd);
NS_IMETHOD DoCommand();
NS_IMETHOD GetLabel(nsString &aText);
NS_IMETHOD SetLabel(nsString &aText);
NS_IMETHOD SetEnabled(PRBool aIsEnabled);
NS_IMETHOD GetEnabled(PRBool *aIsEnabled);
NS_IMETHOD SetChecked(PRBool aIsEnabled);
NS_IMETHOD GetChecked(PRBool *aIsEnabled);
NS_IMETHOD SetCheckboxType(PRBool aIsCheckbox);
NS_IMETHOD GetCheckboxType(PRBool *aIsCheckbox);
NS_IMETHOD GetCommand(PRUint32 & aCommand);
NS_IMETHOD GetTarget(nsIWidget *& aTarget);
NS_IMETHOD GetNativeData(void*& aData);
NS_IMETHOD AddMenuListener(nsIMenuListener * aMenuListener);
NS_IMETHOD RemoveMenuListener(nsIMenuListener * aMenuListener);
NS_IMETHOD IsSeparator(PRBool & aIsSep);
NS_IMETHOD SetShortcutChar(const nsString &aText);
NS_IMETHOD GetShortcutChar(nsString &aText);
NS_IMETHOD SetModifiers(PRUint8 aModifiers);
NS_IMETHOD GetModifiers(PRUint8 * aModifiers);
// nsIMenuListener interface
nsEventStatus MenuItemSelected(const nsMenuEvent & aMenuEvent);
nsEventStatus MenuSelected(const nsMenuEvent & aMenuEvent);
nsEventStatus MenuDeselected(const nsMenuEvent & aMenuEvent);
nsEventStatus MenuConstruct(const nsMenuEvent & aMenuEvent,
nsIWidget * aParentWindow,
void * menubarNode,
void * aWebShell);
nsEventStatus MenuDestruct(const nsMenuEvent & aMenuEvent);
// Need for Native Impl
void SetCmdId(PRInt32 aId);
PRInt32 GetCmdId();
protected:
nsIWidget * GetMenuBarParent(nsISupports * aParent);
nsString mLabel;
PRUint32 mCommand;
nsIWidget * mTarget;
nsIMenu * mMenu;
nsIMenuListener * mListener;
PRInt32 mCmdId;
PRBool mIsSeparator;
nsString mKeyEquivalent;
PRUint8 mModifiers;
};
#endif // nsMenuItem_h__

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

@ -1,127 +0,0 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* ***** BEGIN LICENSE BLOCK *****
* Version: NPL 1.1/GPL 2.0/LGPL 2.1
*
* 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 the Initial Developer are Copyright (C) 1998
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the NPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the NPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
#include "nsPopUpMenu.h"
NS_IMPL_ISUPPORTS1(nsPopUpMenu, nsIPopUpMenu)
nsPopUpMenu::nsPopUpMenu() : nsIPopUpMenu()
{
NS_INIT_REFCNT();
mParent = nsnull;
}
nsPopUpMenu::~nsPopUpMenu()
{
}
NS_METHOD nsPopUpMenu::Create(nsIWidget *aParent)
{
mParent = aParent;
NS_ADDREF(mParent);
return NS_OK;
}
NS_METHOD nsPopUpMenu::AddItem(const nsString &aText)
{
return NS_OK;
}
NS_METHOD nsPopUpMenu::AddItem(nsIMenuItem * aMenuItem)
{
return NS_OK;
}
NS_METHOD nsPopUpMenu::AddMenu(nsIMenu * aMenu)
{
return NS_OK;
}
NS_METHOD nsPopUpMenu::AddSeparator()
{
return NS_OK;
}
NS_METHOD nsPopUpMenu::GetItemCount(PRUint32 &aCount)
{
return NS_OK;
}
NS_METHOD nsPopUpMenu::GetItemAt(const PRUint32 aCount, nsIMenuItem *& aMenuItem)
{
return NS_OK;
}
NS_METHOD nsPopUpMenu::InsertItemAt(const PRUint32 aCount, nsIMenuItem *& aMenuItem)
{
return NS_OK;
}
NS_METHOD nsPopUpMenu::InsertItemAt(const PRUint32 aCount, const nsString & aMenuItemName)
{
return NS_OK;
}
NS_METHOD nsPopUpMenu::InsertSeparator(const PRUint32 aCount)
{
return NS_OK;
}
NS_METHOD nsPopUpMenu::RemoveItem(const PRUint32 aCount)
{
return NS_OK;
}
NS_METHOD nsPopUpMenu::RemoveAll()
{
return NS_OK;
}
NS_METHOD nsPopUpMenu::ShowMenu(PRInt32 aX, PRInt32 aY)
{
return NS_OK;
}
NS_METHOD nsPopUpMenu::GetNativeData(void *& aData)
{
return NS_OK;
}
NS_METHOD nsPopUpMenu::GetParent(nsIWidget *& aParent)
{
aParent = mParent;
return NS_OK;
}

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

@ -1,76 +0,0 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* ***** BEGIN LICENSE BLOCK *****
* Version: NPL 1.1/GPL 2.0/LGPL 2.1
*
* 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 the Initial Developer are Copyright (C) 1998
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the NPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the NPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
#ifndef nsPopUpMenu_h__
#define nsPopUpMenu_h__
#include "nsWidget.h"
#include "nsIPopUpMenu.h"
class nsPopUpMenu : public nsIPopUpMenu
{
public:
nsPopUpMenu();
virtual ~nsPopUpMenu();
NS_DECL_ISUPPORTS
NS_IMETHOD Create(nsIWidget * aParent);
// nsIPopUpMenu Methods
NS_IMETHOD AddItem(const nsString &aText);
NS_IMETHOD AddItem(nsIMenuItem * aMenuItem);
NS_IMETHOD AddMenu(nsIMenu * aMenu);
NS_IMETHOD AddSeparator();
NS_IMETHOD GetItemCount(PRUint32 &aCount);
NS_IMETHOD GetItemAt(const PRUint32 aCount, nsIMenuItem *& aMenuItem);
NS_IMETHOD InsertItemAt(const PRUint32 aCount, nsIMenuItem *& aMenuItem);
NS_IMETHOD InsertItemAt(const PRUint32 aCount, const nsString & aMenuItemName);
NS_IMETHOD InsertSeparator(const PRUint32 aCount);
NS_IMETHOD RemoveItem(const PRUint32 aCount);
NS_IMETHOD RemoveAll();
NS_IMETHOD ShowMenu(PRInt32 aX, PRInt32 aY);
NS_IMETHOD GetNativeData(void*& aData);
NS_IMETHOD GetParent(nsIWidget*& aParent);
protected:
nsIWidget * mParent;
};
#endif // nsPopUpMenu_h__