OWLNext    7.0
Borland's Object Windows Library for the modern age
Loading...
Searching...
No Matches
oleframe.h
Go to the documentation of this file.
1//----------------------------------------------------------------------------
2// ObjectComponents
3// Copyright (c) 1994, 1996 by Borland International, All Rights Reserved
4//
5//----------------------------------------------------------------------------
6
7#if !defined(OCF_OLEFRAME_H)
8#define OCF_OLEFRAME_H
9
10#include <owl/private/defs.h>
11#if defined(BI_HAS_PRAGMA_ONCE)
12# pragma once
13#endif
14
15#include <owl/decframe.h>
16#include <ocf/ocfevent.h>
17#include <ocf/ocreg.h>
18#include <ocf/olefacto.h>
19
20
21
22namespace ocf {
23
24// Generic definitions/compiler options (eg. alignment) preceding the
25// definition of classes
26#include <owl/preclass.h>
27
28//
29// pad decorations IDs, 4 total: 32042, 32043, 32044, 32045
30//
31const int IDW_PADDECORATION = 32042;
32const int IDW_REMVIEWBUCKET = 32046; // Window id for remote view holder
33const int IDT_DLLIDLE = 32000; // Idle timer ID for DLL servers
34
35struct TOcMenuDescr;
36class _ICLASS TOcApp;
37
38//
39/// \class TOleFrame
40// ~~~~~ ~~~~~~~~~
41/// Decorated frame that supports OLE 2 using OCF
42//
43/// Derived from TDecoratedFrame, TOleFrame provides user-interface support for the
44/// main window of a Single Document Interface (SDI) OLE application. Because it
45/// inherits TDecoratedFrame's functionality, TOleFrame is able to position
46/// decorations, such as toolbars, around the client window. Because of its OLE
47/// frame functionality, you will always want to create a TOleFrame as a main frame.
48/// For example, TOleFrame supports basic container operations, such as
49/// - Creating space in a container's frame window that the server has
50/// requested
51/// - Merging the container's menu and the server's menu
52/// - Processing accelerators and other messages from the server's
53/// message queue
54///
55/// In addition to supporting the customary frame window operations and
56/// event-handling, TOleFrame provides functionality that supports OLE 2 menu
57/// merging for pop-up menus.
58///
59/// Through the use of the EvOcXxxx event-handling member functions, TOleFrame
60/// responds to ObjectComponents messages sent to both the server and the container
61/// applications. Although most of the messages and functions provide container
62/// support, one message, EvOcAppShutDown, is server related, and one function,
63/// GetRemViewBucket, supplies server support. Whether TOleFrame functions as a
64/// container or a server, it always has a pointer to a corresponding TOcApp.
66 public:
67 TOleFrame(LPCTSTR title,
68 owl::TWindow* clientWnd,
69 bool trackMenuSelection = false,
70 owl::TModule* module = 0);
71 ~TOleFrame();
73 void SetOcApp(TOcApp* app);
74 void AddUserFormatName(LPCTSTR name, LPCTSTR resultName, LPCTSTR id);
75
77 void OleViewClosing(bool close);
78
79 protected:
80 void SetupWindow() override;
81 void CleanupWindow() override;
82 void Destroy(int retVal) override;
83
84 void EvSize(owl::uint sizeType, const owl::TSize& size);
85 void EvActivateApp(bool active, DWORD threadId);
86 void EvTimer(owl::uint timerId);
87
89 bool EvOcAppInsMenus(TOcMenuDescr & sharedMenu);
90 bool EvOcAppMenus(TOcMenuDescr & md);
91 bool EvOcAppProcessMsg(MSG * msg);
92 bool EvOcAppFrameRect(owl::TRect * rect);
95 void EvOcAppStatusText(LPCTSTR rect);
96 void EvOcAppRestoreUI();
98 bool EvOcAppShutdown();
99
100 protected:
102 void StashContainerPopups(const owl::TMenuDescr& shMenuDescr);
103
104/// Points to the ObjectComponents application associated with this frame window.
106
107/// Holds the stored, shared pop-up menus.
109
110/// Holds the number of menu bars that have been stored. This number indicates how
111/// many active in-place editing sessions you have open.
113
114/// Stores the handle to the container's previously saved copy of the menu.
115 HMENU HOldMenu;
116
117 private:
118 enum {
119 DontCare, UserInitiated, ViewInitiated, ServerInitiated
120 } OcShutDown;
121
123};
124
125// Generic definitions/compiler options (eg. alignment) following the
126// definition of classes
127#include <owl/posclass.h>
128
129// --------------------------------------------------------------------------
130// Inline implementations
131//
132
133//
134/// Gets the ObjectComponents application associated with this frame window.
135inline TOcApp*
137{
138 return OcApp;
139}
140
141//
142/// Returns a pointer to the OLE frame's hidden helper window that holds all
143/// inactive server windows. It can also hold in-place tool bars and TOleView
144/// windows.
145inline owl::TWindow*
150
151//
152/// Responds to an OC_APPDIALOGHELP message. The dh parameter refers to one of the
153/// TOcDialogHelp enum constants that indicate the kind of dialog box the user has
154/// open. For example, dhBrowseLinks indicates that the Links dialog box is open.
155/// The TOcDialogHelp enum lists the help constants and their dialog box
156/// equivalents.
157inline void
161
162} // OCF namespace
163
164
165#endif // OWL_OLEFRAME_H
OCF Application class.
Definition ocapp.h:144
Decorated frame that supports OLE 2 using OCF.
Definition oleframe.h:65
void SetOcApp(TOcApp *app)
Initial set of OcApp being passed to us to use.
Definition oleframe.cpp:257
HMENU HOldMenu
Stores the handle to the container's previously saved copy of the menu.
Definition oleframe.h:115
void EvOcAppDialogHelp(TOcDialogHelp &dh)
Responds to an OC_APPDIALOGHELP message.
Definition oleframe.h:158
owl::TResult EvOcEvent(owl::TParam1 param1, owl::TParam2 param2)
Responds to a WM_OCEVENT message and subdispatches it to one of the EvOcXxxx event-handling functions...
Definition oleframe.cpp:449
int StashCount
Holds the number of menu bars that have been stored.
Definition oleframe.h:112
void EvSize(owl::uint sizeType, const owl::TSize &size)
Passes a WM_SIZE message to TLayoutWindow.
Definition oleframe.cpp:407
owl::TMenu StashedContainerPopups
Holds the stored, shared pop-up menus.
Definition oleframe.h:108
void Destroy(int retVal) override
Checks with all the connected servers to ensure that they can close before destroying the frame windo...
Definition oleframe.cpp:363
void EvActivateApp(bool active, DWORD threadId)
Responds to a EV_WM_ACTIVATEAPP message sent when a window is activated or deactivated.
Definition oleframe.cpp:424
TOcApp * GetOcApp()
Gets the ObjectComponents application associated with this frame window.
Definition oleframe.h:136
TOleFrame(LPCTSTR title, owl::TWindow *clientWnd, bool trackMenuSelection=false, owl::TModule *module=0)
Constructs a TOleFrame object with the specified caption for the frame window (title),...
Definition oleframe.cpp:219
bool EvOcAppBorderSpaceReq(owl::TRect *rect)
Responds to an OC_APPBORDERSPACEREQ message sent to a container.
Definition oleframe.cpp:590
void EvOcAppRestoreUI()
Responds to an OC_APPRESTOREUI message by restoring the container's normal menu and borders because i...
Definition oleframe.cpp:697
bool EvOcAppProcessMsg(MSG *msg)
Responds to an EV_OC_APPROCESSMSG message sent to the container asking the server to process accelera...
Definition oleframe.cpp:562
void DestroyStashedPopups()
Destroys the previously stored shared pop-up menus.
Definition oleframe.cpp:681
owl::TWindow * GetRemViewBucket()
Returns a pointer to the OLE frame's hidden helper window that holds all inactive server windows.
Definition oleframe.h:146
TOcApp * OcApp
Points to the ObjectComponents application associated with this frame window.
Definition oleframe.h:105
void AddUserFormatName(LPCTSTR name, LPCTSTR resultName, LPCTSTR id)
Adds user defined formats and the corresponding names to the list of Clipboard formats.
Definition oleframe.cpp:316
void StashContainerPopups(const owl::TMenuDescr &shMenuDescr)
Stores a local copy of the pop-up menus so they can be used for menu merging and then destroyed later...
Definition oleframe.cpp:659
bool EvOcAppInsMenus(TOcMenuDescr &sharedMenu)
Responds to an EV_OC_APPINSMENUS message by merging the container's menu into the shared menu.
Definition oleframe.cpp:476
bool EvOcAppShutdown()
Responds to an OC_APPSHUTDOWN message indicating that the last embedded object has been closed.
Definition oleframe.cpp:719
void EvTimer(owl::uint timerId)
If this is a DLL server, EvTimer responds to a timer message by running an idle loop if the message q...
Definition oleframe.cpp:435
bool EvOcAppFrameRect(owl::TRect *rect)
Responds to an OC_APPFRAMERECT message sent to a container.
Definition oleframe.cpp:572
void SetupWindow() override
Associates the ObjectComponents application with the window's HWND so that the TOcApp and the window ...
Definition oleframe.cpp:276
bool EvOcAppMenus(TOcMenuDescr &md)
Responds to an OC_OCAPPMENUS sent to the container.
Definition oleframe.cpp:526
void OleViewClosing(bool close)
Sets the OcShutDown data member to ViewInitiated (if close is true and OcShutDown = DontCare) or Dont...
Definition oleframe.cpp:329
void EvOcAppStatusText(LPCTSTR rect)
Responds to an OC_APPSTATUSTEXT message by displaying text from the server on this container's status...
Definition oleframe.cpp:644
void CleanupWindow() override
Performs normal window cleanup of any HWND-related resources.
Definition oleframe.cpp:300
bool EvOcAppBorderSpaceSet(owl::TRect *rect)
Responds to an OC_APPBORDERSPACESET message by making room in the container's frame window for the bo...
Definition oleframe.cpp:600
TDecoratedFrame automatically positions its client window (you must supply a client window) so that i...
Definition decframe.h:74
Menu with information used to allow merging.
Definition menu.h:206
The TMenu class encapsulates window menus.
Definition menu.h:77
ObjectWindows dynamic-link libraries (DLLs) construct an instance of TModule, which acts as an object...
Definition module.h:78
TRect is a mathematical class derived from tagRect.
Definition geometry.h:308
The tagSIZE struct is defined as.
Definition geometry.h:234
TWindow, derived from TEventHandler and TStreamableBase, provides window-specific behavior and encaps...
Definition window.h:414
auto ChildWithId(int id) const -> const TWindow *
Definition window.h:681
Definition of class TDecoratedFrame, a TFrameWindow that can manage decorations around the client win...
#define DECLARE_RESPONSE_TABLE(cls)
Definition eventhan.h:436
Object Component Framework (COM encapsulation).
Definition appdesc.h:22
TOcDialogHelp
Definition ocobject.h:27
const int IDT_DLLIDLE
Definition oleframe.h:33
const int IDW_REMVIEWBUCKET
Definition oleframe.h:32
class _ICLASS TOcApp
Definition ocapp.h:36
const int IDW_PADDECORATION
Definition oleframe.h:31
LPARAM TParam2
Second parameter type.
Definition dispatch.h:55
WPARAM TParam1
First parameter type.
Definition dispatch.h:54
LRESULT TResult
Result type.
Definition dispatch.h:52
unsigned int uint
Definition number.h:25
#define _OCFCLASS
Definition defs.h:45
Definition of OWL signatures for ObjectComponents messages.
OLE Registration definitions.
Templatized class implementation of OLE component creation code for TComponentFactory callback for Ob...
#define _ICLASS
Definition oleutil.h:25