/** * An entry for a tool in a `ngeo.misc.ToolActivateMgr` group. * * @typedef {Object} miscToolActivateMgrEntry * @property {import('ngeo/misc/ToolActivate').default} tool * @property {boolean} defaultTool * @property {function(): void} unlisten */ /** * Provides a service to manage the activation of `ngeo.misc.ToolActivate` objects. * * Example: * * Each tool must be registered before using it. * * let tool = new ngeo.misc.ToolActivate(interaction, 'active'); * ngeoToolActivateMgr.registerTool('mapTools', tool); * * A tool will be registered in a group identified by a group name. * Once registered a tool can be activated and deactivated. When activating a * tool, all others tools in the same group will be deactivated. * * ngeoToolActivateMgr.activateTool(tool); * ngeoToolActivateMgr.deactivateTool(tool); * * See our live examples: * [../examples/mapquery.html](../examples/mapquery.html) * [../examples/toolActivate.html](../examples/toolActivate.html) * * @param {angular.IScope} $rootScope The rootScope provider. * @class * @ngdoc service * @ngname ngeoToolActivateMgr * @hidden */ export function ToolActivateMgr($rootScope: angular.IScope): void; export class ToolActivateMgr { /** * An entry for a tool in a `ngeo.misc.ToolActivateMgr` group. * * @typedef {Object} miscToolActivateMgrEntry * @property {import('ngeo/misc/ToolActivate').default} tool * @property {boolean} defaultTool * @property {function(): void} unlisten */ /** * Provides a service to manage the activation of `ngeo.misc.ToolActivate` objects. * * Example: * * Each tool must be registered before using it. * * let tool = new ngeo.misc.ToolActivate(interaction, 'active'); * ngeoToolActivateMgr.registerTool('mapTools', tool); * * A tool will be registered in a group identified by a group name. * Once registered a tool can be activated and deactivated. When activating a * tool, all others tools in the same group will be deactivated. * * ngeoToolActivateMgr.activateTool(tool); * ngeoToolActivateMgr.deactivateTool(tool); * * See our live examples: * [../examples/mapquery.html](../examples/mapquery.html) * [../examples/toolActivate.html](../examples/toolActivate.html) * * @param {angular.IScope} $rootScope The rootScope provider. * @class * @ngdoc service * @ngname ngeoToolActivateMgr * @hidden */ constructor($rootScope: angular.IScope); /** * @type {Object} */ groups_: { [x: string]: miscToolActivateMgrEntry[]; }; /** * The scope. * * @type {angular.IScope} */ scope_: angular.IScope; /** * Register a tool. * * @param {string} groupName Name of the group of this tool. * @param {import('ngeo/misc/ToolActivate').default} tool Tool to register. * @param {boolean} [opt_defaultActivate] If true, this tool will be activated * when all other tools in the group are deactivated. */ registerTool(groupName: string, tool: import("ngeo/misc/ToolActivate").default, opt_defaultActivate?: boolean): void; /** * Unregister a tool from a group. * * @param {string} groupName Name of the group of this tool. * @param {import('ngeo/misc/ToolActivate').default} tool Tool to unregister. */ unregisterTool(groupName: string, tool: import("ngeo/misc/ToolActivate").default): void; /** * Unregister each tool from a group. * * @param {string} groupName Name of the group of tools to unregister. */ unregisterGroup(groupName: string): void; /** * Activate a tool. * * @param {import('ngeo/misc/ToolActivate').default} tool Tool to activate. */ activateTool(tool: import("ngeo/misc/ToolActivate").default): void; /** * Deactivate a tool. * * @param {import('ngeo/misc/ToolActivate').default} tool Tool to deactivate. */ deactivateTool(tool: import("ngeo/misc/ToolActivate").default): void; /** * Deactivate all tools except the given one. * * @param {string} groupName Name of the group. * @param {import('ngeo/misc/ToolActivate').default} tool Tool to activate. */ deactivateTools_(groupName: string, tool: import("ngeo/misc/ToolActivate").default): void; /** * Activate the default tool in the given group if no other tool is active. * * @param {string} groupName Name of the group. */ activateDefault_(groupName: string): void; } export namespace ToolActivateMgr { let $inject: string[]; } export default myModule; /** * An entry for a tool in a `ngeo.misc.ToolActivateMgr` group. */ export type miscToolActivateMgrEntry = { tool: import("ngeo/misc/ToolActivate").default; defaultTool: boolean; unlisten: () => void; }; import angular from 'angular'; /** * @type {angular.IModule} * @hidden */ declare const myModule: angular.IModule;