2015-05-12 09:30:00 +03: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 15:12:37 +04: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 05:27:53 +04:00
|
|
|
|
2003-04-10 22:44:03 +04:00
|
|
|
#ifndef nsControllerCommandTable_h_
|
|
|
|
#define nsControllerCommandTable_h_
|
2001-04-06 05:27:53 +04:00
|
|
|
|
2003-04-10 22:44:03 +04:00
|
|
|
#include "nsIControllerCommandTable.h"
|
2001-04-06 05:27:53 +04:00
|
|
|
#include "nsWeakReference.h"
|
2014-02-12 02:56:45 +04:00
|
|
|
#include "nsInterfaceHashtable.h"
|
2001-04-06 05:27:53 +04:00
|
|
|
|
2003-04-10 22:44:03 +04:00
|
|
|
class nsIControllerCommand;
|
2002-01-30 08:15:42 +03:00
|
|
|
|
2015-05-11 22:35:14 +03:00
|
|
|
class nsControllerCommandTable final : public nsIControllerCommandTable,
|
|
|
|
public nsSupportsWeakReference {
|
2001-04-06 05:27:53 +04:00
|
|
|
public:
|
2015-05-11 22:35:14 +03:00
|
|
|
nsControllerCommandTable();
|
2001-04-06 05:27:53 +04:00
|
|
|
|
|
|
|
NS_DECL_ISUPPORTS
|
2003-04-10 22:44:03 +04:00
|
|
|
NS_DECL_NSICONTROLLERCOMMANDTABLE
|
2001-04-06 05:27:53 +04:00
|
|
|
|
2019-04-03 15:52:14 +03:00
|
|
|
static already_AddRefed<nsControllerCommandTable> CreateEditorCommandTable();
|
|
|
|
static already_AddRefed<nsControllerCommandTable> CreateEditingCommandTable();
|
|
|
|
static already_AddRefed<nsControllerCommandTable>
|
2018-09-07 06:17:29 +03:00
|
|
|
CreateHTMLEditorCommandTable();
|
2019-04-03 15:52:14 +03:00
|
|
|
static already_AddRefed<nsControllerCommandTable>
|
2018-09-07 06:17:29 +03:00
|
|
|
CreateHTMLEditorDocStateCommandTable();
|
2019-04-03 15:52:14 +03:00
|
|
|
static already_AddRefed<nsControllerCommandTable> CreateWindowCommandTable();
|
2018-09-07 06:17:29 +03:00
|
|
|
|
2001-04-06 05:27:53 +04:00
|
|
|
protected:
|
2015-05-11 22:35:14 +03:00
|
|
|
virtual ~nsControllerCommandTable();
|
2014-07-01 02:11:52 +04:00
|
|
|
|
2014-02-12 02:56:45 +04:00
|
|
|
// Hash table of nsIControllerCommands, keyed by command name.
|
|
|
|
nsInterfaceHashtable<nsCStringHashKey, nsIControllerCommand> mCommandsTable;
|
|
|
|
|
|
|
|
// Are we mutable?
|
|
|
|
bool mMutable;
|
2001-04-06 05:27:53 +04:00
|
|
|
};
|
|
|
|
|
2019-04-03 15:52:14 +03:00
|
|
|
nsControllerCommandTable*
|
|
|
|
nsIControllerCommandTable::AsControllerCommandTable() {
|
|
|
|
return static_cast<nsControllerCommandTable*>(this);
|
|
|
|
}
|
|
|
|
|
|
|
|
const nsControllerCommandTable*
|
|
|
|
nsIControllerCommandTable::AsControllerCommandTable() const {
|
|
|
|
return static_cast<const nsControllerCommandTable*>(this);
|
|
|
|
}
|
|
|
|
|
2003-04-10 22:44:03 +04:00
|
|
|
#endif // nsControllerCommandTable_h_
|