1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/embedding/components/commandhandler/src/nsCommandGroup.h Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,53 @@ 1.4 +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ 1.5 +/* This Source Code Form is subject to the terms of the Mozilla Public 1.6 + * License, v. 2.0. If a copy of the MPL was not distributed with this 1.7 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 1.8 + 1.9 + 1.10 + 1.11 +#ifndef nsCommandGroup_h__ 1.12 +#define nsCommandGroup_h__ 1.13 + 1.14 +#include "nsIController.h" 1.15 + 1.16 +#include "nsHashtable.h" 1.17 + 1.18 + 1.19 +// {ecd55a01-2780-11d5-a73c-ca641a6813bc} 1.20 +#define NS_CONTROLLER_COMMAND_GROUP_CID \ 1.21 +{ 0xecd55a01, 0x2780, 0x11d5, { 0xa7, 0x3c, 0xca, 0x64, 0x1a, 0x68, 0x13, 0xbc } } 1.22 + 1.23 +#define NS_CONTROLLER_COMMAND_GROUP_CONTRACTID \ 1.24 + "@mozilla.org/embedcomp/controller-command-group;1" 1.25 + 1.26 + 1.27 +class nsControllerCommandGroup : public nsIControllerCommandGroup 1.28 +{ 1.29 +public: 1.30 + 1.31 + nsControllerCommandGroup(); 1.32 + virtual ~nsControllerCommandGroup(); 1.33 + 1.34 + NS_DECL_ISUPPORTS 1.35 + NS_DECL_NSICONTROLLERCOMMANDGROUP 1.36 + 1.37 + 1.38 +protected: 1.39 + 1.40 + void ClearGroupsHash(); 1.41 + 1.42 +protected: 1.43 + 1.44 + static bool ClearEnumerator(nsHashKey *aKey, void *aData, void* closure); 1.45 + 1.46 +protected: 1.47 + 1.48 + nsHashtable mGroupsHash; // hash keyed on command group. 1.49 + // Entries are nsTArray<char*> 1.50 + // This could be made more space-efficient, maybe with atoms 1.51 + 1.52 +}; 1.53 + 1.54 + 1.55 +#endif // nsCommandGroup_h__ 1.56 +