tvutil.h

Go to the documentation of this file.
00001 /**********************************************************************
00002  *<
00003     FILE: tvutil.h
00004 
00005     DESCRIPTION: Track view utility plug-in class
00006 
00007     CREATED BY: Rolf Berteig
00008 
00009     HISTORY: 12/18/96
00010     03/11/02 -- Adam Felt.  Expanded the interfaces.  
00011     
00012     WARNING: Plugin compatibility is not preserved between R4.x and R5 
00013     for TrackviewUtility plugins.  R4.x TrackViewUtility plugins need 
00014     to be recompiled before running on R5.x and later.  R5 and later 
00015     plugins will not run properly on previous versions.
00016 
00017 
00018  *> Copyright (c) 1996-2002, All Rights Reserved.
00019  **********************************************************************/
00020 
00021 #pragma once
00022 
00023 
00024 #include "ref.h"
00025 // forward declarations
00026 class ITreeView;
00027 class TrackViewUtility;
00028 class Interface;
00029 
00030 // The five track view major modes
00031 #define TVMODE_EDITKEYS         0
00032 #define TVMODE_EDITTIME         1
00033 #define TVMODE_EDITRANGES       2
00034 #define TVMODE_POSRANGES        3
00035 #define TVMODE_EDITFCURVE       4
00036 
00037 // This is an interface that is given to track view utilities
00038 // that allows them to access the track view they were launched from.
00044 class ITVUtility : public InterfaceServer {
00045     public:
00049         virtual int GetNumTracks()=0;
00054         virtual Animatable *GetAnim(int i)=0;
00060         virtual Animatable *GetClient(int i)=0;
00065         virtual int GetSubNum(int i)=0;
00070         virtual MSTR GetTrackName(int i)=0;
00076         virtual BOOL IsSelected(int i)=0;
00085         virtual void SetSelect(int i,BOOL sel)=0;
00088         virtual HWND GetTrackViewHWnd()=0;
00097         virtual int GetMajorMode()=0;
00099         virtual Interval GetTimeSelection()=0;
00102         virtual BOOL SubTreeMode()=0;
00104         virtual Animatable *GetTVRoot()=0;
00105 
00106         // This must be called when a track view utility is closing
00107         // so that it can be unregistered from notifications
00114         virtual void TVUtilClosing(TrackViewUtility *util)=0;
00115 
00116         // Access to the trackview interface.  R5 and later only
00117         virtual ITreeView* GetTVInterface()=0;
00118     };
00119 
00120 // Results for TrackViewUtility::FilterAnim
00121 #define FILTER_SUBTREE  0   // Filter out this anim and it's subtree
00122 #define FILTER_NONE     1   // Don't filter anything
00123 #define FILTER_ANIM     -1  // Filter out this anim, but include it's subtree
00124 #define FILTER_NODE     -2  // Filter out this node and subAnims, but include it's children
00125 
00126 
00127 // This is the base class for track view utilities. Plug-ins will
00128 // derive their classes from this class.
00151 class TrackViewUtility : public InterfaceServer {
00152     public:
00153 
00159         virtual void DeleteThis()=0;        
00170         #pragma warning(push)
00171         #pragma warning(disable:4100)
00172         virtual void BeginEditParams(Interface *ip,ITVUtility *iu) {}
00183         virtual void EndEditParams(Interface *ip,ITVUtility *iu) {}
00184 
00189         virtual void TrackSelectionChanged() {}
00194         virtual void NodeSelectionChanged() {}
00199         virtual void KeySelectionChanged() {}
00204         virtual void TimeSelectionChanged() {}
00211         virtual void MajorModeChanged() {}
00216         virtual void TrackListChanged() {}
00217         
00218         // available in R5 and later only
00219         virtual int  FilterAnim(Animatable* anim, Animatable* client, int subNum) {return FILTER_NONE;}
00220         #pragma warning(pop)
00221         // used to identify registered utilities
00222         virtual void        GetClassName(MSTR& s)   { s = MSTR(_M("")); }  
00223         virtual Class_ID    ClassID()               { return Class_ID(0,0); }
00224         // end of R5 additions
00225     };
00226 
00227 
00228