home *** CD-ROM | disk | FTP | other *** search
- /* ====================
- * AEAHandlerOpenDoc.cc
- * ====================
- */
-
- #include "AEADebugging.h"
-
- // AEA
- #include "AEAHandler.hh"
- #include "AEAHandlerOpenDoc.hh"
- #include "AEADescAppleEvent.hh"
- #include "AEADescList.hh"
-
-
- AEAHandlerOpenDoc::AEAHandlerOpenDoc()
- : AEAHandler(kCoreEventClass, kAEOpenDocuments)
- {
- MakeNoteToTouchParam(keyDirectObject);
- }
-
- AEAHandlerOpenDoc::~AEAHandlerOpenDoc()
- {
- }
-
- void
- AEAHandlerOpenDoc::HandleEventSelf(const AEADescAppleEvent &inAppleEvent, AEADescAppleEvent &outReply)
- {
- OSErr err;
- AEADescList docList;
- long docCount, index;
- AEKeyword keyword;
- DescType actualType;
- FSSpec fss;
- Size actualSize;
-
- inAppleEvent.GetParameter(keyDirectObject, typeAEList, docList.Ref());
-
- docCount = docList.CountItems();
-
- for (index = 1; index <= docCount; index++) {
- err = ::AEGetNthPtr(&docList.Ref(), index, typeFSS, &keyword, &actualType,
- &fss, sizeof fss, &actualSize);
- if (err) {
- DebugBeep();
- continue; // We should report this
- }
-
- DoOpenDoc(fss);
- }
- NotifyAppOpenDocEvent();
- }
-
- void
- AEAHandlerOpenDoc::DoOpenDoc(FSSpec &inFSS)
- {
- }
-