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 / Form / Sources / Dialog.h < prev    next >
Encoding:
Text File  |  1996-09-17  |  4.7 KB  |  167 lines  |  [TEXT/MPS ]

  1. //========================================================================================
  2. //
  3. //    File:                Dialog.h
  4. //    Release Version:    $ ODF 2 $
  5. //
  6. //    Copyright:            (c) 1993 - 1996 by Apple Computer, Inc., all rights reserved.
  7. //
  8. //========================================================================================
  9.  
  10. #ifndef DIALOG_H
  11. #define DIALOG_H
  12.  
  13. #ifndef FWFRAME_H
  14. #include "FWFrame.h"
  15. #endif
  16.  
  17. #ifndef FWEVENT_H
  18. #include "FWEvent.h"
  19. #endif
  20.  
  21. #ifndef FWDIALOG_H
  22. #include "FWDialog.h"
  23. #endif
  24.  
  25. #ifndef FWEDVIEW_H
  26. #include "FWEdView.h"
  27. #endif
  28.  
  29. #ifndef DEFINES_K
  30. #include "Defines.k"
  31. #endif
  32.  
  33. #if FW_PPOB_VIEWS
  34. #include "FWPPobOb.h"
  35. #endif
  36.  
  37. #if FW_MACAPP_VIEWS
  38. #include "FWMAObjs.h"
  39. #endif
  40.  
  41. //==============================================================================
  42. // Forward Declarations
  43. //==============================================================================
  44.  
  45. class CFormPart;
  46. class CFormFrame;
  47.  
  48. //==============================================================================
  49. // class CPwdDialogFrame
  50. //==============================================================================
  51.  
  52. class CPwdDialogFrame : public FW_CDialogFrame
  53. {
  54.   public:
  55.     FW_DECLARE_AUTO(CPwdDialogFrame)
  56.  
  57.     CPwdDialogFrame(Environment* ev, 
  58.                 ODFrame* odFrame, 
  59.                 FW_CPresentation* presentation, 
  60.                 CFormPart* formPart);
  61.  
  62.     virtual ~CPwdDialogFrame();
  63.  
  64.   public:    
  65.     // ---- FW_CDialogFrame API
  66.     virtual void         HandleNotification(Environment* ev, const FW_CNotification& notification);
  67.  
  68.     // ----- FW_CView & FW_CFrame API
  69. #ifdef FW_BUILD_MAC
  70.     virtual void         FacetAdded(Environment* ev, ODFacet* facet, unsigned short facetCount);
  71. #else
  72.     virtual void         Draw(Environment *ev, ODFacet* odFacet, ODShape* invalidShape);
  73. #endif
  74. #if FW_PPOB_VIEWS || FW_MACAPP_VIEWS
  75.     virtual void        CreateSubViews(Environment* ev);
  76. #endif
  77.     virtual void         PostCreateViewFromStream(Environment* ev);
  78.   
  79.     // -----New API
  80.     void                 Initialize(Environment* ev, CFormFrame* frame);
  81.     
  82.     // ----- Private data
  83.   private:
  84.       CFormFrame*         fFormFrame;  // pointer back to the main frame
  85. };
  86.  
  87. //==============================================================================
  88. // class CPwdEditView
  89. //==============================================================================
  90.  
  91. class CPwdEditView : public FW_CEditView
  92. {
  93.   public:
  94.     FW_DECLARE_CLASS
  95.     FW_DECLARE_AUTO(CPwdEditView)
  96.  
  97.     CPwdEditView(Environment* ev, 
  98.                 FW_CSuperView* container, 
  99.                 const FW_CRect& bounds,
  100.                 ODID  viewID);
  101.                 
  102.     CPwdEditView(Environment* ev); 
  103.     virtual ~CPwdEditView();
  104.     
  105.     // ----- FW_CEditView
  106.     virtual FW_Handled         DoMenu (Environment* ev, const FW_CMenuEvent& event);
  107.     virtual FW_Handled         DoCharKey (Environment* ev, const FW_CCharKeyEvent & event);
  108.     FW_CString                    GetText (Environment * ev);
  109.     virtual void                 ActivateTarget (Environment * ev, FW_Boolean tabSelection);
  110.  
  111.     // ----- Archiving -----
  112. #if FW_ODFRC_VIEWS
  113.     static void*                Create(FW_CReadableStream& stream, FW_ClassTypeConstant type);
  114.     static void                    Destroy(void* object, FW_ClassTypeConstant type);
  115.     virtual void                Flatten(Environment* ev, FW_CWritableStream& stream) const;
  116.     virtual void                InitializeFromStream(Environment* ev, FW_CReadableStream& stream);
  117. #endif
  118.  
  119.   private:
  120.     void                        Initialize(Environment* ev, FW_CSuperView* container, const FW_CRect& bounds);
  121.  
  122.   private:
  123.       FW_CEditView*     fShadowTEd;
  124. };
  125.  
  126. //========================================================================================
  127. // class CPPobPwdEditView
  128. //========================================================================================
  129. #if FW_PPOB_VIEWS
  130.  
  131. // CPPobPwdEditView doesn't need to derive from FW_CPPobEditView because we are only
  132. // interested in the LPane fields.   
  133. // (ODF's PPobReader will ignore extra fields if it finds a subclass of LPane)
  134.  
  135. class CPPobPwdEditView : public FW_CPPobView
  136. {
  137. public:
  138.     CPPobPwdEditView(Environment* ev, FW_CReadableStream& stream, long type);
  139.  
  140.     static void*        Create(Environment* ev, FW_CReadableStream& stream, long type);
  141.     virtual void        CreateODFView(Environment* ev);
  142. };
  143.  
  144. #endif // FW_PPOB_VIEWS
  145.  
  146. //========================================================================================
  147. // class CMAPwdEditView
  148. //========================================================================================
  149. #if FW_MACAPP_VIEWS
  150.  
  151. // We make CMAPwdEditView derive from FW_CMAEditText, so our TPwdEdit template in AdLib
  152. // must derive from TEditText (Unlike PowerPlant MacApp requires that all data be read
  153. // in the stream, even if we don't use it)
  154.  
  155. class CMAPwdEditView : public FW_CMAEditText
  156. {
  157. public:
  158.     CMAPwdEditView(ResType type);
  159.     
  160.     static FW_CMAObject*    Create(ResType type);
  161.     virtual FW_CView*        CreateODFView(Environment* ev, FW_CSuperView* superview, FW_MReceiver* receiver);
  162. };
  163.  
  164. #endif // FW_MACAPP_VIEWS
  165.  
  166. #endif
  167.