home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / warphead.zip / H / BNDNSUTL.H < prev    next >
C/C++ Source or Header  |  1997-02-28  |  11KB  |  274 lines

  1. /* @(#) 1.8 com/src/utils/include/BndNSUtl.h, odconfig, od96os2, odos29646d 10/30/96 18:06:39 [11/15/96 15:28:57] */
  2. /*====START_GENERATED_PROLOG====================================== */
  3. /*
  4.  *   COMPONENT_NAME: odconfig
  5.  *
  6.  *   CLASSES: none
  7.  *
  8.  *   ORIGINS: 82,27
  9.  *
  10.  *
  11.  *   (C) COPYRIGHT International Business Machines Corp. 1995,1996
  12.  *   All Rights Reserved
  13.  *   Licensed Materials - Property of IBM
  14.  *   US Government Users Restricted Rights - Use, duplication or
  15.  *   disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
  16.  *
  17.  *   IBM DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
  18.  *   ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
  19.  *   PURPOSE. IN NO EVENT SHALL IBM BE LIABLE FOR ANY SPECIAL, INDIRECT OR
  20.  *   CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF
  21.  *   USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
  22.  *   OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE
  23.  *   OR PERFORMANCE OF THIS SOFTWARE.
  24.  */
  25. /*====END_GENERATED_PROLOG======================================== */
  26.  
  27. /*
  28.         File:           BndNSUtl.h
  29.  
  30.         Contains:       Binding utilities for EditorSetup.
  31.  
  32.         Owned by:       Caia Grisar
  33.  
  34.         Copyright:      ⌐ 1993 - 1995 by Apple Computer, Inc., all rights reserved.
  35.  
  36. */
  37.  
  38.  
  39. #ifndef _BNDNSUTL_
  40. #define _BNDNSUTL_
  41.  
  42. #ifndef _ODTYPES_
  43. #include <ODTypes.h>
  44. #endif
  45.  
  46. #ifndef _PLFMFILE_
  47. #include "PlfmFile.h"
  48. #endif
  49.  
  50. #ifdef _PLATFORM_MACINTOSH_
  51. #ifndef __CONTROLS__
  52. #include <Controls.h>
  53. #endif
  54. #endif
  55.  
  56. #ifndef SOM_ODWindowState_xh
  57. #include <WinStat.xh>
  58. #endif
  59.  
  60. #ifndef SOM_ODNameSpaceManager_xh
  61. #include "NmSpcMg.xh"
  62. #endif
  63.  
  64. #ifndef _ORDCOLL_
  65. #include "OrdColl.h"
  66. #endif
  67.  
  68. #if (defined _PLATFORM_WIN32_ || _PLATFORM_OS2_ || _PLATFORM_UNIX_ )
  69. #ifndef _ODTYPESP_
  70. #include <ODTypesP.h>
  71. #endif
  72.  
  73.  
  74. #ifndef _ODTYPESB_
  75. #include <ODTypesB.xh>
  76. #endif
  77.  
  78.  
  79. #ifndef _ODTYPESM_
  80. #include <ODTypesM.xh>
  81. #endif
  82.  
  83.  
  84. #ifndef _SOMCORBA_
  85. #include <somcorba.h>
  86. #endif
  87.  
  88. #ifndef SOM_ODPart_xh
  89. #include <Part.xh>
  90. #endif
  91.  
  92. #if defined (_PLATFORM_UNIX_)
  93. #define EXPENTRY
  94. typedef char *PSZ;
  95. #endif
  96.  
  97. #endif // defined(_PLATFORM_WIN32_ || _PLATFORM_OS2_ || _PLATFORM_UNIX_)
  98.  
  99.  
  100.  
  101. //==============================================================================
  102. // Classes used by this interface
  103. //==============================================================================
  104. class   ODTypeList;
  105. class   EditorSet;
  106. class   ODNameSpaceManager;
  107. class   ODStorageUnitView;
  108. class   ODPart;
  109. class   ODStorageUnit;
  110. class   ODPersistentObject;
  111.  
  112.  
  113.  
  114. //==============================================================================
  115. // functions
  116. //==============================================================================
  117.  
  118.  
  119. extern "C" {
  120.  
  121. ODEditor SetSysPrefEditorForKind(ODNameSpaceManager* theNameSpaceManager,
  122.                                                                         ODType kind, ODEditor editor);
  123.         // Sets the system-wide preferred editor for the argument data kind.
  124.         // This routine will overwrite any preference set by the user.
  125.  
  126. ODEditor SetSysPrefEditorForCategory(ODNameSpaceManager* theNameSpaceManager,
  127.                                                                         ODType category,ODEditor editor);
  128.         // Sets the system-wide preferred editor for the argument data category.
  129.         // This routine will overwrite any preference set by the user.
  130.  
  131. ODEditor GetSysPrefEditorForKind(ODNameSpaceManager* theNameSpaceManager,
  132.                                                                         ODType kind);
  133.         // Returns the system-wide preferred editor for the argument data kind.
  134.         // A null value is returned if no preference has been specified.
  135.         // This routine checks to ensure that the preferred editor actually exists;
  136.         // if it does not, the preference is canceled and null is returned.
  137.  
  138. ODEditor GetSysPrefEditorForCategory(ODNameSpaceManager* theNameSpaceManager,
  139.                                                                         ODType category);
  140.         // Returns the system-wide preferred editor for the argument data category.
  141.         // A null value is returned if no preference has been specified.
  142.  
  143. ODTypeList* GetCategoriesOfKind(ODNameSpaceManager* theNameSpaceManager,
  144.                                                                         ODType kind);
  145.         // Returns the categories of the argument data kind, in the content of the
  146.         // argument storage unit.  The client must dispose of the result.
  147.  
  148. ODBoolean GetUserKindFromKind( ODNameSpaceManager* theNameSpaceManager,
  149.                                                                         ODType kind, ODName** name );
  150. ODBoolean GetUserEditorFromEditor( ODNameSpaceManager* theNameSpaceManager,
  151.                                                                         ODType editor, ODName** name );
  152. ODBoolean GetUserCatFromCat( ODNameSpaceManager* theNameSpaceManager,
  153.                                                                         ODType category, ODName** name );
  154.  
  155. ODOSType ODGetODOSTypeForKind(ODNameSpaceManager* theNmSpcMgr, ODType kind);
  156.  
  157. ODBoolean EditorSupportsKind( ODNameSpaceManager* theNameSpaceManager,
  158.                               ODEditor editor, ODType kind );
  159.                 // Returns true if the argument editor supports the argument data type
  160.                 // without translation.
  161.  
  162. ODBoolean EditorForKind( ODEditor editor, ODType kind,
  163.                       ODSession* session);
  164.                 // Returns true if the argument editor supports the argument data type
  165.                 // without translation.
  166.  
  167. ODBoolean GetAllEditorsForCategory( ODNameSpaceManager* theNameSpaceManager,
  168.                                                                 ODType category, EditorSet* theEditorSet );
  169.                 // Returns the set of Editors supporting the argument data category without translation.
  170.  
  171. ODBoolean GetAllEditorsForKind(ODNameSpaceManager* theNameSpaceManager,
  172.                                                                 ODType kind, EditorSet* theEditorSet);
  173.                 // Returns the set of Editors supporting the argument data kind without translation.
  174.  
  175. void GetAllKindsForEditor(ODNameSpaceManager* theNmSpcMgr,
  176.                                                                 ODTypeList*     kindList, ODEditor editorID);
  177.  
  178. ODULong ReadSize(ODFileRefNum file, ODStorageUnitView* view);
  179.  
  180. void ReadBytes(ODFileRefNum file, ODStorageUnitView* view,
  181.                                                 ODPtr bytes, ODULong* length);
  182.  
  183. EditorSet* ODGetEditorSetFromResFile(ODSShort resRefNum);
  184.  
  185.                 // Returns the set of Editors IDs (if any) found in this file
  186.  
  187. EditorSet* ODGetEditorSetFromNMAP(ODHandle nmap );
  188.  
  189.  
  190.  
  191. //------------------------------------------------------------------------------
  192. // phase1 - add following definitions from the defunct InfoUtil.h file
  193. // ODSetPOName        ODGetCategory      ODGetKindFromPartSU
  194. // ODGetCreationDate  ContentValueTypes  GetThisKindFromList
  195. // ODGetCatFromKind   ODGetSUFromPstObj  ODGetCatFromPartSU
  196. //------------------------------------------------------------------------------
  197. //-------------------------------------------------------------------------------------
  198. // Persistent Object Property getters and setters
  199. //    all Getters expect you to pass in a buffer to be filled
  200. //    or kODNULL which causes it to create one for you.
  201. //    all Setters do NOT consume what you pass in, so it is safe to pass in
  202. //    a reference to your internal structures.  They are only accessed for
  203. //    the duration of the Setter API call.
  204. //-------------------------------------------------------------------------------------
  205.  
  206. ODULong  ODGetCreationDate(Environment* ev, ODStorageUnit* su);
  207.  
  208. ODIText* ODGetPOName(Environment* ev, ODPersistentObject* pstobj, ODIText* name);
  209.  
  210. void     ODSetPOName(Environment* ev, ODPersistentObject* pstobj, ODIText* name);
  211.  
  212. ODStorageUnit* ODGetSUFromPstObj(Environment* ev, ODPersistentObject* pstobj);
  213.  
  214. ODIText* ODGetPOComments(Environment* ev,  ODPart* part, ODIText* comments);
  215.  
  216. void     ODSetPOComments(Environment* ev, ODPart* part, ODIText* comments);
  217.  
  218. ODULong  ODGetPOSize(Environment* ev, ODPersistentObject* pstobj);
  219.  
  220. //-------------------------------------------------------------------------------------
  221. // Part only Property getters and setters
  222. //-------------------------------------------------------------------------------------
  223. ODName*   ODGetCategory(Environment* ev, ODPart* part, ODNameSpaceManager* nsm);
  224.  
  225. ODType    ODGetKindFromPartSU(Environment* ev, ODStorageUnit* su);
  226.  
  227. ODName*   ODGetCatFromPartSU(Environment* ev, ODStorageUnit* su, ODNameSpaceManager* nsm);
  228.  
  229. ODName*   ODGetCatFromKind(Environment* ev, ODType kind, ODNameSpaceManager* nsm);
  230.  
  231. ODEditor EXPENTRY  GetCurrentEditorForPart(ODPart* part );
  232.  
  233. void     SetCategory(ODEditor editorID, ODType  kindID,
  234.                  HWND  categoryItem, ODSession* session);
  235.  
  236. void     ChangeEditor(ODPart* part, ODEditor editorID);
  237.  
  238. ODULong  ODGetModificationDate(Environment* ev, ODStorageUnit* su);
  239.  
  240. void     ODSetModificationDate(Environment* ev, ODStorageUnit* su, ODTime dateTime);
  241.  
  242. ODType   ODGetKind(Environment* ev, ODPart* part);
  243.  
  244. ODIText* ODGetModifiedBy(Environment* ev, ODStorageUnit* su,ODIText* userName);
  245.  
  246. //------------------------------------------------------------------------------------
  247. // Editor and Kind popup Menu manipulation functions copied from LinkDlgs.cpp
  248. //------------------------------------------------------------------------------------
  249. void ContentValueTypes(ODStorageUnit* contentSU, ODTypeList* typeList);
  250.  
  251.  
  252. ODType GetThisKindFromList(ODSShort kindItem, ODTypeList* kindList);
  253.  
  254. ODBoolean EditorSupportsKind_Reg( ODEditor editor, ODType kind,
  255.                       ODSession* session);
  256.  
  257. //-------------------------------------------------------------------------------------
  258. // General Utility functions
  259. //-------------------------------------------------------------------------------------
  260.  
  261. PSZ IntlToStr(ODIText* intlText, PSZ pstr);
  262.  
  263. ODIText* StrToIntl(PSZ pstr, ODIText** intlText);
  264.  
  265. ODBoolean ODGetIsStationery(Environment* ev, ODFrame* frame);
  266.  
  267. void      ODSetIsStationery(Environment* ev, ODFrame* frame, ODBoolean isStationery);
  268.  
  269.  
  270.  
  271. }       // End of extern "C" {
  272.  
  273. #endif // _BNDNSUTL_
  274.