home *** CD-ROM | disk | FTP | other *** search
Text File | 1996-09-17 | 3.8 KB | 117 lines | [TEXT/MPS ] |
- //========================================================================================
- //
- // File: FWScpCal.h
- // Release Version: $ ODF 2 $
- //
- // Copyright: (c) 1993 - 1996 by Apple Computer, Inc., all rights reserved.
- //
- //========================================================================================
-
- #ifndef FWSCPCAL_H
- #define FWSCPCAL_H
-
- #ifndef FWSTDDEF_H
- #include "FWStdDef.h"
- #endif
-
- #ifndef FWTDSTRY_H
- #include "FWTDstry.h"
- #endif
-
- #include "FWTMap.tpp"
-
- //========================================================================================
- // Forward Declarations Types
- //========================================================================================
-
- class FW_CDesc;
-
- //========================================================================================
- // Public Callback Types
- //========================================================================================
-
- typedef FW_Handled (*FWDescCoerceFunc)(const FW_CDesc& sourceDesc,
- ODDescType toType,
- FW_CDesc& resultDesc);
-
- typedef FW_Handled (*FWDescComparisonFunc)(ODDescType comparisonOperator,
- const FW_CDesc& lhDesc,
- const FW_CDesc& rhDesc,
- FW_Boolean& result);
-
- //========================================================================================
- // Private Map Types
- //========================================================================================
-
- typedef FW_TMap<ODDescType, FWDescCoerceFunc> FW_CPrivDescTypeToCoercionMap;
- typedef FW_TPair<ODDescType, FWDescCoerceFunc> FW_CPrivDescTypeToCoercionPair;
-
- typedef FW_TMap<ODDescType, FWDescComparisonFunc> FW_CPrivDescTypeToComparisonMap;
- typedef FW_TPair<ODDescType, FWDescComparisonFunc> FW_CPrivDescTypeToComparisonPair;
-
- //========================================================================================
- // class FW_CDescCoercionCallbacks
- //========================================================================================
-
- class FW_CDescCoercionCallbacks
- {
- public:
- static void RegisterHandler(ODDescType toType, FWDescCoerceFunc func);
- static void RemoveHandler(ODDescType toType);
-
- static FW_Handled InvokeHandler(const FW_CDesc& sourceDesc,
- ODDescType toType,
- FW_CDesc& coercedDesc);
-
- private:
- ~FW_CDescCoercionCallbacks();
- FW_CDescCoercionCallbacks();
- FW_CDescCoercionCallbacks(const FW_CDescCoercionCallbacks& other);
- FW_CDescCoercionCallbacks& operator=(const FW_CDescCoercionCallbacks& other);
-
- static FW_CDescCoercionCallbacks* Instance(FW_Boolean create);
-
- friend class FW_TPrivDestroyer<FW_CDescCoercionCallbacks>;
-
- private:
- static FW_CDescCoercionCallbacks* fgInstance;
- static FW_TPrivDestroyer<FW_CDescCoercionCallbacks> fgDestroyer;
-
- FW_CPrivDescTypeToCoercionMap fMap;
- };
-
- //========================================================================================
- // class FW_CDescComparisonCallbacks
- //========================================================================================
-
- class FW_CDescComparisonCallbacks
- {
- public:
- static void RegisterHandler(ODDescType comparisonOperator, FWDescComparisonFunc func);
- static void RemoveHandler(ODDescType comparisonOperator);
-
- static FW_Handled InvokeHandler(ODDescType comparisonOperator,
- const FW_CDesc& lhDesc,
- const FW_CDesc& rhDesc,
- FW_Boolean& result);
-
-
- private:
- FW_CDescComparisonCallbacks();
- ~FW_CDescComparisonCallbacks();
- FW_CDescComparisonCallbacks(const FW_CDescComparisonCallbacks& other);
- FW_CDescComparisonCallbacks& operator=(const FW_CDescComparisonCallbacks& other);
-
- static FW_CDescComparisonCallbacks* Instance(FW_Boolean create);
-
- friend class FW_TPrivDestroyer<FW_CDescComparisonCallbacks>;
-
- private:
- static FW_CDescComparisonCallbacks* fgInstance;
- static FW_TPrivDestroyer<FW_CDescComparisonCallbacks> fgDestroyer;
-
- FW_CPrivDescTypeToComparisonMap fMap;
- };
-
- #endif
-