home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 10 Tools
/
10-Tools.zip
/
odtlktv4.zip
/
ODTLKT
/
TOOLKIT
/
SAMPLES
/
OPENDOC
/
PARTS
/
TTAPE1
/
TTAPE1.IDL
< prev
next >
Wrap
Text File
|
1995-12-15
|
14KB
|
369 lines
//#*********************************************************************
//#*
//#* File Name : TTAPE1.IDL
//#*
//#* Description : This is the SOM Interface Definition for the
//#* TickerTape1Part class. TickerTape1Part is an example
//#* of an OpenDoc part handler.
//#*
//#* The part is a Ticker Tape, which is a rectangular
//#* window containing text which scrolls from right to
//#* left.
//#*
//#* The Ticker Tape has the following features:
//#*
//#* 1. The text adjusts when the size of the rectangle
//#* is adjusted, so that the height of the text
//#* always fills the height of the rectangle.
//#* 2. The background color can be selected by selecting
//#* "Background" from the Popup menu, which appears
//#* when the mouse is clicked over the part with
//#* mouse button 2.
//#* 3. A text file can be selected to replace the
//#* displayed Ticker Tape text. The text file is
//#* selected by selecting "Open Text File..." from the
//#* Popup menu.
//#* 4. Because the TickerTape1Part's parent class is a
//#* container part handler, the TickerTape1Part part
//#* handler allows the embedding of OpenDoc parts
//#* within the Ticker Tape text window.
//#*
//#* Notes : CLASS: TickerTape1Part
//#*
//#* CLASS HIERARCHY:
//#*
//#* SOMObject
//#* └── ODObject
//#* └── ODRefCntObject
//#* └── ODPersistentObject
//#* └── ODPart
//#* └── ContainerPart
//#* └── TickerTape1Part
//#*
//#* 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 _TICKERTAPE1_
#define _TICKERTAPE1_
//#
//# Include the IDL definition for the parent class
//#
#ifndef _CNTNRPRT_
#include "cntnrprt.idl"
#endif
interface M_TickerTape1; //# The M_TickerTape1 metaclass is defined below.
//======================================================================
// Implementation Types
//======================================================================
// typedef unsigned long HMODULE;
typedef somToken TextData;
typedef somToken FILEDLG;
typedef somToken TEXTATTRIBUTES;
interface TickerTape1Part : ContainerPart
{
//#
//# Private method declarations and their method headers.
//#
void CommonInitPart(in char *text,
in char *fileName,
in TEXTATTRIBUTES textAttr);
//#
//# Method(s) : CommonInitPart
//#
//# Description : Contains OpenDoc Part initialization which is
//# common to both InitPart and InitPartFromStorage.
//#
//# Parameters : char *text - Initial Ticker Tape text string.
//# char *filename - Ticker Tape text file name.
//# TEXTATTRIBUTES textAttr - Text attributes:
//# - position of first character
//# of text in the window.
//# - index position of first
//# character to display.
//# - Text background color.
//#
//# Returns : VOID
void SetOrigin(in ODFacet facet, in HPS hpsDraw);
//#
//# Method(s) : SetOrigin
//#
//# Description : This method sets the origin in preparation for rendering
//# the Hello part.
//#
//# Parameters : ODFacet *facet - References the facet for this object.
//# HPS hpsDraw - Handle to PM presentation screen.
//#
//# Returns : VOID
void FileOpenDialog(in HWND hwndClient);
//#
//# Method(s) : FileOpenDialog
//#
//# Description : This method sets up the File Open Dialog Box,
//# which is opened for the user to select a path
//# name. The contents of the selected file will be
//# the new text.
//#
//# Parameters : HWND hwndClient - handle to the Dialog's client window.
//#
//# Returns : VOID
void DrawFrameOrThumbnailView(in ODFacet facet);
//#
//# Method(s) : DrawFrameOrThumbnailView
//#
//# Description : Draw the Ticker Tape 1 part either within its frame
//# or as a thumbnail (ie, a thumbnail-size frame). Draw
//# Draw the Ticker Tape content in the provided facet.
//# Only the visible portion of the part needs to be
//# drawn, based on the obtained aggregate clip shape.
//#
//# This method is invoked whenever the Ticker Tape timer
//# window handler receives a TIMER message.
//#
//# Parameters : ODFacet *facet - References the Part's facet.
//#
//# Returns : VOID
void DrawIconView(in ODFacet facet, in ODULong size);
//#
//# Method(s) : DrawIconView
//#
//# Description : This method renders the Ticker Tape part in the
//# provided facet as either a large or small icon.
//#
//# Parameters : ODFacet *facet - References the Part's facet.
//# ODULong size - The icon size in pixels. Size is
//# actually the length of one side,
//# either 32 (large), or 16 (small).
//#
//# Returns : VOID
void SetFrameSize(in ODRect Rect);
//#
//# Method(s) : SetFrameSize
//#
//# Description : This method sets the frame size that the Ticker Tape
//# text uses to scale its text characters. The height of
//# the text is scaled to the height of the frame.
//#
//# Parameters : ODRect Rect - The new rectangle size.
//#
//# Returns : VOID
TextData *GetTextData();
//#
//# Method(s) : GetTextData
//#
//# Description : Get the TextData text-maintenance object owned by
//# Ticker Tape 1. This is an accessor method provided
//# for classes subclassing from TickerTape1Part.
//#
//# Parameters : None.
//#
//# Returns : TextData* - the TextData class object.
ODBoolean IsNewText();
//#
//# Method(s) : IsNewText
//#
//# Description : Returns the value of the fNewTickerTape text variable.
//# Allows a subclass to determine if the Ticker Tape text
//# has been replaced by text from a file. This is an
//# accessor method provided for classes subclassing from
//# the TickerTape1Part class.
//#
//# Parameters : None.
//#
//# Returns : ODBoolean - the value of fNewTickerTapeText.
void LoadPopupMenu();
//#
//# Method(s) : LoadPopupMenu
//#
//# Description : Loads the Popup menu which will be displayed when the
//# user mouse-clicks with mouse button 2 over the part.
//#
//# Parameters : None.
//#
//# Returns : VOID
void CheckAndAddProperties(in ODStorageUnit storageUnit);
//#
//# Method(s) : CheckAndAddProperties
//#
//# Description : If the Ticker Tape 1 Part storage unit properties
//# are not already there, the properties and their
//# corresponding values are added.
//#
//# Parameters : ODStorageUnit* storageUnit - storage unit belonging
//# either to the part or to
//# a drag and drop operation.
//#
//# Returns : VOID
void ExternalizeContent(in ODStorageUnit storageUnit,
in ODBoolean isPartStorage);
//#
//# Method(s) : ExternalizeContent
//#
//# Description : Put the Ticker Tape 1 part's intrinsic data into the
//# specified storage unit.
//#
//# Parameters : ODStorageUnit* storageUnit - storage unit belonging
//# either to the part or to
//# a drag and drop operation.
//# ODBoolean isPartStorage - Flag to determine whether
//# the storage unit belongs
//# to the part or to a drag
//# and drop operation.
//#
//# Returns : VOID
//#
//# Implementation Statements -- These are specific to SOM and are
//# not part of the CORBA standard.
#ifdef __SOMIDL__
implementation
{
//# Class Modifiers
functionprefix = TickerTape1; //# The prefix for all method names.
metaclass = M_TickerTape1; //# The metaclass for this class.
majorversion = 1;
minorversion = 0;
//#
//# 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:
CommonInitPart,
SetOrigin,
FileOpenDialog,
DrawFrameOrThumbnailView,
DrawIconView,
SetFrameSize,
GetTextData,
IsNewText,
LoadPopupMenu,
CheckAndAddProperties,
ExternalizeContent
;
//#
//# Override statments -- Identify the SOM and OpenDoc methods that
//# this class will re-implement.
//#
override:
somInit,
somUninit,
Draw,
Externalize,
FrameShapeChanged,
HandleEvent,
FacetAdded,
FacetRemoved,
FocusAcquired,
FocusLost,
InitPart,
InitPartFromStorage,
CloneInto,
ViewTypeChanged
;
//#
//# The following information will "pass thru" the SOM
//# compiler to the public XH file for this class.
//#
passthru C_xh = ""
"class ODFrame ;"
"class ODTransform ;"
"class TextData;"
;
passthru C_xh_after = ""
"typedef struct"
"{"
" LONG lBackText;"
" SHORT sGap;"
" SHORT sScrollPos;"
"} TEXTATTRIBUTES;"
;
//#
//# Define the instance data for this class.
//#
HWND msgWnd; //# PM timer window handle.
HMODULE hmMod; //# handle to the class (ttape1) module.
TextData* textArea; //# class which maintains the Ticker Tape text.
FILEDLG fild; //# The file dialog information record.
ODPopup fPopup; //# The Popup menu bar.
//# Is the Ticker Tape text new? If so, it should be externalized.
ODBoolean fNewTickerTapeText;
ODBoolean fIsActivated; //# Is the part activated?
ODBoolean fFrameNegotiated; //# Have the dimensions of the
//# frame been negotiated with
//# the containing part?
ODTypeToken fSelectionFocus; //# Token representing the part's
//# owning the focus when selected.
ODSession fSession; //# the part's storage unit
//# running session.
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.
ODTypeToken CurrentView; //# current view of part (either frame,
//# large or small icon, or thumbnail).
};
#endif
};
//#
//# For part registration. The methods belonging to this class
//# are invoked during the registration process.
//#
interface M_TickerTape1 : M_ODPart
{
#ifdef __SOMIDL__
implementation
{
functionprefix = M_TickerTape1;
override:
clsGetODPartHandlerName,
clsGetODPartHandlerDisplayName,
clsGetODPartKinds,
clsGetOLE2ClassId,
clsGetWindowsIconFileName;
};
#endif
};
#endif // _TICKERTAPE1_