flashliteapi_3_1/ns/inc/NPNFlashExtension.h
changeset 0 2e3d3ce01487
equal deleted inserted replaced
-1:000000000000 0:2e3d3ce01487
       
     1 /*
       
     2 * Copyright (c) 2006-2010 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:  Flash Netscape Plugin command Definitions
       
    15 *
       
    16 */
       
    17 
       
    18 #ifndef NPNFLASH_EXTENSIONS_H
       
    19 #define NPNFLASH_EXTENSIONS_H
       
    20 
       
    21 #include "NPNExtensions.h" //screensaver command set defined by screensaver
       
    22 #include "NPNFlashDefs.h" //parameter definitions
       
    23 
       
    24 /* 
       
    25 * Enumerations for setting the information to/from flash plugin
       
    26 */
       
    27 
       
    28 enum
       
    29     {
       
    30     /* Defines Start/end animation event */
       
    31     NPNAnimationEvent=101,
       
    32     
       
    33     /* Defines variable to get config structure from caller */
       
    34     NPNGetconfigParam=110,
       
    35     
       
    36     /* Defines variable to set volume */
       
    37     NPNVolumeEvent,
       
    38     
       
    39     /* Defines variable to set zoom */
       
    40     NPNZoomEvent,
       
    41     
       
    42    
       
    43     };
       
    44     
       
    45 /* 
       
    46 * Enumerations for getting the information from format specific plugins 
       
    47 *   
       
    48 */    
       
    49     
       
    50 enum
       
    51     {
       
    52 
       
    53     /* Gets the last error encountered by the plugin. 
       
    54      * Int - System wide error code
       
    55      */
       
    56     NPPGetLastError=101,
       
    57     
       
    58     /* Checks whether the error is fatal 
       
    59      * Bool True if the error is fatal, false if not
       
    60      */
       
    61     NPPIsErrorFatal=102,
       
    62     
       
    63     /* Gets the status of plugin. 
       
    64      * Int - System wide error code
       
    65      */
       
    66     NPPGetPluginStatus=210,
       
    67     
       
    68     /* Defines variable to get current frame number */
       
    69     NPPGetCurFrame,
       
    70     
       
    71     /* Defines variable to get total frame number */
       
    72     NPPGetTotalFrames,
       
    73   
       
    74   	/* Defines variable to get total duration */
       
    75     NPPGetTotalDuration,
       
    76     };
       
    77 
       
    78 
       
    79 /** 
       
    80  Enumeration for zoom operations.
       
    81 */
       
    82 enum
       
    83 {
       
    84 	NPZoomIn,	///< Zoom In option selected.
       
    85 	NPZoomOut,	///< Zoom Out option selected.
       
    86 	NPShowAll	///< Show All option selected.
       
    87 };
       
    88  
       
    89 /**
       
    90 *  Value sent by caller during newp instance creation.
       
    91 *
       
    92 *  @lib
       
    93 *  @since Series 60 3rd Edition, Feature Pack 2
       
    94 */   
       
    95 enum  
       
    96     {
       
    97     /* animation plug-in Mode , use flash as plug-in*/
       
    98     NPAnimPluginMode = 110
       
    99       
       
   100     };    
       
   101    
       
   102 /**
       
   103 *  Value sent by caller for Set_value.
       
   104 *
       
   105 *  @lib
       
   106 *  @since Series 60 3rd Edition, Feature Pack 2
       
   107 */ 
       
   108 enum NPFlashAnimationEvent
       
   109     {
       
   110     /* Sent to the plugin to pause */
       
   111     NPPPauseAnimation = 150,
       
   112     
       
   113     /* Sent to the plugin to pause */
       
   114     NPPResumeAnimation =151 ,
       
   115     
       
   116     /* Sent to the plugin to stop */
       
   117     NPPStopAnimation =152,
       
   118     
       
   119     /* Sent to the plugin to rewind */
       
   120     NPPRewindAnimation =153,
       
   121     
       
   122     /* Sent to the plugin to mute audio */
       
   123     NPPMuteAnimation =154,
       
   124     
       
   125        /* Sent to the plugin to Unmute audio */
       
   126     NPPUnmuteAnimation=155,
       
   127 
       
   128     /* Sent to the plugin to zoomin */
       
   129     NPPZoomInAnimation=156,
       
   130 
       
   131    /* Sent to the plugin to zoomout*/
       
   132     NPPZoomOutAnimation=157
       
   133         
       
   134     } ;
       
   135  
       
   136 /**
       
   137 *  Value sent by plug-in for player status.
       
   138 *
       
   139 *  @lib
       
   140 *  @since Series 60 3rd Edition, Feature Pack 1
       
   141 */ 
       
   142 enum NPFlashPlayerState //
       
   143             {
       
   144             NPContentError = -2,
       
   145             NPInstanceError = -1,
       
   146             NPEngineNotInitialized,
       
   147             NPEngineInitialized,
       
   148             NPContentClosed = 2,
       
   149             NPContentOpening,
       
   150             NPContentOpen,
       
   151             NPContentPreparing,
       
   152             NPContentReady, // player's stopped state
       
   153             NPContentPlaying,
       
   154             NPPlayerPaused,
       
   155             NPPlayerStopped,
       
   156             NPPlayComplete
       
   157             };
       
   158 
       
   159        
       
   160 /* 
       
   161  * The NPInteractionMode needs to be sent to the Flash Plugin
       
   162  * in the newp call, The interaction mode attribute name is passed 
       
   163  * in argn and the attribute value is passed in argv parameter.
       
   164  * The mode parameter of newp is not used in Screensaver mode.
       
   165  */
       
   166  
       
   167 // Flash animation plug-in structure definitions
       
   168 /**
       
   169 *  Plug-in Mode set by caller
       
   170 *
       
   171 *  @lib
       
   172 *  @since Series 60 3rd Edition, Feature Pack 2
       
   173 */
       
   174 
       
   175 enum NPPluginMode
       
   176   {
       
   177   	/** 
       
   178 		*  simple animation, this is default 
       
   179     */
       
   180     
       
   181   	NPAnimation = 4,
       
   182   	
       
   183   	/** 
       
   184 		*  flash running in idle 
       
   185     */
       
   186     
       
   187   	NPIdle ,
       
   188   	
       
   189   	/** 
       
   190 		*  flash running as video ring tone 
       
   191     */
       
   192     
       
   193   	NPRingTone,
       
   194   	
       
   195   	/** 
       
   196 		*  flash running as call image 
       
   197     */
       
   198     
       
   199   	NPCallImage,
       
   200   	
       
   201   	/** 
       
   202 		*  flash running as animated background in idle 
       
   203     */
       
   204     
       
   205   	NPBackground,
       
   206   	
       
   207   	/** 
       
   208 		*  flash running as wall paper 
       
   209     */
       
   210     
       
   211   	NPWallpaper,
       
   212   	
       
   213   	/** 
       
   214 		*  flash running as notification  for calendar apointments
       
   215     */
       
   216     
       
   217   	NPNotification,
       
   218   	
       
   219   	/** 
       
   220 		*  flash running as startup screen
       
   221     */  	
       
   222   	NPStartupScreen,
       
   223   	
       
   224   	/** 
       
   225 		*  flash running as shutdown screen
       
   226     */
       
   227   	NPShutdownScreen
       
   228   	
       
   229   };
       
   230   
       
   231 /**
       
   232 *  Preference flag set by caller NotifyL.
       
   233 *
       
   234 *  @lib
       
   235 *  @since Series 60 3rd Edition, Feature Pack 2
       
   236 */
       
   237   
       
   238 enum NPPluginPref
       
   239 {
       
   240 	/**
       
   241 	*  Prefer controlling animation
       
   242 	*  plug-in should not start playing animation,
       
   243 	*  it should wait for start,stop, pause commands
       
   244 	*/
       
   245 	NPPrefControlAnim = 0x00001,
       
   246 
       
   247 	/**
       
   248 		*  Preference flag indicates caller expects error notification.
       
   249 		*
       
   250 	*/
       
   251 	
       
   252 	NPPrefErrorNotification = 0x00002,
       
   253 	
       
   254 	/**
       
   255 		*  Preference flag indicates caller expects content status notification.
       
   256 		*  ready,playing,paused, stopped etc.
       
   257 	*/
       
   258 	
       
   259 	NPPrefContentStatusNotification = 0x00004,
       
   260 	
       
   261 	
       
   262 	/**
       
   263 		*  Preference flag indicates caller expects frame ready notification.
       
   264 		*
       
   265 	*/
       
   266 	
       
   267 	NPPrefFrameReadyNotification = 0x00008,
       
   268 	
       
   269 		
       
   270 };
       
   271 
       
   272 /**
       
   273 *  notification type flag provided by flash plug-in in NotifyL.
       
   274 *
       
   275 *  @lib
       
   276 *  @since Series 60 3rd Edition, Feature Pack 1
       
   277 */
       
   278 
       
   279 enum NPFlashNotifyType
       
   280 {
       
   281 	/**
       
   282 	*  Notification related to flash content error
       
   283 	*
       
   284 	*/
       
   285  NPNotifyContentError,
       
   286  /**
       
   287 	*  Notification related to flash plug-in instance error
       
   288 	*
       
   289 	*/
       
   290  NPNotifyInstanceError,	
       
   291 
       
   292  /**
       
   293 	*  Notification related to flash plug-in instance
       
   294 	*
       
   295 	*/	
       
   296  NPNotifyInstanceStatus
       
   297 	
       
   298 };
       
   299 
       
   300 /**
       
   301 *  Notification data (aParam)provided by flash plug-in in NotifyL.
       
   302 *  Not mandatory to be returned for every NotifyType
       
   303 *  @lib
       
   304 *  @since Series 60 3rd Edition, Feature Pack 2
       
   305 */
       
   306 
       
   307 typedef struct _NPNotifyParam
       
   308     {
       
   309     /* status code returned by the plugin */
       
   310     TInt  iStatusCode;
       
   311     
       
   312     /* additional parameter */
       
   313     TAny* iParam;
       
   314     
       
   315     } NPNotifyParam;
       
   316    
       
   317     
       
   318 /**
       
   319 *  Notification interface implemented by caller.
       
   320 *  These methods are called by flash plug-in
       
   321 *
       
   322 *  @lib
       
   323 *  @since Series 60 3rd Edition, Feature Pack 1
       
   324 */
       
   325 
       
   326 class MFlashNotifier 
       
   327 {
       
   328 	public:
       
   329 	 /**
       
   330         * Notifies the caller an event.Do not hold this method for longer
       
   331         * @since Series 60 3rd Edition, Feature Pack 1
       
   332         * @param aNotifyType The event type that is passed to the plug-in
       
   333         * @param aParam The parameter associated with the event
       
   334         * @return Not used
       
   335         */
       
   336     virtual TInt NotifyL (TInt aNotifyType, TAny *aParam)=0;
       
   337 
       
   338 };
       
   339 
       
   340 /**
       
   341 *  Flash Configuration structure  passed by caller through get_value.
       
   342 *  These structure has to passed if interaction mode is anim
       
   343 *  Flash will get this structure through get_Value NPNGetconfigParam
       
   344 *  @lib
       
   345 *  @since Series 60 3rd Edition, Feature Pack 1
       
   346 */
       
   347 
       
   348 typedef struct _NPFlashConfig{
       
   349 
       
   350     /**
       
   351     	Size of the structure
       
   352     **/
       
   353     
       
   354     TUint16 iSize;
       
   355 
       
   356     /**
       
   357     	version of the _NPFlashAdapter structure
       
   358     	
       
   359     	1 for S60 3.1
       
   360     **/
       
   361     
       
   362     TUint16 iVersion;
       
   363 
       
   364     /**
       
   365     	type of the mode idle, ring tone,call image, wallpaper
       
   366     	value defined in NPPluginMode
       
   367     **/
       
   368     TUint16 iModeType; 
       
   369     
       
   370     /** 
       
   371 		* Etrue if MMI is supported. 
       
   372     */
       
   373     TBool iIsMMI;
       
   374 	
       
   375    /** 
       
   376    * Name of the MMI ECOM plug-ins
       
   377    */
       
   378    const TDesC8* iExtensions;
       
   379    
       
   380     /** 
       
   381 		* Etrue if noaudio , mute is valid. 
       
   382     */
       
   383     
       
   384     
       
   385     TBool iNoAudio;
       
   386     /** 
       
   387 		* Etrue if iAudioPriority, iAudioPreference is valid. 
       
   388     */
       
   389     TBool iIsPriorityValid;
       
   390     
       
   391    /** 
       
   392     *  Priority for playing audio
       
   393    */
       
   394     TInt iAudioPriority; 
       
   395     
       
   396     /** 
       
   397      *  Preference for playing audio
       
   398      */
       
   399     TUint iAudioPreference;
       
   400     
       
   401     /**
       
   402     
       
   403     * Preference flag for Flash
       
   404     
       
   405     */
       
   406     
       
   407     TInt iPrefFlag;
       
   408     
       
   409     /**
       
   410     
       
   411     * Notification interface provided by caller
       
   412     
       
   413     **/
       
   414     
       
   415     MFlashNotifier* iNotifyCaller;
       
   416     
       
   417   
       
   418 } NPFlashConfig;
       
   419 
       
   420 
       
   421 #endif // NPNFLASH_EXTENSIONS_H
       
   422 // End Of file
       
   423 
       
   424