imageeditor/plugins/FramePlugin/src/ImageEditorFramePlugin.cpp
changeset 1 edfc90759b9f
equal deleted inserted replaced
0:57d4cdd99204 1:edfc90759b9f
       
     1 /*
       
     2 * Copyright (c) 2010 Ixonos Plc.
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of the "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 * Ixonos Plc
       
    14 *
       
    15 * Description:  
       
    16 *
       
    17 */
       
    18 
       
    19 
       
    20 #include <aknquerydialog.h> 
       
    21 
       
    22 #include "ImageEditorFramePlugin.h"
       
    23 #include "ImageEditorFrameControl.h"
       
    24 #include "ImageEditorPluginBaseDefs.h"
       
    25 #include "DrawUtils.h"
       
    26 
       
    27 //	CONSTANTS
       
    28 _LIT (KPgnResourceFile, "frame.rsc");
       
    29 
       
    30 
       
    31 //=============================================================================
       
    32 EXPORT_C CImageEditorPluginBase * CreateImageEditorPlugin ()
       
    33 {
       
    34 	CImageEditorFramePlugin * plugin = new (ELeave) CImageEditorFramePlugin;
       
    35 	CleanupStack::PushL(plugin);
       
    36 	plugin->ConstructL();
       
    37 	CleanupStack::Pop(); // plugin
       
    38     return plugin;
       
    39 }
       
    40 
       
    41 //=============================================================================
       
    42 CImageEditorFramePlugin::CImageEditorFramePlugin ()
       
    43 {
       
    44 
       
    45 }
       
    46 
       
    47 //=============================================================================
       
    48 void CImageEditorFramePlugin::ConstructL ()
       
    49 {
       
    50     CImageEditorPluginBase::ConstructL (KPgnResourcePath, KPgnResourceFile);
       
    51 }
       
    52 
       
    53 //=============================================================================
       
    54 CImageEditorFramePlugin::~CImageEditorFramePlugin ()
       
    55 {
       
    56     ReleasePlugin();
       
    57 }
       
    58 
       
    59 //=============================================================================
       
    60 TInt CImageEditorFramePlugin::SetProperty (
       
    61 	TInt		/*aPropertyId*/, 
       
    62 	TDesC &		/*aPropertyValue*/
       
    63 	)
       
    64 {
       
    65 	return KErrNotSupported;
       
    66 }
       
    67 
       
    68 //=============================================================================
       
    69 TInt CImageEditorFramePlugin::GetProperty (
       
    70 	TInt		aPropertyId, 
       
    71 	TDes &		aPropertyValue
       
    72 	)
       
    73 {
       
    74 	//	Clean buffer
       
    75 	aPropertyValue.Zero();
       
    76 
       
    77 	//	Copy data
       
    78 	switch (aPropertyId) 
       
    79 	{
       
    80 		case KCapParamStruct:
       
    81 		{
       
    82     		LOG(KFramePluginLogFile, "CImageEditorFrameControl::GetProperty()");
       
    83 			aPropertyValue.Copy (((CImageEditorFrameControl*)iControl)->GetParam());
       
    84 			LOGDES (KFramePluginLogFile, aPropertyValue);
       
    85 			return KErrNone;
       
    86 		}
       
    87         case KCapGlobalZoomDisabled:
       
    88         {
       
    89             aPropertyValue.AppendNum((TInt)ETrue);
       
    90             return KErrNone;
       
    91         }
       
    92 		default:
       
    93 		{
       
    94 			return CImageEditorPluginBase::GetProperty (aPropertyId, aPropertyValue);
       
    95 		}
       
    96 	}
       
    97 }
       
    98 
       
    99 //=============================================================================
       
   100 TInt CImageEditorFramePlugin::InitPluginL (
       
   101 	const TRect &		aRect,
       
   102 	CCoeControl *		aParent,
       
   103 	CCoeControl *&		aPluginControl
       
   104 	)
       
   105 {
       
   106     // create log file if the logging is enabled
       
   107 	LOG_INIT(KFramePluginLogFile);
       
   108 
       
   109     //  Delete previous control
       
   110 	ReleasePlugin();
       
   111 
       
   112     // Create new control
       
   113     iControl = CImageEditorFrameControl::NewL (aRect, aParent);
       
   114     aPluginControl = iControl;
       
   115 
       
   116     return KErrNone;
       
   117 }
       
   118 
       
   119 //=============================================================================
       
   120 void CImageEditorFramePlugin::ProcessImageL (CEditorImage * /*aImage*/ )
       
   121 {
       
   122 
       
   123 }
       
   124 
       
   125 //=============================================================================
       
   126 void CImageEditorFramePlugin::ReleasePlugin ()
       
   127 {
       
   128 	delete iControl;
       
   129 	iControl = 0;
       
   130 }
       
   131 
       
   132 // End of File