//====START_GENERATED_PROLOG======================================
//
//
//   COMPONENT_NAME: odother
//
//   CLASSES: none
//
//   ORIGINS: 27
//
//
//   (C) COPYRIGHT International Business Machines Corp. 1995,1996
//   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.
//
//   IBM DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
//   ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
//   PURPOSE. IN NO EVENT SHALL IBM BE LIABLE FOR ANY SPECIAL, INDIRECT OR
//   CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF
//   USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
//   OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE
//   OR PERFORMANCE OF THIS SOFTWARE.
//
//====END_GENERATED_PROLOG========================================
//
// @(#) 1.5 nt/src/samples/cdplayer/cddisp.h, odcdplayerpart, od96nt, odnt9712d 11/5/96 17:08:52 [ 3/21/97 17:32:43 ]

#ifndef IBMSample_CDDISPLAY
#define IBMSample_CDDISPLAY

#ifndef SOM_CDPlayer_xh
#include "IODCDPly.xh"
#endif

extern "C" {
	#include <windows.h>
	#include <winuser.h>
	#include <objbase.h>
	#include <stdio.h>
	#include <commctrl.h>
}

#include "iodcdply.h"
#include "CDCntrl.h"
#include "List.h"

typedef LRESULT (CALLBACK* WNDPROC)(HWND, UINT, WPARAM, LPARAM);

class CDDisplay {
public:
	CDDisplay ();
	~CDDisplay ();

	/*
	 *  Initialize display...
	 */
	void Initialize (CDPlayer* part);

	/*
	 *  Process windows messages...
	 */
	LRESULT ProcessMessages (HWND hwnd, UINT iMsg, 
				WPARAM wParam, LPARAM lParam);

	LRESULT ProcessCommands (HWND hwnd, UINT iMsg, 
				WPARAM wParam, LPARAM lParam);

private:
	enum EFontStyle { 
		kNormal = 0x00, 
		kItalic = 0x01, 
		kUnderLine = 0x02, 
		kStrikeOut = 0x04 
	};

	void CreateStatusBar (HWND parentWindow);
	void ResizeStatusBar (int x, int y, int nWidth, int nHeight);

	HWND CreateProgressBar (HWND parentWindow, RECT rect, WORD id,
				LONG lRange, LONG lStep);
	void ResizeProgressBar (int x, int y, int nWidth, int nHeight);

	void SetColorsAndFonts (HWND hWnd, HDC hdc);
	HFONT CDDisplay::MakeFont (HWND hWnd, HDC hdc, int pointsize, 
				int weight, LPCSTR typeface,
				EFontStyle style = kNormal);
	void DisableControls ();
	void DisableButton (int id);

	/*
	 *  Data...
	 */
	HINSTANCE	fInstance;
	CDPlayer*	fPart;
	HWND		fRootWindow;

	HWND		fProgressBar;
	HWND		fStatusBar;
	int		fStatusBarPanels [3];

	CDControl*	fCDControl;

	List<HFONT>	fFontList;

public:

	HWND GetRootWindow () { return fRootWindow; }
};

LRESULT CALLBACK ProcessWindowsMessages (HWND hwnd, UINT iMsg, 
				WPARAM wParam, LPARAM lParam);

extern CDDisplay gDisplay;

#endif /* IBMSample_CDDisplay */
