home *** CD-ROM | disk | FTP | other *** search
/ C Programming Starter Kit 2.0 / SamsPublishing-CProgrammingStarterKit-v2.0-Win31.iso / bc45 / ocfinc.pak / OCREMVIE.H < prev    next >
C/C++ Source or Header  |  1997-07-23  |  5KB  |  149 lines

  1. //
  2. //----------------------------------------------------------------------------
  3. // ObjectComponents
  4. // (C) Copyright 1994 by Borland International, All Rights Reserved
  5. //
  6. //   Definition of TOcRemView Class
  7. //----------------------------------------------------------------------------
  8. #if !defined(OCF_OCREMVIE_H)
  9. #define OCF_OCREMVIE_H
  10.  
  11. #if !defined(OCF_OCVIEW_H)
  12. # include <ocf/ocview.h>
  13. #endif
  14.  
  15. //
  16. // Remote Viewer object for a server document
  17. //
  18. class _ICLASS TOcRemView : public TOcView, public IBPart2 {
  19.   public:
  20.     TOcRemView(TOcDocument& doc, TRegList* regList = 0, IUnknown* outer = 0);
  21.  
  22.     virtual void   ReleaseObject();
  23.  
  24.     // IBSite pass-thrus
  25.     //
  26.     void    Invalidate(TOcInvalidate);
  27.     void    Disconnect();
  28.     virtual bool EvSetFocus(bool set);
  29.  
  30.     // IBDocument pass-thrus
  31.     //
  32.     void   EvClose();
  33.     void   Rename();
  34.     TString GetContainerTitle();
  35.     void   GetInitialRect(bool selection = false);
  36.     bool   Save(IStorage* storageI);
  37.     bool   Load(IStorage* storageI);
  38.  
  39.     // IBApplication pass-thrus
  40.     //
  41.     bool   SetContainerStatusText(const char far* text);
  42.  
  43.     // Server State and Kind accessors, etc.
  44.     //
  45.     enum TState {                  // Current state of this server view
  46.       Hidden,                        //  Hidden & ready to go
  47.       Closing,                       //  Shutting down
  48.       OpenEditing,                   //  Open editing
  49.       InPlaceActive,                 //  Inplace active
  50.     };
  51.     enum TKind {                   // What kind of server view this is
  52.       DontKnow,                      //  Don't know yet, wait for Init()
  53.       Embedding,                     //  Normal Embedding
  54.       LoadFromFile,                  //  Transient load-from-file
  55.       Link,                          //  Load-from-file is really a link
  56.     };
  57.     TState  GetState() const {return State;}
  58.     TKind   GetKind() const {return Kind;}
  59.  
  60.     // Used by TOcLinkView to let us know our state was changed
  61.     //
  62.     void    SetOpenEditing() {State = OpenEditing;}
  63.  
  64.     // Object reference & lifetime managment
  65.     //
  66.     ulong   _IFUNC AddRef();
  67.     ulong   _IFUNC Release();
  68.     HRESULT _IFUNC QueryInterface(const GUID far& iid, void far*far* iface);
  69.  
  70.  
  71.   protected:
  72.     // IBContains forwarding to base
  73.     //
  74.     HRESULT _IFUNC Init(LPCOLESTR path);
  75.     HRESULT _IFUNC GetPart(IBPart far* far*, LPCOLESTR);
  76.  
  77.     // IBContainer implementation for Bolero to use
  78.     //
  79.     HRESULT  _IFUNC BringToFront();
  80.  
  81.     // TUnknown virtual overrides
  82.     //
  83.     HRESULT      QueryObject(const IID far& iid, void far* far* iface);
  84.  
  85.     // IBContainer forwarding to base
  86.     //
  87.     void    _IFUNC DragFeedback(TPoint far* p, const TRect far* r,
  88.                                 TOcMouseAction a, uint cf, HRESULT& hr);
  89.  
  90.     HRESULT _IFUNC AllowInPlace();
  91.  
  92.     // IBDataNegotiator implementation
  93.     //
  94.     uint     _IFUNC CountFormats();
  95.     HRESULT  _IFUNC GetFormat(uint index, TOcFormatInfo far* fmt);
  96.  
  97.     // IBDataProvider2 implementation
  98.     //
  99.     HANDLE  _IFUNC  GetFormatData(TOcFormatInfo far*);
  100.     HRESULT _IFUNC  SetFormatData(TOcFormatInfo far* fmt, HANDLE data, bool release);
  101.     HRESULT _IFUNC  Draw(HDC, const RECTL far*, const RECTL far*, TOcAspect, TOcDraw bd);
  102.     HRESULT _IFUNC  GetPartSize(TSize far*);
  103.     HRESULT _IFUNC  Save(IStorage*, bool sameAsLoad, bool remember);
  104.  
  105.     // IBPart implementation
  106.     //
  107.     HRESULT _IFUNC  Init(IBSite far*, TOcInitInfo far*);
  108.     HRESULT _IFUNC  Close();
  109.     HRESULT _IFUNC  CanOpenInPlace();
  110.     HRESULT _IFUNC  SetPartSize(TSize far*);
  111.     HRESULT _IFUNC  SetPartPos(TRect far*);
  112.     HRESULT _IFUNC  Activate(bool);
  113.     HRESULT _IFUNC  Show(bool);
  114.     HRESULT _IFUNC  Open(bool);
  115.     HRESULT _IFUNC  EnumVerbs(TOcVerb far*);
  116.     HRESULT _IFUNC  DoVerb(uint);
  117.     HWND    _IFUNC  OpenInPlace(HWND);
  118.     HRESULT _IFUNC  InsertMenus(HMENU, TOcMenuWidths far*);
  119.     HRESULT _IFUNC  ShowTools(bool);
  120.     void    _IFUNC  FrameResized(const TRect far*, bool);
  121.     HRESULT _IFUNC  DragFeedback(TPoint far*, bool);
  122.     HRESULT _IFUNC  GetPalette(LOGPALETTE far* far*);
  123.     HRESULT _IFUNC  SetHost(IBContainer far* objContainer);
  124.     HRESULT _IFUNC  DoQueryInterface(const IID far& iid, void far* far* pif);
  125.     LPOLESTR _IFUNC GetName(TOcPartName);
  126.  
  127.   protected:
  128.    ~TOcRemView();
  129.  
  130.     IBContainer*    BContainerI;     //
  131.     IBLinkable*     BLSiteI;         // for site moniker
  132.     IUnknown*       BSite;           // In-place site helper
  133.     IBSite*         BSiteI;          // Site interface
  134.     IBApplication*  BAppI;           // Site's application interface
  135.     HWND            HRealParent;     // View's real parent
  136.     TOcToolBarInfo  ToolBarInfo;     // Inplace tool bar info
  137.  
  138.     TState          State;           // Current state of this server view
  139.     TKind           Kind;            // What kind of server view this is
  140. };
  141.  
  142. inline bool TOcRemView::SetContainerStatusText(const char far* text) {
  143.   return HRIsOK(BAppI->SetStatusText(OleStr(text)));
  144. }
  145.  
  146. #endif  // OCF_OCREMVIE_H
  147.  
  148.  
  149.