campo-sirio/al/h/winmon.h
alex 714dd74636 Archive Library versione 2.00
git-svn-id: svn://10.65.10.50/trunk@5350 c028cbd2-c16b-5b4b-a496-9718f37d4682
1997-10-09 16:09:54 +00:00

134 lines
4.5 KiB
C++
Executable File

/*
* WINMON.H
*
* Header file for ArchiveLib 2.0
*
* Copyright (c) 1994-1996 Greenleaf Software, Inc.
* All Rights Reserved
*
* DESCRIPTION
*
* This header file contains the declaration for ALWindowsMessage,
* a monitor class used under Windows.
*
* CLASS DEFINITIONS:
*
* ALWindowsMessage
*
* REVISION HISTORY
*
* May 26, 1994 1.0A : First release
*
* February 14, 1996 2.0A : Exciting new release
*/
#ifndef _WINMON_H
#define _WINMON_H
#include "arclib.h"
#include "winutil.h"
#if defined( __cplusplus )
/*
* class ALWindowsMessage
*
* DESCRIPTION
*
* This class is used to provide user feedback when operating under
* windows. It can be constructed to send messages to windows from
* YieldTime(), allowing you to easily update progress bars, text
* boxes, or whatever.
*
* DATA MEMBERS
*
* mhMessageWindowHandle : The handle of the window that is going to
* get the text messages generated by the
* ArchiveOperation() procedure. If this
* member is set to 0, no messages are sent.
*
* mhNumberWindowHandle : The handle of the window that is going to
* get either the byte count or the percent
* complete figure. If miMessage is 0, it
* is formatted as ASCII and sent using a
* SetWindowText() call. O/W, it is sent
* using SendMessage(), in Lparam and Wparam.
*
* mMessageType : AL_SEND_BYTE_COUNT or AL_SEND_RATIO.
*
* miMessage : The message that gets sent with with the
* byte count or ratio.
*
* MEMBER FUNCTIONS
*
* ALWindowsMessage() : The one and only constructor.
* ~ALWindowsMessage() : The destructor.
* operator new() : The memory allocation operator, only used
* when the library is in a DLL.
* Progress() : The virtual function that gets called to
* update progress through the file/job.
* ArchiveOperation() : The virtual function that gets called
* at key points in the archiving process.
*
* REVISION HISTORY
*
* May 26, 1994 1.0A : First release
*
* February 14, 1996 2.0A : New release
*/
class AL_CLASS_TYPE ALWindowsMessage : public ALMonitor { /* Tag public class */
/*
* Constructors, destructors, and friends
*/
public :
AL_PROTO ALWindowsMessage( ALMonitorType monitor_type,
HWND progress_text_window,
ALWindowsMessageType message_type,
HWND progress_number_window,
UINT windows_message = 0 );
virtual AL_PROTO ~ALWindowsMessage();
#if defined( AL_USING_DLL ) || defined( AL_BUILDING_DLL )
void AL_DLL_FAR * AL_PROTO operator new( size_t size );
#endif
/*
* As usual, I don't want the compiler to generate a default copy constructor,
* or an assignment operator here. I force it to back off by declaring them
* here. They do not exist!
*/
protected :
AL_PROTO ALWindowsMessage( ALWindowsMessage AL_DLL_FAR & );
ALWindowsMessage AL_DLL_FAR & AL_PROTO operator=( const ALWindowsMessage AL_DLL_FAR & );
protected :
virtual void AL_PROTO Progress( long mlObjectSoFar,
ALStorage AL_DLL_FAR & object );
virtual void AL_PROTO
ArchiveOperation( ALArchiveOperation operation,
ALArchive AL_DLL_FAR *archive,
ALEntry AL_DLL_FAR *job );
/*
* Data members
*/
protected :
HWND mhMessageWindowHandle;
HWND mhNumberWindowHandle;
ALWindowsMessageType mMessageType;
int miMessage;
public :
AL_CLASS_TAG( _ALWindowsMessageTag );
};
#else /* #if defined( __cplusplus ) ...*/
AL_LINKAGE hALMonitor AL_FUNCTION
newALWindowsMessage( enum ALMonitorType monitor_type,
HWND progress_text_window,
enum ALWindowsMessageType message_type,
HWND progress_number_window,
UINT windows_message );
#endif /* #if defined( __cplusplus ) ... #else ... */
#endif /* #ifdef _WINMON_H */