|         |      1 /* | 
|         |      2 * Copyright (c) 2004 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:  Adapter between CMsgBaseControl and CCoeControl | 
|         |     15 * | 
|         |     16 */ | 
|         |     17  | 
|         |     18  | 
|         |     19  | 
|         |     20 #ifndef CMAILMSGBASECONTROLADAPTER_H | 
|         |     21 #define CMAILMSGBASECONTROLADAPTER_H | 
|         |     22  | 
|         |     23 //  INCLUDES | 
|         |     24 #include <MsgBaseControl.h> | 
|         |     25  | 
|         |     26  | 
|         |     27 // CLASS DECLARATION | 
|         |     28 class MMailMsgBaseControl; | 
|         |     29  | 
|         |     30 /** | 
|         |     31 *  Base control adapter. | 
|         |     32 * | 
|         |     33 *  @since Series 60 3.0 | 
|         |     34 */ | 
|         |     35 class CMailMsgBaseControlAdapter : public CMsgBaseControl | 
|         |     36     { | 
|         |     37     public:  // Constructors and destructor | 
|         |     38          | 
|         |     39         /** | 
|         |     40         * Two-phased constructor. | 
|         |     41         * @param aParent Window owning parent control where  | 
|         |     42         * aControl will be added.  | 
|         |     43         * @param aControl a non window owning control to be added. | 
|         |     44         */ | 
|         |     45         static CMailMsgBaseControlAdapter* NewL( | 
|         |     46             CCoeControl* aParent, | 
|         |     47             MMailMsgBaseControl& aBaseControl); | 
|         |     48          | 
|         |     49         /** | 
|         |     50         * Destructor. | 
|         |     51         */ | 
|         |     52         virtual ~CMailMsgBaseControlAdapter(); | 
|         |     53          | 
|         |     54     public: // Functions from base classes | 
|         |     55          | 
|         |     56         /// From CMsgBaseControl | 
|         |     57         void NotifyViewEvent( TMsgViewEvent aEvent, TInt aParam ); | 
|         |     58         TRect CurrentLineRect(); | 
|         |     59         void SetAndGetSizeL(TSize& aSize);         | 
|         |     60         void ClipboardL(TMsgClipboardFunc aFunc); | 
|         |     61         void EditL(TMsgEditFunc aFunc); | 
|         |     62         TBool IsFocusChangePossible(TMsgFocusDirection aDirection) const; | 
|         |     63         TBool IsCursorLocation(TMsgCursorLocation aLocation) const; | 
|         |     64         TUint32 EditPermission() const; | 
|         |     65         TInt VirtualHeight(); | 
|         |     66         TInt VirtualVisibleTop(); | 
|         |     67          | 
|         |     68 		// From CCoeControl | 
|         |     69         TInt CountComponentControls() const; | 
|         |     70         CCoeControl* ComponentControl(TInt aIndex) const; | 
|         |     71         void SizeChanged(); | 
|         |     72         void SetExtent(const TPoint& aPosition,const TSize& aSize); | 
|         |     73         void SetPosition(const TPoint& aPosition); | 
|         |     74         void FocusChanged(TDrawNow aDrawNow); | 
|         |     75 		void HandleResourceChange(TInt aType); | 
|         |     76         TKeyResponse OfferKeyEventL(const TKeyEvent& aKeyEvent,TEventCode aType); | 
|         |     77  | 
|         |     78     protected:  // Functions from base classes | 
|         |     79          | 
|         |     80         /// From CMsgBaseControl | 
|         |     81         void PrepareForReadOnly(TBool aReadOnly); | 
|         |     82  | 
|         |     83     private:  // Implementation | 
|         |     84         | 
|         |     85     private: | 
|         |     86  | 
|         |     87         /** | 
|         |     88         * Constructor. | 
|         |     89         */ | 
|         |     90         CMailMsgBaseControlAdapter(MMailMsgBaseControl& aBaseControl); | 
|         |     91         void ConstructL(); | 
|         |     92  | 
|         |     93     private:    // Data | 
|         |     94         // Ref: to added control | 
|         |     95         MMailMsgBaseControl& iBaseControl; | 
|         |     96           | 
|         |     97     }; | 
|         |     98  | 
|         |     99 #endif      // CMAILMSGBASECONTROLADAPTER_H   | 
|         |    100              | 
|         |    101 // End of File |