home *** CD-ROM | disk | FTP | other *** search
/ MacHack 2000 / MacHack 2000.toast / pc / The Hacks / PostScript OSA / DropShell3 / DropShell3.h < prev    next >
Encoding:
C/C++ Source or Header  |  2000-06-23  |  1.9 KB  |  71 lines

  1. /*
  2.     A C++ framework for making drop-box applications.
  3.     These are simple applications with minimal user interfaces, usually invoked
  4.     via drag-and-drop. They launch, do their work, and then quit.
  5.  
  6. */
  7. #ifndef    __DROPSHELL3__
  8. #define    __DROPSHELL3__
  9.  
  10. #ifndef __EVENTS__
  11. #include <Events.h>
  12. #endif
  13.  
  14. #ifndef __FILES__
  15. #include <Files.h>
  16. #endif
  17.  
  18.  
  19. class CDropShell {
  20. protected:
  21.     Boolean        fDone;                //    should we quit now?
  22.     Boolean        fOApped;            //    was the app opened by an OAPP event?
  23.     Boolean        fHasAppleEvents;    //    Does the system that we are running on have AppleEvents?
  24.     Boolean        fHasThreadMgr;        //    Does the system that we are running on have the Thread Manager?
  25.     MenuHandle    fAppleMenu, fFileMenu, fEditMenu;
  26.     WindowRef    fSplashScreen;
  27.     Boolean        fWalkFolders;        //    do we walk folders?
  28.  
  29. public:
  30.     CDropShell ( Boolean walkFolders = false );
  31.     virtual ~CDropShell();
  32.  
  33. //    Run the application
  34.     virtual void    Run ( void );
  35.     virtual void     EventLoop( void );
  36.  
  37.  
  38. //    Handle Documents (these can be threaded)
  39.     virtual Boolean PreFlightDocs  ( Boolean opening, short itemCount );
  40.     virtual OSErr    OpenDoc           ( FSSpec &myFSSpec, Boolean opening );
  41.     virtual OSErr    PostFlightDocs ( Boolean opening, short itemCount );
  42.  
  43.     virtual OSErr    ProcessItem        ( FSSpec &theFile );
  44.     virtual OSErr    ProcessFolder    ( FSSpec &theFile );
  45.  
  46. //    Handle Events
  47.     virtual void    SelectFile  ( void );
  48.     virtual void    DoMouseDown ( EventRecord *theEvent );
  49.     virtual void    DoKeyDown   ( EventRecord *theEvent );
  50.  
  51. //    Commands
  52.     virtual void    ShowAbout            ( void );
  53.     virtual void    DoMenu                ( long menuChoice );
  54.  
  55. //    Misc
  56.     virtual void    SetUpMenus            ( void );
  57.     virtual void    InstallSplashScreen    ( void );
  58.     virtual OSErr    InitGlobals            ( void );
  59.     virtual void    DeInitGlobals        ( void );
  60.     
  61. //    AEvents
  62.     virtual OSErr    InitAEVTStuff         ( void );
  63.     virtual void    OpenApp                ( void );
  64.     virtual void    QuitApp                ( void );
  65. };
  66.  
  67. //    Use this routine to send an 'ODOC' to yourself
  68. void SendODOCToSelf ( FSSpecPtr theFileSpec );
  69.  
  70. #endif
  71.