imageeditor/inc/ImageEditorControlBase.h
changeset 1 edfc90759b9f
child 12 18b321db4884
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 * A base class for image editor controls.
       
    17 *
       
    18 */
       
    19 
       
    20 
       
    21 #ifndef IMAGEEDITORCONTROLBASE_H
       
    22 #define IMAGEEDITORCONTROLBASE_H
       
    23 
       
    24 //  INCLUDES
       
    25 #include <coecntrl.h>
       
    26 #include "bitfield.h"
       
    27 
       
    28 //  FORWARD DECLARATIONS
       
    29 class CImageEditorUIView;
       
    30 class CUiItem;
       
    31 class CAknView;
       
    32 class CPluginInfo;
       
    33 class CEikButtonGroupContainer;
       
    34 
       
    35 /*	CLASS: CImageEditorControlBase
       
    36 *
       
    37 *	CImageEditorControlBase represents a base class for all Image Editor
       
    38 *	controls: main UI controls and plug-in controls.
       
    39 */
       
    40 class CImageEditorControlBase   : public CCoeControl
       
    41 {
       
    42 
       
    43 public:
       
    44 
       
    45 /** @name Methods:*/
       
    46 //@{
       
    47 
       
    48 	/*	Default constructor
       
    49 	*
       
    50 	*   @param -
       
    51 	*   @return - 
       
    52 	*/
       
    53     IMPORT_C CImageEditorControlBase ();
       
    54 
       
    55 	/*	Destructor
       
    56 	*
       
    57 	*   @param -
       
    58 	*   @return - 
       
    59 	*/
       
    60     IMPORT_C virtual ~CImageEditorControlBase ();
       
    61 
       
    62 	/** Second phase constructor
       
    63 	*
       
    64 	*	@param aRect - control rectangle
       
    65 	*	@param aParent - pointer to window owning control
       
    66 	*	@return -
       
    67 	*/
       
    68 	IMPORT_C virtual void ConstructL (
       
    69 		const TRect &		aRect,
       
    70 		CCoeControl	*		aParent
       
    71 		);
       
    72 
       
    73 	/*	SetImageL
       
    74 	*
       
    75 	*   Setter for bitmap pointer 
       
    76 	*
       
    77 	*   @param aBitmap - pointer to bitmap image
       
    78 	*   @return - 
       
    79 	*/
       
    80     IMPORT_C virtual void SetImageL (CFbsBitmap * aBitmap);
       
    81     
       
    82     /*	SetImageL
       
    83 	*
       
    84 	*   Setter for constant bitmap pointer 
       
    85 	*
       
    86 	*   @param aBitmap - const pointer to bitmap image
       
    87 	*   @return - 
       
    88 	*/
       
    89     IMPORT_C virtual void SetImageL (const CFbsBitmap * aBitmap);
       
    90     
       
    91 	/*	SetView
       
    92 	*
       
    93 	*   Sets reference to the parent view
       
    94 	*
       
    95 	*   @param aView - pointer to view
       
    96 	*   @return - 
       
    97 	*/
       
    98     IMPORT_C virtual void SetView (CAknView * aView);
       
    99 
       
   100 	/*	SetSelectedUiItemL
       
   101 	*
       
   102 	*   Sets selected UI item
       
   103 	*
       
   104 	*   @param aItem - pointer to selected UI Item
       
   105 	*   @return - 
       
   106 	*/
       
   107     IMPORT_C virtual void SetSelectedUiItemL (CPluginInfo * aItem);
       
   108 
       
   109 	/*	PrepareL
       
   110 	*
       
   111 	*	This function is called to finalize the plugin control construction.
       
   112 	*	It is called after ConstructL, SetView and SetSelectedUiItemL
       
   113 	*	have been done.
       
   114 	*	
       
   115 	*	@param -
       
   116 	*	@return -
       
   117 	*/
       
   118     IMPORT_C virtual void PrepareL ();
       
   119 
       
   120     /*	OfferKeyEventL
       
   121     *
       
   122     *   Handles key events. When a key event occurs, the control framework 
       
   123     *   calls this function for each control on the control stack, until one 
       
   124     *   of them can process the key event (and returns EKeyWasConsumed).
       
   125     *
       
   126     *   @param aKeyEvent - the key event
       
   127     *   @param aType - type of key event
       
   128     *   @return indicator for event to be handled
       
   129     *   @see CCoeControl
       
   130     */
       
   131     IMPORT_C virtual TKeyResponse OfferKeyEventL (
       
   132         const TKeyEvent &   aKeyEvent,
       
   133         TEventCode          aType
       
   134         );   
       
   135 
       
   136 	/*	CountComponentControls
       
   137 	*
       
   138 	*   Gets the number of controls in compound control.
       
   139 	*
       
   140 	*   @param -
       
   141 	*   @return number of controls
       
   142 	*	@see CoeControl
       
   143 	*/
       
   144     IMPORT_C virtual TInt CountComponentControls() const; 
       
   145 
       
   146 	/*	ComponentControl
       
   147 	*
       
   148 	*   Gets special component control indexed with aIndex.
       
   149 	*
       
   150 	*   @param aIndex - component control index
       
   151 	*   @return pointer to component control 
       
   152 	*	@see CoeControl
       
   153 	*/
       
   154     IMPORT_C virtual CCoeControl * ComponentControl (TInt aIndex) const;
       
   155 
       
   156 	/*	SetBusy
       
   157 	*
       
   158 	*	Sets busy, when busy UI does not handle key events.
       
   159 	*
       
   160 	*   @param -
       
   161 	*   @return - 
       
   162 	*/
       
   163     IMPORT_C virtual void SetBusy();
       
   164 
       
   165 	/*	ResetBusy
       
   166 	*
       
   167 	*	Resets busy, when busy UI does not handle key events.
       
   168 	*
       
   169 	*   @param -
       
   170 	*   @return - 
       
   171 	*/
       
   172     IMPORT_C virtual void ResetBusy();
       
   173 
       
   174 	/*	Busy
       
   175 	*
       
   176 	*	Returns the busy value, when busy UI does not handle key events
       
   177 	*
       
   178 	*   @param -
       
   179 	*   @return - 
       
   180 	*/
       
   181     IMPORT_C virtual TBool Busy() const;
       
   182 
       
   183 	/*	HandlePluginCommandL
       
   184 	*
       
   185 	*	Handles plug-in command for a plug-in.
       
   186 	*
       
   187 	*   @param aCommand - command id
       
   188 	*   @return UI step index >= 0, -1 if no UI update needed
       
   189 	*/
       
   190     IMPORT_C virtual void HandlePluginCommandL (const TInt aCommand);
       
   191 
       
   192 	/*	GetSoftkeyIndexL
       
   193 	*
       
   194 	*	Gets soft key index of a plug-in.
       
   195 	*
       
   196 	*   @param -
       
   197 	*   @return -1 if no change, index otherwise
       
   198 	*/
       
   199     IMPORT_C virtual TInt GetSoftkeyIndexL ();
       
   200     
       
   201     /*	GetContextMenuResourceId
       
   202 	*
       
   203 	*	Gets context specific menu resource id of a plug-in.
       
   204 	*
       
   205 	*   @param -
       
   206 	*   @return 0 if no id, resource id otherwise
       
   207 	*/
       
   208     IMPORT_C virtual TInt GetContextMenuResourceId ();
       
   209     
       
   210 	/*	GetNaviPaneTextL
       
   211 	*
       
   212 	*	Gets navi pane text.
       
   213 	*	
       
   214 	*	By default a plain navi pane label is created. Scroll
       
   215 	*	indicators can be enabled by setting the boolean parateters.
       
   216 	*
       
   217 	*   @param - aLeftNaviPaneScrollButtonVisibile
       
   218 	*   @param - aRightNaviPaneScrollButtonVisible
       
   219 	*   @return - 
       
   220 	*/
       
   221 	IMPORT_C virtual TPtrC GetNaviPaneTextL (
       
   222 		TBool& aLeftNaviPaneScrollButtonVisibile, 
       
   223 		TBool& aRightNaviPaneScrollButtonVisible);
       
   224 
       
   225 	/*	GetDimmedMenuItems
       
   226 	*
       
   227 	*	Get the plugin menu item visibility information to dynamically
       
   228 	*	initialise the menu pane.
       
   229 	*
       
   230 	*   @param - 
       
   231 	*   @return - the visibility information bitfield
       
   232 	*/
       
   233 	IMPORT_C virtual TBitField GetDimmedMenuItems ();
       
   234 
       
   235 //@}
       
   236 
       
   237 protected:
       
   238 
       
   239 /** @name Methods:*/
       
   240 //@{
       
   241 
       
   242 	/*	SizeChanged
       
   243 	*
       
   244 	*   Responds to size and position changes of the control. Called every
       
   245 	*	time if one of the control size-changing methods is called.
       
   246 	*
       
   247 	*   @param -
       
   248 	*   @return -
       
   249 	*	@see CoeControl
       
   250 	*/
       
   251 	IMPORT_C virtual void SizeChanged();
       
   252 
       
   253     /*	HandlePointerEventL
       
   254 	*
       
   255 	*   @param aPointerEvent event to handle in the function
       
   256 	*   @return -
       
   257 	*	@see CoeControl
       
   258 	*/
       
   259 	IMPORT_C virtual void HandlePointerEventL( const TPointerEvent &aPointerEvent );
       
   260 	
       
   261 //@}
       
   262 
       
   263 /** @name Members:*/
       
   264 //@{
       
   265 
       
   266 //@}
       
   267 
       
   268 private:
       
   269 
       
   270 /** @name Methods:*/
       
   271 //@{
       
   272 	/*	Draw
       
   273 	*
       
   274 	*   Draw controls, called by window server.
       
   275 	*
       
   276 	*   @param aRect - region of control in need of redrawing
       
   277 	*   @return -
       
   278 	*	@see CoeControl
       
   279 	*/
       
   280 	IMPORT_C virtual void Draw (const TRect & aRect) const;
       
   281 
       
   282 //@}
       
   283 
       
   284 /** @name Members:*/
       
   285 //@{
       
   286     /// Busy flag
       
   287     TBool                       iBusy;
       
   288 //@}
       
   289 
       
   290 };
       
   291 
       
   292 
       
   293 #endif
       
   294 
       
   295 // End of File
       
   296 
       
   297 
       
   298