svgtviewer/SvgtViewerPlugin/ScreenSaverPluginInc/Svgtplugin.h
branchRCL_3
changeset 13 e52958d06c29
parent 10 1882882c7f9c
child 14 20b99a6d6175
equal deleted inserted replaced
10:1882882c7f9c 13:e52958d06c29
     1 /*
       
     2 * Copyright (c) 2005 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:  SVGT Plugin Implementation header file
       
    15  *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef SVGTPLUGIN_H
       
    20 #define SVGTPLUGIN_H
       
    21 
       
    22 #include <e32std.h>
       
    23 #include <coecntrl.h>
       
    24 #include <coemain.h>
       
    25 #include <fbs.h>
       
    26 #include <barsread.h>
       
    27 
       
    28 
       
    29 /**
       
    30 * Note: Need to ensure that EPOC is defined before including these headers...
       
    31 */
       
    32 #if defined(__SYMBIAN32__) && !defined(EPOC)
       
    33     #define EPOC
       
    34 #endif
       
    35 
       
    36 #include <npupp.h>
       
    37 #include <pluginadapterinterface.h>
       
    38 
       
    39 //This is to include ECom Style Plugin Specific headers
       
    40 #include <cecombrowserplugininterface.h>
       
    41 
       
    42 //Implementation id Svgt Ecom Plugin
       
    43 const TInt KSvgtPluginImplementationValue = 0x102071E6; 
       
    44 
       
    45 class   CSvgScreenSaver;
       
    46 class   CSvgtPlugin;
       
    47 
       
    48 /**
       
    49 * This function initializes the NPPluginFuncs with the
       
    50 * SVG plugin Netscape interface implementation functions
       
    51 */
       
    52 IMPORT_C NPError InitializeFuncs(NPPluginFuncs* aPpf);
       
    53 
       
    54 /**
       
    55 * This class is specific to ECom Style Plugin.
       
    56 * This is used for passing plugin specific initialization information to 
       
    57 * and from Screensaver Animation Plugin.
       
    58 */
       
    59 class CSvgtPluginEcomMain :  public CEcomBrowserPluginInterface
       
    60     {
       
    61     public: 
       
    62         /**
       
    63         * Two-phased constructor.
       
    64         * @param aInitParam Has Pointer to NPNImplementationFuncs and
       
    65         *                       Pointer to PluginFuncs
       
    66         * @since 3.1
       
    67         */
       
    68         static CSvgtPluginEcomMain* NewL( TAny* aInitParam );
       
    69         
       
    70         /**
       
    71         * Destructor.
       
    72         * @since 3.1
       
    73         */
       
    74         virtual ~CSvgtPluginEcomMain();
       
    75         
       
    76         /**
       
    77         * Returns the iNpf.
       
    78         * @since 3.1
       
    79         */
       
    80         NPNetscapeFuncs* Funcs() const {return iNpf;}
       
    81         
       
    82     private:
       
    83         /**
       
    84         * Constructor.
       
    85         * @since 3.1
       
    86         */
       
    87         CSvgtPluginEcomMain( NPNetscapeFuncs* aNpf );
       
    88         
       
    89         /**
       
    90         * Second-phase constructor.
       
    91         * @since 3.1
       
    92         */
       
    93         void ConstructL( NPPluginFuncs* aPluginFuncs );
       
    94         
       
    95     private:
       
    96         // NPN implementation function pointers
       
    97         NPNetscapeFuncs* iNpf;
       
    98     };
       
    99 
       
   100 /*******************************************************
       
   101 Class CSvgtPlugin
       
   102 ********************************************************/
       
   103 
       
   104 class CSvgtPlugin : public CBase
       
   105     {
       
   106 public:
       
   107     /**
       
   108     * Two-phased constructor.
       
   109     * @since 3.1
       
   110     */
       
   111     static CSvgtPlugin* NewL(NPP anInstance);
       
   112     
       
   113     /**
       
   114     * Destructor.
       
   115     * @since 3.1
       
   116     */
       
   117     ~CSvgtPlugin();
       
   118     
       
   119     /**
       
   120     * Second-phase constructor.
       
   121     * @since 3.1
       
   122     */
       
   123     void ConstructL();
       
   124     
       
   125     /**
       
   126     * Called before the Plugin Exits.
       
   127     * @since 3.1
       
   128     */    
       
   129     void PrepareToExitL();
       
   130     
       
   131     /**
       
   132     * returns the Control.
       
   133     * @since 3.1
       
   134     */    
       
   135     CSvgScreenSaver* Control() const; 
       
   136     
       
   137     /**
       
   138     * returns the instance.
       
   139     * @since 3.1
       
   140     */    
       
   141     NPP Instance() const;    
       
   142         
       
   143     /**
       
   144     * Called by the SetWindow Netscape API.
       
   145     * @param aWindow - structure having the parent control
       
   146     * @param aRect - size of the control
       
   147     * @since 3.1
       
   148     */    
       
   149     void SetWindowL(const NPWindow* aWindow,const TRect& aRect);
       
   150 
       
   151 private:
       
   152     /**
       
   153     * Default constructor.
       
   154     * @since 3.1
       
   155     */    
       
   156     CSvgtPlugin(NPP anInstance);
       
   157  
       
   158 private:
       
   159     // Handle to the plugin Adapter
       
   160     MPluginAdapter*             iPluginAdapter;        
       
   161     
       
   162     // Pointer to the SVG control
       
   163     CSvgScreenSaver*            iControl;
       
   164     
       
   165     // Plugin instance
       
   166     NPP                         iInstance;       
       
   167     
       
   168     // Screensaver mode flag
       
   169     TBool                       iScreenSaverMode;
       
   170     };
       
   171 
       
   172 
       
   173 /******************************************************************************
       
   174 *
       
   175 *    Plugin API methods
       
   176 *
       
   177 ******************************************************************************/
       
   178 
       
   179 /**
       
   180 * Create a plugin.
       
   181 */
       
   182 NPError SvgtPluginNewp(NPMIMEType /*pluginType*/,
       
   183                        NPP aInstance, 
       
   184                        uint16 /*mode*/, 
       
   185                        CDesCArray* /*argn*/, 
       
   186                        CDesCArray* /*argv*/, 
       
   187                        NPSavedData* /*saved*/);
       
   188 /**
       
   189 * Destroy a plugin.
       
   190 */
       
   191 NPError SvgtPluginDestroy(NPP aInstance, NPSavedData** /*save*/);
       
   192 
       
   193 /**
       
   194 * This is the parent window of a plugin.
       
   195 */
       
   196 NPError SvgtPluginSetWindow(NPP aInstance, NPWindow* aWindow);
       
   197 
       
   198 /**
       
   199 * A data stream has been fully saved to a file.
       
   200 */
       
   201 void SvgtPluginAsFile(NPP aInstance, 
       
   202                       NPStream* /*stream*/, 
       
   203                       const TDesC& aFname);
       
   204 
       
   205 
       
   206 /**
       
   207 * Generic hook to retrieve values/attributes from the plugin.
       
   208 */
       
   209 NPError SvgtPluginGetValue(NPP aInstance, 
       
   210                            NPPVariable aVariable, 
       
   211                            void* aRetvalue);
       
   212 
       
   213 /**
       
   214 * Generic hook to set values/attributes within the plugin.
       
   215 */              
       
   216 NPError SvgtPluginSetValue(NPP aInstance, 
       
   217                            NPNVariable aVariable, 
       
   218                            void* aRetvalue);              
       
   219 
       
   220 /**
       
   221 * Check File Validity 
       
   222 */
       
   223 void SvgtPluginCheckFileL( void* aRetvalue );
       
   224 
       
   225 
       
   226 #endif // SVGTPLUGIN_H
       
   227 // End of File