2015-05-12 06:30:00 +00:00
|
|
|
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
|
|
|
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
|
2012-05-21 11:12:37 +00:00
|
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
2001-04-06 01:27:53 +00:00
|
|
|
|
2003-04-10 18:44:03 +00:00
|
|
|
#ifndef nsControllerCommandTable_h_
|
|
|
|
#define nsControllerCommandTable_h_
|
2001-04-06 01:27:53 +00:00
|
|
|
|
2003-04-10 18:44:03 +00:00
|
|
|
#include "nsIControllerCommandTable.h"
|
2001-04-06 01:27:53 +00:00
|
|
|
#include "nsWeakReference.h"
|
2014-02-11 22:56:45 +00:00
|
|
|
#include "nsInterfaceHashtable.h"
|
2001-04-06 01:27:53 +00:00
|
|
|
|
2003-04-10 18:44:03 +00:00
|
|
|
class nsIControllerCommand;
|
2002-01-30 05:15:42 +00:00
|
|
|
|
2015-05-11 19:35:14 +00:00
|
|
|
class nsControllerCommandTable final : public nsIControllerCommandTable,
|
|
|
|
public nsSupportsWeakReference {
|
2001-04-06 01:27:53 +00:00
|
|
|
public:
|
2015-05-11 19:35:14 +00:00
|
|
|
nsControllerCommandTable();
|
2001-04-06 01:27:53 +00:00
|
|
|
|
|
|
|
NS_DECL_ISUPPORTS
|
2003-04-10 18:44:03 +00:00
|
|
|
NS_DECL_NSICONTROLLERCOMMANDTABLE
|
2001-04-06 01:27:53 +00:00
|
|
|
|
2019-04-03 12:52:14 +00:00
|
|
|
static already_AddRefed<nsControllerCommandTable> CreateEditorCommandTable();
|
|
|
|
static already_AddRefed<nsControllerCommandTable> CreateEditingCommandTable();
|
|
|
|
static already_AddRefed<nsControllerCommandTable>
|
2018-09-07 03:17:29 +00:00
|
|
|
CreateHTMLEditorCommandTable();
|
2019-04-03 12:52:14 +00:00
|
|
|
static already_AddRefed<nsControllerCommandTable>
|
2018-09-07 03:17:29 +00:00
|
|
|
CreateHTMLEditorDocStateCommandTable();
|
2019-04-03 12:52:14 +00:00
|
|
|
static already_AddRefed<nsControllerCommandTable> CreateWindowCommandTable();
|
2018-09-07 03:17:29 +00:00
|
|
|
|
2001-04-06 01:27:53 +00:00
|
|
|
protected:
|
2015-05-11 19:35:14 +00:00
|
|
|
virtual ~nsControllerCommandTable();
|
2014-06-30 22:11:52 +00:00
|
|
|
|
2014-02-11 22:56:45 +00:00
|
|
|
// Hash table of nsIControllerCommands, keyed by command name.
|
|
|
|
nsInterfaceHashtable<nsCStringHashKey, nsIControllerCommand> mCommandsTable;
|
|
|
|
|
|
|
|
// Are we mutable?
|
|
|
|
bool mMutable;
|
2001-04-06 01:27:53 +00:00
|
|
|
};
|
|
|
|
|
2019-04-03 12:52:14 +00:00
|
|
|
nsControllerCommandTable*
|
|
|
|
nsIControllerCommandTable::AsControllerCommandTable() {
|
|
|
|
return static_cast<nsControllerCommandTable*>(this);
|
|
|
|
}
|
|
|
|
|
|
|
|
const nsControllerCommandTable*
|
|
|
|
nsIControllerCommandTable::AsControllerCommandTable() const {
|
|
|
|
return static_cast<const nsControllerCommandTable*>(this);
|
|
|
|
}
|
|
|
|
|
2003-04-10 18:44:03 +00:00
|
|
|
#endif // nsControllerCommandTable_h_
|