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

  1. /* @(#)Z 1.3 com/src/utils/include/InfoUtil.h, odcore, od96os2, odos29646d 96/11/15 15:28:59 (96/07/15 18:15:52) */
  2. /*====START_GENERATED_PROLOG======================================
  3.  */
  4. /*
  5.  *   COMPONENT_NAME: odcore
  6.  *
  7.  *   CLASSES: none
  8.  *
  9.  *   ORIGINS: 82,27
  10.  *
  11.  *
  12.  *   (C) COPYRIGHT International Business Machines Corp. 1995,1996
  13.  *   All Rights Reserved
  14.  *   Licensed Materials - Property of IBM
  15.  *   US Government Users Restricted Rights - Use, duplication or
  16.  *   disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
  17.  *       
  18.  *   IBM DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
  19.  *   ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
  20.  *   PURPOSE. IN NO EVENT SHALL IBM BE LIABLE FOR ANY SPECIAL, INDIRECT OR
  21.  *   CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF
  22.  *   USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
  23.  *   OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE
  24.  *   OR PERFORMANCE OF THIS SOFTWARE.
  25.  */
  26. /*====END_GENERATED_PROLOG========================================
  27.  */
  28. /*
  29.     File:        InfoUtil.h
  30.  
  31.     Contains:    function declarations Info getters & setters
  32.  
  33.     Owned by:    Tantek éelik
  34.  
  35.     Copyright:    ⌐ 1993 - 1995 by Apple Computer, Inc., all rights reserved.
  36.  
  37.     
  38.     In Progress:
  39.         
  40. */
  41.  
  42.  
  43. #ifndef _INFOUTIL_
  44. #define _INFOUTIL_
  45.  
  46. #ifndef _ODTYPES_
  47. #include <ODTypes.h>
  48. #endif
  49.  
  50. #if !defined(_PLATFORM_WIN32_)
  51. #ifndef __CONTROLS__
  52. #include <Controls.h>
  53. #endif
  54. #endif // !defined(_PLATFORM_WIN32_)
  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_)
  69. #ifndef _ODTYPESP_
  70. #include <ODTypesP.h>
  71. #endif
  72. #endif // defined(_PLATFORM_WIN32_)
  73. //==============================================================================
  74. // Theory of Operation
  75. //==============================================================================
  76.  
  77. //==============================================================================
  78. // Constants
  79. //==============================================================================
  80.  
  81. //==============================================================================
  82. // Scalar Types
  83. //==============================================================================
  84.  
  85. //==============================================================================
  86. // Classes used by this interface
  87. //==============================================================================
  88.  
  89. class    ODFrame;
  90. class    ODStorageUnit;
  91. class    ODPart;
  92. class    ODPersistentObject;
  93. class    ODTypeList;
  94. class    EditorSet;
  95. class    ODSession;
  96. class    PlatformFile;
  97.  
  98. //==============================================================================
  99. // Info functions
  100. //==============================================================================
  101.  
  102. #ifdef _OD_IMPL_SHARE_UTILS_
  103. #pragma import on
  104. #endif
  105.  
  106. extern "C" {
  107.  
  108.  
  109.  
  110. //-------------------------------------------------------------------------------------
  111. // Persistent Object Property getters and setters
  112. // Note: 
  113. //  all Getters expect you to pass in a buffer to be filled 
  114. //  or kODNULL which causes it to create one for you
  115. //  all Setters do NOT consume what you pass in, so it is safe to pass in
  116. //     a reference to your internal structures.  They are only accessed for the duration
  117. //     of the Setter API call.
  118. // These conventions were adopted to reduce memory allocation/deallocation.
  119. //-------------------------------------------------------------------------------------
  120.  
  121. ODULong        ODGetCreationDate(Environment* ev, 
  122.                 ODStorageUnit* su);
  123. void        ODSetCreationDate(Environment* ev, 
  124.                 ODStorageUnit* su,
  125.                 ODTime dateTime);
  126.                 
  127. ODULong        ODGetModificationDate(Environment* ev, 
  128.                 ODStorageUnit* su);
  129. void        ODSetModificationDate(Environment* ev, 
  130.                 ODStorageUnit* su,
  131.                 ODTime dateTime);
  132.                 
  133. ODIText*    ODGetModifiedBy(Environment* ev, 
  134.                 ODStorageUnit* su,ODIText* userName);
  135. void        ODSetModifiedBy(Environment* ev, 
  136.                 ODStorageUnit* su, ODIText* userName);
  137.  
  138.  
  139. ODStorageUnit* ODGetSUFromPstObj(Environment* ev, ODPersistentObject* pstobj);
  140.  
  141. ODIText*    ODGetPOComments(Environment* ev,  ODPart* part, ODIText* comments);
  142. void        ODSetPOComments(Environment* ev, ODPart* part, ODIText* comments);
  143.  
  144. ODIconFamily    ODGetPOIconFamily(Environment* ev,
  145.                     ODPart* part);
  146. void        ODSetPOIconFamily(Environment* ev, 
  147.                     ODPart* part, ODIconFamily iconFamily,
  148.                     ODBoolean deleteOtherPlatformIcons =kODTrue);
  149.  
  150. ODULong        ODGetPOSize(Environment* ev, 
  151.                 ODPersistentObject* pstobj);
  152. ODID        ODGetPOID(Environment* ev, 
  153.                 ODPersistentObject* pstobj);
  154.  
  155. // Note: the next two functions are lowlevel functions for directly setting
  156. // and getting the name property of persistent objects.  
  157. // If you are dealing with a part, please use ODGetPartName & ODSetPartName
  158. // in order to make sure the right thing happens with respect to 
  159. // the document file, titles of windows etc.  -Tantek
  160. ODIText*    ODGetPOName(Environment* ev, 
  161.                         ODPersistentObject* pstobj,ODIText* name);
  162. void        ODSetPOName(Environment* ev, 
  163.                         ODPersistentObject* pstobj,ODIText* name);
  164.  
  165. // The next function is used when the persistent object is not internalized yet. - Vincent
  166. void        ODSetPONameUsingSU(Environment* ev, ODStorageUnit* su, ODIText* name);
  167.  
  168. //-------------------------------------------------------------------------------------
  169. // Part only Property getters and setters
  170. //-------------------------------------------------------------------------------------
  171.  
  172. ODIText*    ODGetPartName(Environment* ev, 
  173.                 ODFrame* frame,ODIText* name);
  174.         // Returns the name of the part of the frame passed in.
  175.  
  176. ODBoolean    ODSetPartName(Environment* ev, 
  177.                 ODFrame* frame, ODIText* name, DescType replaceOption);
  178.         // Renames the part of the frame passed in.
  179.         // Returns whether or not it succeeded.
  180.         // The frame helps more easily determine whether
  181.         // the part is the root part of the document or not.
  182.         // For example, renaming the root part of the document could fail
  183.         // if there was a file with the same name and the user canceled the
  184.         // "Replace?" dialog.
  185.  
  186. void        ODRenamePartWindows( Environment *ev, ODSession *session, ODPart *part,
  187.                                  ODIText *oldName, ODIText *name );
  188.         // Renames windows with 'part' as their root part. Subroutine used
  189.         // by ODSetPartName; not usually needed for other purposes (although
  190.         // the Shell does use it.)
  191.  
  192.  
  193. ODIText*    ODGetComments(Environment* ev,  ODFrame* frame, ODIText* comments);
  194. void        ODSetComments(Environment* ev, ODFrame* frame, ODIText* comments);
  195.  
  196. ODName*        ODGetCategory(Environment* ev, ODPart* part, ODNameSpaceManager* nsm);
  197. ODName*        ODGetCatFromPartSU(Environment* ev, ODStorageUnit* su, ODNameSpaceManager* nsm);
  198. ODName*        ODGetCatFromKind(Environment* ev, ODType kind, ODNameSpaceManager* nsm);
  199.  
  200. ODType        ODGetKind(Environment* ev, ODPart* part);
  201. ODType        ODGetKindFromPartSU(Environment* ev, ODStorageUnit* su);
  202. ODPlatformType ODGetIconFilePlatformTypeFromPartSU(Environment* ev, 
  203.         ODStorageUnit* su);
  204.  
  205. ODIconFamily    ODGetIconFamily(Environment* ev,
  206.                     ODFrame* frame);
  207. void        ODSetIconFamily(Environment* ev, 
  208.                     ODFrame* frame, ODIconFamily iconFamily,
  209.                     ODBoolean deleteOtherPlatformIcons =kODTrue);
  210.  
  211. ODBoolean    ODGetIsStationery(Environment* ev, 
  212.                 ODFrame* frame);
  213. void        ODSetIsStationery(Environment* ev, 
  214.                 ODFrame* frame, ODBoolean isStationery);
  215.  
  216. ODBoolean        ODGetSUIsStationery(Environment* ev, ODStorageUnit* su);
  217. void        ODSetSUIsStationery(Environment* ev, 
  218.                 ODStorageUnit* su, ODBoolean isStationery);
  219.  
  220. //-------------------------------------------------------------------------------------
  221. // Frame only Property getters and setters
  222. //-------------------------------------------------------------------------------------
  223. // see Frame.idl
  224.  
  225.  
  226. //-------------------------------------------------------------------------------------
  227. // General Utility functions
  228. //-------------------------------------------------------------------------------------
  229.  
  230. void SetAllWindowShowLinks(Environment* ev, ODWindowState* winState, ODBoolean showLinks);
  231. PlatformFile*    ODGetFileIfRoot(Environment* ev, ODFrame* frame);
  232.  
  233. ODBoolean    ODAskUserReplace(Environment* ev,
  234.                             ODSession* session);
  235. // Pass in the name in question via ParamText(^0).
  236.  
  237. //-------------------------------------------------------------------------------------
  238. // Editor and Kind popup Menu manipulation functions
  239. // copied from LinkDlgs.cpp (!with changes by Té and CG)
  240. //-------------------------------------------------------------------------------------
  241. // private by convention.
  242.  
  243. void AddTypesToMenu(ODTypeList* kindList, 
  244.                                 MenuHandle kindMenu, 
  245.                                 ODSession* session);
  246. ODUShort EnableTypesInMenu(ODTypeList* typeList,
  247.                                 MenuHandle kindMenu,
  248.                                 ODEditor editor,
  249.                                 ODNameSpaceManager* nsm);
  250. ODBoolean SetupEditorMenu(ODType kind,
  251.                                 EditorSet* editorList,
  252.                                 MenuHandle editorMenu, 
  253.                                 ControlHandle popupCtlHndl, 
  254.                                 ODSession* session);
  255. void AddEditorsToMenu(EditorSet* editorList,
  256.                                 MenuHandle editorMenu, 
  257.                                 ODSession* session);
  258. void ContentValueTypes(ODStorageUnit* contentSU, ODTypeList* typeList);
  259. ODEditor GetThisEditorFromList(ODSShort editorIndex, EditorSet* editorList);
  260. ODType GetThisKindFromList(ODSShort kindItem, ODTypeList* kindList);
  261. ODSShort IndexOfEditorInList(EditorSet* editorsList, ODEditor editor);
  262. ODSShort IndexOfKindInList(ODTypeList* kindList, ODType kind);
  263. void TranslateValueTypes(ODTypeList* kindList,
  264.                                 ODTypeList* translateToList,
  265.                                 OrderedCollection* translateFromList,
  266.                                 ODSession* session);
  267. void AddTranslationKindToMenu(ODType        kind, 
  268.                                 MenuHandle    kindMenu,
  269.                                 short        item,
  270.                                 ODBoolean    insert,
  271.                                 ODSession*    session);
  272. }    // End of extern "C" {
  273.  
  274. #ifdef _OD_IMPL_SHARE_UTILS_
  275. #pragma import off
  276. #endif
  277.  
  278. #endif // _INFOUTIL_
  279.