//////////////////////////////////////////////////////////////////////////////
//
//  Copyright 2025 Autodesk, Inc.  All rights reserved.
//
//  Use of this software is subject to the terms of the Autodesk license 
//  agreement provided at the time of installation or download, or which 
//  otherwise accompanies this software in either electronic or hard copy form.   
//
//////////////////////////////////////////////////////////////////////////////

#ifndef AMILAYER_H
#define AMILAYER_H

#include "miStatus.h"
#include <vector>

////////////////////////////////////////////////////////////////////////////////////////////////

AMIAPI AmiStatus amiGetLayerGroups(std::vector<TSTDSTRING>& layerGroupNames);

AMIAPI AmiStatus amiGetLayerGroupEntities(TSTDSTRING groupName, AcDbObjectIdArray& entityIds,
                                          bool bIgnoreBlocks = false, bool bOnlyBlockRefs = false,
                                          bool bIgnore_FLO_Objects = false);

AMIAPI AmiStatus amiMoveLayerGroupEntities(TSTDSTRING srcGroup, TSTDSTRING targetGroup);

AMIAPI AmiStatus amiGetLayersFromGroup(TSTDSTRING groupName, std::vector<TSTDSTRING>& layerNames);


////////////////////////////////////////////////////////////////////////////////////////////////

class AmiLayerCfg;
class AmiLayObjCfg;

///<summary>get the ACM layer by its name for specified standard</summary>
AMIAPI AmiStatus amiGetLayerProperty(const ACHAR* layerName, AmiLayerCfg*& layerProp, const AcDbObjectId& stdId = AcDbObjectId::kNull);

///<summary>get the ACM layer object by its key fore the specified standard</summary>
AMIAPI AmiStatus amiGetLayerObjProperty(const ACHAR* objKey, AmiLayObjCfg*& objProp, const AcDbObjectId& stdId = AcDbObjectId::kNull);

///<summary>get all ACM layers for the specified standard</summary>
AMIAPI AmiStatus amiGetAllLayers(AcArray<AmiLayerCfg*>& arLayCfg, const AcDbObjectId& stdId = AcDbObjectId::kNull);

///<summary>get all ACM layer objects for the specified standard</summary>
AMIAPI AmiStatus amiGetAllLayerObjs(AcArray<AmiLayObjCfg*>& arLayObjCfg, const AcDbObjectId& stdId = AcDbObjectId::kNull);

///<summary>create new layer in current layer&object settings.</summary>
AMIAPI AmiStatus amiCreateLayer(const ACHAR* pLayerName, const ACHAR* pLayerGroup = NULL, AcDbDatabase* pDwg = NULL);

///<summary>set layer&object settings to standard default.default for current layer&object setting if database pointer is NULL.</summary>
AMIAPI AmiStatus amiSetLayCfgDefault(AcDbDatabase* pDwg = NULL);

///<summary>set current layer&object settings from another database</summary>
AMIAPI AmiStatus amiImportLayCfg(const ACHAR* pDwgName, bool bReplace);

#endif AMILAYER_H