williamr@2: // Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies). williamr@2: // All rights reserved. williamr@2: // This component and the accompanying materials are made available williamr@2: // under the terms of the License "Symbian Foundation License v1.0" to Symbian Foundation members and "Symbian Foundation End User License Agreement v1.0" to non-members williamr@2: // which accompanies this distribution, and is available williamr@2: // at the URL "http://www.symbianfoundation.org/legal/licencesv10.html". williamr@2: // williamr@2: // Initial Contributors: williamr@2: // Nokia Corporation - initial contribution. williamr@2: // williamr@2: // Contributors: williamr@2: // williamr@2: // Description: williamr@2: // williamr@2: williamr@2: #ifndef __FRMFRAME_H__ williamr@2: #define __FRMFRAME_H__ williamr@2: williamr@2: #include williamr@2: williamr@2: /** A rectangular frame surrounding a picture with eight smaller, square areas williamr@2: (referred to as blobs) for moving and resizing the picture. A blob is located williamr@2: on each corner and at the centre of each side. williamr@2: williamr@2: Each blob has a visible width and an active width. The active width allows williamr@2: easier manipulation of picture frames because the blobs may be small and difficult williamr@2: to manipulate with a pen. The active width should be set to be at least as williamr@2: large as the visible width. williamr@2: williamr@2: A picture frame also has a set of flags which are used when drawing the frame. williamr@2: These control the frame border visibility, whether blobs should be drawn inside williamr@2: or outside the frame and whether the blobs should be filled using a solid williamr@2: brush style or using a NULL brush style, causing them to appear dimmed. For williamr@2: more information on brush styles. see CGraphicsContext::TBrushStyle. williamr@2: @publishedAll williamr@2: @released williamr@2: */ williamr@2: class TFrameOverlay williamr@2: williamr@2: { williamr@2: public: williamr@2: /** This enumeration is used by CTextView::SetXyPosL() and by TFrameOverlay::XyPosToEdges() williamr@2: to identify which active region of the picture frame a pixel position is in. */ williamr@2: enum TEdges williamr@2: { williamr@2: /** Not in an active region. */ williamr@2: ENoEdges=0x00, williamr@2: /** In active region around left edge. */ williamr@2: EEdgeLeft=0x01, williamr@2: /** In active region around right edge. */ williamr@2: EEdgeRight=0x02, williamr@2: /** In active region around top edge. */ williamr@2: EEdgeTop=0x04, williamr@2: /** In active region around bottom edge. */ williamr@2: EEdgeBottom=0x08 williamr@2: }; williamr@2: williamr@2: /** Frame appearance flags. */ williamr@2: enum TFrameOverlayFlags williamr@2: { williamr@2: /** Controls whether blobs are drawn inside or outside the frame border. */ williamr@2: EFrameOverlayFlagBlobsInternal=0x01, williamr@2: /** Controls whether the frame border is drawn or not. */ williamr@2: EFrameOverlayFlagShowBorder=0x02, williamr@2: /** Controls whether the three blobs at the top of the frame are drawn dimmed. */ williamr@2: EFrameOverlayFlagTopBlobsDimmed=0x04, williamr@2: /** Controls whether the three blobs at the bottom of the frame are drawn dimmed. */ williamr@2: EFrameOverlayFlagBottomBlobsDimmed=0x08, williamr@2: /** Controls whether the three blobs on the left hand side of the frame are drawn williamr@2: dimmed. */ williamr@2: EFrameOverlayFlagLeftBlobsDimmed=0x10, williamr@2: /** Controls whether the three blobs on the right hand side of the frame are drawn williamr@2: dimmed. */ williamr@2: EFrameOverlayFlagRightBlobsDimmed=0x20 williamr@2: }; williamr@2: public: williamr@2: IMPORT_C TFrameOverlay(); williamr@2: IMPORT_C void SetBlobWidthInPixels(const TInt aWidth); //sets visible and active blob width williamr@2: IMPORT_C void SetVisibleBlobWidthInPixels(const TInt aWidth); //default zero williamr@2: IMPORT_C void SetActiveBlobWidthInPixels(const TInt aWidth); // default zero williamr@2: IMPORT_C void SetFlags(TInt aFlag); williamr@2: IMPORT_C void ClearFlags(TInt aFlag); williamr@2: IMPORT_C void SetRect(const TRect& aRect); williamr@2: IMPORT_C void XorDraw(CGraphicsContext& aGc) const; williamr@2: IMPORT_C TInt XyPosToEdges(const TPoint& aPos) const; williamr@2: inline TRect Rect() const; // deprecated williamr@2: inline const TRect& RefRect() const; williamr@2: inline TInt Flags() const; williamr@2: private: williamr@2: TInt VisibleBlobWidth() const; williamr@2: TInt ActiveMarginWidth() const; williamr@2: TBool DrawLeftAndRight() const; williamr@2: TBool DrawTopAndBottom() const; williamr@2: void DrawDottedRectangle(CGraphicsContext& aGc,const TRect& aRect) const; williamr@2: private: williamr@2: TInt iFlags; williamr@2: TInt iVisibleBlobWidth; williamr@2: TInt iActiveBlobWidth; williamr@2: TRect iRect; williamr@2: }; williamr@2: williamr@2: /** @deprecated */ williamr@2: inline TRect TFrameOverlay::Rect() const williamr@2: { williamr@2: return(iRect); williamr@2: } williamr@2: williamr@2: inline const TRect& TFrameOverlay::RefRect() const williamr@2: { williamr@2: return(iRect); williamr@2: } williamr@2: williamr@2: TInt TFrameOverlay::Flags() const williamr@2: { williamr@2: return(iFlags); williamr@2: } williamr@2: williamr@2: #endif