home *** CD-ROM | disk | FTP | other *** search
/ io Programmo 8 / IOPROG_8.ISO / soft / sdkplnet / mac / plgsk401.sit / PluginSDK 4.01a / Examples / CharFlipper / Source / CCharFlipper.h < prev    next >
Encoding:
C/C++ Source or Header  |  1996-07-09  |  1.8 KB  |  70 lines

  1. // CCharFlipper.h
  2.  
  3. #ifndef CCHARFLIPPER_H
  4. #define CCHARFLIPPER_H
  5.  
  6. #ifndef _NPAPI_H_
  7. #include "npapi.h"
  8. #endif
  9.  
  10. #include "CNetscapePlugin.h"
  11.  
  12. class CPluginView;
  13.  
  14. class CCharFlipper : public CNetscapePlugin {
  15.     public:
  16.             static NPError        Initialize( void );
  17.         static NPError        Shutdown( void );
  18.         
  19.                             CCharFlipper( NPP instance, uint16 mode, CPluginArguments* adoptedArgs );
  20.         virtual                ~CCharFlipper();
  21.  
  22.         virtual NPError        SaveData( NPSavedData** );
  23.         
  24.         virtual NPBool                Handle_Event( void* event );
  25.         
  26.         virtual CNetscapeStream*    CreateStream( NPMIMEType type, NPStream *stream, NPBool seekable, uint16 stype );
  27.         virtual CPluginView*         CreatePluginView( ) ;
  28.         
  29.         int32                GetSpeed( );
  30.         void                SetSpeed( int32 inSpeed );
  31.         NPBool                GetRunning( );
  32.         void                SetRunning( NPBool inRunning );
  33.         NPBool                GetLooping( );
  34.         void                SetLooping( NPBool inLooping );
  35.         
  36.         void                StartAtFrame( int32 inFrame = 0 );
  37.         
  38.         void                SetText( char* inText, int32 inTextLength );
  39.     
  40.         //        Message handlers (called by event pump.)
  41.         void                HandleTimePassed();
  42.         void                HandleMouseClick();
  43.  
  44.     protected:
  45.         char                GetNextChar();
  46.         unsigned long        GetNormalSysTime();
  47.  
  48.         virtual void        PrintEmbeded( NPEmbedPrint& embedPrintInfo );
  49.  
  50.         static const char*     kCharFlipperArgs_Speed;
  51.         static const char*     kCharFlipperArgs_Autostart;
  52.         static const char*     kCharFlipperArgs_Looping;
  53.  
  54.         static const int32            kDefaultSpeed;
  55.         static const NPBool         kDefaultAutostart;
  56.         static const NPBool         kDefaultLooping;
  57.         
  58.         NPBool                mRunning;
  59.         NPBool                mLooping;
  60.         int32                mSpeed;
  61.     
  62.         char*                 mText;            // The text
  63.         long                mTextLength;    // How much text do we have
  64.         long                mTextIndex;        // The part we are displaying
  65.         
  66.         char                mCurrentChar;
  67.         unsigned long        mTimeLastFlipped;
  68. };
  69.  
  70. #endif /* CCHARFLIPPER_H */