home *** CD-ROM | disk | FTP | other *** search
- #ifndef _IAPPWIN_
- #define _IAPPWIN_
- /*******************************************************************************
- * FILE NAME: iappwin.hpp *
- * *
- * DESCRIPTION: *
- * Declaration of the class(es): *
- * IApplicationWindow - Abstract base class for application window. *
- * *
- * COPYRIGHT: *
- * Licensed Materials - Property of IBM *
- * (C) Copyright IBM Corporation 1992, 1993 *
- * All Rights Reserved *
- * US Government Users Restricted Rights - Use, duplication, or disclosure *
- * restricted by GSA ADP Schedule Contract with IBM Corp. *
- * *
- *$Log: R:/IBMCLASS/IBASEAPP/VCS/IAPPWIN.HPV $ *
- //
- // Rev 1.23 26 Oct 1992 10:48:38 nunn
- // Kevin's changes for 10/26
-
- Rev 1.1 25 Oct 1992 00:00:01 kleong
- Miscellaneous improvements.
- *******************************************************************************/
- #ifndef _IWINDOW_
- #include <iwindow.hpp>
- #endif
-
- // Forward declarations for other classes:
- class IApplicationWindow;
- class IResourceId;
- class IEvent;
-
- class IApplicationWindow : public IWindow {
- /*******************************************************************************
- * The IApplicationWindow class is an abstract base class for application *
- window class, such as a frame and dialog window. It provide common
- functions applicable to a frame and dialog window.
- *******************************************************************************/
- typedef IWindow Inherited;
- public:
-
- /*-------------------------------- ACCESSORS -----------------------------------
- | These functions provide means of getting and setting the accessible |
- | attributes of instances of this class: |
- | beginFlash - Starts the window flashing to bring the user's |
- | attention to the window. |
- | close - Closes the window |
- | disableEscClose - Disables closing the window when ESC key is pressed |
- | endFlash - Stops the window flashing |
- | enableEscClose - Enables closing the window when ESC key is pressed |
- | icon - Returns the pointer handle of the window icon |
- | maximize - Maximizes the window |
- | maximizeRect - Returns the window rectangle coordinates to which it is |
- | maximized |
- | minimize - Minimizes the window |
- | minimizeRect - Returns the window rectangle coordinates to which it is |
- | minimized |
- | nextShellRect - Returns the system recommended window rectangle |
- | coordinates of the next main window |
- | restore - Restores a maximized or minimized window |
- | restoreRect - Returns the window rectangle coordinates to which the |
- | window is restored |
- | setIcon - Sets the window icon |
- | setRestoreRect - Changes the rectangle corrdinates to which the window |
- | is restored |
- ------------------------------------------------------------------------------*/
- IApplicationWindow
- &beginFlash(),
- &disableEscClose(),
- &enableEscClose(Boolean enableEsc = true),
- &endFlash(),
- &minimize(),
- &maximize(),
- &restore(),
- &setIcon(const IPointerHandle& icon),
- &setIcon(const IResourceId& iconResId),
- &setIcon(unsigned long iconResId),
- &setRestoreRect(const IRectangle& newRect);
-
- IPointerHandle
- icon() const;
-
- void
- close();
-
- IWindowHandle
- lastFocusControl() const;
-
- IRectangle
- minimizeRect() const,
- maximizeRect() const,
- nextShellRect() const,
- restoreRect() const;
-
- /*-------------------------------- TESTING -----------------------------------
- | These functions provide means of testing the attributes of instances of |
- | this class: |
- | isFlash - Queries if the window is flashing
- | isMaximize - Queries if the window is maximized
- isMinimize - Queries if the window is minimized
- ------------------------------------------------------------------------------*/
- Boolean
- isFlash() const,
- isMaximize() const,
- isMinimize() const;
-
- /*----------------------------- WINDOW LIST -----------------------------------
- | These functions provide means of setting and removing the window list entry |
- | for this window: |
- | setWindowListEntry - Adds the window title to the system window list |
- | Note that frame window window list entry can be |
- | set using window style |
- | removeWindowListEntry - Removes the window title from the system window |
- | list |
- ------------------------------------------------------------------------------*/
- IApplicationWindow
- &setWindowListEntry(Boolean enable = true),
- &removeWindowListEntry();
-
- /*-------------------------------- OVERRIDES -----------------------------------
- | This class overrides the following inherited functions: |
- | disable - Disables the window and its children |
- | enable - Enables the window and its children |
- ------------------------------------------------------------------------------*/
- virtual void
- enable(Boolean enableWin = true) {enableWindow(enableWin);}
- virtual void
- disable() {enableWindow(false);}
-
- protected:
- /*------------------------ CONSTRUCTORS/DESTRUCTORS ----------------------------
- | There are one way to construct instances of this class: |
- | 1. default |
- | this initialize the object |
- ------------------------------------------------------------------------------*/
- IApplicationWindow();
- virtual
- ~IApplicationWindow();
-
- /*----------------------- EVENT HANDLING ---------------------------------------
- | There functions provide means to handle events of instances of this class: |
- | handleEvent - Overrides to dispatch event handling function |
- | specific to an application window, as listed below. |
- | handleClose - Function dispatched when to when is above to close. |
- | Application should return false to prevent the window |
- | for closing. |
- | handleActivate - Function dispatched when the window is activated. |
- | handleDeactivate - Function dispatched when the window is deactivated. |
- | handleSave - Function dispatched to allow the application to save |
- | application data when the window is closing. |
- ------------------------------------------------------------------------------*/
- virtual Boolean
- handleWindowEvent(IEvent& event);
- virtual Boolean
- handleWindowClose() {return true;}
- virtual void
- handleActivate() {;}
- virtual void
- handleDeactivate() {;}
- virtual void
- handleSave() {;}
-
- private:
- /*--------------------------------- PRIVATE ----------------------------------*/
- IApplicationWindow(const IApplicationWindow&);
- IApplicationWindow
- &operator=(const IApplicationWindow&);
-
- void
- manageQuit(),
- enableWindow(Boolean b);
-
- unsigned long
- flAppWinFlag;
- };
-
- #endif /* _IAPPWIN_ */