home *** CD-ROM | disk | FTP | other *** search
Text File | 1996-08-16 | 6.4 KB | 235 lines | [TEXT/MPS ] |
- //========================================================================================
- //
- // File: Commands.h
- // Release Version: $ ODF 1 $
- //
- // Copyright: (c) 1993 - 1996 by Apple Computer, Inc., all rights reserved.
- //
- //========================================================================================
-
- #ifndef COMMANDS_H
- #define COMMANDS_H
-
- // ----- FrameWork Includes -----
-
- #ifndef FWCMD_H
- #include "FWCmd.h"
- #endif
-
- #ifndef FWCLPCMD_H
- #include "FWClpCmd.h"
- #endif
-
- #ifndef FWDRCMD_H
- #include "FWDrCmd.h"
- #endif
-
- #ifndef FWINSCMD_H
- #include "FWInsCmd.h"
- #endif
-
- //========================================================================================
- // Forward Declarations
- //========================================================================================
-
- class FW_CFrame;
-
- class CContainerPart;
- class CContainerFrame;
- class CContainerSelection;
- class CBaseContent;
- class CUndoContent;
-
- //========================================================================================
- // Constants - Command numbers
- //========================================================================================
-
- const ODCommandID cResizeCommand = 3006;
-
- //========================================================================================
- // CClipboardCommand
- //========================================================================================
-
- class CClipboardCommand : public FW_CClipboardCommand
- {
- public:
-
- FW_DECLARE_AUTO(CClipboardCommand)
-
- CClipboardCommand(Environment* ev,
- ODCommandID commandID,
- CContainerPart* part,
- CContainerFrame* frame,
- CContainerSelection* selection,
- FW_Boolean canUndo);
-
- virtual ~ CClipboardCommand();
-
- // --- FW_CCommand overrides
- virtual void UndoIt(Environment* ev);
- virtual void RedoIt(Environment* ev);
- virtual void SaveUndoState(Environment* ev);
- virtual void SaveRedoState(Environment* ev);
- virtual void FreeUndoState(Environment* ev);
- virtual void FreeRedoState(Environment* ev);
-
- // ----- FW_CClipboardCommand overrides -----
- virtual void PreCommand(Environment* ev);
- virtual void CommandDone(Environment* ev);
-
- private:
- CContainerPart* fContainerPart;
- CContainerSelection* fContainerSelection;
- CUndoContent* fUndoContent;
- };
-
- //========================================================================================
- // class CDragCommand - for dragging
- //========================================================================================
-
- class CDragCommand : public FW_CDragCommand
- {
- public:
-
- FW_DECLARE_AUTO(CDragCommand)
-
- CDragCommand(Environment* ev,
- CContainerPart* part,
- FW_CFrame* frame,
- CContainerSelection* selection,
- FW_Boolean canUndo);
-
- virtual ~CDragCommand();
-
- // --- FW_CCommand overrides
- virtual void UndoIt(Environment* ev);
- virtual void RedoIt(Environment* ev);
- virtual void SaveUndoState(Environment* ev);
- virtual void FreeUndoState(Environment* ev);
-
- protected:
- CContainerPart* fContainerPart;
- CContainerSelection* fContainerSelection;
- CUndoContent* fDraggedContent;
- ODShape* fUpdateShape;
- };
-
- //========================================================================================
- // class CDropCommand - for dropping
- //========================================================================================
-
- class CDropCommand : public FW_CDropCommand
- {
- public:
-
- FW_DECLARE_AUTO(CDropCommand)
-
- CDropCommand(Environment* ev,
- CContainerPart* itsPart,
- FW_CFrame* frame,
- ODDragItemIterator* dropInfo,
- ODFacet* facet,
- const FW_CPoint& windowPoint,
- FW_Boolean canUndo);
-
- virtual ~ CDropCommand();
-
- // --- FW_CCommand overrides
- virtual void UndoIt(Environment* ev);
- virtual void RedoIt(Environment* ev);
- virtual void SaveRedoState(Environment* ev);
- virtual void FreeRedoState(Environment* ev);
-
- // --- FW_CDropCommand overrides
- virtual FW_Boolean DoDrop(Environment* ev,
- ODStorageUnit* dropSU,
- const FW_CPoint& mouseDownOffset,
- const FW_CPoint& dropPoint,
- FW_Boolean isDropMove,
- short itemNumber);
- virtual FW_Boolean DoDroppedInSameFrame(Environment* ev,
- ODStorageUnit* dropSU,
- const FW_CPoint& mouseDownOffset,
- const FW_CPoint& dropPoint);
-
- private:
- void OffsetSelection(Environment* ev, const FW_CPoint& delta);
- void RestoreDroppedProxies(Environment* ev);
-
- private:
- CContainerPart* fContainerPart;
- CContainerSelection* fContainerSelection;
- FW_CPoint fDropDelta;
- CUndoContent* fDroppedContent;
- };
-
- //========================================================================================
- // CInsertCommand
- //========================================================================================
-
- class CInsertCommand : public FW_CInsertCommand
- {
- public:
-
- FW_DECLARE_AUTO(CInsertCommand)
-
- CInsertCommand(Environment* ev,
- CContainerFrame* frame,
- const FW_PFileSpecification& fileSpec,
- CContainerSelection* selection,
- FW_Boolean canUndo);
- virtual ~CInsertCommand();
-
- // --- FW_CCommand overrides
- virtual void UndoIt(Environment* ev);
- virtual void RedoIt(Environment* ev);
- virtual void SaveRedoState(Environment* ev);
- virtual void FreeRedoState(Environment* ev);
-
- public:
- virtual void PreCommand(Environment* ev);
- virtual void CommandDone(Environment* ev);
-
- private:
- CContainerSelection* fContainerSelection;
- CUndoContent* fUndoContent;
- };
-
- //========================================================================================
- // class CResizeCommand - Change size of selected proxies
- //========================================================================================
-
- class CResizeCommand : public FW_CCommand
- {
- public:
-
- FW_DECLARE_AUTO(CResizeCommand)
-
- CResizeCommand (Environment* ev,
- CContainerPart* part,
- FW_CFrame* frame,
- CContainerSelection* selection,
- const FW_CRect& srcRect,
- const FW_CRect& dstRect);
-
- virtual ~ CResizeCommand();
-
- // --- Command overrides
- virtual void DoIt(Environment* ev);
- virtual void UndoIt(Environment* ev);
- virtual void RedoIt(Environment* ev);
-
- private:
- void ResizeProxies(Environment* ev, const FW_CRect& srcRect, const FW_CRect& dstRect);
- void Redraw(Environment* ev, ODDoneState doneState);
-
- protected:
- CContainerPart* fContainerPart;
- CContainerSelection* fContainerSelection;
- FW_CRect fSourceRect;
- FW_CRect fDestRect;
- ODShape* fUpdateShape;
- CBaseContent* fChangedContent;
- };
-
- #endif