//
//  (C) Copyright 2005-2008 by Autodesk, Inc.  All rights reserved.
//
// Permission to use, copy, modify, and distribute this software in
// object code form for any purpose and without fee is hereby granted, 
// provided that the above copyright notice appears in all copies and 
// that both that copyright notice and the limited warranty and
// restricted rights notice below appear in all supporting 
// documentation.
//
// AUTODESK PROVIDES THIS PROGRAM "AS IS" AND WITH ALL FAULTS. 
// AUTODESK SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTY OF
// MERCHANTABILITY OR FITNESS FOR A PARTICULAR USE.  AUTODESK, INC. 
// DOES NOT WARRANT THAT THE OPERATION OF THE PROGRAM WILL BE
// UNINTERRUPTED OR ERROR FREE.
//
// Use, duplication, or disclosure by the U.S. Government is subject to 
// restrictions set forth in FAR 52.227-19 (Commercial Computer
// Software - Restricted Rights) and DFAR 252.227-7013(c)(1)(ii)
// (Rights in Technical Data and Computer Software), as applicable.
//
#ifndef AMI2DSHIDE_H
#define AMI2DSHIDE_H

// Includes
//
#include "mibase.h"
#include "migeom.h"
#include "AdAChar.h"

// Open Ami namespace to include feature API enumerations.
//
namespace Ami
{
  enum HideSituationSubentType
  {
    mc2DSNoEnt      = 0,
    mc2DSFGEnt      = 1,       // foreground entity
    mc2DSBGEnt      = 2,       // background entity
    mc2DSFGExclEnt  = 4,       // foreground exclude entity
    mc2DSBGExclEnt  = 8,       // background exclude entity
    mc2DSUpperBGExclEnt  = 16, // foreground entity excluded from background of levels above
  };
  enum HideSituationRefType
  {
    mc2DSDirectRef  = 0x0001,  // leaf or view instance is directly refered by hide situation
    mc2DSSubEntRef  = 0x0002,  // leaf or view instance is subentity of view that is
    // refered by hide situation
    mc2DSPartialRef = 0x0004,  // view instance is partially or fully refered by hide situation
    mc2DSAllRef     = mc2DSDirectRef | mc2DSSubEntRef,
  };
};
// Convenience typedefs for feature enumeration types.
//
typedef Ami::HideSituationSubentType     AmiHideSituationSubentType;
typedef Ami::HideSituationRefType        AmiHideSituationRefType;

class AmiFolderDefKey;
class AmiFolderKey;
// Hide Situation key class.
//
class AMIAPI AmiHideSituationKey : public AmiObjectKey
{
public:

  MCADAPI_DECLARE_MEMBERS(AmiHideSituationKey);
};

class AMIAPI AmiComplexHideSituationKey : public AmiObjectKey
{
public:

  MCADAPI_DECLARE_MEMBERS(AmiComplexHideSituationKey);
};

//////////////////////////////////////////////////////////////////////////
// AMSHIDE 2D
//////////////////////////////////////////////////////////////////////////

AMIAPI AmiStatus ami2DSSetHideName(AmiHideSituationKey* pHideSituationKey,
								   const ACHAR* name);

AMIAPI AmiStatus ami2DSGetHideName(AmiHideSituationKey* pHideSituationKey, 
								   ACHAR*& name);

AMIAPI AmiStatus ami2DSSetHideSysName(AmiHideSituationKey* pHideSituationKey, 
                   const ACHAR* sysName);
				   
AMIAPI AmiStatus ami2DSGetHideSysName(AmiHideSituationKey* pHideSituationKey, 
                   ACHAR*& sysName);

AMIAPI AmiStatus ami2DSSetHideDefinition(AmiHideSituationKey* pHideSituationKey, 
                   const AmiFolderDefKey* pViewDefKey);
				   
AMIAPI AmiStatus ami2DSGetHideDefinition(AmiHideSituationKey* pHideSituationKey, 
                   AmiFolderDefKey*& pViewDefKey);

AMIAPI AmiStatus ami2DSIsHideSuppressed(AmiHideSituationKey* pHideSituationKey, 
                   Adesk::Boolean& suppressed);
				   
AMIAPI AmiStatus ami2DSSetHideSuppressed(AmiHideSituationKey* pHideSituationKey, 
                   Adesk::Boolean suppressed);

AMIAPI AmiStatus ami2DSIsHideConcealed(AmiHideSituationKey* pHideSituationKey, 
                   Adesk::Boolean& concealed);
				   
AMIAPI AmiStatus ami2DSSetHideConcealed(AmiHideSituationKey* pHideSituationKey, 
                   Adesk::Boolean concealed);

AMIAPI AmiStatus ami2DSIsStdPartHide(AmiHideSituationKey* pHideSituationKey, 
                   Adesk::Boolean& isStandardPartHide);

AMIAPI AmiStatus ami2DSIsModifiedStdPartHide(AmiHideSituationKey* pHideSituationKey, 
                   Adesk::Boolean& isModifiedStandardPartHide);

AMIAPI AmiStatus ami2DSIsHideMigrated(AmiHideSituationKey* pHideSituationKey, 
                   Adesk::Boolean& isIsMigrated);

AMIAPI AmiStatus ami2DSIsHideComplexHideLevel(AmiHideSituationKey* pHideSituationKey, 
                   Adesk::Boolean& isComplexHideLevel);

AMIAPI AmiStatus ami2DSGetHideSubents(AmiHideSituationKey* pHideSituationKey, 
                   AmiHideSituationSubentType subentType,
                   AmiArray<AmiFolderKey>& viewKeys);

AMIAPI AmiStatus ami2DSAddHideSubent(AmiHideSituationKey* pHideSituationKey, 
                   AmiHideSituationSubentType subentType,
                   const AmiFolderKey* pViewKey);

AMIAPI AmiStatus ami2DSAddHideSubents(AmiHideSituationKey* pHideSituationKey, 
                   AmiHideSituationSubentType subentType,
                   const AmiArray<AmiFolderKey>& viewKeys);

AMIAPI AmiStatus ami2DSRemoveHideSubent(AmiHideSituationKey* pHideSituationKey, 
                   AmiHideSituationSubentType subentType,
                   const AmiFolderKey* pViewKey);

AMIAPI AmiStatus ami2DSRemoveHideSubentByIdx(AmiHideSituationKey* pHideSituationKey,
                   long subentIdx,
                   AmiHideSituationSubentType subentType);

AMIAPI AmiStatus ami2DSClearHideSubents(AmiHideSituationKey* pHideSituationKey,
                   AmiHideSituationSubentType subentType);

AMIAPI AmiStatus ami2DSAddHideMSSubent(AmiHideSituationKey* pHideSituationKey,
                   const AcDbObjectId& ent,
                   AmiHideSituationSubentType subentType);

AMIAPI AmiStatus ami2DSAddHideMSSubents(AmiHideSituationKey* pHideSituationKey,
                   AcDbObjectIdArray entityIds,
                   AmiHideSituationSubentType subentType);

AMIAPI AmiStatus ami2DSSetHideIgnoreFgExclude(AmiHideSituationKey* pHideSituationKey, 
                   Adesk::Boolean ignore);
				   
AMIAPI AmiStatus ami2DSGetHideIgnoreFgExclude(AmiHideSituationKey* pHideSituationKey, 
                   Adesk::Boolean& ignore);

AMIAPI AmiStatus ami2DSSetHideIgnoreBgExclude(AmiHideSituationKey* pHideSituationKey, 
                   Adesk::Boolean ignore);
				   
AMIAPI AmiStatus ami2DSGetHideIgnoreBgExclude(AmiHideSituationKey* pHideSituationKey, 
                   Adesk::Boolean& ignore);

AMIAPI AmiStatus ami2DSSetHideIgnoreUpperBgExclude(AmiHideSituationKey* pHideSituationKey, 
                   Adesk::Boolean ignore);
				   
AMIAPI AmiStatus ami2DSGetHideIgnoreUpperBgExclude(AmiHideSituationKey* pHideSituationKey, 
                   Adesk::Boolean& ignore);

AMIAPI AmiStatus ami2DSSetHideFgSelectionName(AmiHideSituationKey* pHideSituationKey, 
                   const ACHAR* name);
				   
AMIAPI AmiStatus ami2DSGetHideFgSelectionName(AmiHideSituationKey* pHideSituationKey, 
                   ACHAR*& name);

AMIAPI AmiStatus ami2DSSetHideBgSelectionName(AmiHideSituationKey* pHideSituationKey, 
                   const ACHAR* name);
				   
AMIAPI AmiStatus ami2DSGetHideBgSelectionName(AmiHideSituationKey* pHideSituationKey, 
                   ACHAR*& name);

AMIAPI AmiStatus ami2DSSetHideHiddenLinesInvisible(AmiHideSituationKey* pHideSituationKey, 
                   Adesk::Boolean val);
				   
AMIAPI AmiStatus ami2DSGetHideHiddenLinesInvisible(AmiHideSituationKey* pHideSituationKey, 
                   Adesk::Boolean& val);

AMIAPI AmiStatus ami2DSSetHideAppropriateObjectsOnly(AmiHideSituationKey* pHideSituationKey, 
                   Adesk::Boolean val);
				   
AMIAPI AmiStatus ami2DSGetHideAppropriateObjectsOnly(AmiHideSituationKey* pHideSituationKey, 
                   Adesk::Boolean& val);

AMIAPI AmiStatus ami2DSSetHideOuterContourOnly(AmiHideSituationKey* pHideSituationKey, 
                   Adesk::Boolean val);
				   
AMIAPI AmiStatus ami2DSGetHideOuterContourOnly(AmiHideSituationKey* pHideSituationKey, 
                   Adesk::Boolean& val);

AMIAPI AmiStatus ami2DSSetHideSaveSimplifiedOuterContour(AmiHideSituationKey* pHideSituationKey, 
                   Adesk::Boolean val);
				   
AMIAPI AmiStatus ami2DSGetHideSaveSimplifiedOuterContour(AmiHideSituationKey* pHideSituationKey, 
                   Adesk::Boolean& val);

AMIAPI AmiStatus ami2DSSetHideInverseForeground(AmiHideSituationKey* pHideSituationKey, 
                   Adesk::Boolean val);
				   
AMIAPI AmiStatus ami2DSGetHideInverseForeground(AmiHideSituationKey* pHideSituationKey, 
                   Adesk::Boolean& val);

AMIAPI AmiStatus ami2DSSetHideContoursOnlyInForeground(AmiHideSituationKey* pHideSituationKey, 
                   Adesk::Boolean val);
				   
AMIAPI AmiStatus ami2DSGetHideContoursOnlyInForeground(AmiHideSituationKey* pHideSituationKey, 
                   Adesk::Boolean& val);

AMIAPI AmiStatus ami2DSHideAutoSelectBackground(AmiHideSituationKey* pHideSituationKey, 
                              Adesk::Boolean occurrencesOnly = Adesk::kFalse,
                              Adesk::Boolean createNewLevel = Adesk::kFalse);

AMIAPI AmiStatus ami2DSHideSwapFgAndBg(AmiHideSituationKey* pHideSituationKey);

AMIAPI AmiStatus ami2DSGetHideParentHide(AmiHideSituationKey* pHideSituationKey,
                   AmiComplexHideSituationKey*& pParentHide);

AMIAPI AmiStatus ami2DSGetHideLevelIndex(AmiHideSituationKey* pHideSituationKey,
                   long& index);

AMIAPI AmiStatus ami2DSIsHideLastLevel(AmiHideSituationKey* pHideSituationKey, 
                  Adesk::Boolean& val);

//////////////////////////////////////////////////////////////////////////
//complex hide situation
//////////////////////////////////////////////////////////////////////////

AMIAPI AmiStatus ami2DSSetCpxHideName(AmiComplexHideSituationKey* pHideSituationKey, 
                   const ACHAR* name);
				   
AMIAPI AmiStatus ami2DSGetCpxHideName(AmiComplexHideSituationKey* pHideSituationKey, 
                   ACHAR*& name);

AMIAPI AmiStatus ami2DSSetCpxHideSysName(AmiComplexHideSituationKey* pHideSituationKey, 
                   const ACHAR* sysName);
				   
AMIAPI AmiStatus ami2DSGetCpxHideSysName(AmiComplexHideSituationKey* pHideSituationKey, 
                   ACHAR*& sysName);

AMIAPI AmiStatus ami2DSSetCpxHideDefinition(AmiComplexHideSituationKey* pHideSituationKey, 
                   const AmiFolderDefKey* pViewDefKey);
				   
AMIAPI AmiStatus ami2DSGetCpxHideDefinition(AmiComplexHideSituationKey* pHideSituationKey, 
                   AmiFolderDefKey*& pViewDefKey);

AMIAPI AmiStatus ami2DSIsCpxHideSuppressed(AmiComplexHideSituationKey* pHideSituationKey, 
                   Adesk::Boolean& suppressed);
				   
AMIAPI AmiStatus ami2DSSetCpxHideSuppressed(AmiComplexHideSituationKey* pHideSituationKey, 
                   Adesk::Boolean suppressed);

AMIAPI AmiStatus ami2DSIsCpxHideConcealed(AmiComplexHideSituationKey* pHideSituationKey, 
                   Adesk::Boolean& concealed);
				   
AMIAPI AmiStatus ami2DSSetCpxHideConcealed(AmiComplexHideSituationKey* pHideSituationKey, 
                   Adesk::Boolean concealed);

AMIAPI AmiStatus ami2DSIsStdPartCpxHide(AmiComplexHideSituationKey* pHideSituationKey, 
                   Adesk::Boolean& isStandardPartHide);

AMIAPI AmiStatus ami2DSIsModifiedStdPartCpxHide(AmiComplexHideSituationKey* pHideSituationKey, 
                   Adesk::Boolean& isModifiedStandardPartHide);

AMIAPI AmiStatus ami2DSSetCpxHideHiddenLinesInvisible(AmiComplexHideSituationKey* pHideSituationKey, 
                   Adesk::Boolean val);
				   
AMIAPI AmiStatus ami2DSGetCpxHideHiddenLinesInvisible(AmiComplexHideSituationKey* pHideSituationKey, 
                   Adesk::Boolean& val);

AMIAPI AmiStatus ami2DSSetCpxHideAppropriateObjectsOnly(AmiComplexHideSituationKey* pHideSituationKey, 
                   Adesk::Boolean val);
				   
AMIAPI AmiStatus ami2DSGetCpxHideAppropriateObjectsOnly(AmiComplexHideSituationKey* pHideSituationKey, 
                   Adesk::Boolean& val);

AMIAPI AmiStatus ami2DSGetCpxHideLevelIndex(AmiComplexHideSituationKey* pHideSituationKey,
                   long& count);

AMIAPI AmiStatus ami2DSGetLevelCpxHideSituations(AmiComplexHideSituationKey* pHideSituationKey,
                   AmiArray<AmiHideSituationKey>& pVal);

AMIAPI AmiStatus ami2DSInitCpxHide(AmiComplexHideSituationKey* pHideSituationKey,
                   AmiHideSituationKey* pHide);

AMIAPI AmiStatus ami2DSCpxHideAddLevel(AmiComplexHideSituationKey* pHideSituationKey,
                   long levelIdx,
                   AmiHideSituationKey*& pNewHide);

AMIAPI AmiStatus ami2DSCpxHideRemoveLevel(AmiComplexHideSituationKey* pHideSituationKey,
                   AmiHideSituationKey* pHide);

AMIAPI AmiStatus ami2DSCpxHideRemoveLevelByIdx(AmiComplexHideSituationKey* pHideSituationKey,
                   long levelIdx);

AMIAPI AmiStatus ami2DSCpxHideMoveLevel(AmiComplexHideSituationKey* pHideSituationKey,
                   long srcIdx,
                   long destIdx);

AMIAPI AmiStatus ami2DSCpxHideReverseLevels(AmiComplexHideSituationKey* pHideSituationKey);

AMIAPI AmiStatus ami2DSCpxHideLookupLevelName(AmiComplexHideSituationKey* pHideSituationKey,
                   const ACHAR* levelName,
                   Adesk::Boolean& found);

AMIAPI AmiStatus ami2DSCpxHideNextLevelName(AmiComplexHideSituationKey* pHideSituationKey,
                   ACHAR*& levelName);

AMIAPI AmiStatus ami2DSCpxHideUpdateBgSelection(AmiComplexHideSituationKey* pHideSituationKey);

AMIAPI AmiStatus ami2DSExplodeCpxHide(AmiComplexHideSituationKey* pHideSituationKey);

#endif  // AMI2DSHIDE_H
