import { InteractiveObject } from "./InteractiveObject"; import { DisplayObjectFlags, DisplayObject, HitTestingType, HitTestingResult } from "./DisplayObject"; import { Bounds } from "../../base/utilities"; import { ASArray } from "../../avm2/nat/ASArray"; import { Point } from "../geom/Point"; import { TextSnapshot } from "../text/TextSnapshot"; /** * Copyright 2014 Mozilla Foundation * * Licensed under the Apache License, Version 2.0 (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.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ export declare const enum LookupChildOptions { DEFAULT = 0, IGNORE_CASE = 1, INCLUDE_NON_INITIALIZED = 2 } export declare class DisplayObjectContainer extends InteractiveObject { static bindings: string[]; static classSymbols: string[]; static classInitializer: any; constructor(); protected _initializeFields(): void; private _tabChildren; private _mouseChildren; /** * This object's children have changed. */ private _invalidateChildren; /** * Propagates flags down the display list. Propagation stops if all flags are already set. */ _propagateFlagsDown(flags: DisplayObjectFlags): void; /** * Calls the constructors of new children placed by timeline commands. */ _constructChildren(): void; _enqueueFrameScripts(): void; get numChildren(): number; _getNumChildren(): number; get textSnapshot(): TextSnapshot; get tabChildren(): boolean; _getTabChildren(): boolean; set tabChildren(enable: boolean); _setTabChildren(enable: boolean): void; get mouseChildren(): boolean; _getMouseChildren(): boolean; set mouseChildren(enable: boolean); _setMouseChildren(enable: boolean): void; addChild(child: DisplayObject): DisplayObject; /** * Adds a child at a given index. The index must be within the range [0 ... children.length]. * Note that this is different than the range setChildIndex expects. */ addChildAt(child: DisplayObject, index: number): DisplayObject; /** * Adds a timeline object to this container. The new child is added after the last object that * exists at a smaller depth, or before the first object that exists at a greater depth. If no * other timeline object is found, the new child is added to the front(top) of all other * children. * * Note that this differs from `addChildAt` in that the depth isn't an index in the `children` * array, and doesn't have to be in the dense range [0..children.length]. */ addTimelineObjectAtDepth(child: DisplayObject, depth: number): void; removeChild(child: DisplayObject): DisplayObject; removeChildAt(index: number): DisplayObject; getChildIndex(child: DisplayObject): number; /** * Sets the index of a child. The index must be within the range [0 ... children.length - 1]. */ setChildIndex(child: DisplayObject, index: number): void; getChildAt(index: number): DisplayObject; /** * Returns the timeline object that exists at the specified depth. */ getTimelineObjectAtDepth(depth: number): DisplayObject; /** * Returns the last child index that is covered by the clip depth. */ getClipDepthIndex(depth: number): number; getChildByName(name: string): DisplayObject; /** * Returns the child display object instance that exists at given index without creating a * reference nor taking ownership. */ _lookupChildByIndex(index: number, options: LookupChildOptions): DisplayObject; /** * Returns the child display object that exists with given name without creating a reference * nor taking ownership. */ _lookupChildByName(name: string, options: LookupChildOptions): DisplayObject; /** * Override of DisplayObject#_containsPoint that takes children into consideration. */ _containsPoint(globalX: number, globalY: number, localX: number, localY: number, testingType: HitTestingType, objects: DisplayObject[]): HitTestingResult; _containsPointImpl(globalX: number, globalY: number, localX: number, localY: number, testingType: HitTestingType, objects: DisplayObject[], skipBoundsCheck: boolean): HitTestingResult; private _getUnclippedChildren; /** * Override of DisplayObject#_getChildBounds that union all childrens's * bounds into the bounds. */ _getChildBounds(bounds: Bounds, includeStrokes: boolean): void; /** * Returns an array of all leaf objects under the given point in global coordinates. * A leaf node in this context is an object that itself contains visual content, so it can be * any of Shape, Sprite, MovieClip, Bitmap, Video, and TextField. * Note that, while the Flash documentation makes it sound like it doesn't, the result also * contains the receiver object if that matches the criteria above. */ getObjectsUnderPoint(globalPoint: Point): ASArray; areInaccessibleObjectsUnderPoint(point: Point): boolean; contains(child: DisplayObject): boolean; swapChildrenAt(index1: number, index2: number): void; private _swapChildrenAt; swapChildren(child1: DisplayObject, child2: DisplayObject): void; removeChildren(beginIndex?: number, endIndex?: number): void; hashCode(): number; /** * This is a very slow recursive function that should not be used in performance critical code. */ getAncestorCount(): number; }