home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 10 Tools
/
10-Tools.zip
/
odtlktv4.zip
/
ODTLKT
/
TOOLKIT
/
SAMPLES
/
OPENDOC
/
PARTS
/
PUSHBTN
/
PUSHBTN.IDL
< prev
next >
Wrap
Text File
|
1995-12-15
|
7KB
|
190 lines
//#**************************************************************************
//#
//# File Name : PUSHBTN.IDL
//#
//# Description : SOM Interface Definition for the OpenDoc class PushButtonPart.
//# The purpose of this sample part handler is to show
//# embedding of PM control and scripting in a part in OpenDoc
//# document. The DisplayMsgBox statement in HandleEvent method
//# can be replaced by any user define method.
//#
//# Notes : CLASS: PushButtonPart
//#
//# CLASS HIERARCHY:
//#
//# SOMObject
//# └── ODObject
//# └── ODRefCntObject
//# └── ODPersistentObject
//# └── ODPart
//# └── ContainerPart
//# └── PushButtonPart
//#
//# Entry Points: N/A
//#
//# (C) COPYRIGHT International Business Machines Corp. 1995
//# All Rights Reserved
//# Licensed Materials - Property of IBM
//#
//# US Government Users Restricted Rights - Use, duplication or
//# disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
//#
//# DISCLAIMER OF WARRANTIES. The following [enclosed] code is
//# sample code created by IBM Corporation. This sample code is not
//# part of any standard or IBM product and is provided to you solely
//# for the purpose of assisting you in the development of your
//# applications. The code is provided "AS IS", without
//# warranty of any kind. IBM shall not be liable for any damages
//# arising out of your use of the sample code, even if they have been
//# advised of the possibility of such damages.
//#
//#*************************************************************************/
#ifndef _PUSHBTN_
#define _PUSHBTN_
#ifndef _CNTNRPRT_
#include "cntnrprt.idl"
#endif
interface M_PushButtonPart;
// Components interface definition, parent derivation
interface PushButtonPart : ContainerPart
{
typedef unsigned long HMODULE; // Define type for module handle.
// Private methods
void CheckAndAddProperties(in ODStorageUnit storageUnit);
void ExternalizeContent(in ODStorageUnit storageUnit);
void DrawIconView(in ODFacet facet, in ODULong size);
void DrawThumbnailView(in ODFacet facet);
void CommonInitPart();
void DisplayMsgBox(in ODFacet facet);
#ifdef __SOMIDL__
implementation
{
//#
//# Standard SOM identifiers
//#
functionprefix = PushButton;
metaclass = M_PushButtonPart;
majorversion = 1;
minorversion = 1;
//#
//# Release Order statements -- This section is used to specify the
//# order in which the SOM compiler will place the class' methods in
//# the data structures it builds to represent the class.
//#
releaseorder:
CheckAndAddProperties,
ExternalizeContent,
DrawIconView,
DrawThumbnailView,
CommonInitPart,
DisplayMsgBox;
//#
//# Override statments -- Identify the SOM and OpenDoc methods that
//# this class will re-implement.
//#
override:
somInit,
somUninit,
InitPart,
InitPartFromStorage,
Externalize,
CloneInto,
HandleEvent,
FacetAdded,
FacetRemoved,
GeometryChanged,
Draw,
ViewTypeChanged;
//#
//# The following information will be stored in the public XH file
//# fot the class.
//#
passthru C_xh = ""
"#define VARIABLE_MACROS // To access instance variables in"
" // _variableName form instead of"
" // somThis->variableName form of natation"
"#define METHOD_MACROS // To access class methods in"
" // _methodName form instead of"
" // somSelf->methodName form of natation"
""
"#define INCL_WIN // Include all Presentation Manager info"
"#define INCL_WINERRORS"
"#define INCL_GPI // Include all Graphics Pres. Interface info"
"#define INCL_GPIERRORS"
"#define INCL_DOSMODULEMGR // Include Module manager"
"#define INCL_ODAPI // Include OpenDoc for OS/2"
"#define INCL_ODCANVAS // Include ODCanvas class definition"
"#define INCL_ODFACET // Include ODFacet, ODFacetIterator,"
" // ODFrameFacetIterator class definitions"
"#define INCL_ODFRAME // Include ODFrame class definition"
"#define INCL_ODSESSION // Include ODSESSION class definition"
"#define INCL_ODSHAPE // Include ODShape class definition"
"#define INCL_ODSTORAGEUNIT // Include ODStorageUnit, ODStorageUnitCursor,"
" // ODStorageUnitRefIterator class defs"
"#define INCL_ODTRANSFORM // Include ODTransform class definition"
"#define INCL_ODWINDOW // Include ODWindow class definition"
""
"#include <os2.h>"
"#include <stdio.h>"
"#include <string.h>"
"";
//#
//# Define the instance data for this class.
//#
ODBoolean fIsInitFromStorage; // This flag ensures that the frame
// shape displayed is the one
// obtained from document storage.
ODBoolean fShowDefaultFrameSize; // Flag of showing default frame size.
ISOString fBuffer; // A ASCII string contains the text
// which display on the Push Button.
HMODULE ModuleHandle; // The handle to the module which
// contains the Push Button Part
// Handler's resources.
ODTypeToken FrameView; // Token representing the frame view.
ODTypeToken LargeIconView; // Token representing large icon view.
ODTypeToken SmallIconView; // Token representing small icon view.
ODTypeToken ThumbnailView; // Token representing thumbnail view.
ODSession Session; // The part's storage unit running
// session.
ULONG hwndPushButton; // PM Push Button window handle.
ULONG habDeskTop; // Anchor-block handle of Desktop.
};
#endif // End of __SOMIDL__
};
// Added for Part Registration
interface M_PushButtonPart : M_ODPart
{
#ifdef __SOMIDL__
implementation
{
functionprefix = M_PushButtonPart;
override:
clsGetODPartHandlerName,
clsGetODPartHandlerDisplayName,
clsGetODPartKinds,
clsGetOLE2ClassId,
clsGetWindowsIconFileName;
};
#endif
};
#endif // End of _PUSHBTN_