home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1996 July: Mac OS SDK / Dev.CD Jul 96 SDK / Dev.CD Jul 96 SDK1.toast / Development Kits (Disc 1) / OpenDoc / OpenDoc Development / Debugging Support / OpenDoc Source Code / Messaging / SemtIntB.cpp < prev    next >
Encoding:
C/C++ Source or Header  |  1996-04-22  |  14.5 KB  |  412 lines  |  [TEXT/MPS ]

  1.  
  2. /*
  3.  *  This file was generated by the SOM Compiler.
  4.  *  Generated using:
  5.  *     SOM incremental update: somc/smmain.c
  6.  */
  7.  
  8.  
  9. /*
  10.     File:        SemtIntB.cpp
  11.  
  12.     Contains:    Implementation of platform-independent ODSemanticInterface
  13.                 class.
  14.  
  15.     Owned by:    Nick Pilch
  16.  
  17.     Copyright:    © 1994 - 1995 by Apple Computer, Inc., all rights reserved.
  18.  
  19.     Change History (most recent first):
  20.  
  21.         <21>     10/8/95    TJ        Fixes Recomended by Refball
  22.         <20>     8/23/95    NP        1276287: Move constant kODAppShell.
  23.         <19>     8/16/95    NP        1275241: IDL Review. Remove unnecessary
  24.                                     overrides.
  25.         <18>     8/12/95    TÇ        1276806 Optimization: use kODFalse instead
  26.                                     of kODTrue in comparisons
  27.         <17>      8/7/95    NP        1275105:  Exception safety.
  28.         <16>      8/3/95    RR        #1257260: Collapse B classes. Remove
  29.                                     somInit methods. Don't call IsInitialized
  30.                                     or SubclassResponsibility
  31.         <15>     6/20/95    JP        1251250: Removed ReleaseExtension method
  32.         <14>     6/19/95    eeh        1259707: SIHelper needs to return
  33.                                     errAEEventNotHandled
  34.         <13>     5/21/95    NP        1249232: Gid rid of TokenInquiryProc.
  35.                                     1250474: Change to CallGetMarkTokenProc.
  36.                                     1248779: Change API of GetUserToken.
  37.                                     1250590: Add default behavior to
  38.                                     ODSemanticInterface.
  39.         <12>      5/4/95    eeh        1243497: implement ReleaseExtension
  40.         <11>     4/28/95    eeh        1244258: : override BaseRemoved, IsValid,
  41.                                     and CheckValid
  42.         <10>     1/27/95    NP        1213948: New classes for ODDesc et al.
  43.          <9>     1/25/95    eeh        1214626: API change: remove SetTerminology
  44.                                     and GetTerminology
  45.          <8>      1/9/95    NP        1194880: SemtIntf name changes.
  46.          <7>    10/12/94    RA        #1189812: Prevents incomplete cast #warning
  47.                                     18.
  48.          <6>     9/29/94    RA        1189812: Mods for 68K build.
  49.          <5>      9/9/94    NP        1185851: implement scripting. 1184040: API
  50.                                     changes.
  51.          <4>      9/9/94    jpa        Removed call to parent in Release, at
  52.                                     Nick's suggestion. [1185656]
  53.          <3>     8/13/94    NP        1180819-Added Get/SetTerminology and
  54.                                     ForwardEvent.,
  55.          <2>      7/8/94    NP        Fixed initialization.
  56.          <1>      7/1/94    NP        first checked in
  57.  
  58.     To Do:
  59. */
  60.  
  61. #ifndef SOM_ODMessageInterface_xh
  62. #include "MssgIntf.xh"
  63. #endif
  64.  
  65. #ifndef SOM_ODSession_xh
  66. #include "ODSessn.xh"
  67. #endif
  68.  
  69. #define VARIABLE_MACROS
  70. #define ODSemanticInterface_Class_Source
  71. #include <SemtIntB.xih>
  72.  
  73. #ifndef SOM_ODPart_xh
  74. #include "Part.xh"
  75. #endif
  76.  
  77. #ifndef SOM_ODPart_xh
  78. #include "Part.xh"
  79. #endif
  80.  
  81. #ifndef SOM_Module_OpenDoc_StdDefs_defined
  82. #include <StdDefs.xh>
  83. #endif
  84.  
  85. #if 0
  86. //------------------------------------------------------------------------------
  87. // ODSemanticInterface::somUninit
  88. //------------------------------------------------------------------------------
  89.  
  90. SOM_Scope void  SOMLINK ODSemanticInterfacesomUninit(ODSemanticInterface *somSelf)
  91. {
  92.     /* ODSemanticInterfaceData *somThis = ODSemanticInterfaceGetData(somSelf); */
  93.     ODSemanticInterfaceMethodDebug("ODSemanticInterface","ODSemanticInterfacesomUninit");
  94.  
  95.     ODSemanticInterface_parents_somUninit(somSelf);
  96. }
  97. #endif /* 0 */
  98. //------------------------------------------------------------------------------
  99. // ODSemanticInterface::BaseRemoved
  100. //------------------------------------------------------------------------------
  101.  
  102. SOM_Scope void  SOMLINK ODSemanticInterfaceBaseRemoved(ODSemanticInterface *somSelf, Environment *ev)
  103. {
  104.     ODSemanticInterfaceData *somThis = ODSemanticInterfaceGetData(somSelf);
  105.     ODSemanticInterfaceMethodDebug("ODSemanticInterface","ODSemanticInterfaceBaseRemoved");
  106.  
  107.     SOM_TRY
  108.     
  109.     _fIsValid = kODFalse;
  110.     ODSemanticInterface_parents_BaseRemoved(somSelf, ev);
  111.     
  112.     SOM_CATCH_ALL
  113.     SOM_ENDTRY
  114. }
  115.  
  116. //------------------------------------------------------------------------------
  117. // ODSemanticInterface::IsValid
  118. //------------------------------------------------------------------------------
  119.  
  120. SOM_Scope ODBoolean  SOMLINK ODSemanticInterfaceIsValid(ODSemanticInterface *somSelf, Environment *ev)
  121. {
  122.     ODSemanticInterfaceData *somThis = ODSemanticInterfaceGetData(somSelf);
  123.     ODSemanticInterfaceMethodDebug("ODSemanticInterface","ODSemanticInterfaceIsValid");
  124.  
  125.     return _fIsValid;
  126. }
  127.  
  128. //------------------------------------------------------------------------------
  129. // ODSemanticInterface::CheckValid
  130. //------------------------------------------------------------------------------
  131.  
  132. SOM_Scope void  SOMLINK ODSemanticInterfaceCheckValid(ODSemanticInterface *somSelf, Environment *ev)
  133. {
  134.     ODSemanticInterfaceData *somThis = ODSemanticInterfaceGetData(somSelf);
  135.     ODSemanticInterfaceMethodDebug("ODSemanticInterface","ODSemanticInterfaceCheckValid");
  136.  
  137.     if ( !_fIsValid )
  138.         ODSetSOMException( ev, kODErrInvalidExtension );
  139. }
  140.  
  141. //------------------------------------------------------------------------------
  142. // ODSemanticInterface::Release
  143. //------------------------------------------------------------------------------
  144.  
  145. SOM_Scope void  SOMLINK ODSemanticInterfaceRelease(ODSemanticInterface *somSelf, Environment *ev)
  146. {
  147.     ODSemanticInterfaceData *somThis = ODSemanticInterfaceGetData(somSelf);
  148.     ODSemanticInterfaceMethodDebug("ODSemanticInterface","ODSemanticInterfaceRelease");
  149.     
  150.     SOM_TRY
  151.  
  152.     ODBoolean    shouldDelete = kODFalse;
  153.  
  154.     if (somSelf->GetRefCount(ev) == 1 && somSelf->GetBase(ev) == kODAppShell)
  155.         shouldDelete = kODTrue;
  156.  
  157.     ODSemanticInterface_parent_ODExtension_Release(somSelf,ev);
  158.     
  159.     if (shouldDelete)
  160.         ODDeleteObject(somSelf);
  161.     
  162.     SOM_CATCH_ALL
  163.     SOM_ENDTRY
  164. }
  165.  
  166. //------------------------------------------------------------------------------
  167. // ODSemanticInterface::InitSemanticInterface
  168. //------------------------------------------------------------------------------
  169.  
  170. SOM_Scope void  SOMLINK ODSemanticInterfaceInitSemanticInterface(ODSemanticInterface *somSelf, Environment *ev,
  171.         ODPart* base,
  172.         ODSession* session)
  173. {
  174.     ODSemanticInterfaceData *somThis = ODSemanticInterfaceGetData(somSelf);
  175.     ODSemanticInterfaceMethodDebug("ODSemanticInterface","ODSemanticInterfaceInitSemanticInterface");
  176.  
  177.     /* Moved from somInit. SOM itself sets fields to zero
  178.     _fIsValid = kODFalse;
  179.     _fFlags = 0;
  180.     _fMessageInterface = kODNULL;
  181.     */
  182.     
  183.     SOM_TRY
  184.         somSelf->InitExtension(ev, (ODObject*)base);
  185.         _fIsValid = kODTrue;
  186.         _fMessageInterface = session->GetMessageInterface(ev);
  187.     SOM_CATCH_ALL
  188.     SOM_ENDTRY
  189. }
  190.  
  191. //------------------------------------------------------------------------------
  192. // ODSemanticInterface::CallEventHandler
  193. //------------------------------------------------------------------------------
  194.  
  195. SOM_Scope void  SOMLINK ODSemanticInterfaceCallEventHandler(ODSemanticInterface *somSelf, Environment *ev,
  196.         ODPart* thePart,
  197.         ODAppleEvent* theODAppleEvent,
  198.         ODAppleEvent* reply)
  199. {
  200.     /* ODSemanticInterfaceData *somThis = ODSemanticInterfaceGetData(somSelf); */
  201.     ODSemanticInterfaceMethodDebug("ODSemanticInterface","ODSemanticInterfaceCallEventHandler");
  202.  
  203.     ODSetSOMException(ev, errAEEventNotHandled);
  204. }
  205.  
  206. //------------------------------------------------------------------------------
  207. // ODSemanticInterface::CallCoercionHandler
  208. //------------------------------------------------------------------------------
  209.  
  210. SOM_Scope void  SOMLINK ODSemanticInterfaceCallCoercionHandler(ODSemanticInterface *somSelf, Environment *ev,
  211.         ODPart* thePart,
  212.         ODDesc* theODDesc,
  213.         ODDescType toType,
  214.         ODDesc* result)
  215. {
  216.     /* ODSemanticInterfaceData *somThis = ODSemanticInterfaceGetData(somSelf); */
  217.     ODSemanticInterfaceMethodDebug("ODSemanticInterface","ODSemanticInterfaceCallCoercionHandler");
  218.  
  219.     ODSetSOMException(ev, errAECoercionFail);
  220. }
  221.  
  222. //------------------------------------------------------------------------------
  223. // ODSemanticInterface::CallObjectAccessor
  224. //------------------------------------------------------------------------------
  225.  
  226. SOM_Scope void  SOMLINK ODSemanticInterfaceCallObjectAccessor(ODSemanticInterface *somSelf, Environment *ev,
  227.         ODPart* thePart,
  228.         ODDescType desiredClass,
  229.         ODOSLToken* container,
  230.         ODDescType containerClass,
  231.         ODDescType form,
  232.         ODDesc* selectionData,
  233.         ODOSLToken* value)
  234. {
  235.     /* ODSemanticInterfaceData *somThis = ODSemanticInterfaceGetData(somSelf); */
  236.     ODSemanticInterfaceMethodDebug("ODSemanticInterface","ODSemanticInterfaceCallObjectAccessor");
  237.  
  238.     ODSetSOMException(ev, errAEEventNotHandled);
  239. }
  240.  
  241. //------------------------------------------------------------------------------
  242. // ODSemanticInterface::CallPredispatchProc
  243. //------------------------------------------------------------------------------
  244.  
  245. SOM_Scope void  SOMLINK ODSemanticInterfaceCallPredispatchProc(ODSemanticInterface *somSelf, Environment *ev,
  246.         ODPart* thePart,
  247.         ODAppleEvent* theODAppleEvent,
  248.         ODAppleEvent* reply)
  249. {
  250.     /* ODSemanticInterfaceData *somThis = ODSemanticInterfaceGetData(somSelf); */
  251.     ODSemanticInterfaceMethodDebug("ODSemanticInterface","ODSemanticInterfaceCallPredispatchProc");
  252.  
  253.     ODSetSOMException(ev, errAEEventNotHandled);
  254. }
  255.  
  256. //------------------------------------------------------------------------------
  257. // ODSemanticInterface::CallCompareProc
  258. //------------------------------------------------------------------------------
  259.  
  260. SOM_Scope void  SOMLINK ODSemanticInterfaceCallCompareProc(ODSemanticInterface *somSelf, Environment *ev,
  261.         ODPart* thePart,
  262.         ODDescType oper,
  263.         ODOSLToken* obj1,
  264.         ODOSLToken* obj2,
  265.         ODBoolean* result)
  266. {
  267. //    ODSemanticInterfaceData *somThis = ODSemanticInterfaceGetData(somSelf);
  268.     ODSemanticInterfaceMethodDebug("ODSemanticInterface","ODSemanticInterfaceCallCompareProc");
  269.  
  270.     ODSetSOMException(ev, errAEEventNotHandled);
  271. }
  272.  
  273. //------------------------------------------------------------------------------
  274. // ODSemanticInterface::CallCallCountProc
  275. //------------------------------------------------------------------------------
  276.  
  277. SOM_Scope void  SOMLINK ODSemanticInterfaceCallCountProc(ODSemanticInterface *somSelf, Environment *ev,
  278.         ODPart* thePart,
  279.         ODDescType desiredType,
  280.         ODDescType containerClass,
  281.         ODOSLToken* container,
  282.         ODSLong* result)
  283. {
  284. //    ODSemanticInterfaceData *somThis = ODSemanticInterfaceGetData(somSelf);
  285.     ODSemanticInterfaceMethodDebug("ODSemanticInterface","ODSemanticInterfaceCallCountProc");
  286.  
  287.     ODSetSOMException(ev, errAEEventNotHandled);
  288. }
  289.  
  290. //------------------------------------------------------------------------------
  291. // ODSemanticInterface::CallDisposeTokenProc
  292. //------------------------------------------------------------------------------
  293.  
  294. SOM_Scope void  SOMLINK ODSemanticInterfaceCallDisposeTokenProc(ODSemanticInterface *somSelf, Environment *ev,
  295.         ODPart* thePart,
  296.         ODOSLToken* unneededToken)
  297. {
  298. //    ODSemanticInterfaceData *somThis = ODSemanticInterfaceGetData(somSelf);
  299.     ODSemanticInterfaceMethodDebug("ODSemanticInterface","ODSemanticInterfaceCallDisposeTokenProc");
  300.  
  301.     ODSetSOMException(ev, errAEEventNotHandled);
  302. }
  303.  
  304. //------------------------------------------------------------------------------
  305. // ODSemanticInterface::CallGetErrDescProc
  306. //------------------------------------------------------------------------------
  307.  
  308. SOM_Scope void  SOMLINK ODSemanticInterfaceCallGetErrDescProc(ODSemanticInterface *somSelf, Environment *ev,
  309.         ODPart* thePart,
  310.         ODDesc** errDesc)
  311. {
  312. //    ODSemanticInterfaceData *somThis = ODSemanticInterfaceGetData(somSelf);
  313.     ODSemanticInterfaceMethodDebug("ODSemanticInterface","ODSemanticInterfaceCallGetErrDescProc");
  314.  
  315.     ODSetSOMException(ev, errAEEventNotHandled);
  316. }
  317.  
  318. //------------------------------------------------------------------------------
  319. // ODSemanticInterface::CallGetMarkTokenProc
  320. //------------------------------------------------------------------------------
  321.  
  322. SOM_Scope void  SOMLINK ODSemanticInterfaceCallGetMarkTokenProc(ODSemanticInterface *somSelf, Environment *ev,
  323.         ODPart* thePart,
  324.         ODOSLToken* dContainerToken,
  325.         ODDescType containerClass,
  326.         ODOSLToken* result)
  327. {
  328. //    ODSemanticInterfaceData *somThis = ODSemanticInterfaceGetData(somSelf);
  329.     ODSemanticInterfaceMethodDebug("ODSemanticInterface","ODSemanticInterfaceCallGetMarkTokenProc");
  330.  
  331.     ODSetSOMException(ev, errAEEventNotHandled);
  332. }
  333.  
  334. //------------------------------------------------------------------------------
  335. // ODSemanticInterface::CallMarkProc
  336. //------------------------------------------------------------------------------
  337.  
  338. SOM_Scope void  SOMLINK ODSemanticInterfaceCallMarkProc(ODSemanticInterface *somSelf, Environment *ev,
  339.         ODPart* thePart,
  340.         ODOSLToken* dToken,
  341.         ODOSLToken* markToken,
  342.         ODSLong index)
  343. {
  344. //    ODSemanticInterfaceData *somThis = ODSemanticInterfaceGetData(somSelf);
  345.     ODSemanticInterfaceMethodDebug("ODSemanticInterface","ODSemanticInterfaceCallMarkProc");
  346.  
  347.     ODSetSOMException(ev, errAEEventNotHandled);
  348. }
  349.  
  350. //------------------------------------------------------------------------------
  351. // ODSemanticInterface::CallAdjustMarksProc
  352. //------------------------------------------------------------------------------
  353.  
  354. SOM_Scope void  SOMLINK ODSemanticInterfaceCallAdjustMarksProc(ODSemanticInterface *somSelf, Environment *ev,
  355.         ODPart* thePart,
  356.         ODSLong newStart,
  357.         ODSLong newStop,
  358.         ODOSLToken* markToken)
  359. {
  360. //    ODSemanticInterfaceData *somThis = ODSemanticInterfaceGetData(somSelf);
  361.     ODSemanticInterfaceMethodDebug("ODSemanticInterface","ODSemanticInterfaceCallAdjustMarksProc");
  362.  
  363.     ODSetSOMException(ev, errAEEventNotHandled);
  364. }
  365.  
  366. //------------------------------------------------------------------------------
  367. // ODSemanticInterface::GetOSLSupportFlags
  368. //------------------------------------------------------------------------------
  369.  
  370. SOM_Scope ODSShort  SOMLINK ODSemanticInterfaceGetOSLSupportFlags(ODSemanticInterface *somSelf, Environment *ev)
  371. {
  372.     ODSemanticInterfaceData *somThis = ODSemanticInterfaceGetData(somSelf);
  373.     ODSemanticInterfaceMethodDebug("ODSemanticInterface","ODSemanticInterfaceGetOSLSupportFlags");
  374.  
  375.     return _fFlags;
  376. }
  377.  
  378. //------------------------------------------------------------------------------
  379. // ODSemanticInterface::SetOSLSupportFlags
  380. //------------------------------------------------------------------------------
  381.  
  382. SOM_Scope void  SOMLINK ODSemanticInterfaceSetOSLSupportFlags(ODSemanticInterface *somSelf, Environment *ev,
  383.         ODSShort flags)
  384. {
  385.     ODSemanticInterfaceData *somThis = ODSemanticInterfaceGetData(somSelf);
  386.     ODSemanticInterfaceMethodDebug("ODSemanticInterface","ODSemanticInterfaceSetOSLSupportFlags");
  387.  
  388.     _fFlags = flags;
  389. }
  390.  
  391. //------------------------------------------------------------------------------
  392. // ODSemanticInterface::UsingPredispatchProc
  393. //------------------------------------------------------------------------------
  394.  
  395. SOM_Scope void  SOMLINK ODSemanticInterfaceUsingPredispatchProc(ODSemanticInterface *somSelf, Environment *ev,
  396.         ODBoolean usingNotUsing)
  397. {
  398.     ODSemanticInterfaceData *somThis = ODSemanticInterfaceGetData(somSelf);
  399.     ODSemanticInterfaceMethodDebug("ODSemanticInterface","ODSemanticInterfaceUsingPredispatchProc");
  400.  
  401.     SOM_TRY
  402.     
  403.     if (usingNotUsing != kODFalse)
  404.         _fMessageInterface->PreHandlerAdded(ev, somSelf, 0);
  405.     else
  406.         _fMessageInterface->PreHandlerRemoved(ev, somSelf, 0);
  407.     
  408.     SOM_CATCH_ALL
  409.     SOM_ENDTRY
  410. }
  411.  
  412.