home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1997 January: Mac OS SDK / Dev.CD Jan 97 SDK2.toast / Development Kits (Disc 2) / OpenDoc Development Framework / ODFDev / ODF / Framewrk / FWPart / FWPasta.h < prev    next >
Encoding:
Text File  |  1996-09-17  |  3.5 KB  |  126 lines  |  [TEXT/MPS ]

  1. //========================================================================================
  2. //
  3. //    File:                FWPasta.h
  4. //    Release Version:    $ ODF 2 $
  5. //
  6. //    Copyright:    (c) 1993 - 1996 by Apple Computer, Inc., all rights reserved.
  7. //
  8. //========================================================================================
  9. #ifndef FWPASTA_H
  10. #define FWPASTA_H
  11.  
  12. // ----- Framework Includes -----
  13.  
  14. #ifndef FWPRTDEF_H
  15. #include "FWPrtDef.h"
  16. #endif
  17.  
  18. // ----- Foundation Includes -----
  19.  
  20. #ifndef FWSTDDEF_H
  21. #include "FWStdDef.h"
  22. #endif
  23.  
  24. #ifndef FWRUNTYP_H
  25. #include "FWRunTyp.h"
  26. #endif
  27.  
  28. // ----- OpenDoc Includes -----
  29.  
  30. #ifndef FWODTYPS_H
  31. #include "FWODTyps.h"
  32. #endif
  33.  
  34. //========================================================================================
  35. //    Forward Declarations
  36. //========================================================================================
  37.  
  38. class ODStorageUnit;
  39. class FW_CFrame;
  40. class FW_CLinkDestination;
  41.  
  42. //========================================================================================
  43. //     class FW_MPasteAsHandler
  44. //========================================================================================
  45.  
  46. class FW_MPasteAsHandler
  47. {
  48. //----------------------------------------------------------------------------------------
  49. //    Constructor/Destructors
  50. //
  51.   public:
  52.     FW_MPasteAsHandler(Environment *ev, FW_CFrame* frame);
  53.  
  54.     virtual ~ FW_MPasteAsHandler();
  55.     
  56. //----------------------------------------------------------------------------------------
  57. //    Public API
  58. //
  59.   public:
  60.     FW_Boolean    HandleDropPasteAsDialog(Environment* ev, 
  61.                                     ODStorageUnit* dropSU, 
  62.                                     FW_Boolean& handledDrop);    // drag&drop version
  63.  
  64.     FW_Boolean    HandlePasteAsDialog(Environment* ev, 
  65.                                     ODCloneKind cloneKind, 
  66.                                     FW_Boolean& handledIt);        // clipboard version
  67.  
  68.     FW_Boolean    WantsEmbedAs(Environment* ev) const;
  69.     FW_Boolean    WantsTranslation(Environment* ev) const;
  70.  
  71.     FW_CLinkDestination* GetNewLink(Environment* ev) const;
  72.     ODPasteAsResult* GetEmbedInfoPtr(Environment* ev);
  73.  
  74. //----------------------------------------------------------------------------------------
  75. //    Private API
  76. //
  77. public:
  78.     static void         PrivDisposeEmbedInfoFields(ODPasteAsResult* embedInfo);
  79.     
  80.   private:
  81.     FW_Boolean            PostPasteAsDialog(Environment* ev, 
  82.                                   ODStorageUnit* storageUnit,
  83.                                   FW_StorageKinds storageKind,
  84.                                   ODCloneKind cloneKind, 
  85.                                   FW_Boolean& handledIt);
  86.  
  87.     FW_Boolean            PasteAsEmbed(Environment* ev, 
  88.                              ODStorageUnit* storageUnit,
  89.                              FW_StorageKinds storageKind,
  90.                              ODCloneKind cloneKind);
  91.  
  92.   private:
  93.     FW_CLinkDestination*    fNewLink;            // NULL if no link created
  94.     ODPasteAsResult            fEmbedInfo;
  95.     FW_CFrame*                fPrivFrame;
  96. };
  97.  
  98. //========================================================================================
  99. //    Inlines
  100. //========================================================================================
  101.  
  102. inline ODPasteAsResult* FW_MPasteAsHandler::GetEmbedInfoPtr(Environment*)
  103. {
  104.     return &fEmbedInfo;
  105. }
  106.  
  107. //----------------------------------------------------------------------------------------
  108. inline FW_CLinkDestination* FW_MPasteAsHandler::GetNewLink(Environment*) const
  109. {
  110.     return fNewLink;
  111. }
  112.  
  113. //----------------------------------------------------------------------------------------
  114. inline FW_Boolean FW_MPasteAsHandler::WantsEmbedAs(Environment*) const
  115. {
  116.     return (fEmbedInfo.mergeSetting == FALSE);
  117. }
  118.  
  119. //----------------------------------------------------------------------------------------
  120. inline FW_Boolean FW_MPasteAsHandler::WantsTranslation(Environment*) const
  121. {
  122.     return (fEmbedInfo.translateKind != NULL);
  123. }
  124.  
  125. #endif
  126.