home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1997 February: Technology Seed / Mac Tech Seed Feb '97.toast / OpenDoc 1.2b2c1 / Implementation / Core / ODSessnB.cpp < prev    next >
Encoding:
C/C++ Source or Header  |  1997-02-13  |  25.5 KB  |  745 lines  |  [TEXT/MPS ]

  1. /*
  2.     File:        ODSessnB.cpp
  3.  
  4.     Contains:    Base Session class implementation
  5.  
  6.     Owned by:    Nick Pilch
  7.  
  8.     Copyright:    © 1993 - 1996 by Apple Computer, Inc., all rights reserved.
  9.  
  10.     Change History (most recent first):
  11.  
  12.          <6>      10/14/96    RA        1386083: Make sure that session knows
  13.                                     whether it's inited or not.
  14.          <5>    03.10.1996    NP        Reverting last change. SOM apparently
  15.                                     didn't like the IDL change.
  16.          <4>    02.10.1996    NP        1386083: Make sure that session knows
  17.                                     whether it's inited or not.
  18.          <3>    20.09.1996    NP        1386083: Add include
  19.         <19>     10/8/95    TJ        Fixes Recomended by Refball
  20.         <18>     9/27/95    TÇ        1287399 GM: Cyberdog needs chance to
  21.                                     cleanup before ODSession dies
  22.         <17>     8/26/95    TÇ        1274606 FB2: Patching Remarks
  23.         <16>     8/16/95    NP        1273600: FB: ShellSI is not ref-counted
  24.                                     correctly.
  25.         <15>      8/3/95    RR        #1257260: Collapse B classes. Remove
  26.                                     somInit methods. Don't call IsInitialized
  27.                                     or SubclassResponsibility
  28.         <14>     7/31/95    CG        #1270320: Delete _fInfo in somUnint.
  29.         <13>     5/26/95    DM        1251403: Multithreading naming support.
  30.         <12>     5/21/95    NP        1250142: AcquireShellSemtInterface should do
  31.                                     ref counting.
  32.         <11>     5/18/95    DM        #1250474: RemoveEntry(in ODType type)
  33.                                     inout->in
  34.         <10>     5/11/95    NP        1242421: Fix exception handling, 1248917:
  35.                                     Remove unused method.
  36.          <9>      1/9/95    NP        1196615: ODSession::Get/SetShellSemtIntf
  37.                                     changes.
  38.          <8>    11/15/94    NP        1200193-The Shell should instantiate its
  39.                                     Semantic Interface.
  40.          <7>     10/7/94    CC        1191489 - Moved UniqueUpdateID() to
  41.                                     ODSession.
  42.          <6>     8/22/94    TÇ        #1182448 System Process quits when no
  43.                                     OpenDoc documents are running
  44.          <5>     8/19/94    NP        1181622: Ownership fix.
  45.          <4>     8/17/94    jpa        Added tons of includes so somUninit will
  46.                                     delete the objects properly. [1181515]
  47.          <3>     8/13/94    NP        1180819-Added support for private
  48.                                     ScritingObject.
  49.          <2>     8/12/94    NP        1180762-added setters for getters. moved
  50.                                     stuff to non-B file. Removed
  51.                                     GetSemtInterface.
  52.          <1>     6/23/94    CG        first checked in
  53.         ------------------------------------------------------------
  54.          <3>      6/1/94    CG        Removed include for Binding.h
  55.          <2>     3/15/94    MB        Changes to support SCpp/ASLM builds,
  56.                                     #1150864.
  57.          <1>      2/3/94    CG        first checked in
  58.     
  59.     To Do:
  60.     In Progress:
  61.         - Not including SOM class headers so the 'delete' calls were
  62. not properly deleting the objects.
  63. */
  64.  
  65. #ifndef _PLFMDEF_
  66. #include "PlfmDef.h"
  67. #endif
  68.  
  69. #ifndef _ODUTILS_
  70. #include <ODUtils.h>
  71. #endif
  72.  
  73. #ifndef _DOCUTILS_
  74. #include <DocUtils.h>
  75. #endif
  76.  
  77. #ifndef _TOKNTABL_
  78. #include "ToknTabl.h"
  79. #endif
  80.  
  81. #ifndef _DOCUTILP_
  82. #include "DocUtilP.h"
  83. #endif
  84.  
  85. #ifndef SOM_ODSemanticInterface_xh
  86. #include "SemtIntB.xh"
  87. #endif
  88.  
  89. // We have to include the proper headers for the classes of all the
  90. // instance variables, so the proper destructors get called when they're deleted.
  91. #include <WinStat.xh>
  92. #include <Disptch.xh>
  93. #include <Arbitrat.xh>
  94. #include <Clipbd.xh>
  95. #include <DragDrp.xh>
  96. #include <LinkMgr.xh>
  97. #include <MssgIntf.xh>
  98. #include <NamRslvr.xh>
  99. #include <Translt.xh>
  100. #include <Undo.xh>
  101. #include "ToknTabl.h"
  102. #include <ODBindng.xh>
  103. #include <NmSpcMg.xh>
  104. #include <ODStor.xh>
  105. #include <Info.xh>
  106.  
  107. #define ODBaseSession_Class_Source
  108. #define VARIABLE_MACROS
  109. #include <ODSessnB.xih>
  110.  
  111. #pragma segment ODBaseSession
  112.  
  113. //==============================================================================
  114. // ODBaseSession
  115. //==============================================================================
  116.  
  117. //------------------------------------------------------------------------------
  118. // ODBaseSession: InitBaseSession
  119. //------------------------------------------------------------------------------
  120.  
  121. SOM_Scope void     SOMLINK ODBaseSessionInitBaseSession(ODBaseSession *somSelf, Environment *ev)
  122. {
  123.     ODBaseSessionData *somThis = ODBaseSessionGetData(somSelf);
  124.     ODBaseSessionMethodDebug("ODBaseSession","InitBaseSession");
  125.  
  126.     SOM_TRY
  127.     
  128.         /* Moved from somInit. SOM itself sets fields to zero
  129.         _fWindowState = kODNULL;
  130.         _fDispatcher = kODNULL;
  131.         _fArbitrator = kODNULL;
  132.         _fClipboard = kODNULL;
  133.         _fDragAndDrop = kODNULL;
  134.         _fLinkManager = kODNULL;
  135.         _fMessageInterface = kODNULL;
  136.         _fNameResolver = kODNULL;
  137.         _fTranslation = kODNULL;
  138.         _fUndo = kODNULL;
  139.         _fBinding = kODNULL;
  140.         _fNameSpaceManager = kODNULL;
  141.         _fStorage = kODNULL;
  142.         _fShellSemtInterface = kODNULL;
  143.         _fInfo = kODNULL;
  144.     
  145.         _fTokenTable = kODNULL;
  146.         _fScriptingObject = kODNULL;
  147.         */
  148.         somSelf->InitObject(ev);
  149.         
  150.     SOM_CATCH_ALL
  151.     SOM_ENDTRY
  152. }
  153. #if 0
  154. //------------------------------------------------------------------------------
  155. // ODBaseSession: Purge
  156. //------------------------------------------------------------------------------
  157.  
  158. SOM_Scope ODSize  SOMLINK ODBaseSessionPurge(ODBaseSession *somSelf, Environment *ev,
  159.         ODSize size)
  160. {
  161.     //ODBaseSessionData *somThis = ODBaseSessionGetData(somSelf);
  162.     ODBaseSessionMethodDebug("ODBaseSession","Purge");
  163.  
  164.     ODSize    retVal = 0; ODVolatile( retVal );
  165.  
  166.     SOM_TRY
  167.         retVal = ODBaseSession_parent_ODObject_Purge(somSelf, ev, size);
  168.     SOM_CATCH_ALL
  169.         WARN("Error %ld trying to purge in ODBaseSessionPurge",ErrorCode());
  170.         SetErrorCode(kODNoError);        // dh - Eat the exception; Purge should not 
  171.                                         // propagate it because clients function
  172.                                         // fine whether memory was purged or not.
  173.     SOM_ENDTRY
  174.     
  175.     return retVal;
  176. }
  177. #endif /* 0 */
  178. //------------------------------------------------------------------------------
  179. // ODBaseSession: somUninit
  180. //------------------------------------------------------------------------------
  181.  
  182. static void    DispatchExitEvent(Environment* ev, ODDispatcher* dispatcher)
  183. {
  184. // Copied from RealShell::FakePrintMenuEvent
  185.     ODEventData event;
  186.     event.message = 0L;
  187.     event.what = kODEvtExit;
  188.     // zero the rest of the fields
  189.     WASSERT( sizeof(Point) == sizeof(long) );
  190.     *(long*)&event.where = 0L;
  191.     event.when = 0L;
  192.     event.modifiers = 0;
  193.     dispatcher->Dispatch(ev, &event);
  194. }
  195.  
  196.  
  197. SOM_Scope void  SOMLINK ODBaseSessionsomUninit(ODBaseSession *somSelf)
  198. {
  199.     ODBaseSessionData *somThis = ODBaseSessionGetData(somSelf);
  200.     ODBaseSessionMethodDebug("ODBaseSession","somUninit");
  201.     Environment *ev = somGetGlobalEnvironment();
  202.     
  203.     if (somSelf->WasSuccessfullyInitialized(ev))
  204.     {
  205.         TRY
  206.             // When do we do this?
  207.             DispatchExitEvent(ev, _fDispatcher);
  208.         //    close outstanding documents appropriately
  209.             ODDocument* document = kODNULL;
  210.             while ((document = ODGetFirstOpenDocument(ev, (ODSession*)somSelf)) != kODNULL)
  211.             {
  212.                 WARN("Wierd. Closing documents in ODBaseSessionsomUninit. Let Nick know that this has happened.");
  213.                 ODCloseDocument(ev, (ODSession*)somSelf, document);
  214.             }
  215.         CATCH_ALL
  216.             WARN("Exit event or closing outstanding documents failed.");
  217.         ENDTRY
  218.     }
  219.  
  220.     ODDeleteObject(_fWindowState);
  221.     ODDeleteObject(_fDispatcher);
  222.     ODDeleteObject(_fArbitrator);
  223.     ODDeleteObject(_fClipboard);
  224.     ODDeleteObject(_fDragAndDrop);
  225.     ODDeleteObject(_fLinkManager);
  226.     ODDeleteObject(_fMessageInterface);
  227.     ODDeleteObject(_fNameResolver);
  228.     ODDeleteObject(_fTranslation);
  229.     ODDeleteObject(_fUndo);
  230.     ODDeleteObject(_fTokenTable);
  231.     ODDeleteObject(_fBinding);
  232.     ODDeleteObject(_fNameSpaceManager);
  233.     ODDeleteObject(_fStorage);
  234.     ODDeleteObject(_fInfo);
  235.     
  236.     ODSafeReleaseObject(_fShellSemtInterface); _fShellSemtInterface = kODNULL;
  237. }
  238.  
  239. //------------------------------------------------------------------------------
  240. // "Getters" / "Setters"
  241. //------------------------------------------------------------------------------
  242.  
  243. //------------------------------------------------------------------------------
  244. // ODBaseSession: GetWindowState
  245. //------------------------------------------------------------------------------
  246.  
  247. SOM_Scope ODWindowState*  SOMLINK ODBaseSessionGetWindowState(ODBaseSession *somSelf, Environment *ev)
  248. {
  249.     ODBaseSessionData *somThis = ODBaseSessionGetData(somSelf);
  250.     ODBaseSessionMethodDebug("ODBaseSession","GetWindowState");
  251.  
  252.     return _fWindowState;
  253. }
  254.  
  255. //------------------------------------------------------------------------------
  256. // ODBaseSession: SetWindowState
  257. //------------------------------------------------------------------------------
  258.  
  259. SOM_Scope void  SOMLINK ODBaseSessionSetWindowState(ODBaseSession *somSelf, Environment *ev,
  260.         ODWindowState* windowState)
  261. {
  262.     ODBaseSessionData *somThis = ODBaseSessionGetData(somSelf);
  263.     ODBaseSessionMethodDebug("ODBaseSession","ODBaseSessionSetWindowState");
  264.  
  265.     _fWindowState = windowState;
  266. }
  267.  
  268. //------------------------------------------------------------------------------
  269. // ODBaseSession: GetDispatcher
  270. //------------------------------------------------------------------------------
  271.  
  272. SOM_Scope ODDispatcher*  SOMLINK ODBaseSessionGetDispatcher(ODBaseSession *somSelf, Environment *ev)
  273. {
  274.     ODBaseSessionData *somThis = ODBaseSessionGetData(somSelf);
  275.     ODBaseSessionMethodDebug("ODBaseSession","GetDispatcher");
  276.  
  277.     return _fDispatcher;
  278. }
  279.  
  280. //------------------------------------------------------------------------------
  281. // ODBaseSession: SetDispatcher
  282. //------------------------------------------------------------------------------
  283.  
  284. SOM_Scope void  SOMLINK ODBaseSessionSetDispatcher(ODBaseSession *somSelf, Environment *ev,
  285.         ODDispatcher* dispatcher)
  286. {
  287.     ODBaseSessionData *somThis = ODBaseSessionGetData(somSelf);
  288.     ODBaseSessionMethodDebug("ODBaseSession","ODBaseSessionSetDispatcher");
  289.  
  290.     _fDispatcher = dispatcher;
  291. }
  292.  
  293. //------------------------------------------------------------------------------
  294. // ODBaseSession: GetArbitrator
  295. //------------------------------------------------------------------------------
  296.  
  297. SOM_Scope ODArbitrator*  SOMLINK ODBaseSessionGetArbitrator(ODBaseSession *somSelf, Environment *ev)
  298. {
  299.     ODBaseSessionData *somThis = ODBaseSessionGetData(somSelf);
  300.     ODBaseSessionMethodDebug("ODBaseSession","GetArbitrator");
  301.  
  302.     return _fArbitrator;
  303. }
  304.  
  305. //------------------------------------------------------------------------------
  306. // ODBaseSession: SetArbitrator
  307. //------------------------------------------------------------------------------
  308.  
  309. SOM_Scope void  SOMLINK ODBaseSessionSetArbitrator(ODBaseSession *somSelf, Environment *ev,
  310.         ODArbitrator* arbitrator)
  311. {
  312.     ODBaseSessionData *somThis = ODBaseSessionGetData(somSelf);
  313.     ODBaseSessionMethodDebug("ODBaseSession","ODBaseSessionSetArbitrator");
  314.  
  315.     _fArbitrator = arbitrator;
  316. }
  317.  
  318. //------------------------------------------------------------------------------
  319. // ODBaseSession: GetClipboard
  320. //------------------------------------------------------------------------------
  321.  
  322. SOM_Scope ODClipboard*  SOMLINK ODBaseSessionGetClipboard(ODBaseSession *somSelf, Environment *ev)
  323. {
  324.     ODBaseSessionData *somThis = ODBaseSessionGetData(somSelf);
  325.     ODBaseSessionMethodDebug("ODBaseSession","GetClipboard");
  326.  
  327.     return _fClipboard;
  328. }
  329.  
  330. //------------------------------------------------------------------------------
  331. // ODBaseSession: SetClipboard
  332. //------------------------------------------------------------------------------
  333.  
  334. SOM_Scope void  SOMLINK ODBaseSessionSetClipboard(ODBaseSession *somSelf, Environment *ev,
  335.         ODClipboard* clipboard)
  336. {
  337.     ODBaseSessionData *somThis = ODBaseSessionGetData(somSelf);
  338.     ODBaseSessionMethodDebug("ODBaseSession","ODBaseSessionSetClipboard");
  339.  
  340.     _fClipboard = clipboard;
  341. }
  342.  
  343. //------------------------------------------------------------------------------
  344. // ODBaseSession: GetDragAndDrop
  345. //------------------------------------------------------------------------------
  346.  
  347. SOM_Scope ODDragAndDrop*     SOMLINK ODBaseSessionGetDragAndDrop(ODBaseSession *somSelf, Environment *ev)
  348. {
  349.     ODBaseSessionData *somThis = ODBaseSessionGetData(somSelf);
  350.     ODBaseSessionMethodDebug("ODBaseSession","GetDragAndDrop");
  351.  
  352.     return _fDragAndDrop;
  353. }
  354.  
  355. //------------------------------------------------------------------------------
  356. // ODBaseSession: SetDragAndDrop
  357. //------------------------------------------------------------------------------
  358.  
  359. SOM_Scope void  SOMLINK ODBaseSessionSetDragAndDrop(ODBaseSession *somSelf, Environment *ev,
  360.         ODDragAndDrop* dragAndDrop)
  361. {
  362.     ODBaseSessionData *somThis = ODBaseSessionGetData(somSelf);
  363.     ODBaseSessionMethodDebug("ODBaseSession","ODBaseSessionSetDragAndDrop");
  364.  
  365.     _fDragAndDrop = dragAndDrop;
  366. }
  367.  
  368. //------------------------------------------------------------------------------
  369. // ODBaseSession: GetInfo
  370. //------------------------------------------------------------------------------
  371.  
  372. SOM_Scope ODInfo*     SOMLINK ODBaseSessionGetInfo(ODBaseSession *somSelf, Environment *ev)
  373. {
  374.     ODBaseSessionData *somThis = ODBaseSessionGetData(somSelf);
  375.     ODBaseSessionMethodDebug("ODBaseSession","GetInfo");
  376.  
  377.     return _fInfo;
  378. }
  379.  
  380. //------------------------------------------------------------------------------
  381. // ODBaseSession: SetInfo
  382. //------------------------------------------------------------------------------
  383.  
  384. SOM_Scope void     SOMLINK ODBaseSessionSetInfo(ODBaseSession *somSelf, Environment *ev, ODInfo* info)
  385. {
  386.     ODBaseSessionData *somThis = ODBaseSessionGetData(somSelf);
  387.     ODBaseSessionMethodDebug("ODBaseSession","SetInfo");
  388.  
  389.     _fInfo = info;
  390. }
  391.  
  392. //------------------------------------------------------------------------------
  393. // ODBaseSession: GetLinkManager
  394. //------------------------------------------------------------------------------
  395.  
  396. SOM_Scope ODLinkManager*     SOMLINK ODBaseSessionGetLinkManager(ODBaseSession *somSelf, Environment *ev)
  397. {
  398.     ODBaseSessionData *somThis = ODBaseSessionGetData(somSelf);
  399.     ODBaseSessionMethodDebug("ODBaseSession","GetLinkManager");
  400.  
  401.     return _fLinkManager;
  402. }
  403.  
  404. //------------------------------------------------------------------------------
  405. // ODBaseSession: SetLinkManager
  406. //------------------------------------------------------------------------------
  407.  
  408. SOM_Scope void  SOMLINK ODBaseSessionSetLinkManager(ODBaseSession *somSelf, Environment *ev,
  409.         ODLinkManager* linkManager)
  410. {
  411.     ODBaseSessionData *somThis = ODBaseSessionGetData(somSelf);
  412.     ODBaseSessionMethodDebug("ODBaseSession","ODBaseSessionSetLinkManager");
  413.  
  414.     _fLinkManager = linkManager;
  415. }
  416.  
  417. //------------------------------------------------------------------------------
  418. // ODBaseSession: GetMessageInterface
  419. //------------------------------------------------------------------------------
  420.  
  421. SOM_Scope ODMessageInterface*  SOMLINK ODBaseSessionGetMessageInterface(ODBaseSession *somSelf, Environment *ev)
  422. {
  423.     ODBaseSessionData *somThis = ODBaseSessionGetData(somSelf);
  424.     ODBaseSessionMethodDebug("ODBaseSession","GetMessageInterface");
  425.  
  426.     return _fMessageInterface;
  427. }
  428.  
  429. //------------------------------------------------------------------------------
  430. // ODBaseSession: SetMessageInterface
  431. //------------------------------------------------------------------------------
  432.  
  433. SOM_Scope void  SOMLINK ODBaseSessionSetMessageInterface(ODBaseSession *somSelf, Environment *ev,
  434.         ODMessageInterface* messageInterface)
  435. {
  436.     ODBaseSessionData *somThis = ODBaseSessionGetData(somSelf);
  437.     ODBaseSessionMethodDebug("ODBaseSession","ODBaseSessionSetMessageInterface");
  438.  
  439.     _fMessageInterface = messageInterface;
  440. }
  441.  
  442. //------------------------------------------------------------------------------
  443. // ODBaseSession: GetNameResolver
  444. //------------------------------------------------------------------------------
  445.  
  446. SOM_Scope ODNameResolver*  SOMLINK ODBaseSessionGetNameResolver(ODBaseSession *somSelf, Environment *ev)
  447. {
  448.     ODBaseSessionData *somThis = ODBaseSessionGetData(somSelf);
  449.     ODBaseSessionMethodDebug("ODBaseSession","GetNameResolver");
  450.  
  451.     return _fNameResolver;
  452. }
  453.  
  454. //------------------------------------------------------------------------------
  455. // ODBaseSession: SetNameResolver
  456. //------------------------------------------------------------------------------
  457.  
  458. SOM_Scope void  SOMLINK ODBaseSessionSetNameResolver(ODBaseSession *somSelf, Environment *ev,
  459.         ODNameResolver* nameResolver)
  460. {
  461.     ODBaseSessionData *somThis = ODBaseSessionGetData(somSelf);
  462.     ODBaseSessionMethodDebug("ODBaseSession","ODBaseSessionSetNameResolver");
  463.  
  464.     _fNameResolver = nameResolver;
  465. }
  466.  
  467. //------------------------------------------------------------------------------
  468. // ODBaseSession: GetTranslation
  469. //------------------------------------------------------------------------------
  470.  
  471. SOM_Scope ODTranslation*  SOMLINK ODBaseSessionGetTranslation(ODBaseSession *somSelf, Environment *ev)
  472. {
  473.     ODBaseSessionData *somThis = ODBaseSessionGetData(somSelf);
  474.     ODBaseSessionMethodDebug("ODBaseSession","GetTranslation");
  475.  
  476.     return _fTranslation;
  477. }
  478.  
  479. //------------------------------------------------------------------------------
  480. // ODBaseSession: SetTranslation
  481. //------------------------------------------------------------------------------
  482.  
  483. SOM_Scope void  SOMLINK ODBaseSessionSetTranslation(ODBaseSession *somSelf, Environment *ev,
  484.         ODTranslation* translation)
  485. {
  486.     ODBaseSessionData *somThis = ODBaseSessionGetData(somSelf);
  487.     ODBaseSessionMethodDebug("ODBaseSession","ODBaseSessionSetTranslation");
  488.  
  489.     _fTranslation = translation;
  490. }
  491.  
  492. //------------------------------------------------------------------------------
  493. // ODBaseSession: GetUndo
  494. //------------------------------------------------------------------------------
  495.  
  496. SOM_Scope ODUndo*  SOMLINK ODBaseSessionGetUndo(ODBaseSession *somSelf, Environment *ev)
  497. {
  498.     ODBaseSessionData *somThis = ODBaseSessionGetData(somSelf);
  499.     ODBaseSessionMethodDebug("ODBaseSession","GetUndo");
  500.  
  501.     return _fUndo;
  502. }
  503.  
  504. //------------------------------------------------------------------------------
  505. // ODBaseSession: SetUndo
  506. //------------------------------------------------------------------------------
  507.  
  508. SOM_Scope void  SOMLINK ODBaseSessionSetUndo(ODBaseSession *somSelf, Environment *ev,
  509.         ODUndo* undo)
  510. {
  511.     ODBaseSessionData *somThis = ODBaseSessionGetData(somSelf);
  512.     ODBaseSessionMethodDebug("ODBaseSession","ODBaseSessionSetUndo");
  513.  
  514.     _fUndo = undo;
  515. }
  516.  
  517. //------------------------------------------------------------------------------
  518. // ODBaseSession: GetStorageSystem
  519. //------------------------------------------------------------------------------
  520.  
  521. SOM_Scope ODStorageSystem*  SOMLINK ODBaseSessionGetStorageSystem(ODBaseSession *somSelf, Environment *ev)
  522. {
  523.     ODBaseSessionData *somThis = ODBaseSessionGetData(somSelf);
  524.     ODBaseSessionMethodDebug("ODBaseSession","GetStorageSystem");
  525.  
  526.     return _fStorage;
  527. }
  528.  
  529. //------------------------------------------------------------------------------
  530. // ODBaseSession: SetStorageSystem
  531. //------------------------------------------------------------------------------
  532.  
  533. SOM_Scope void  SOMLINK ODBaseSessionSetStorageSystem(ODBaseSession *somSelf, Environment *ev,
  534.         ODStorageSystem* storageSystem)
  535. {
  536.     ODBaseSessionData *somThis = ODBaseSessionGetData(somSelf);
  537.     ODBaseSessionMethodDebug("ODBaseSession","ODBaseSessionSetStorageSystem");
  538.  
  539.     _fStorage = storageSystem;
  540. }
  541.  
  542. //------------------------------------------------------------------------------
  543. // ODBaseSession: GetNameSpaceManager
  544. //------------------------------------------------------------------------------
  545.  
  546. SOM_Scope ODNameSpaceManager*  SOMLINK ODBaseSessionGetNameSpaceManager(ODBaseSession *somSelf, Environment *ev)
  547. {
  548.     ODBaseSessionData *somThis = ODBaseSessionGetData(somSelf);
  549.     ODBaseSessionMethodDebug("ODBaseSession","GetNameSpaceManager");
  550.  
  551.     return _fNameSpaceManager;
  552. }
  553.  
  554. //------------------------------------------------------------------------------
  555. // ODBaseSession: SetNameSpaceManager
  556. //------------------------------------------------------------------------------
  557.  
  558. SOM_Scope void  SOMLINK ODBaseSessionSetNameSpaceManager(ODBaseSession *somSelf, Environment *ev,
  559.         ODNameSpaceManager* nameSpaceManager)
  560. {
  561.     ODBaseSessionData *somThis = ODBaseSessionGetData(somSelf);
  562.     ODBaseSessionMethodDebug("ODBaseSession","ODBaseSessionSetNameSpaceManager");
  563.  
  564.     _fNameSpaceManager = nameSpaceManager;
  565. }
  566.  
  567. //------------------------------------------------------------------------------
  568. // ODBaseSession: GetBinding
  569. //------------------------------------------------------------------------------
  570.  
  571. SOM_Scope ODBinding*  SOMLINK ODBaseSessionGetBinding(ODBaseSession *somSelf, Environment *ev)
  572. {
  573.     ODBaseSessionData *somThis = ODBaseSessionGetData(somSelf);
  574.     ODBaseSessionMethodDebug("ODBaseSession","GetBinding");
  575.  
  576.     return _fBinding;
  577. }
  578.  
  579. //------------------------------------------------------------------------------
  580. // ODBaseSession: SetBinding
  581. //------------------------------------------------------------------------------
  582.  
  583. SOM_Scope void  SOMLINK ODBaseSessionSetBinding(ODBaseSession *somSelf, Environment *ev,
  584.         ODBinding* binding)
  585. {
  586.     ODBaseSessionData *somThis = ODBaseSessionGetData(somSelf);
  587.     ODBaseSessionMethodDebug("ODBaseSession","ODBaseSessionSetBinding");
  588.  
  589.     _fBinding = binding;
  590. }
  591.  
  592. //------------------------------------------------------------------------------
  593. // ODBaseSession: AcquireShellSemtInterface
  594. //------------------------------------------------------------------------------
  595.  
  596. SOM_Scope ODSemanticInterface*  SOMLINK ODBaseSessionAcquireShellSemtInterface(ODBaseSession *somSelf, Environment *ev)
  597. {
  598.     ODBaseSessionData *somThis = ODBaseSessionGetData(somSelf);
  599.     ODBaseSessionMethodDebug("ODBaseSession","AcquireShellSemtInterface");
  600.  
  601.     if (_fShellSemtInterface)
  602.         _fShellSemtInterface->Acquire(ev);
  603.     return _fShellSemtInterface;
  604. }
  605.  
  606. //------------------------------------------------------------------------------
  607. // ODBaseSession: SetShellSemtInterface
  608. //------------------------------------------------------------------------------
  609.  
  610. SOM_Scope void  SOMLINK ODBaseSessionSetShellSemtInterface(ODBaseSession *somSelf, Environment *ev,
  611.         ODSemanticInterface* shellSemanticInterface)
  612. {
  613.     ODBaseSessionData *somThis = ODBaseSessionGetData(somSelf);
  614.     ODBaseSessionMethodDebug("ODBaseSession","ODBaseSessionSetShellSemtInterface");
  615.  
  616.     SOM_TRY
  617.         ODReleaseObject(ev, _fShellSemtInterface);
  618.         if (shellSemanticInterface)
  619.             shellSemanticInterface->Acquire(ev);
  620.         _fShellSemtInterface = shellSemanticInterface;
  621.     SOM_CATCH_ALL
  622.     SOM_ENDTRY
  623. }
  624.  
  625. //------------------------------------------------------------------------------
  626. // ODBaseSession: Tokenize
  627. //------------------------------------------------------------------------------
  628.  
  629. SOM_Scope ODTypeToken  SOMLINK ODBaseSessionTokenize(ODBaseSession *somSelf, Environment *ev,
  630.         ODType type)
  631. {
  632.     ODBaseSessionData *somThis = ODBaseSessionGetData(somSelf);
  633.     ODBaseSessionMethodDebug("ODBaseSession","Tokenize");
  634.  
  635.     ODTypeToken    retVal = kODNullTypeToken;
  636.  
  637.     SOM_TRY
  638.         retVal = _fTokenTable->Tokenize(type);
  639.     SOM_CATCH_ALL
  640.     SOM_ENDTRY
  641.     
  642.     return retVal;
  643. }
  644.  
  645. //------------------------------------------------------------------------------
  646. // ODBaseSession: RemoveEntry
  647. //------------------------------------------------------------------------------
  648.  
  649. SOM_Scope void  SOMLINK ODBaseSessionRemoveEntry(ODBaseSession *somSelf, Environment *ev,
  650.         ODType type)
  651. {
  652.     ODBaseSessionData *somThis = ODBaseSessionGetData(somSelf);
  653.     ODBaseSessionMethodDebug("ODBaseSession","RemoveEntry");
  654.  
  655.     SOM_TRY
  656.         _fTokenTable->RemoveEntry(type);
  657.     SOM_CATCH_ALL
  658.     SOM_ENDTRY
  659. }
  660.  
  661. //------------------------------------------------------------------------------
  662. // ODBaseSession: GetType
  663. //------------------------------------------------------------------------------
  664.  
  665. SOM_Scope ODBoolean  SOMLINK ODBaseSessionGetType(ODBaseSession *somSelf, Environment *ev,
  666.         ODTypeToken token, ODType* type)
  667. {
  668.     ODBaseSessionData *somThis = ODBaseSessionGetData(somSelf);
  669.     ODBaseSessionMethodDebug("ODBaseSession","GetType");
  670.  
  671.     ODBoolean    retVal = kODFalse;
  672.  
  673.     SOM_TRY
  674.         retVal = _fTokenTable->GetType(token, type);
  675.     SOM_CATCH_ALL
  676.     SOM_ENDTRY
  677.     
  678.     return retVal;
  679. }
  680.  
  681. //------------------------------------------------------------------------------
  682. // ODBaseSession: GetTokenTable
  683. //------------------------------------------------------------------------------
  684.  
  685. SOM_Scope TokenTable*  SOMLINK ODBaseSessionGetTokenTable(ODBaseSession *somSelf, Environment *ev)
  686. {
  687.     ODBaseSessionData *somThis = ODBaseSessionGetData(somSelf);
  688.     ODBaseSessionMethodDebug("ODBaseSession","ODBaseSessionGetTokenTable");
  689.  
  690.     return _fTokenTable;
  691. }
  692.  
  693. //------------------------------------------------------------------------------
  694. // ODBaseSession: SetTokenTable
  695. //------------------------------------------------------------------------------
  696.  
  697. SOM_Scope void  SOMLINK ODBaseSessionSetTokenTable(ODBaseSession *somSelf, Environment *ev,
  698.         TokenTable* table)
  699. {
  700.     ODBaseSessionData *somThis = ODBaseSessionGetData(somSelf);
  701.     ODBaseSessionMethodDebug("ODBaseSession","ODBaseSessionSetTokenTable");
  702.  
  703.     _fTokenTable = table;
  704. }
  705.  
  706. //------------------------------------------------------------------------------
  707. // ODBaseSession: SetSuccessfullyInitialized
  708. //------------------------------------------------------------------------------
  709.  
  710. SOM_Scope void  SOMLINK ODBaseSessionSetSuccessfullyInitialized(ODBaseSession *somSelf, Environment *ev)
  711. {
  712.     ODBaseSessionData *somThis = ODBaseSessionGetData(somSelf);
  713.     ODBaseSessionMethodDebug("ODBaseSession","ODBaseSessionSetSuccessfullyInitialized");
  714.  
  715.     _fInited = kODTrue;
  716. }
  717.  
  718. //------------------------------------------------------------------------------
  719. // ODBaseSession: WasSuccessfullyInitialized
  720. //------------------------------------------------------------------------------
  721.  
  722. SOM_Scope ODBoolean  SOMLINK ODBaseSessionWasSuccessfullyInitialized(ODBaseSession *somSelf, Environment *ev)
  723. {
  724.     ODBaseSessionData *somThis = ODBaseSessionGetData(somSelf);
  725.     ODBaseSessionMethodDebug("ODBaseSession","ODBaseSessionWasSuccessfullyInitialized");
  726.  
  727.     return _fInited;
  728. }
  729. #if 0
  730. //------------------------------------------------------------------------------
  731. // ODBaseSession: GetScriptingbject
  732. //------------------------------------------------------------------------------
  733.  
  734. SOM_Scope ScriptingObject*  SOMLINK ODBaseSessionGetScriptingObject(ODBaseSession *somSelf, Environment *ev)
  735. {
  736.     ODBaseSessionData *somThis = ODBaseSessionGetData(somSelf);
  737.     ODBaseSessionMethodDebug("ODBaseSession","ODBaseSessionGetScriptingObject");
  738.  
  739. //    if (!_fScriptingObject)
  740. //        _fScriptingObject = new ScriptingObject;
  741. //    return _fScriptingObject;
  742.     return 0;
  743. }
  744. #endif /* 0 */
  745.