OWLNext    7.0
Borland's Object Windows Library for the modern age
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
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();
72 TOcApp* GetOcApp();
73 void SetOcApp(TOcApp* app);
74 void AddUserFormatName(LPCTSTR name, LPCTSTR resultName, LPCTSTR id);
75
76 owl::TWindow* GetRemViewBucket();
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
88 owl::TResult EvOcEvent(owl::TParam1 param1, owl::TParam2 param2);
89 bool EvOcAppInsMenus(TOcMenuDescr & sharedMenu);
90 bool EvOcAppMenus(TOcMenuDescr & md);
91 bool EvOcAppProcessMsg(MSG * msg);
92 bool EvOcAppFrameRect(owl::TRect * rect);
93 bool EvOcAppBorderSpaceReq(owl::TRect * rect);
94 bool EvOcAppBorderSpaceSet(owl::TRect * rect);
95 void EvOcAppStatusText(LPCTSTR rect);
96 void EvOcAppRestoreUI();
97 void EvOcAppDialogHelp(TOcDialogHelp & dh);
98 bool EvOcAppShutdown();
99
100 protected:
101 void DestroyStashedPopups();
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
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
int StashCount
Holds the number of menu bars that have been stored.
Definition oleframe.h:112
owl::TMenu StashedContainerPopups
Holds the stored, shared pop-up menus.
Definition oleframe.h:108
TOcApp * GetOcApp()
Gets the ObjectComponents application associated with this frame window.
Definition oleframe.h:136
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
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:75
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