⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 cmyscreensaverplugin.h

📁 一个在symbian下制作屏保的程序
💻 H
字号:
#include <e32base.h>
#include <w32std.h>
#include <screensaverplugin.h>
#include <eikenv.h>
#include <coecntrl.h>


// CONSTANTS
_LIT( KMyScreenSaverPluginName, "ScreenSaverExamplePlugin.dll" );


class CMyScreenSaverPlugin : public CCoeControl,
							 public MScreensaverPlugin
	{
	public:         
		/**
		*  destructor.
		*/
		~CMyScreenSaverPlugin() {}

		
		//////////////////////////////////////////////////////////////////////////
		///   from MScreensaverPlugin
		//////////////////////////////////////////////////////////////////////////
        
        /**
        * Used to initialize the plugin module after creation.
        * Name() function may be called without the plugin being initialized,
        * to enable name query from modules that are not plugin hosts.
        *
        * @param aHost  Screen saver plugin host.
        * @return KErrNone if everything went ok. Otherwise 
        *         system wide error code.
        */
        virtual TInt InitializeL(MScreensaverPluginHost *aHost);
        
        
        /**
        * When a plugin module is active this method is called every time 
        * when refresh timer expires in screensaver application.
        *
        * @param aGc  Graphics context for plugin module to draw to.
        * @return KErrNone if everything went ok. Otherwise 
        *         system wide error code (doesn't have any effect in
        *         current version).
        */
        virtual TInt Draw(CWindowGc& aGc);


        /**
        * Returns the name of plugin module. Returned name is displayed in
        * the list of installed plugin modules in personalization application.
        *
        * @return Descriptor containing the name of the plugin module.
        */
        virtual const TDesC16& Name() const;


        /**
        * Handler function for screensaver events.
        *
		* @param aEvent Event to be handled.
		* @param aData  Currently not used, reserved for future purposes.
		*
        * @return Should always return KErrNone.
        */
		virtual TInt HandleScreensaverEventL(TScreensaverEvent aEvent,
            								 TAny* aData);
        
        
        /**
        * Screensaver plugin capabilities query. The capabilitities
        * reveal which functions the plugin implements, that can be
        * used by calling PluginFunction)(.
        *
        * @return Bit mask of plugin capabilities.
        */
        virtual TInt Capabilities() { return EScpCapsNone; }
        
        
        /**
        * Screensaver plugin function method. Only the functions
        * returned by Capabilities() can be used, and only one
        * function at a time.
        *
        * @paran aFunction
        * @param aParam Parameters to the function. TBD function-by-function.
        * 
        * @return System wide error code. KErrNone on success.
        */
        virtual TInt PluginFunction(TScPluginCaps /*aFunction*/,
            						TAny* /*aParam*/)
			{
            return KErrNone;
			}
	
	private:
		MScreensaverPluginHost* 	iHost; 
		TBool 						iStatusCallsOrMsgs;
		TInt64 						iRandSeed;
		const CFont* 				iFontUsed;
		
		// Internal functions
		void InitializeGraphics(CWindowGc& aGc, TRect aClearArea);
		void RandomizeDrawingPosition(TInt aRandomizedRangeX,
								 	  TInt aRandomizedRangeY,
								 	  TPoint& aPos);
	};

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -