home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1996 October: Mac OS SDK / Dev.CD Oct 96 SDK / Dev.CD Oct 96 SDK2.toast / Development Kits (Disc 2) / OpenDoc Development Framework / ODFDev / Embed / Sources / Select.cpp < prev    next >
Encoding:
Text File  |  1996-08-16  |  3.4 KB  |  116 lines  |  [TEXT/MPS ]

  1. //========================================================================================
  2. //
  3. //    File:                Select.cpp
  4. //    Release Version:    $ ODF 1 $
  5. //
  6. //    Author:                M.Boetcher
  7. //
  8. //    Copyright:            (c) 1993 - 1996 by Apple Computer, Inc., all rights reserved.
  9. //
  10. //========================================================================================
  11.  
  12. #include "Embed.hpp"
  13.  
  14. #ifndef SELECT_H
  15. #include "Select.h"
  16. #endif
  17.  
  18. #ifndef PROXY_H
  19. #include "Proxy.h"
  20. #endif
  21.  
  22. #ifndef CONTENT_H
  23. #include "Content.h"
  24. #endif
  25.  
  26. // ----- Framework Includes -----
  27.  
  28. #ifndef FWPRESEN_H
  29. #include "FWPresen.h"
  30. #endif
  31.  
  32. //========================================================================================
  33. //    Runtime information
  34. //========================================================================================
  35.  
  36. #ifdef FW_BUILD_MAC
  37. #pragma segment odfembed
  38. #endif
  39.  
  40. FW_DEFINE_AUTO(CEmbedSelection)
  41.  
  42. //========================================================================================
  43. //    CLASS CEmbedSelection
  44. //========================================================================================
  45.  
  46. //---------------------------------------------------------------------------------------
  47. //    CEmbedSelection constructor
  48. //---------------------------------------------------------------------------------------
  49.  
  50. CEmbedSelection::CEmbedSelection(Environment* ev, CEmbedContent* content) :
  51.     FW_CSelection(ev, false, false),
  52.     fContent(content)
  53. {
  54. }
  55.  
  56. //---------------------------------------------------------------------------------------
  57. //    CEmbedSelection destructor
  58. //---------------------------------------------------------------------------------------
  59.  
  60. CEmbedSelection::~CEmbedSelection()
  61. {
  62. }
  63.  
  64. //---------------------------------------------------------------------------------------
  65. //    CEmbedSelection::CloseSelection
  66. //---------------------------------------------------------------------------------------
  67.  
  68. void CEmbedSelection::CloseSelection(Environment* ev)
  69. {
  70.     // Nothing to do
  71. }
  72.  
  73. //---------------------------------------------------------------------------------------
  74. //    CEmbedSelection::ClearSelection
  75. //---------------------------------------------------------------------------------------
  76.  
  77. void CEmbedSelection::ClearSelection(Environment* ev)
  78. {
  79.     CEmbedProxy* proxy = fContent->GetProxy();
  80.  
  81.     if (proxy)    // there is an embedded part - don't delete it, because this action might be undone
  82.     {
  83.         proxy->SetSelectState(ev, false);
  84.         proxy->DetachEmbeddedFrames(ev);
  85.         fContent->SetProxy(NULL);
  86.         GetPresentation(ev)->Invalidate(ev);
  87.     }
  88. }
  89.  
  90. //---------------------------------------------------------------------------------------
  91. //    CEmbedSelection::SelectAll
  92. //---------------------------------------------------------------------------------------
  93.  
  94. void CEmbedSelection::SelectAll(Environment* ev)
  95. {
  96.     // Nothing to do
  97. }
  98.  
  99. //---------------------------------------------------------------------------------------
  100. //    CEmbedSelection::IsEmpty
  101. //---------------------------------------------------------------------------------------
  102.  
  103. FW_Boolean CEmbedSelection::IsEmpty(Environment* ev) const
  104. {
  105.     return (fContent->GetProxy() == NULL);
  106. }
  107.  
  108. //---------------------------------------------------------------------------------------
  109. //    CEmbedSelection::GetSelectedContent
  110. //---------------------------------------------------------------------------------------
  111.  
  112. FW_CContent* CEmbedSelection::GetSelectedContent(Environment* ev)
  113. {
  114.     return fContent;
  115. }
  116.