home *** CD-ROM | disk | FTP | other *** search
- /*
- A C++ framework for making drop-box applications.
- These are simple applications with minimal user interfaces, usually invoked
- via drag-and-drop. They launch, do their work, and then quit.
-
- */
- #ifndef __DROPSHELL3__
- #define __DROPSHELL3__
-
- #ifndef __EVENTS__
- #include <Events.h>
- #endif
-
- #ifndef __FILES__
- #include <Files.h>
- #endif
-
-
- class CDropShell {
- protected:
- Boolean fDone; // should we quit now?
- Boolean fOApped; // was the app opened by an OAPP event?
- Boolean fHasAppleEvents; // Does the system that we are running on have AppleEvents?
- Boolean fHasThreadMgr; // Does the system that we are running on have the Thread Manager?
- MenuHandle fAppleMenu, fFileMenu, fEditMenu;
- WindowRef fSplashScreen;
- Boolean fWalkFolders; // do we walk folders?
-
- public:
- CDropShell ( Boolean walkFolders = false );
- virtual ~CDropShell();
-
- // Run the application
- virtual void Run ( void );
- virtual void EventLoop( void );
-
-
- // Handle Documents (these can be threaded)
- virtual Boolean PreFlightDocs ( Boolean opening, short itemCount );
- virtual OSErr OpenDoc ( FSSpec &myFSSpec, Boolean opening );
- virtual OSErr PostFlightDocs ( Boolean opening, short itemCount );
-
- virtual OSErr ProcessItem ( FSSpec &theFile );
- virtual OSErr ProcessFolder ( FSSpec &theFile );
-
- // Handle Events
- virtual void SelectFile ( void );
- virtual void DoMouseDown ( EventRecord *theEvent );
- virtual void DoKeyDown ( EventRecord *theEvent );
-
- // Commands
- virtual void ShowAbout ( void );
- virtual void DoMenu ( long menuChoice );
-
- // Misc
- virtual void SetUpMenus ( void );
- virtual void InstallSplashScreen ( void );
- virtual OSErr InitGlobals ( void );
- virtual void DeInitGlobals ( void );
-
- // AEvents
- virtual OSErr InitAEVTStuff ( void );
- virtual void OpenApp ( void );
- virtual void QuitApp ( void );
- };
-
- // Use this routine to send an 'ODOC' to yourself
- void SendODOCToSelf ( FSSpecPtr theFileSpec );
-
- #endif
-