OWLNext    7.0
Borland's Object Windows Library for the modern age
Loading...
Searching...
No Matches
ocremvie.h
Go to the documentation of this file.
1//----------------------------------------------------------------------------
2// ObjectComponents
3// Copyright (c) 1994, 1996 by Borland International, All Rights Reserved
4/// \file
5/// Definition of TOcRemView Class
6//----------------------------------------------------------------------------
7
8#if !defined(OCF_OCREMVIE_H)
9#define OCF_OCREMVIE_H
10
11#include <owl/private/defs.h>
12#if defined(BI_HAS_PRAGMA_ONCE)
13# pragma once
14#endif
15
16#include <ocf/ocview.h>
17
18
19namespace ocf {
20
21//
22/// \class TOcRemView
23// ~~~~~ ~~~~~~~~~~
24/// Remote Viewer object for a server document
25//
26class _ICLASS TOcRemView : public TOcView, public IBPart2 {
27 public:
29 owl::TRegList* regList=0, IUnknown* outer=0);
30
31 // Compatibility
32 TOcRemView(TOcDocument& doc, owl::TRegList* regList = 0, IUnknown* outer = 0);
33
34 virtual void ReleaseObject();
35
36 // IBSite pass-thrus
37 //
38 void Invalidate(TOcInvalidate);
39 void Disconnect();
40 virtual bool EvSetFocus(bool set);
41
42 // IBDocument pass-thrus
43 //
44 void EvClose();
45 void Rename();
46 owl::TString GetContainerTitle();
47 void GetInitialRect(bool selection = false);
48 bool Save(IStorage* storageI);
49 bool Load(IStorage* storageI);
50
51 // IBApplication pass-thrus
52 //
53 bool SetContainerStatusText(LPCTSTR text);
54
55 // Server State and Kind accessors, etc.
56 //
57 enum TState { ///< Current state of this server view
58 Hidden, ///< Hidden & ready to go
59 Closing, ///< Shutting down
60 OpenEditing, ///< Open editing
61 InPlaceActive, ///< Inplace active
62 };
63 enum TKind { ///< What kind of server view this is
64 DontKnow, ///< Don't know yet, wait for Init()
65 Embedding, ///< Normal Embedding
66 LoadFromFile, ///< Transient load-from-file
67 Link, ///< Load-from-file is really a link
68 };
69 TState GetState() const {return State;}
70 TKind GetKind() const {return Kind;}
71
72 // Used by TOcLinkView to let us know our state was changed
73 //
74 void SetOpenEditing() {State = OpenEditing;}
75
76 // Object reference & lifetime managment
77 //
78 owl::ulong _IFUNC AddRef();
79 owl::ulong _IFUNC Release();
80 HRESULT _IFUNC QueryInterface(const GUID & iid, void ** iface);
81
82 HRESULT _IFUNC GetPartSize(owl::TSize *);
83
84 protected:
85 // IBContains forwarding to base
86 //
87 HRESULT _IFUNC Init(LPCOLESTR path);
88 HRESULT _IFUNC GetPart(IBPart * *, LPCOLESTR);
89
90 // IBContainer implementation for Bolero to use
91 //
92 HRESULT _IFUNC BringToFront();
93
94 // TUnknown virtual overrides
95 //
96 HRESULT QueryObject(const IID & iid, void * * iface);
97
98 // IBContainer forwarding to base
99 //
100 void _IFUNC DragFeedback(owl::TPoint * p, const owl::TRect * r,
101 TOcMouseAction a, owl::uint cf, HRESULT& hr);
102
103 HRESULT _IFUNC AllowInPlace();
104
105 // IBDataNegotiator implementation to eliminate ambiguity
106 //
107 owl::uint _IFUNC CountFormats();
108 HRESULT _IFUNC GetFormat(owl::uint index, TOcFormatInfo * fmt);
109
110 // IBDataProvider2 implementation
111 //
112 HANDLE _IFUNC GetFormatData(TOcFormatInfo *);
113 HRESULT _IFUNC SetFormatData(TOcFormatInfo * fmt, HANDLE data, BOOL release);
114 HRESULT _IFUNC Draw(HDC, const RECTL *, const RECTL *, TOcAspect, TOcDraw bd);
115 HRESULT _IFUNC Save(IStorage*, BOOL sameAsLoad, BOOL remember);
116
117 // IBPart(2) implementation
118 //
119 HRESULT _IFUNC Init(IBSite *, TOcInitInfo *);
120 HRESULT _IFUNC Close();
121 HRESULT _IFUNC CanOpenInPlace();
122 HRESULT _IFUNC SetPartSize(owl::TSize *);
123 HRESULT _IFUNC SetPartPos(owl::TRect *);
124 HRESULT _IFUNC Activate(BOOL);
125 HRESULT _IFUNC Show(BOOL);
126 HRESULT _IFUNC Open(BOOL);
127 HRESULT _IFUNC EnumVerbs(TOcVerb *);
128 HRESULT _IFUNC DoVerb(owl::uint);
129 HWND _IFUNC OpenInPlace(HWND);
130 HRESULT _IFUNC InsertMenus(HMENU, TOcMenuWidths *);
131 HRESULT _IFUNC ShowTools(BOOL);
132 void _IFUNC FrameResized(const owl::TRect *, BOOL);
133 HRESULT _IFUNC DragFeedback(owl::TPoint *, BOOL);
134 HRESULT _IFUNC GetPalette(LOGPALETTE * *);
135 HRESULT _IFUNC SetHost(IBContainer * objContainer);
136 HRESULT _IFUNC DoQueryInterface(const IID & iid, void * * pif);
137 LPOLESTR _IFUNC GetName(TOcPartName);
138
139 protected:
140 void Init(); // Constructor helper
141 ~TOcRemView();
142
144 IBLinkable* BLSiteI; ///< for site moniker
145 IUnknown* BSite; ///< In-place site helper
146 IBSite* BSiteI; ///< Site interface
147 IBApplication* BAppI; ///< Site's application interface
148 HWND HRealParent; ///< View's real parent
149 TOcToolBarInfo ToolBarInfo; ///< Inplace tool bar info
150
151 TState State; ///< Current state of this server view
152 TKind Kind; ///< What kind of server view this is
153};
154
155//----------------------------------------------------------------------------
156// Inline implementations
157//
158
159//
160inline bool TOcRemView::SetContainerStatusText(LPCTSTR text)
161{
162 return HRIsOK(BAppI->SetStatusText(OleStr(text)));
163}
164
165} // OCF namespace
166
167#endif // OCF_OCREMVIE_H
IBApplication – Supported at frame window/app object of container apps.
Definition ocbocole.h:422
IBContainer – Supported by container app's document window.
Definition ocbocole.h:398
ILinkable abstract base class.
Definition ocbocole.h:321
IBPart2 – Supported by server objects.
Definition ocbocole.h:269
IBPart – Supported by server objects.
Definition ocbocole.h:241
IBSite – Supported by container apps for each linked/embedded object.
Definition ocbocole.h:437
virtual HRESULT _IFUNC SetStatusText(LPCOLESTR)=0
OC Document class, holds parts & is a owner of views.
Definition ocdoc.h:43
Remote Viewer object for a server document.
Definition ocremvie.h:26
TOcToolBarInfo ToolBarInfo
Inplace tool bar info.
Definition ocremvie.h:149
IBApplication * BAppI
Site's application interface.
Definition ocremvie.h:147
TState GetState() const
Definition ocremvie.h:69
IUnknown * BSite
In-place site helper.
Definition ocremvie.h:145
IBContainer * BContainerI
Definition ocremvie.h:143
@ LoadFromFile
Transient load-from-file.
Definition ocremvie.h:66
@ DontKnow
What kind of server view this is.
Definition ocremvie.h:64
@ Link
Load-from-file is really a link.
Definition ocremvie.h:67
@ Embedding
Normal Embedding.
Definition ocremvie.h:65
void SetOpenEditing()
Definition ocremvie.h:74
IBSite * BSiteI
Site interface.
Definition ocremvie.h:146
TKind GetKind() const
Definition ocremvie.h:70
bool SetContainerStatusText(LPCTSTR text)
Definition ocremvie.h:160
TKind Kind
What kind of server view this is.
Definition ocremvie.h:152
TState State
Current state of this server view.
Definition ocremvie.h:151
@ Hidden
Current state of this server view.
Definition ocremvie.h:58
@ InPlaceActive
Inplace active.
Definition ocremvie.h:61
@ Closing
Shutting down.
Definition ocremvie.h:59
@ OpenEditing
Open editing.
Definition ocremvie.h:60
HWND HRealParent
View's real parent.
Definition ocremvie.h:148
IBLinkable * BLSiteI
for site moniker
Definition ocremvie.h:144
The TOcView partner is a container (viewer) of a given (server/client) document.
Definition ocview.h:136
TPoint is a support class, derived from tagPOINT.
Definition geometry.h:87
TRect is a mathematical class derived from tagRect.
Definition geometry.h:308
A registration parameter table, composed of a list of TRegItems.
Definition registry.h:531
The tagSIZE struct is defined as.
Definition geometry.h:234
Reference to reference counted string object TUString Lightweight reference object consisting of a po...
Definition string.h:67
Object Component Framework (COM encapsulation)
Definition appdesc.h:22
bool HRIsOK(HRESULT hr)
Definition defs.h:132
TOcAspect
Definition ocobject.h:64
TOcInvalidate
Definition ocobject.h:59
TOcMouseAction
Definition ocobject.h:46
const GUID & iid
Definition appdesc.h:328
TOcPartName
Definition ocobject.h:87
TOcDraw
Definition ocobject.h:81
unsigned long ulong
Definition number.h:26
unsigned int uint
Definition number.h:25
interface _ICLASS IStorage
Definition ocdoc.h:25
Definition of Compound Document TOcView Class.
#define _IFUNC
Definition oleutil.h:28
#define _ICLASS
Definition oleutil.h:25
#define OleStr(s)
Definition string.h:128